From 1b53dd0ae2c39fd816d0f72f224b00991222a3b9 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 17 Feb 2023 09:21:02 +0100 Subject: [PATCH 001/139] update config_template --- config_template.cfg | 68 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/config_template.cfg b/config_template.cfg index 0463ce3357f..dd501098f13 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -29,6 +29,10 @@ SA_OPTIONS= NONE % % Transition model (NONE, LM) KIND_TRANS_MODEL= NONE +% +% Value of RMS roughness for transition model +HROUGHNESS= 1.0e-6 +% % Specify versions/correlations of the LM model (LM2015, MALAN, SULUKSNA, KRAUSE, KRAUSE_HYPER, MEDIDA, MEDIDA_BAEDER, MENTER_LANGTRY) LM_OPTIONS= NONE % @@ -50,6 +54,9 @@ MATH_PROBLEM= DIRECT % Axisymmetric simulation, only compressible flows (NO, YES) AXISYMMETRIC= NO % +% Gravity force +GRAVITY_FORCE= NO +% % Restart solution (NO, YES) RESTART_SOL= NO % @@ -200,6 +207,9 @@ FREESTREAM_VISCOSITY= 1.853E-5 % Free-stream turbulence intensity FREESTREAM_TURBULENCEINTENSITY= 0.05 % +% Value for freestream intermittency +FREESTREAM_INTERMITTENCY= 1.0 +% % Fix turbulence quantities to far-field values inside an upstream half-space TURB_FIXED_VALUES= NO % @@ -259,6 +269,9 @@ INC_INLET_TYPE= VELOCITY_INLET % Damping coefficient for iterative updates at pressure inlets. (0.1 by default) INC_INLET_DAMPING= 0.1 % +% Impose inlet velocity magnitude in the direction of the normal of the inlet face +INC_INLET_USENORMAL= NO +% % List of outlet types for incompressible flows. List length must % match number of outlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET INC_OUTLET_TYPE= PRESSURE_OUTLET @@ -266,6 +279,8 @@ INC_OUTLET_TYPE= PRESSURE_OUTLET % Damping coefficient for iterative updates at mass flow outlets. (0.1 by default) INC_OUTLET_DAMPING= 0.1 % +% Bulk Modulus for computing the Mach number +BULK_MODULUS= 1.42E5 % Epsilon^2 multipier in Beta calculation for incompressible preconditioner. BETA_FACTOR= 4.1 % @@ -291,12 +306,22 @@ TARGET_CL= 0.80 % Estimation of dCL/dAlpha (0.2 per degree by default) DCL_DALPHA= 0.2 % +% Damping factor for fixed CL mode +DCM_DIH= 0.05 +% % Maximum number of iterations between AoA updates UPDATE_AOA_ITER_LIMIT= 100 % +% Number of times Alpha is updated in a fix CL problem. +UPDATE_IH= 5 +% % Number of iterations to evaluate dCL_dAlpha by using finite differences (500 by default) ITER_DCL_DALPHA= 500 - +% +% Evaluate the dOF_dCL or dOF_dCMy during run time +EVAL_DOF_DCX= NO +% Damping factor for fixed CL mode. +NETTHRUST_DBCTHRUST= 1.0 % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % % Reference origin for moment computation (m or in) @@ -336,7 +361,10 @@ CRITICAL_TEMPERATURE= 131.00 % Critical Pressure (3588550.0 N/m^2 by default) CRITICAL_PRESSURE= 3588550.0 % -% Acentri factor (0.035 (air)) +% Critical Density (263.0 kg/m^3 by default) +CRITICAL_DENSITY= 263.0 +% +% Acentric factor (0.035 (air)) ACENTRIC_FACTOR= 0.035 % % Thermodynamics(operating) Pressure (101325 Pa default value, only for incompressible flow and FLUID_MIXTURE) @@ -358,7 +386,7 @@ MOLECULAR_WEIGHT= 28.96, 16.043 % Format -> Cp(T) : b0 + b1*T + b2*T^2 + b3*T^3 + b4*T^4 CP_POLYCOEFFS= (0.0, 0.0, 0.0, 0.0, 0.0) % -% Nonequilibrium fluid options +% --- Nonequilibrium fluid options % % Gas model - mixture GAS_MODEL= AIR-5 @@ -369,6 +397,12 @@ GAS_COMPOSITION= (0.77, 0.23, 0.0, 0.0, 0.0) % Freeze chemical reactions FROZEN_MIXTURE= NO % +% Specify if there is ionization +IONIZATION= NO +% +% Specify if there is VT transfer residual limiting +VT_RESIDUAL_LIMITING= NO +% % NEMO Inlet Options INLET_TEMPERATURE_VE = 288.15 INLET_GAS_COMPOSITION = (0.77, 0.23, 0.0, 0.0, 0.0) @@ -606,6 +640,9 @@ ENGINE_NU_FACTOR= 3.0 % % Actuator disk jump definition using ratio or difference (DIFFERENCE, RATIO) ACTDISK_JUMP= DIFFERENCE +% +% secondary flow value for actuator disk +ACTDISK_SECONDARY_FLOW= 0.0 % % Number of times BC Thrust is updated in a fix Net Thrust problem (5 by default) UPDATE_BCTHRUST= 100 @@ -708,16 +745,22 @@ TIME_DISCRE_RADIATION = EULER_IMPLICIT % % Specify scalar transport model (NONE, SPECIES_TRANSPORT) KIND_SCALAR_MODEL= NONE -% -% Mass diffusivity model (CONSTANT_DIFFUSIVITY) +% mixing model for species transport (DAVIDSON, WILKE) +MIXING_VISCOSITY_MODEL= DAVIDSON +% Mass diffusivity model (CONSTANT_DIFFUSIVITY, CONSTANT_SCHMIDT, UNITY_LEWIS, CONSTANT_LEWIS) DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY % % Mass diffusivity if DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY is chosen. D_air ~= 0.001 DIFFUSIVITY_CONSTANT= 0.001 % +% Laminar Schmidt number for mass diffusion (for constant schmidt number model) +SCHMIDT_NUMBER_LAMINAR= 1.0 % Turbulent Schmidt number of mass diffusion SCHMIDT_NUMBER_TURBULENT= 0.7 % +% list of constant Lewis numbers for all species for +CONSTANT_LEWIS_NUMBER= (1,1,1) +% % Inlet Species boundary marker(s) with the following format: % (inlet_marker, Species1, Species2, ..., SpeciesN-1, inlet_marker2, Species1, Species2, ...) % For N species, N-1 transport equations are solved, the last one Y_N is solved algebraically as 1-(sum of the species 1 to (N-1)) @@ -985,6 +1028,12 @@ SPATIAL_FOURIER= NO % Catalytic wall marker(s) (NONE = no marker) % Format: ( marker name, ... ) CATALYTIC_WALL= ( NONE ) +% specify if catalytic wall is a supercatalytic wall +SUPERCATALYTIC_WALL= NO +% species composition at the supercatalytic wall +SUPERCATALYTIC_WALL_COMPOSITION= (0,0,0) +% catalytic efficiency +CATALYTIC_EFFICIENCY= 0.2 % % Inlet Turbulent boundary marker(s) with the following format: % (inlet_marker1, TurbIntensity1, RatioTurbLamViscosity1, inlet_marker2, TurbIntensity2, RatioTurbLamViscosity2, ...) @@ -1292,7 +1341,14 @@ LEVELS_TIME_ACCURATE_LTS= 1 % % Specify the method for matrix coloring for Jacobian computations (GREEDY_COLORING, NATURAL_COLORING) KIND_MATRIX_COLORING= GREEDY_COLORING - +% +% Specify shock capturing method for DG +KIND_FEM_DG_SHOCK= NONE +% +% -------------------- Weakly Coupled Heat ------------------% +% +WEAKLY_COUPLED_HEAT_EQUATION= NO +% % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % % Convective numerical method (SCALAR_UPWIND, BOUNDED_SCALAR) From 98e93198c3a04de379c2c093f02324a05832c5b6 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Sun, 19 Feb 2023 11:11:05 +0100 Subject: [PATCH 002/139] add config options to config_template --- Common/include/CConfig.hpp | 54 +++---- Common/src/CConfig.cpp | 150 ++++++++--------- .../meshreader/CSU2ASCIIMeshReaderFVM.cpp | 3 +- config_template.cfg | 151 +++++++++++++++++- 4 files changed, 248 insertions(+), 110 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index f3b1abd9876..3b488c27314 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -96,7 +96,7 @@ class CConfig { *TemperatureLimits; /*!< \brief Limits for the primitive variables */ bool ActDisk_DoubleSurface; /*!< \brief actuator disk double surface */ bool Engine_HalfModel; /*!< \brief only half model is in the computational grid */ - bool ActDisk_SU2_DEF; /*!< \brief actuator disk double surface */ + //bool ActDisk_SU2_DEF; /*!< \brief actuator disk double surface */ unsigned short nFFD_Iter; /*!< \brief Iteration for the point inversion problem. */ unsigned short FFD_Blending; /*!< \brief Kind of FFD Blending function. */ su2double FFD_Tol; /*!< \brief Tolerance in the point inversion problem. */ @@ -216,8 +216,8 @@ class CConfig { nMarker_Damper, /*!< \brief Number of damper surface markers. */ nMarker_Load_Dir, /*!< \brief Number of load surface markers defined by magnitude and direction. */ nMarker_Disp_Dir, /*!< \brief Number of load surface markers defined by magnitude and direction. */ - nMarker_Load_Sine, /*!< \brief Number of load surface markers defined by magnitude and direction. */ - nMarker_FlowLoad, /*!< \brief Number of load surface markers. */ + //nMarker_Load_Sine, /*!< \brief Number of load surface markers defined by magnitude and direction. */ + //nMarker_FlowLoad, /*!< \brief Number of load surface markers. */ nMarker_Internal, /*!< \brief Number of internal flow markers. */ nMarker_All, /*!< \brief Total number of markers using the grid information. */ nMarker_Max, /*!< \brief Max number of number of markers using the grid information. */ @@ -328,10 +328,10 @@ class CConfig { su2double *Disp_Dir_Multiplier; /*!< \brief Specified multiplier for load boundaries defined in cartesian coordinates. */ su2double **Load_Dir; /*!< \brief Specified flow direction vector (unit vector) for inlet boundaries. */ su2double **Disp_Dir; /*!< \brief Specified structural displacement direction (unit vector). */ - su2double *Load_Sine_Amplitude; /*!< \brief Specified amplitude for a sine-wave load. */ - su2double *Load_Sine_Frequency; /*!< \brief Specified multiplier for load boundaries defined in cartesian coordinates. */ - su2double **Load_Sine_Dir; /*!< \brief Specified flow direction vector (unit vector) for inlet boundaries. */ - su2double *FlowLoad_Value; /*!< \brief Specified force for flow load boundaries. */ + //su2double *Load_Sine_Amplitude; /*!< \brief Specified amplitude for a sine-wave load. */ + //su2double *Load_Sine_Frequency; /*!< \brief Specified multiplier for load boundaries defined in cartesian coordinates. */ + //su2double **Load_Sine_Dir; /*!< \brief Specified flow direction vector (unit vector) for inlet boundaries. */ + //su2double *FlowLoad_Value; /*!< \brief Specified force for flow load boundaries. */ su2double *ActDiskInlet_MassFlow; /*!< \brief Specified inlet mass flow for actuator disk. */ su2double *ActDiskInlet_Temperature; /*!< \brief Specified inlet temperature for actuator disk. */ su2double *ActDiskInlet_TotalTemperature; /*!< \brief Specified inlet total temperature for actuator disk. */ @@ -1106,7 +1106,7 @@ class CConfig { distortion[2], /*!< \brief SU2_GEO section locations array for the COption class. */ ea_lim[3], /*!< \brief equivalent area limit array for the COption class. */ grid_fix[6], /*!< \brief fixed grid (non-deforming region) array for the COption class. */ - htp_axis[2], /*!< \brief HTP axis for the COption class. */ + //htp_axis[2], /*!< \brief HTP axis for the COption class. */ ffd_axis[3], /*!< \brief FFD axis for the COption class. */ inc_crit[3], /*!< \brief incremental criteria array for the COption class. */ extrarelfac[2], /*!< \brief extra relaxation factor for Giles BC in the COption class. */ @@ -1539,11 +1539,11 @@ class CConfig { */ const su2double *GetHold_GridFixed_Coord(void) const { return grid_fix; } - /*! - * \brief Get the values of subsonic engine. - * \return Values of subsonic engine. - */ - const su2double *GetSubsonicEngine_Values(void) const { return eng_val; } + /*! + * \brief Get the values of subsonic engine. + * \return Values of subsonic engine. + */ + const su2double *GetSubsonicEngine_Values(void) const { return eng_val; } /*! * \brief Get the cycle of a subsonic engine. @@ -5694,11 +5694,11 @@ class CConfig { */ bool GetEngine_HalfModel(void) const { return Engine_HalfModel; } - /*! - * \brief Actuator disk defined with a double surface. - * \return TRUE if the elements must be divided; otherwise FALSE. - */ - bool GetActDisk_SU2_DEF(void) const { return ActDisk_SU2_DEF; } + ///*! + // * \brief Actuator disk defined with a double surface. + // * \return TRUE if the elements must be divided; otherwise FALSE. + // */ + //bool GetActDisk_SU2_DEF(void) const { return ActDisk_SU2_DEF; } /*! * \brief Value of the design variable step, we use this value in design problems. @@ -8166,28 +8166,28 @@ class CConfig { * \param[in] val_index - Index corresponding to the load boundary. * \return The load value. */ - su2double GetLoad_Sine_Amplitude(string val_index) const; + // su2double GetLoad_Sine_Amplitude(string val_index) const; /*! * \brief Get the frequency of the sine-wave at a load boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load frequency. */ - su2double GetLoad_Sine_Frequency(string val_index) const; + // su2double GetLoad_Sine_Frequency(string val_index) const; /*! * \brief Get the force direction at a sine-wave loaded boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load direction. */ - const su2double* GetLoad_Sine_Dir(string val_index) const; + // const su2double* GetLoad_Sine_Dir(string val_index) const; - /*! - * \brief Get the force value at an load boundary. - * \param[in] val_index - Index corresponding to the load boundary. - * \return The load value. - */ - su2double GetFlowLoad_Value(string val_index) const; + ///*! + // * \brief Get the force value at an load boundary. + // * \param[in] val_index - Index corresponding to the load boundary. + // * \return The load value. + // */ + //su2double GetFlowLoad_Value(string val_index) const; /*! * \brief Cyclic pitch amplitude for rotor blades. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index f0c0d8ea91a..ce144c82983 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -854,8 +854,8 @@ void CConfig::SetPointersNull(void) { Marker_Isothermal = nullptr; Marker_HeatFlux = nullptr; Marker_EngineInflow = nullptr; Marker_Load = nullptr; Marker_Disp_Dir = nullptr; Marker_RoughWall = nullptr; Marker_EngineExhaust = nullptr; Marker_Displacement = nullptr; Marker_Load = nullptr; - Marker_Load_Dir = nullptr; Marker_Load_Sine = nullptr; Marker_Clamped = nullptr; - Marker_FlowLoad = nullptr; Marker_Internal = nullptr; + Marker_Load_Dir = nullptr; Marker_Clamped = nullptr; + Marker_Internal = nullptr; Marker_All_TagBound = nullptr; Marker_CfgFile_TagBound = nullptr; Marker_All_KindBC = nullptr; Marker_CfgFile_KindBC = nullptr; Marker_All_SendRecv = nullptr; Marker_All_PerBound = nullptr; Marker_ZoneInterface = nullptr; Marker_All_ZoneInterface = nullptr; Marker_Riemann = nullptr; @@ -866,7 +866,7 @@ void CConfig::SetPointersNull(void) { Isothermal_Temperature = nullptr; HeatTransfer_Coeff = nullptr; HeatTransfer_WallTemp = nullptr; Heat_Flux = nullptr; Displ_Value = nullptr; Load_Value = nullptr; - FlowLoad_Value = nullptr; Damper_Constant = nullptr; Wall_Emissivity = nullptr; + Damper_Constant = nullptr; Wall_Emissivity = nullptr; Roughness_Height = nullptr; /*--- Inlet Outlet Boundary Condition settings ---*/ @@ -903,7 +903,7 @@ void CConfig::SetPointersNull(void) { Load_Dir = nullptr; Load_Dir_Value = nullptr; Load_Dir_Multiplier = nullptr; Disp_Dir = nullptr; Disp_Dir_Value = nullptr; Disp_Dir_Multiplier = nullptr; - Load_Sine_Dir = nullptr; Load_Sine_Amplitude = nullptr; Load_Sine_Frequency = nullptr; + //Load_Sine_Dir = nullptr; Load_Sine_Amplitude = nullptr; Load_Sine_Frequency = nullptr; Electric_Field_Mod = nullptr; Electric_Field_Dir = nullptr; RefNode_Displacement = nullptr; Electric_Constant = nullptr; @@ -1435,7 +1435,7 @@ void CConfig::SetConfig_Options() { /*!\brief REF_VELOCITY\n DESCRIPTION: Reference velocity (incompressible only) \ingroup Config*/ addDoubleOption("REF_VELOCITY", Velocity_Ref, -1.0); /* !\brief REF_VISCOSITY \n DESCRIPTION: Reference viscosity (incompressible only) \ingroup Config*/ - addDoubleOption("REF_VISCOSITY", Viscosity_Ref, -1.0); + addDoubleOption("REF_VISCOSITY", Viscosity_Ref, 1.0); /* DESCRIPTION: Type of mesh motion */ addEnumOption("REF_DIMENSIONALIZATION", Ref_NonDim, NonDim_Map, DIMENSIONAL); @@ -1443,8 +1443,8 @@ void CConfig::SetConfig_Options() { /*--- Options related to various boundary markers ---*/ /*!\brief HTP_AXIS\n DESCRIPTION: Location of the HTP axis*/ - htp_axis[0] = 0.0; htp_axis[1] = 0.0; - addDoubleArrayOption("HTP_AXIS", 2, htp_axis); + //htp_axis[0] = 0.0; htp_axis[1] = 0.0; + //addDoubleArrayOption("HTP_AXIS", 2, htp_axis); /*!\brief MARKER_PLOTTING\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/ addStringListOption("MARKER_PLOTTING", nMarker_Plotting, Marker_Plotting); /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/ @@ -1584,10 +1584,10 @@ void CConfig::SetConfig_Options() { /*!\brief SPANWISE_KIND \n DESCRIPTION: type of algorithm to identify the span-wise sections at the turbo boundaries. \n OPTIONS: see \link SpanWise_Map \endlink \n Default: AUTOMATIC */ addEnumOption("SPANWISE_KIND", Kind_SpanWise, SpanWise_Map, AUTOMATIC); - /*!\brief TURBOMACHINERY_KIND \n DESCRIPTION: types of turbomachynery architecture. + /*!\brief TURBOMACHINERY_KIND \n DESCRIPTION: types of turbomachinery architecture. \n OPTIONS: see \link TurboMachinery_Map \endlink \n Default: AXIAL */ addEnumListOption("TURBOMACHINERY_KIND",nTurboMachineryKind, Kind_TurboMachinery, TurboMachinery_Map); - /*!\brief MARKER_SHROUD \n DESCRIPTION: markers in which velocity is forced to 0.0 . + /*!\brief MARKER_SHROUD \n DESCRIPTION: markers in which velocity is forced to 0.0. * \n Format: (shroud1, shroud2, ...)*/ addStringListOption("MARKER_SHROUD", nMarker_Shroud, Marker_Shroud); /*!\brief MARKER_SUPERSONIC_INLET \n DESCRIPTION: Supersonic inlet boundary marker(s) @@ -1611,7 +1611,7 @@ void CConfig::SetConfig_Options() { /*!\brief MARKER_HEATTRANSFER DESCRIPTION: Heat flux with specified heat transfer coefficient boundary marker(s)\n * Format: ( Heat transfer marker, heat transfer coefficient, wall temperature (static), ... ) \ingroup Config */ addExhaustOption("MARKER_HEATTRANSFER", nMarker_HeatTransfer, Marker_HeatTransfer, HeatTransfer_Coeff, HeatTransfer_WallTemp); - /*!\brief Smluchowski/Maxwell wall boundary marker(s) \n DESCRIPTION: Slip velocity and temperature jump wall boundary marker(s) + /*!\brief Smoluchowski/Maxwell wall boundary marker(s) \n DESCRIPTION: Slip velocity and temperature jump wall boundary marker(s) Format: ( Heat flux marker, wall temperature (static), momentum accomodation coefficient, thermal accomodation coefficient ... ) \ingroup Config*/ addStringDoubleListOption("MARKER_SMOLUCHOWSKI_MAXWELL", nMarker_Smoluchowski_Maxwell, Marker_Smoluchowski_Maxwell, Isothermal_Temperature); //Missing TMAC and TAC /*!\brief WALL_ROUGHNESS \n DESCRIPTION: Specified roughness heights at wall boundary marker(s) @@ -1630,8 +1630,8 @@ void CConfig::SetConfig_Options() { addBoolOption("ACTDISK_DOUBLE_SURFACE", ActDisk_DoubleSurface, false); /* DESCRIPTION: Only half engine is in the computational grid */ addBoolOption("ENGINE_HALF_MODEL", Engine_HalfModel, false); - /* DESCRIPTION: Actuator disk double surface */ - addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); + // /* DESCRIPTION: Actuator disk double surface */ + // addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); /* DESCRIPTION: Definition of the distortion rack (radial number of proves / circumferential density (degree) */ distortion[0] = 5.0; distortion[1] = 15.0; addDoubleArrayOption("DISTORTION_RACK", 2, distortion); @@ -1661,7 +1661,7 @@ void CConfig::SetConfig_Options() { addInletOption("MARKER_DISPLACEMENT", nMarker_Disp_Dir, Marker_Disp_Dir, Disp_Dir_Value, Disp_Dir_Multiplier, Disp_Dir); /* DESCRIPTION: Sine load boundary marker(s) Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), i.e. primitive variables specified. */ - addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, Load_Sine_Dir); + //addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, Load_Sine_Dir); /*!\brief SINE_LOAD\n DESCRIPTION: option to apply the load as a sine*/ addBoolOption("SINE_LOAD", Sine_Load, false); sineload_coeff[0] = 0.0; sineload_coeff[1] = 0.0; sineload_coeff[2] = 0.0; @@ -1671,7 +1671,7 @@ void CConfig::SetConfig_Options() { addBoolOption("RAMP_AND_RELEASE_LOAD", RampAndRelease, false); /* DESCRIPTION: Flow load boundary marker(s) */ - addStringDoubleListOption("MARKER_FLOWLOAD", nMarker_FlowLoad, Marker_FlowLoad, FlowLoad_Value); + //addStringDoubleListOption("MARKER_FLOWLOAD", nMarker_FlowLoad, Marker_FlowLoad, FlowLoad_Value); /* DESCRIPTION: Damping factor for engine inlet condition */ addDoubleOption("DAMP_ENGINE_INFLOW", Damp_Engine_Inflow, 0.95); /* DESCRIPTION: Damping factor for engine exhaust condition */ @@ -1822,6 +1822,8 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Convergence\ingroup Config*/ /*--- Options related to convergence ---*/ + /*!\brief CONV_FIELD\n DESCRIPTION: Output field to monitor \n Default: depends on solver \ingroup Config*/ + addStringListOption("CONV_FIELD", nConvField, ConvField); /*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 \ingroup Config*/ addDoubleOption("CONV_RESIDUAL_MINVAL", MinLogResidual, -14.0); /*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup Config*/ @@ -1830,15 +1832,13 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("CONV_CAUCHY_ELEMS", Cauchy_Elems, 100); /*!\brief CONV_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-10 \ingroup Config*/ addDoubleOption("CONV_CAUCHY_EPS", Cauchy_Eps, 1E-10); - /*!\brief CONV_FIELD\n DESCRIPTION: Output field to monitor \n Default: depends on solver \ingroup Config*/ - addStringListOption("CONV_FIELD", nConvField, ConvField); /*!\brief CONV_WINDOW_STARTITER\n DESCRIPTION: Iteration number after START_ITER_WND to begin convergence monitoring\n DEFAULT: 15 \ingroup Config*/ addUnsignedLongOption("CONV_WINDOW_STARTITER", Wnd_StartConv_Iter, 15); - /*!\brief CONV_WINDOW_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ - addUnsignedShortOption("CONV_WINDOW_CAUCHY_ELEMS", Wnd_Cauchy_Elems, 100); /*!\brief CONV_WINDOW_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-3 \ingroup Config*/ addDoubleOption("CONV_WINDOW_CAUCHY_EPS", Wnd_Cauchy_Eps, 1E-3); + /*!\brief CONV_WINDOW_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ + addUnsignedShortOption("CONV_WINDOW_CAUCHY_ELEMS", Wnd_Cauchy_Elems, 100); /*!\brief WINDOW_CAUCHY_CRIT \n DESCRIPTION: Determines, if the cauchy convergence criterion should be used for windowed time averaged objective functions*/ addBoolOption("WINDOW_CAUCHY_CRIT",Wnd_Cauchy_Crit, false); /*!\brief CONV_WINDOW_FIELD @@ -2051,7 +2051,7 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Input/output files and formats \ingroup Config */ /*--- Options related to input/output files and formats ---*/ - +nijso /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_OUTPUT::TAB_CSV); /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ @@ -5429,10 +5429,10 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_Smoluchowski_Maxwell, iMarker_Isothermal,iMarker_HeatFlux,iMarker_HeatTansfer, iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Damper, - iMarker_Displacement, iMarker_Load, iMarker_FlowLoad, iMarker_Internal, + iMarker_Displacement, iMarker_Load, iMarker_Internal, iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iMarker_Moving, iMarker_SobolevBC, iMarker_PyCustom, iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, - iMarker_Clamped, iMarker_ZoneInterface, iMarker_CHTInterface, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Load_Sine, + iMarker_Clamped, iMarker_ZoneInterface, iMarker_CHTInterface, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Fluid_Load, iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, iMarker_ActDiskInlet, iMarker_ActDiskOutlet, iMarker_Turbomachinery, iMarker_MixingPlaneInterface; @@ -5448,8 +5448,8 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { nMarker_HeatFlux + nMarker_HeatTransfer + nMarker_EngineInflow + nMarker_EngineExhaust + nMarker_Internal + nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + nMarker_Load + - nMarker_FlowLoad + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + - nMarker_Clamped + nMarker_Load_Sine + nMarker_Load_Dir + nMarker_Disp_Dir + + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + + nMarker_Clamped + nMarker_Load_Dir + nMarker_Disp_Dir + nMarker_ActDiskInlet + nMarker_ActDiskOutlet + nMarker_ZoneInterface; /*--- Add the possible send/receive domains ---*/ @@ -5780,22 +5780,22 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) { - Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Load_Sine[iMarker_Load_Sine]; - Marker_CfgFile_KindBC[iMarker_CfgFile] = LOAD_SINE_BOUNDARY; - iMarker_CfgFile++; - } + // for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) { + // Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Load_Sine[iMarker_Load_Sine]; + // Marker_CfgFile_KindBC[iMarker_CfgFile] = LOAD_SINE_BOUNDARY; + // iMarker_CfgFile++; + // } for (iMarker_Fluid_Load = 0; iMarker_Fluid_Load < nMarker_Fluid_Load; iMarker_Fluid_Load++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Fluid_Load[iMarker_Fluid_Load]; iMarker_CfgFile++; } - for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) { - Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_FlowLoad[iMarker_FlowLoad]; - Marker_CfgFile_KindBC[iMarker_CfgFile] = FLOWLOAD_BOUNDARY; - iMarker_CfgFile++; - } + // for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) { + // Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_FlowLoad[iMarker_FlowLoad]; + // Marker_CfgFile_KindBC[iMarker_CfgFile] = FLOWLOAD_BOUNDARY; + // iMarker_CfgFile++; + // } for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_Monitoring[iMarker_CfgFile] = NO; @@ -5956,9 +5956,9 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { iMarker_Smoluchowski_Maxwell, iWall_Catalytic, iMarker_Giles, iMarker_Outlet, iMarker_Isothermal, iMarker_HeatFlux, iMarker_HeatTransfer, iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Displacement, iMarker_Damper, - iMarker_Load, iMarker_FlowLoad, iMarker_Internal, iMarker_Monitoring, + iMarker_Load, iMarker_Internal, iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iDV_Value, - iMarker_ZoneInterface, iMarker_PyCustom, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Load_Sine, iMarker_Clamped, + iMarker_ZoneInterface, iMarker_PyCustom, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Clamped, iMarker_Moving, iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, iMarker_ActDiskInlet, iMarker_Emissivity, iMarker_ActDiskOutlet, iMarker_MixingPlaneInterface, @@ -7239,14 +7239,14 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { BoundaryTable.PrintFooter(); } - if (nMarker_FlowLoad != 0) { - BoundaryTable << "Flow load boundary"; - for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) { - BoundaryTable << Marker_FlowLoad[iMarker_FlowLoad]; - if (iMarker_FlowLoad < nMarker_FlowLoad-1) BoundaryTable << " "; - } - BoundaryTable.PrintFooter(); - } + // if (nMarker_FlowLoad != 0) { + // BoundaryTable << "Flow load boundary"; + // for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) { + // BoundaryTable << Marker_FlowLoad[iMarker_FlowLoad]; + // if (iMarker_FlowLoad < nMarker_FlowLoad-1) BoundaryTable << " "; + // } + // BoundaryTable.PrintFooter(); + // } if (nMarker_Internal != 0) { BoundaryTable << "Internal boundary"; @@ -7446,14 +7446,14 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { BoundaryTable.PrintFooter(); } - if (nMarker_Load_Sine != 0) { - BoundaryTable << "Sine-Wave boundary"; - for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) { - BoundaryTable << Marker_Load_Sine[iMarker_Load_Sine]; - if (iMarker_Load_Sine < nMarker_Load_Sine-1) BoundaryTable << " "; - } - BoundaryTable.PrintFooter(); - } + // if (nMarker_Load_Sine != 0) { + // BoundaryTable << "Sine-Wave boundary"; + // for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) { + // BoundaryTable << Marker_Load_Sine[iMarker_Load_Sine]; + // if (iMarker_Load_Sine < nMarker_Load_Sine-1) BoundaryTable << " "; + // } + // BoundaryTable.PrintFooter(); + // } if (nMarker_Emissivity != 0) { BoundaryTable << "Radiative boundary"; @@ -9484,26 +9484,26 @@ const su2double* CConfig::GetDisp_Dir(string val_marker) const { return Disp_Dir[iMarker_Disp_Dir]; } -su2double CConfig::GetLoad_Sine_Amplitude(string val_marker) const { - unsigned short iMarker_Load_Sine; - for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) - if (Marker_Load_Sine[iMarker_Load_Sine] == val_marker) break; - return Load_Sine_Amplitude[iMarker_Load_Sine]; -} +// su2double CConfig::GetLoad_Sine_Amplitude(string val_marker) const { +// unsigned short iMarker_Load_Sine; +// for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) +// if (Marker_Load_Sine[iMarker_Load_Sine] == val_marker) break; +// return Load_Sine_Amplitude[iMarker_Load_Sine]; +// } -su2double CConfig::GetLoad_Sine_Frequency(string val_marker) const { - unsigned short iMarker_Load_Sine; - for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) - if (Marker_Load_Sine[iMarker_Load_Sine] == val_marker) break; - return Load_Sine_Frequency[iMarker_Load_Sine]; -} +// su2double CConfig::GetLoad_Sine_Frequency(string val_marker) const { +// unsigned short iMarker_Load_Sine; +// for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) +// if (Marker_Load_Sine[iMarker_Load_Sine] == val_marker) break; +// return Load_Sine_Frequency[iMarker_Load_Sine]; +// } -const su2double* CConfig::GetLoad_Sine_Dir(string val_marker) const { - unsigned short iMarker_Load_Sine; - for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) - if (Marker_Load_Sine[iMarker_Load_Sine] == val_marker) break; - return Load_Sine_Dir[iMarker_Load_Sine]; -} +// const su2double* CConfig::GetLoad_Sine_Dir(string val_marker) const { +// unsigned short iMarker_Load_Sine; +// for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) +// if (Marker_Load_Sine[iMarker_Load_Sine] == val_marker) break; +// return Load_Sine_Dir[iMarker_Load_Sine]; +// } su2double CConfig::GetWall_Emissivity(string val_marker) const { @@ -9517,12 +9517,12 @@ su2double CConfig::GetWall_Emissivity(string val_marker) const { return Wall_Emissivity[iMarker_Emissivity]; } -su2double CConfig::GetFlowLoad_Value(string val_marker) const { - unsigned short iMarker_FlowLoad; - for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) - if (Marker_FlowLoad[iMarker_FlowLoad] == val_marker) break; - return FlowLoad_Value[iMarker_FlowLoad]; -} +//su2double CConfig::GetFlowLoad_Value(string val_marker) const { +// unsigned short iMarker_FlowLoad; +// for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) +// if (Marker_FlowLoad[iMarker_FlowLoad] == val_marker) break; +// return FlowLoad_Value[iMarker_FlowLoad]; +//} short CConfig::FindInterfaceMarker(unsigned short iInterface) const { diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp index 92e63d0623d..8aed5f58615 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp @@ -40,8 +40,7 @@ CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig *val_config, actuator_disk = (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || - ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) && - (config->GetActDisk_SU2_DEF())))); + (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) )); if (config->GetActDisk_DoubleSurface()) actuator_disk = false; /* Read the basic metadata and perform some basic error checks. */ diff --git a/config_template.cfg b/config_template.cfg index dd501098f13..cc68faa89ec 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -153,6 +153,9 @@ WINDOW_START_ITER = 500 % Window used for reverse sweep and direct run. Options (SQUARE, HANN, HANN_SQUARE, BUMP) Square is default. WINDOW_FUNCTION = SQUARE % +% Starting direct solver iteration for the unsteady adjoint +UNST_ADJOINT_ITER= 0 +% % ------------------------------- DES Parameters ------------------------------% % % Specify Hybrid RANS/LES model (SA_DES, SA_DDES, SA_ZDES, SA_EDDES) @@ -322,6 +325,19 @@ ITER_DCL_DALPHA= 500 EVAL_DOF_DCX= NO % Damping factor for fixed CL mode. NETTHRUST_DBCTHRUST= 1.0 +% +% parameter for the definition of a complex objective function +DCD_DCL_VALUE= 0.0 +% +% parameter for the definition of a complex objective function +DCMX_DCL_VALUE= 0.0 +% +% parameter for the definition of a complex objective function +DCMY_DCL_VALUE= 0.0 +% +% parameter for the definition of a complex objective function +DCMZ_DCL_VALUE= 0.0 + % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % % Reference origin for moment computation (m or in) @@ -332,6 +348,12 @@ REF_ORIGIN_MOMENT_Z = 0.00 % Reference length for moment non-dimensional coefficients (m or in) REF_LENGTH= 1.0 % +% Reference velocity (incompressible only) +REF_VELOCITY= 1.0 +% +% Reference viscosity (incompressible only) +REF_VISCOSITY= 1.0 +% % Reference area for non-dimensional force coefficients (0 implies automatic % calculation) (m^2 or in^2) REF_AREA= 1.0 @@ -620,6 +642,9 @@ DRAG_IN_SONICBOOM= 0.0 % -------------------------- ENGINE SIMULATION --------------------------------% % +% Evaluate a problem with engines +ENGINE= NO +% % Highlite area to compute MFR (1 in2 by default) HIGHLITE_AREA= 1.0 % @@ -640,10 +665,14 @@ ENGINE_NU_FACTOR= 3.0 % % Actuator disk jump definition using ratio or difference (DIFFERENCE, RATIO) ACTDISK_JUMP= DIFFERENCE -% +% % secondary flow value for actuator disk ACTDISK_SECONDARY_FLOW= 0.0 % +% Actuator disk double surface +ACTDISK_DOUBLE_SURFACE= NO +% +% % Number of times BC Thrust is updated in a fix Net Thrust problem (5 by default) UPDATE_BCTHRUST= 100 % @@ -658,6 +687,9 @@ SUBSONIC_ENGINE_CYL= ( 0.0, 0.0, 0.0, 1.0, 0.0 , 0.0, 1.0 ) % % Flow variables that define the subsonic region (Mach, Alpha, Beta, Pressure, Temperature) SUBSONIC_ENGINE_VALUES= ( 0.4, 0.0, 0.0, 2116.216, 518.67 ) +% +% Definition of the distortion rack (radial number of proves / circumferential density (degree) +DISTORTION_RACK= (0.0, 0.0) % ------------------------- TURBOMACHINERY SIMULATION -------------------------% % @@ -702,7 +734,15 @@ MIXEDOUT_COEFF= (1.0, 1.0E-05, 15) % Limit of Mach number below which the mixedout algorithm is substituted % with a AREA average algorithm to avoid numerical issues AVERAGE_MACH_LIMIT= 0.05 - +% +% Integer number of periodic time instances for Harmonic Balance +TIME_INSTANCES= 1 +% +% Time period for Harmonic Balance wihtout moving meshes +HB_PERIOD= -1 +% +% Turn on/off harmonic balance preconditioning +HB_PRECONDITION= NO % ------------------- RADIATIVE HEAT TRANSFER SIMULATION ----------------------% % % Type of radiation model (NONE, P1) @@ -758,7 +798,7 @@ SCHMIDT_NUMBER_LAMINAR= 1.0 % Turbulent Schmidt number of mass diffusion SCHMIDT_NUMBER_TURBULENT= 0.7 % -% list of constant Lewis numbers for all species for +% list of constant Lewis numbers for all species for CONSTANT_LEWIS_NUMBER= (1,1,1) % % Inlet Species boundary marker(s) with the following format: @@ -891,6 +931,11 @@ SPECIFIED_INLET_PROFILE= NO % File specifying inlet profile INLET_FILENAME= inlet.dat % +% If a file is provided to specify the inlet profile, +% this tolerance will be used to match the coordinates in the input file to +% the points on the grid. +% INLET_MATCHING_TOLERANCE= 1e-6 +% % Inlet boundary marker(s) with the following formats (NONE = no marker) % Total Conditions: (inlet marker, total temp, total pressure, flow_direction_x, % flow_direction_y, flow_direction_z, ... ) where flow_direction is @@ -987,6 +1032,9 @@ MARKER_SHROUD= (NONE) % MARKER_ZONE_INTERFACE= ( NONE ) % +% CHT interface boundary marker(s) +MARKER_CHT_INTERFACE= ( NONE ) +% % Specifies the interface (s) % The kind of interface is defined by listing pairs of markers (one from each % zone connected by the interface) @@ -999,6 +1047,9 @@ MARKER_ZONE_INTERFACE= ( NONE ) % MARKER_FLUID_INTERFACE= ( NONE ) % +% Marker(s) in which the flow load is computed/applied +MARKER_FLUID_LOAD= ( NONE ) +% % Kind of interface interpolation among different zones (NEAREST_NEIGHBOR, % ISOPARAMETRIC, SLIDING_MESH) KIND_INTERPOLATION= NEAREST_NEIGHBOR @@ -1007,6 +1058,12 @@ KIND_INTERPOLATION= NEAREST_NEIGHBOR % the natural groth of the machine (i.e, from the first blade to the last) MARKER_TURBOMACHINERY= ( NONE ) % +% Integer number of spanwise sections to compute 3D turbo BC and Performance for turbomachinery +NUM_SPANWISE_SECTIONS= 1 +% +% type of algorithm to identify the span-wise sections at the turbo boundaries. 1 means automatic. +SPANWISE_KIND= 1 +% % Mixing-plane interface markers must be specified to activate the transfer of % information between zones MARKER_MIXINGPLANE_INTERFACE= ( NONE ) @@ -1038,7 +1095,37 @@ CATALYTIC_EFFICIENCY= 0.2 % Inlet Turbulent boundary marker(s) with the following format: % (inlet_marker1, TurbIntensity1, RatioTurbLamViscosity1, inlet_marker2, TurbIntensity2, RatioTurbLamViscosity2, ...) MARKER_INLET_TURBULENT= (inlet1, 0.05, 15, inlet2, 0.02, ...) - +% +% Custom boundary marker(s) +MARKER_CUSTOM= ( NONE ) +% +% Smoluchowski/Maxwell wall boundary marker(s) +MARKER_SMOLUCHOWSKI_MAXWELL= ( NONE ) +% +% Clamped boundary marker(s) +MARKER_CLAMPED= ( NONE ) +% +% Load boundary marker(s) +MARKER_DAMPER= ( NONE ) +% +% Load boundary marker(s) +% Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), +% i.e. primitive variables specified. +MARKER_LOAD= ( NONE ) +% +% option to apply the load as a sine +SINE_LOAD= NO +% the 1st coeff is the amplitude, +% the 2nd is the frequency, +% the 3rd is the phase in radians +SINE_LOAD_COEFF= (0.0, 0.0, 0.0) +% +RAMP_AND_RELEASE_LOAD= NO +% +% Load boundary marker(s) +% Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), +% i.e. primitive variables specified. +MARKER_DISPLACEMENT= ( NONE ) % ------------------------ WALL ROUGHNESS DEFINITION --------------------------% % The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m. % This is a list of (string, double) each element corresponding to the MARKER defined in WALL_TYPE. @@ -1062,6 +1149,13 @@ WALLMODEL_MAXITER= 200 % [Expert] relaxation factor for the Newton iterations of the standard wall function WALLMODEL_RELFAC= 0.5 +% ------------------------ CONJUGATE HEAT TRANSFER --------------------------% +% +% Relaxation of the CHT coupling +RELAXATION_FACTOR_CHT= 1.0 +% +% + % ------------------------ SURFACES IDENTIFICATION ----------------------------% % % Marker(s) of the surface in the surface flow solution file @@ -1115,6 +1209,9 @@ CFL_ADAPT_PARAM= ( 0.1, 2.0, 10.0, 1e10, 0.001 ) % Maximum Delta Time in local time stepping simulations MAX_DELTA_TIME= 1E6 % +% External iteration offset due to restart +EXT_ITER_OFFSET= 0 +% % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % @@ -1184,6 +1281,8 @@ ADJ_SHARP_LIMITER_COEFF= 3.0 % Remove sharp edges from the sensitivity evaluation (NO, YES) SENS_REMOVE_SHARP = NO % +SENS_SMOOTHING= NONE +% % Freeze the value of the limiter after a number of iterations LIMITER_ITER= 999999 % @@ -1212,6 +1311,15 @@ LINEAR_SOLVER= FGMRES % Same for discrete adjoint (smoothers not supported), replaces LINEAR_SOLVER in SU2_*_AD codes. DISCADJ_LIN_SOLVER= FGMRES % +% Linear solver for the turbulent adjoint systems +ADJTURB_LIN_SOLVER= FGMRES +% +% Preconditioner for the turbulent adjoint Krylov linear solvers +ADJTURB_LIN_PREC= ILU +% +% Maximum number of iterations of the turbulent adjoint linear solver for the implicit formulation +ADJTURB_LIN_ITER= 10 +% % Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) LINEAR_SOLVER_PREC= ILU % @@ -1266,6 +1374,15 @@ CONV_NUM_METHOD_FLOW= ROE % Roe Low Dissipation function for Hybrid RANS/LES simulations (FD, NTS, NTS_DUCROS) ROE_LOW_DISSIPATION= FD % +% Roe coefficient +ROE_KAPPA= 0.5 +% +% Time Step for dual time stepping simulations (s) +MIN_ROE_TURKEL_PREC= 0.01 +% +% Time Step for dual time stepping simulations (s) +MAX_ROE_TURKEL_PREC= 0.2 +% % Post-reconstruction correction for low Mach number flows (NO, YES) LOW_MACH_CORR= NO % @@ -1289,6 +1406,10 @@ ENTROPY_FIX_COEFF= 0.0 % only) more diagonal dominant (but mathematically incorrect) so that higher CFL can be used. CENTRAL_JACOBIAN_FIX_FACTOR= 4.0 % +% Control numerical properties of the global Jacobian matrix using a multiplication factor +% for incompressible central schemes +CENTRAL_INC_JACOBIAN_FIX_FACTOR= 1.0 +% % Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % @@ -1296,7 +1417,12 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % For multizone discrete adjoint it will use FGMRES on inner iterations with restart frequency % equal to "QUASI_NEWTON_NUM_SAMPLES". NEWTON_KRYLOV= NO - +% +% Integer parameters {startup iters, precond iters, initial tolerance relaxation}. +NEWTON_KRYLOV_IPARAM= (10, 3, 2) +% +% Double parameters {startup residual drop, precond tolerance, full tolerance residual drop, findiff step}. +NEWTON_KRYLOV_DPARAM= (1.0, 0.1, -6.0, 1e-5) % ------------------- FEM FLOW NUMERICAL METHOD DEFINITION --------------------% % % FEM numerical method (DG) @@ -1330,7 +1456,7 @@ ALIGNED_BYTES_MATMUL= 128 TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % % Number of time DOFs for the predictor step of ADER-DG (2 by default) -%TIME_DOFS_ADER_DG= 2 +TIME_DOFS_ADER_DG= 2 % Factor applied during quadrature in time for ADER-DG. (2.0 by default) %QUADRATURE_FACTOR_TIME_ADER_DG = 2.0 % @@ -1345,6 +1471,8 @@ KIND_MATRIX_COLORING= GREEDY_COLORING % Specify shock capturing method for DG KIND_FEM_DG_SHOCK= NONE % +% Time discretization +TIME_DISCRE_FEA= NEWMARK_IMPLICIT % -------------------- Weakly Coupled Heat ------------------% % WEAKLY_COUPLED_HEAT_EQUATION= NO @@ -1382,6 +1510,9 @@ TIME_DISCRE_HEAT= EULER_IMPLICIT % Frozen the slope limiter in the discrete adjoint formulation (NO, YES) FROZEN_LIMITER_DISC= NO % +% Continuous Adjoint frozen viscosity +% FROZEN_VISC_CONT= NO +% % Frozen the turbulent viscosity in the discrete adjoint formulation (NO, YES) FROZEN_VISC_DISC= NO % @@ -1436,9 +1567,14 @@ GEO_MARKER= ( airfoil ) % Description of the geometry to be analyzed (AIRFOIL, WING) GEO_DESCRIPTION= AIRFOIL % +% Z location of the waterline +GEO_WATERLINE_LOCATION= 0.0 +% % Coordinate of the stations to be analyzed GEO_LOCATION_STATIONS= (0.0, 0.5, 1.0) % +% Definition of the nacelle location (higlite coordinates, tilt angle, toe angle) +GEO_NACELLE_LOCATION= (0.0, 0.0, 0.0, 0.0, 0.0) % Geometrical bounds (Y coordinate) for the wing geometry analysis or % fuselage evaluation (X coordinate) GEO_BOUNDS= (1.5, 3.5) @@ -1924,6 +2060,9 @@ DEFINITION_DV= ( 1, 1.0 | airfoil | 0, 0.05 ); ( 1, 1.0 | airfoil | 0, 0.10 ); ( % Use combined objective within gradient evaluation: may reduce cost to compute gradients when using the adjoint formulation. OPT_COMBINE_OBJECTIVE = NO % +% +% Number of iterations to average the objective +ITER_AVERAGE_OBJ= 0 % --------------------- LIBROM PARAMETERS -----------------------% % LibROM can be found here: https://github.com/LLNL/libROM % From b850cd31ca01942a873812360323838d3767e0a6 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Sun, 19 Feb 2023 11:21:07 +0100 Subject: [PATCH 003/139] alignment --- Common/include/CConfig.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3b488c27314..62f5a8b856e 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1539,10 +1539,10 @@ class CConfig { */ const su2double *GetHold_GridFixed_Coord(void) const { return grid_fix; } - /*! - * \brief Get the values of subsonic engine. - * \return Values of subsonic engine. - */ + /*! + * \brief Get the values of subsonic engine. + * \return Values of subsonic engine. + */ const su2double *GetSubsonicEngine_Values(void) const { return eng_val; } /*! From efa6a4fe22769349f70ca66a9e5bb6eb34cb962f Mon Sep 17 00:00:00 2001 From: Nijso Date: Mon, 20 Feb 2023 08:46:57 +0100 Subject: [PATCH 004/139] Update config_template.cfg Co-authored-by: Wally Maier --- config_template.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_template.cfg b/config_template.cfg index cc68faa89ec..9fbdc29f4d2 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1099,7 +1099,7 @@ MARKER_INLET_TURBULENT= (inlet1, 0.05, 15, inlet2, 0.02, ...) % Custom boundary marker(s) MARKER_CUSTOM= ( NONE ) % -% Smoluchowski/Maxwell wall boundary marker(s) +% Smoluchowski/Maxwell slip wall boundary marker(s) MARKER_SMOLUCHOWSKI_MAXWELL= ( NONE ) % % Clamped boundary marker(s) From 26df91bb42643bdd64f19b578330a3bfdc875e06 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Mon, 20 Feb 2023 15:58:18 +0100 Subject: [PATCH 005/139] add config options to config_template --- Common/include/CConfig.hpp | 26 ++--- .../grid_movement/CSurfaceMovement.hpp | 12 +-- Common/src/CConfig.cpp | 26 ++--- config_template.cfg | 95 +++++++++++++++++++ 4 files changed, 127 insertions(+), 32 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 62f5a8b856e..4e061e79409 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -923,8 +923,8 @@ class CConfig { bool RampAndRelease; /*!< \brief option for ramp load and release */ bool Sine_Load; /*!< \brief option for sine load */ su2double Thermal_Diffusivity; /*!< \brief Thermal diffusivity used in the heat solver. */ - su2double Cyclic_Pitch, /*!< \brief Cyclic pitch for rotorcraft simulations. */ - Collective_Pitch; /*!< \brief Collective pitch for rotorcraft simulations. */ + //su2double Cyclic_Pitch, /*!< \brief Cyclic pitch for rotorcraft simulations. */ + //Collective_Pitch; /*!< \brief Collective pitch for rotorcraft simulations. */ su2double Mach_Motion; /*!< \brief Mach number based on mesh velocity and freestream quantities. */ su2double Motion_Origin[3] = {0.0}, /*!< \brief Mesh motion origin. */ @@ -8189,17 +8189,17 @@ class CConfig { // */ //su2double GetFlowLoad_Value(string val_index) const; - /*! - * \brief Cyclic pitch amplitude for rotor blades. - * \return The specified cyclic pitch amplitude. - */ - su2double GetCyclic_Pitch(void) const { return Cyclic_Pitch; } - - /*! - * \brief Collective pitch setting for rotor blades. - * \return The specified collective pitch setting. - */ - su2double GetCollective_Pitch(void) const { return Collective_Pitch; } + // /*! + // * \brief Cyclic pitch amplitude for rotor blades. + // * \return The specified cyclic pitch amplitude. + // */ + // su2double GetCyclic_Pitch(void) const { return Cyclic_Pitch; } + + // /*! + // * \brief Collective pitch setting for rotor blades. + // * \return The specified collective pitch setting. + // */ + // su2double GetCollective_Pitch(void) const { return Collective_Pitch; } /*! * \brief Get name of the arbitrary mesh motion input file. diff --git a/Common/include/grid_movement/CSurfaceMovement.hpp b/Common/include/grid_movement/CSurfaceMovement.hpp index 564071e9338..9e6be8fdbe6 100644 --- a/Common/include/grid_movement/CSurfaceMovement.hpp +++ b/Common/include/grid_movement/CSurfaceMovement.hpp @@ -156,12 +156,12 @@ class CSurfaceMovement : public CGridMovement { void SetBoundary_Flutter3D(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, unsigned long iter, unsigned short iZone); - /*! - * \brief Set the collective pitch for a blade surface movement. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void SetCollective_Pitch(CGeometry *geometry, CConfig *config); + // /*! + // * \brief Set the collective pitch for a blade surface movement. + // * \param[in] geometry - Geometrical definition of the problem. + // * \param[in] config - Definition of the particular problem. + // */ + // void SetCollective_Pitch(CGeometry *geometry, CConfig *config); /*! * \brief Set any surface deformationsbased on an input file. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index ce144c82983..3baf03c048a 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2051,7 +2051,7 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Input/output files and formats \ingroup Config */ /*--- Options related to input/output files and formats ---*/ -nijso + /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_OUTPUT::TAB_CSV); /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ @@ -2078,7 +2078,7 @@ nijso /* DESCRIPTION: Determine if the mesh file supports multizone. \n DEFAULT: true (temporarily) */ addBoolOption("MULTIZONE_MESH", Multizone_Mesh, true); - /* DESCRIPTION: Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: true (temporarily) */ + /* DESCRIPTION: Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: false (temporarily) */ addBoolOption("MULTIZONE_RESIDUAL", Multizone_Residual, false); /*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup Config*/ @@ -2307,9 +2307,9 @@ nijso addDoubleOption("DEFORM_LIMIT", Deform_Limit, 1E6); /* DESCRIPTION: Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, WALL_DISTANCE, CONSTANT_STIFFNESS) */ addEnumOption("DEFORM_STIFFNESS_TYPE", Deform_StiffnessType, Deform_Stiffness_Map, SOLID_WALL_DISTANCE); - /* DESCRIPTION: Poisson's ratio for constant stiffness FEA method of grid deformation */ + /* DESCRIPTION: Young's modulus for constant stiffness FEA method of grid deformation */ addDoubleOption("DEFORM_ELASTICITY_MODULUS", Deform_ElasticityMod, 2E11); - /* DESCRIPTION: Young's modulus and Poisson's ratio for constant stiffness FEA method of grid deformation */ + /* DESCRIPTION: Poisson's ratio for constant stiffness FEA method of grid deformation */ addDoubleOption("DEFORM_POISSONS_RATIO", Deform_PoissonRatio, 0.3); /* DESCRIPTION: Size of the layer of highest stiffness for wall distance-based mesh stiffness */ addDoubleOption("DEFORM_STIFF_LAYER_SIZE", Deform_StiffLayerSize, 0.0); @@ -2325,10 +2325,10 @@ nijso /*!\par CONFIG_CATEGORY: Rotorcraft problem \ingroup Config*/ /*--- option related to rotorcraft problems ---*/ - /* DESCRIPTION: MISSING ---*/ - addDoubleOption("CYCLIC_PITCH", Cyclic_Pitch, 0.0); - /* DESCRIPTION: MISSING ---*/ - addDoubleOption("COLLECTIVE_PITCH", Collective_Pitch, 0.0); + // /* DESCRIPTION: MISSING ---*/ + // addDoubleOption("CYCLIC_PITCH", Cyclic_Pitch, 0.0); + // /* DESCRIPTION: MISSING ---*/ + // addDoubleOption("COLLECTIVE_PITCH", Collective_Pitch, 0.0); /*!\par CONFIG_CATEGORY: FEM flow solver definition \ingroup Config*/ /*--- Options related to the finite element flow solver---*/ @@ -2356,7 +2356,7 @@ nijso /*!\par CONFIG_CATEGORY: FEA solver \ingroup Config*/ /*--- Options related to the FEA solver ---*/ - /*!\brief FEA_FILENAME \n DESCRIPTION: Filename to input for element-based properties \n Default: element_properties.dat \ingroup Config */ + /*!\brief FEA_FILENAME \n DESCRIPTION: Filename to input for element-based properties \n Default: default_element_properties.dat \ingroup Config */ addStringOption("FEA_FILENAME", FEA_FileName, string("default_element_properties.dat")); /* DESCRIPTION: Determine if advanced features are used from the element-based FEA analysis (NO, YES = experimental) */ addBoolOption("FEA_ADVANCED_MODE", FEAAdvancedMode, false); @@ -2385,7 +2385,7 @@ nijso /*!\brief DESIGN_VARIABLE_FEA * \n DESCRIPTION: Design variable for FEA problems \n OPTIONS: See \link DVFEA_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ addEnumOption("DESIGN_VARIABLE_FEA", Kind_DV_FEA, DVFEA_Map, NODV_FEA); - +// nijso /* DESCRIPTION: Consider a reference solution for the structure (optimization applications) * Options: NO, YES \ingroup Config */ addBoolOption("REFERENCE_GEOMETRY", RefGeom, false); @@ -2398,9 +2398,6 @@ nijso /*!\brief REFERENCE_GEOMETRY_SURFACE\n DESCRIPTION: If true consider only the surfaces where loads are applied. \ingroup Config*/ addBoolOption("REFERENCE_GEOMETRY_SURFACE", RefGeomSurf, false); - /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup Config*/ - addDoubleOption("TOTAL_DV_PENALTY", DV_Penalty, 0); - /*!\brief REFERENCE_NODE\n DESCRIPTION: Reference node for the structure (optimization applications) */ addUnsignedLongOption("REFERENCE_NODE", refNodeID, 0); /*!\brief REFERENCE_NODE_DISPLACEMENT\n DESCRIPTION: Target displacement of the reference node \ingroup Config*/ @@ -2408,6 +2405,9 @@ nijso /*!\brief REFERENCE_NODE_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_NODE_PENALTY", RefNode_Penalty, 1E3); + /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup Config*/ + addDoubleOption("TOTAL_DV_PENALTY", DV_Penalty, 0); + /*!\brief STRESS_PENALTY_PARAM\n DESCRIPTION: Maximum allowed stress and KS exponent for structural optimization \ingroup Config*/ addDoubleArrayOption("STRESS_PENALTY_PARAM", 2, StressPenaltyParam.data()); diff --git a/config_template.cfg b/config_template.cfg index cc68faa89ec..8c4072f8343 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -743,6 +743,10 @@ HB_PERIOD= -1 % % Turn on/off harmonic balance preconditioning HB_PRECONDITION= NO +% +% Omega_HB = 2*PI*frequency - frequencies for Harmonic Balance method +OMEGA_HB= (0,1.0,-1.0) + % ------------------- RADIATIVE HEAT TRANSFER SIMULATION ----------------------% % % Type of radiation model (NONE, P1) @@ -1363,6 +1367,11 @@ MG_DAMP_RESTRICTION= 0.75 % % Damping factor for the correction prolongation MG_DAMP_PROLONGATION= 0.75 +% +% -------------------------- MESH SMOOTHING -----------------------------% +% +% Before each computation, implicitly smooth the nodal coordinates +SMOOTH_GEOMETRY= 0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % @@ -1473,6 +1482,41 @@ KIND_FEM_DG_SHOCK= NONE % % Time discretization TIME_DISCRE_FEA= NEWMARK_IMPLICIT +% +% ------------------- FEA SOLVER FOR FLUID-STRUCTURE INTERACTION --------------------% +% +% Filename to input for element-based properties +FEA_FILENAME= default_element_properties.dat +% +% Determine if advanced features are used from the element-based FEA analysis (NO, YES = experimental) +FEA_ADVANCED_MODE= NO +% +% Modulus of elasticity +ELASTICITY_MODULUS= 1000.0 +% +% Poisson ratio +POISSON_RATIO= 0.35 +% +% Knowles B constant +KNOWLES_B= 1.0 +% +% Knowles N constant +KNOWLES_N= 1.0 + +% -------------------- Dielectric effects ------------------% +% +% Include DE effects +DE_EFFECTS= NO +% +% Value of the Dielectric Elastomer constant +ELECTRIC_FIELD_CONST= 4.25e-11 +% +% Modulus of the Electric Fields +ELECTRIC_FIELD_MOD= 20e5 +% +% Direction of the Electic Fields +ELECTRIC_FIELD_DIR= (0.0, 1.0) + % -------------------- Weakly Coupled Heat ------------------% % WEAKLY_COUPLED_HEAT_EQUATION= NO @@ -1541,6 +1585,13 @@ LIMIT_ADJFLOW= 1E6 % % Use multigrid in the adjoint problem (NO, YES) MG_ADJFLOW= YES +% ---------------- MULTIZONE DEFINITION --------------% +% +% Determine if the mesh file supports multizone. \n DEFAULT: true (temporarily) +MULTIZONE_MESH= YES +% +% Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: true (temporarily) +MULTIZONE_RESIDUAL= NO % ---------------- ADJOINT-TURBULENT NUMERICAL METHOD DEFINITION --------------% % @@ -1665,6 +1716,16 @@ DV_SENS_FILENAME= surface_sensitivity.dat % rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each grid point. DV_SENSITIVITY_FORMAT= SU2_NATIVE DV_UNORDERED_SENS_FILENAME= unordered_sensitivity.dat +% +% Hold the grid fixed in a region +HOLD_GRID_FIXED= NO +% +% Coordinates of the box where the grid will be deformed (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax) +HOLD_GRID_FIXED_COORDS= (-1e15, -1e15, -1e15, 1e15, 1e15, 1e15) +% +% Design variable for FEA problems +% options: NONE, YOUNG_MODULUS, POISSON_RATIO, DENSITY, DEAD_WEIGHT, ELECTRIC_FIELD +DESIGN_VARIABLE_FEA= NONE % ---------------- MESH DEFORMATION PARAMETERS (NEW SOLVER) -------------------% % @@ -1706,6 +1767,15 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % Deform the grid only close to the surface. It is possible to specify how much % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) DEFORM_LIMIT = 1E6 +% +% Young modulus for constant stiffness FEA method of grid deformation +DEFORM_ELASTICITY_MODULUS= 2e11 +% +% Poisson ratio for constant stiffness FEA method of grid deformation +DEFORM_POISSON_RATIO= 0.3 +% +% Size of the layer of highest stiffness for wall distance-based mesh stiffness +DEFORM_STIFF_LAYER_SIZE= 0.0 % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % @@ -1891,6 +1961,10 @@ OUTPUT_WRT_FREQ= 10, 250, 42 % Output the performance summary to the console at the end of SU2_CFD WRT_PERFORMANCE= NO % +% Output the tape statistics (discrete adjoint) +WRT_AD_STATISTICS= NO +% +% % Overwrite or append iteration number to the restart files when saving WRT_RESTART_OVERWRITE= YES % @@ -1900,6 +1974,9 @@ WRT_SURFACE_OVERWRITE= YES % Overwrite or append iteration number to the volume files when saving WRT_VOLUME_OVERWRITE= YES % +% MPI communication level (NONE, MINIMAL, FULL) +COMM_LEVEL= FULL + % ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------% % % Mesh input file @@ -1908,6 +1985,15 @@ MESH_FILENAME= mesh_NACA0012_inv.su2 % Mesh input file format (SU2, CGNS) MESH_FORMAT= SU2 % +% List of the number of grid points in the RECTANGLE or BOX grid in the x,y,z directions. (default: (33,33,33) ). +MESH_BOX_SIZE= (33, 33, 33) +% +% List of the length of the RECTANGLE or BOX grid in the x,y,z directions. (default: (1.0,1.0,1.0) ). +MESH_BOX_LENGTH= (1.0, 1.0, 1.0) +% +% List of the offset from 0.0 of the RECTANGLE or BOX grid in the x,y,z directions. (default: (0.0,0.0,0.0) ). +MESH_BOX_OFFSET= (0.0, 0.0, 0.0) +% % Mesh output file MESH_OUT_FILENAME= mesh_out.su2 % @@ -1920,6 +2006,9 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Output tabular file format (TECPLOT, CSV) TABULAR_FORMAT= CSV % +% Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. +OUTPUT_PRECISION= 10 +% % Files to output % Possible formats : (TECPLOT_ASCII, TECPLOT, SURFACE_TECPLOT_ASCII, % SURFACE_TECPLOT, CSV, SURFACE_CSV, PARAVIEW_ASCII, PARAVIEW_LEGACY, SURFACE_PARAVIEW_ASCII, @@ -1957,6 +2046,12 @@ SURFACE_FILENAME= surface_flow % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint % +% Output file surface sensitivity (discrete adjoint) (w/o extension) +SURFACE_SENS_FILENAME= surface_sens +% +% Output file volume sensitivity (discrete adjoint)) +VOLUME_SENS_FILENAME= volume_sens +% % Read binary restart files (YES, NO) READ_BINARY_RESTART= YES % From d606ef32bfac234a8f60d26bdf54c89a7d0b39b3 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Wed, 8 Mar 2023 23:57:20 +0100 Subject: [PATCH 006/139] update config_template --- Common/include/option_structure.inl | 2 +- Common/src/CConfig.cpp | 11 +- config_template.cfg | 289 +++++++++++++++++++++++++++- 3 files changed, 285 insertions(+), 17 deletions(-) diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index 758033da153..9b5934033f2 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -646,7 +646,7 @@ public: default : { string newstring; newstring.append(this->name); - newstring.append(": undefined design variable type found in configuration file."); + newstring.append(": undefined design variable type found in configuration file. "); return newstring; } } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 74efdf63c5d..feee6e94c8a 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2385,7 +2385,6 @@ void CConfig::SetConfig_Options() { /*!\brief DESIGN_VARIABLE_FEA * \n DESCRIPTION: Design variable for FEA problems \n OPTIONS: See \link DVFEA_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ addEnumOption("DESIGN_VARIABLE_FEA", Kind_DV_FEA, DVFEA_Map, NODV_FEA); -// nijso /* DESCRIPTION: Consider a reference solution for the structure (optimization applications) * Options: NO, YES \ingroup Config */ addBoolOption("REFERENCE_GEOMETRY", RefGeom, false); @@ -2442,7 +2441,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("DYN_TIME", Total_DynTime, 1.0); /* DESCRIPTION: Parameter alpha for Newmark scheme (s) */ addDoubleOption("NEWMARK_BETA", Newmark_beta, 0.25); - /* DESCRIPTION: Parameter delta for Newmark scheme (s) */ + /* DESCRIPTION: Parameter gamma for Newmark scheme (s) */ addDoubleOption("NEWMARK_GAMMA", Newmark_gamma, 0.5); /* DESCRIPTION: Apply the load as a ramp */ addBoolOption("RAMP_LOADING", Ramp_Load, false); @@ -2522,7 +2521,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Determines if the convergence history of each individual zone is written to file */ addBoolOption("WRT_ZONE_HIST", Wrt_ZoneHist, false); - /* DESCRIPTION: Determines if the special output is written out */ + /* DESCRIPTION: Determines if the forces breakdown is written out */ addBoolOption("WRT_FORCES_BREAKDOWN", Wrt_ForcesBreakdown, false); @@ -2624,7 +2623,7 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Visualize Control Volumes \ingroup Config*/ /*--- options related to visualizing control volumes ---*/ - /* DESCRIPTION: Node number for the CV to be visualized */ + /* DESCRIPTION: Node number for the CV to be visualized (tecplot) (nijso: delete?) */ addLongOption("VISUALIZE_CV", Visualize_CV, -1); /*!\par CONFIG_CATEGORY: Inverse design problem \ingroup Config*/ @@ -2639,10 +2638,10 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Unsupported options \ingroup Config*/ /*--- Options that are experimental and not intended for general use ---*/ - /* DESCRIPTION: Write extra output */ + /* DESCRIPTION: Write extra output (EXPERIMENTAL, NOT FOR GENERAL USE) */ addBoolOption("EXTRA_OUTPUT", ExtraOutput, false); - /* DESCRIPTION: Write extra heat output for a given zone heat solver zone */ + /* DESCRIPTION: Write extra heat output for a given heat solver zone */ addLongOption("EXTRA_HEAT_ZONE_OUTPUT", ExtraHeatOutputZone, -1); /*--- options related to the FFD problem ---*/ diff --git a/config_template.cfg b/config_template.cfg index d61da71e13a..add187190a4 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -429,6 +429,19 @@ VT_RESIDUAL_LIMITING= NO INLET_TEMPERATURE_VE = 288.15 INLET_GAS_COMPOSITION = (0.77, 0.23, 0.0, 0.0, 0.0) % +% --------------------------- REFERENCE VALUES FOR DEFORMATION ----------------% +% +% Consider a reference solution for the structure +REFERENCE_GEOMETRY= NO +% +% Penalty weight value for the objective function +REFERENCE_GEOMETRY_PENALTY= 1E6 +% +% Reference geometry filename +REFERENCE_GEOMETRY_FILENAME= reference_geometry.dat +% +% Format of the reference geometry file +REFERENCE_GEOMETRY_FORMAT= % --------------------------- VISCOSITY MODEL ---------------------------------% % % Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY). @@ -746,6 +759,13 @@ HB_PRECONDITION= NO % % Omega_HB = 2*PI*frequency - frequencies for Harmonic Balance method OMEGA_HB= (0,1.0,-1.0) +% +% Determines if the single-zone driver is used. (TEMPORARY) +SINGLEZONE_DRIVER= NO +% +% Determines if the special output is written out +SPECIAL_OUTPUT= NO + % ------------------- RADIATIVE HEAT TRANSFER SIMULATION ----------------------% % @@ -774,7 +794,7 @@ HEAT_SOURCE_ROTATION_Z = 0.0 HEAT_SOURCE_CENTER = ( 0.0, 0.0, 0.0 ) % % Vector of heat source radii (Heat_Source_Radius_A, Heat_Source_Radius_B, Heat_Source_Radius_C) -HEAT_SOURCE_RADIUS = ( 1.0, 1.0, 1.0 ) +HEAT_SOURCE_AXES = ( 1.0, 1.0, 1.0 ) % % Wall emissivity of the marker for radiation purposes MARKER_EMISSIVITY = ( MARKER_NAME, 1.0 ) @@ -1058,6 +1078,30 @@ MARKER_FLUID_LOAD= ( NONE ) % ISOPARAMETRIC, SLIDING_MESH) KIND_INTERPOLATION= NEAREST_NEIGHBOR % +% Use conservative approach for interpolating between meshes +CONSERVATIVE_INTERPOLATION= YES +% +% Type of radial basis function to use for radial basis function interpolation +KIND_RADIAL_BASIS_FUNCTION = WENDLAND_C2 +% +% Radius for radial basis function. +RADIAL_BASIS_FUNCTION_PARAMETER = 0.015 +% +% Use polynomial term in radial basis function interpolation. +RADIAL_BASIS_FUNCTION_POLYNOMIAL_TERM = YES +% +% Tolerance to prune small coefficients from the RBF interpolation matrix. +RADIAL_BASIS_FUNCTION_PRUNE_TOLERANCE = 0 +% +% Type of spanwise interpolation to use for the inlet face. +INLET_INTERPOLATION_FUNCTION= NONE +% +% +INLET_INTERPOLATION_DATA_TYPE= VRVTHETA +% +% +PRINT_INLET_INTERPOLATED_DATA= NO +% % Inflow and Outflow markers must be specified, for each blade (zone), following % the natural groth of the machine (i.e, from the first blade to the last) MARKER_TURBOMACHINERY= ( NONE ) @@ -1126,6 +1170,33 @@ SINE_LOAD_COEFF= (0.0, 0.0, 0.0) % RAMP_AND_RELEASE_LOAD= NO % +% Apply the load as a ramp +RAMP_LOADING= NO +% +% Time while the load is to be increased linearly +RAMP_TIME= 1.0 +% +% Number of FSI iterations during which a ramp is applied +RAMP_FSI_ITER= 2 +% +% Aitken static relaxation factor +STAT_RELAX_PARAMETER= 0.4 +% +% Aitken dynamic maximum relaxation factor for the first iteration +AITKEN_DYN_MAX_INITIAL= 0.5 +% +% Aitken dynamic minimum relaxation factor for the first iteration +AITKEN_DYN_MIN_INITIAL= 0.5 +% +% Kind of relaxation +BGS_RELAXATION= NONE +% +% Relaxation required +RELAXATION= NO +% +% Transfer method used for multiphysics problems +DYNAMIC_LOAD_TRANSFER= RAMP + % Load boundary marker(s) % Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), % i.e. primitive variables specified. @@ -1153,12 +1224,13 @@ WALLMODEL_MAXITER= 200 % [Expert] relaxation factor for the Newton iterations of the standard wall function WALLMODEL_RELFAC= 0.5 -% ------------------------ CONJUGATE HEAT TRANSFER --------------------------% +% ------------------------ CONJUGATE HEAT TRANSFER (CHT) --------------------------% % % Relaxation of the CHT coupling RELAXATION_FACTOR_CHT= 1.0 % -% +% CHT interface coupling methods +CHT_COUPLING_METHOD= DIRECT_TEMPERATURE_ROBIN_HEATFLUX % ------------------------ SURFACES IDENTIFICATION ----------------------------% % @@ -1432,6 +1504,7 @@ NEWTON_KRYLOV_IPARAM= (10, 3, 2) % % Double parameters {startup residual drop, precond tolerance, full tolerance residual drop, findiff step}. NEWTON_KRYLOV_DPARAM= (1.0, 0.1, -6.0, 1e-5) + % ------------------- FEM FLOW NUMERICAL METHOD DEFINITION --------------------% % % FEM numerical method (DG) @@ -1483,6 +1556,60 @@ KIND_FEM_DG_SHOCK= NONE % Time discretization TIME_DISCRE_FEA= NEWMARK_IMPLICIT % +% Parameter alpha for Newmark scheme (s) +NEWMARK_BETA= 0.25 +% +% Parameter gamma for Newmark scheme (s) +NEWMARK_GAMMA= 0.50 +% +% Newmark - Generalized alpha - coefficients +TIME_INT_STRUCT_COEFFS= 0.0 +% +% Apply dead loads +INCREMENTAL_LOAD= NO +% +% Maximum number of increments of the +NUMBER_INCREMENTS= 10 +% +% Definition of the UTOL RTOL ETOL +INCREMENTAL_CRITERIA= (0.0, 0.0, 0.0) +% +% Use of predictor +PREDICTOR= NO +% +% Order of the predictor +PREDICTOR_ORDER= 0 + +% ------------------- TOPOLOGY OPTIMIZATION --------------------% +TOPOLOGY_OPTIMIZATION= NO +% +% +TOPOL_OPTIM_OUTFILE= element_derivatives.dat +% +% +TOPOL_OPTIM_SIMP_EXPONENT= 1.0 +% +% +TOPOL_OPTIM_SIMP_MINSTIFF= 0.001 +% +% +TOPOL_OPTIM_FILTER_KERNEL= (DILATE, ERODE) +% +% +TOPOL_OPTIM_FILTER_RADIUS= 0.0 +% +% +TOPOL_OPTIM_KERNEL_PARAM= 0.01 +% +% +TOPOL_OPTIM_SEARCH_LIMIT= 0 +% +% +TOPOL_OPTIM_PROJECTION_TYPE= NO_PROJECTION +% +% +TOPOL_OPTIM_PROJECTION_PARAM= 0.0 + % ------------------- FEA SOLVER FOR FLUID-STRUCTURE INTERACTION --------------------% % % Filename to input for element-based properties @@ -1502,6 +1629,12 @@ KNOWLES_B= 1.0 % % Knowles N constant KNOWLES_N= 1.0 +% +% ID of the region we want to compute the sensitivities using direct differentiation +FEA_ID_DIRECTDIFF= 0 +% +% +RESTART_STEADY_STATE= NO % -------------------- Dielectric effects ------------------% % @@ -1548,7 +1681,7 @@ SLOPE_LIMITER_HEAT = NONE % % Time discretization TIME_DISCRE_HEAT= EULER_IMPLICIT -% + % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % % Frozen the slope limiter in the discrete adjoint formulation (NO, YES) @@ -1585,6 +1718,7 @@ LIMIT_ADJFLOW= 1E6 % % Use multigrid in the adjoint problem (NO, YES) MG_ADJFLOW= YES + % ---------------- MULTIZONE DEFINITION --------------% % % Determine if the mesh file supports multizone. \n DEFAULT: true (temporarily) @@ -1592,6 +1726,12 @@ MULTIZONE_MESH= YES % % Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: true (temporarily) MULTIZONE_RESIDUAL= NO +% +% Determines if the convergence history of each individual zone is written to screen +WRT_ZONE_CONV= NO +% +% Determines if the convergence history of each individual zone is written to file +WRT_ZONE_HIST= NO % ---------------- ADJOINT-TURBULENT NUMERICAL METHOD DEFINITION --------------% % @@ -1604,7 +1744,6 @@ TIME_DISCRE_ADJTURB= EULER_IMPLICIT % Reduction factor of the CFL coefficient in the adjoint turbulent problem CFL_REDUCTION_ADJTURB= 0.01 - % -------------------- NEMO NUMERICAL METHOD DEFINITION -----------------------% % % Mixture transport properties (WILKE,GUPTA-YOS,CHAPMANN-ENSKOG, SUTHERLAND) @@ -1715,6 +1854,7 @@ DV_SENS_FILENAME= surface_sensitivity.dat % as an ASCII file with name given by DV_SENS_FILENAMEand with format as % rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each grid point. DV_SENSITIVITY_FORMAT= SU2_NATIVE +% DV_UNORDERED_SENS_FILENAME= unordered_sensitivity.dat % % Hold the grid fixed in a region @@ -1726,6 +1866,61 @@ HOLD_GRID_FIXED_COORDS= (-1e15, -1e15, -1e15, 1e15, 1e15, 1e15) % Design variable for FEA problems % options: NONE, YOUNG_MODULUS, POISSON_RATIO, DENSITY, DEAD_WEIGHT, ELECTRIC_FIELD DESIGN_VARIABLE_FEA= NONE +% +% Penalty weight value to maintain the total sum of DV constant +TOTAL_DV_PENALTY= 0.0 +% +% Parameters for the corresponding OF (allowed stress and KS multiplier). +STRESS_PENALTY_PARAM= (1.0, 10.0) +% +% Geometric conditions +GEOMETRIC_CONDITIONS= SMALL_DEFORMATIONS +% +% Material model +MATERIAL_MODEL= LINEAR_ELASTIC +% +% Compressibility of the material +MATERIAL_COMPRESSIBILITY= COMPRESSIBLE +% + +% ---------------- AUTOMATIC DIFFERENTIATION -------------------% +% +% Direct differentiation mode (forward) +DIRECT_DIFF= NONE +% +% Automatic differentiation mode (reverse) +AUTO_DIFF= NO +% +% Preaccumulation in the AD mode. +PREACC= YES + +% ---------------- PRESTRETCH FOR STRUCTURES -------------------% +% Consider a prestretch in the structural domain +PRESTRETCH= NO +% +% Filename to input for prestretching membranes +PRESTRETCH_FILENAME= prestretch_file.dat +% +% Iterative method for non-linear structural analysis +NONLINEAR_FEM_SOLUTION_METHOD= NEWTON_RAPHSON +% +% Formulation for bidimensional elasticity solver +FORMULATION_ELASTICITY_2D= PLANE_STRAIN +% +% Apply dead loads +DEAD_LOAD= NO +% +% pseudo static analysis (no density in dynamic analysis) +PSEUDO_STATIC= NO +% +% Dynamic or static structural analysis +DYNAMIC_ANALYSIS= NO +% +% Time Step for dynamic analysis (s) +DYN_TIMESTEP= 0.0 +% +% Total Physical Time for dual time stepping simulations (s) +DYN_TIME= 1.0 % ---------------- MESH DEFORMATION PARAMETERS (NEW SOLVER) -------------------% % @@ -1777,6 +1972,32 @@ DEFORM_POISSON_RATIO= 0.3 % Size of the layer of highest stiffness for wall distance-based mesh stiffness DEFORM_STIFF_LAYER_SIZE= 0.0 +% -------------------- REFERENCE GEOMETRY -----------------------% +% +% Consider a reference solution for the structure (optimization applications) +REFERENCE_GEOMETRY= NO +% +% Penalty weight value for the objective function +REFERENCE_GEOMETRY_PENALTY= 1.0E6 +% +% Reference geometry filename +REFERENCE_GEOMETRY_FILENAME= reference_geometry.dat +% +% Format of the reference geometry file +REFERENCE_GEOMETRY_FORMAT= SU2_REF +% +% If true consider only the surfaces where loads are applied. +REFERENCE_GEOMETRY_SURFACE= NO +% +% Reference node for the structure (optimization applications) +REFERENCE_NODE= 0 +% +% Target displacement of the reference node +REFERENCE_NODE_DISPLACEMENT= (0.0, 0.0) +% +% Penalty weight value for the objective function +REFERENCE_NODE_PENALTY= 1.0E3 + % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % % Tolerance of the Free-Form Deformation point inversion @@ -1784,17 +2005,17 @@ FFD_TOLERANCE= 1E-10 % % Maximum number of iterations in the Free-Form Deformation point inversion FFD_ITERATIONS= 500 - +% % Parameters for prevention of self-intersections within FFD box FFD_INTPREV = YES FFD_INTPREV_ITER = 10 FFD_INTPREV_DEPTH = 3 - +% % Parameters for prevention of nonconvex elements in mesh after deformation CONVEXITY_CHECK = YES CONVEXITY_CHECK_ITER = 10 CONVEXITY_CHECK_DEPTH = 3 - +% % % FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, % X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) @@ -1974,8 +2195,20 @@ WRT_SURFACE_OVERWRITE= YES % Overwrite or append iteration number to the volume files when saving WRT_VOLUME_OVERWRITE= YES % +% Determines if the forces breakdown is written out +WRT_FORCES_BREAKDOWN= NO +% % MPI communication level (NONE, MINIMAL, FULL) COMM_LEVEL= FULL +% +% Node number for the CV to be visualized (tecplot) (delete?) +VISUALIZE_CV= -1 +% +% Write extra output (EXPERIMENTAL, NOT FOR GENERAL USE) +EXTRA_OUTPUT= NO +% +% Write extra heat output for a given heat solver zone +EXTRA_HEAT_ZONE_OUTPUT= -1 % ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------% % @@ -2103,14 +2336,14 @@ REORIENT_ELEMENTS= YES % Definition of multipoint design problems, this option should be combined with the % the prefix MULTIPOINT in the objective function or constraint (e.g. MULTIPOINT_DRAG, MULTIPOINT_LIFT, etc.) MULTIPOINT_MACH_NUMBER= (0.79, 0.8, 0.81) +MULTIPOINT_WEIGHT= (0.33333, 0.33333, 0.33333) MULTIPOINT_AOA= (1.25, 1.25, 1.25) MULTIPOINT_SIDESLIP_ANGLE= (0.0, 0.0, 0.0) MULTIPOINT_TARGET_CL= (0.8, 0.8, 0.8) MULTIPOINT_REYNOLDS_NUMBER= (1E6, 1E6, 1E6) -MULTIPOINT_FREESTREAM_PRESSURE= (101325.0, 101325.0, 101325.0) MULTIPOINT_FREESTREAM_TEMPERATURE= (288.15, 288.15, 288.15) +MULTIPOINT_FREESTREAM_PRESSURE= (101325.0, 101325.0, 101325.0) MULTIPOINT_OUTLET_VALUE= (0.0, 0.0, 0.0) -MULTIPOINT_WEIGHT= (0.33333, 0.33333, 0.33333) MULTIPOINT_MESH_FILENAME= (mesh_NACA0012_m79.su2, mesh_NACA0012_m8.su2, mesh_NACA0012_m81.su2) % % Optimization objective function with scaling factor, separated by semicolons. @@ -2176,3 +2409,39 @@ MAX_BASIS_DIM = 100 % % Frequency of snapshots saves, for unsteady problems (default: 1. 2 means every other) ROM_SAVE_FREQ = 1 + +% --------------------- PASTIX PARAMETERS -----------------------% +% +% Number of calls to 'Build' that trigger re-factorization (0 means only once) +PASTIX_FACTORIZATION_FREQUENCY= 1 +% +% 0 - Quiet, 1 - During factorization and cleanup, 2 - Even more detail +PASTIX_VERBOSITY_LEVEL= 0 +% +% Level of fill for PaStiX incomplete LU factorization +PASTIX_FILL_LEVEL= 1 + +% --------------------- PYTHON PARAMETERS -----------------------% +% DESCRIPTION: Gradient method +%GRADIENT_METHOD +% +% DESCRIPTION: Geometrical Parameter +%GEO_PARAM +% +% DESCRIPTION: Current value of the design variables +%DV_VALUE_NEW +% +% DESCRIPTION: Previous value of the design variables +%DV_VALUE_OLD +% +% DESCRIPTION: Number of partitions of the mesh +NUMBER_PART= 1 +% +% DESCRIPTION: Verbosity of the python scripts to Stdout +%CONSOLE +% +% DESCRIPTION: Flag specifying if the mesh was decomposed +%DECOMPOSED +% +% DESCRIPTION: Number of zones of the problem +%NZONES= 1 \ No newline at end of file From 4415e321ed591d0638913cfcf322a57acbf16fc5 Mon Sep 17 00:00:00 2001 From: Nijso Date: Mon, 10 Apr 2023 21:49:35 +0200 Subject: [PATCH 007/139] Update config_template.cfg Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- config_template.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_template.cfg b/config_template.cfg index 0f6a2ce27e0..3e4edaba453 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1074,8 +1074,8 @@ MARKER_FLUID_INTERFACE= ( NONE ) % Marker(s) in which the flow load is computed/applied MARKER_FLUID_LOAD= ( NONE ) % -% Kind of interface interpolation among different zones (NEAREST_NEIGHBOR, -% ISOPARAMETRIC, SLIDING_MESH) +% Kind of interface interpolation among different zones (NEAREST_NEIGHBOR, WEIGHTED_AVERAGE, +% ISOPARAMETRIC, RADIAL_BASIS_FUNCTION) KIND_INTERPOLATION= NEAREST_NEIGHBOR % % Use conservative approach for interpolating between meshes From fb7a2661662d7ab6ff91a1cc5d97bd39cf90dfb1 Mon Sep 17 00:00:00 2001 From: Nijso Date: Mon, 10 Apr 2023 21:50:31 +0200 Subject: [PATCH 008/139] Update config_template.cfg Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- config_template.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_template.cfg b/config_template.cfg index 3e4edaba453..3b43d7967b1 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -2216,7 +2216,7 @@ EXTRA_HEAT_ZONE_OUTPUT= -1 % Mesh input file MESH_FILENAME= mesh_NACA0012_inv.su2 % -% Mesh input file format (SU2, CGNS) +% Mesh input file format (SU2, CGNS, RECTANGLE, BOX) MESH_FORMAT= SU2 % % List of the number of grid points in the RECTANGLE or BOX grid in the x,y,z directions. (default: (33,33,33) ). From 3736e7c0a4d142d4e9b28ccc46282bc50f2934ff Mon Sep 17 00:00:00 2001 From: bigfooted Date: Sun, 7 May 2023 22:23:08 +0200 Subject: [PATCH 009/139] remove grid adaptation options --- config_template.cfg | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/config_template.cfg b/config_template.cfg index 3b43d7967b1..4290764b45b 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1779,23 +1779,6 @@ GEO_NUMBER_STATIONS= 25 % Geometrical evaluation mode (FUNCTION, GRADIENT) GEO_MODE= FUNCTION -% ------------------------- GRID ADAPTATION STRATEGY --------------------------% -% -% Kind of grid adaptation (NONE, PERIODIC, FULL, FULL_FLOW, GRAD_FLOW, -% FULL_ADJOINT, GRAD_ADJOINT, GRAD_FLOW_ADJ, ROBUST, -% FULL_LINEAR, COMPUTABLE, COMPUTABLE_ROBUST, -% REMAINING, WAKE, SMOOTHING, SUPERSONIC_SHOCK) -KIND_ADAPT= FULL_FLOW -% -% Percentage of new elements (% of the original number of elements) -NEW_ELEMS= 5 -% -% Scale factor for the dual volume -DUALVOL_POWER= 0.5 -% -% Adapt the boundary elements (NO, YES) -ADAPT_BOUNDARY= YES - % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % % Kind of deformation (NO_DEFORMATION, SCALE_GRID, TRANSLATE_GRID, ROTATE_GRID, @@ -2445,4 +2428,4 @@ NUMBER_PART= 1 %DECOMPOSED % % DESCRIPTION: Number of zones of the problem -%NZONES= 1 \ No newline at end of file +%NZONES= 1 From 3f4b04d09058cd873de0ccf1a80433bf4123228a Mon Sep 17 00:00:00 2001 From: bigfooted Date: Sun, 7 May 2023 23:28:52 +0200 Subject: [PATCH 010/139] remove some commented code --- Common/include/CConfig.hpp | 7 ------ Common/src/CConfig.cpp | 22 ------------------- .../drivers/CDiscAdjDeformationDriver.hpp | 2 +- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index fe9374d5ac5..2b0d855caf2 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -96,7 +96,6 @@ class CConfig { *TemperatureLimits; /*!< \brief Limits for the primitive variables */ bool ActDisk_DoubleSurface; /*!< \brief actuator disk double surface */ bool Engine_HalfModel; /*!< \brief only half model is in the computational grid */ - //bool ActDisk_SU2_DEF; /*!< \brief actuator disk double surface */ unsigned short nFFD_Iter; /*!< \brief Iteration for the point inversion problem. */ unsigned short FFD_Blending; /*!< \brief Kind of FFD Blending function. */ su2double FFD_Tol; /*!< \brief Tolerance in the point inversion problem. */ @@ -212,8 +211,6 @@ class CConfig { nMarker_Damper, /*!< \brief Number of damper surface markers. */ nMarker_Load_Dir, /*!< \brief Number of load surface markers defined by magnitude and direction. */ nMarker_Disp_Dir, /*!< \brief Number of load surface markers defined by magnitude and direction. */ - //nMarker_Load_Sine, /*!< \brief Number of load surface markers defined by magnitude and direction. */ - //nMarker_FlowLoad, /*!< \brief Number of load surface markers. */ nMarker_Internal, /*!< \brief Number of internal flow markers. */ nMarker_All, /*!< \brief Total number of markers using the grid information. */ nMarker_Max, /*!< \brief Max number of number of markers using the grid information. */ @@ -324,10 +321,6 @@ class CConfig { su2double *Disp_Dir_Multiplier; /*!< \brief Specified multiplier for load boundaries defined in cartesian coordinates. */ su2double **Load_Dir; /*!< \brief Specified flow direction vector (unit vector) for inlet boundaries. */ su2double **Disp_Dir; /*!< \brief Specified structural displacement direction (unit vector). */ - //su2double *Load_Sine_Amplitude; /*!< \brief Specified amplitude for a sine-wave load. */ - //su2double *Load_Sine_Frequency; /*!< \brief Specified multiplier for load boundaries defined in cartesian coordinates. */ - //su2double **Load_Sine_Dir; /*!< \brief Specified flow direction vector (unit vector) for inlet boundaries. */ - //su2double *FlowLoad_Value; /*!< \brief Specified force for flow load boundaries. */ su2double *ActDiskInlet_MassFlow; /*!< \brief Specified inlet mass flow for actuator disk. */ su2double *ActDiskInlet_Temperature; /*!< \brief Specified inlet temperature for actuator disk. */ su2double *ActDiskInlet_TotalTemperature; /*!< \brief Specified inlet total temperature for actuator disk. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 9160a227862..e74de8c4ea6 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -904,7 +904,6 @@ void CConfig::SetPointersNull() { Load_Dir = nullptr; Load_Dir_Value = nullptr; Load_Dir_Multiplier = nullptr; Disp_Dir = nullptr; Disp_Dir_Value = nullptr; Disp_Dir_Multiplier = nullptr; - //Load_Sine_Dir = nullptr; Load_Sine_Amplitude = nullptr; Load_Sine_Frequency = nullptr; Electric_Field_Mod = nullptr; Electric_Field_Dir = nullptr; RefNode_Displacement = nullptr; Electric_Constant = nullptr; @@ -5757,23 +5756,11 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - // for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) { - // Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Load_Sine[iMarker_Load_Sine]; - // Marker_CfgFile_KindBC[iMarker_CfgFile] = LOAD_SINE_BOUNDARY; - // iMarker_CfgFile++; - // } - for (iMarker_Fluid_Load = 0; iMarker_Fluid_Load < nMarker_Fluid_Load; iMarker_Fluid_Load++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Fluid_Load[iMarker_Fluid_Load]; iMarker_CfgFile++; } - // for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) { - // Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_FlowLoad[iMarker_FlowLoad]; - // Marker_CfgFile_KindBC[iMarker_CfgFile] = FLOWLOAD_BOUNDARY; - // iMarker_CfgFile++; - // } - for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_Monitoring[iMarker_CfgFile] = NO; for (iMarker_Monitoring = 0; iMarker_Monitoring < nMarker_Monitoring; iMarker_Monitoring++) @@ -7431,15 +7418,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { BoundaryTable.PrintFooter(); } - // if (nMarker_Load_Sine != 0) { - // BoundaryTable << "Sine-Wave boundary"; - // for (iMarker_Load_Sine = 0; iMarker_Load_Sine < nMarker_Load_Sine; iMarker_Load_Sine++) { - // BoundaryTable << Marker_Load_Sine[iMarker_Load_Sine]; - // if (iMarker_Load_Sine < nMarker_Load_Sine-1) BoundaryTable << " "; - // } - // BoundaryTable.PrintFooter(); - // } - if (nMarker_Emissivity != 0) { BoundaryTable << "Radiative boundary"; for (iMarker_Emissivity = 0; iMarker_Emissivity < nMarker_Emissivity; iMarker_Emissivity++) { diff --git a/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp b/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp index 93bf81a55c5..5284fa26220 100644 --- a/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp +++ b/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp @@ -1,5 +1,5 @@ /*! - * \file CDiscAdjDeformationDriver.cpp + * \file CDiscAdjDeformationDriver.hpp * \brief Headers of the main subroutines for driving the projection of sensitivities. * \author T. Economon, H. Kline, R. Sanchez, A. Gastaldi, H. Patel * \version 7.5.1 "Blackbird" From 5a7871001fa3cfa4c2614c5cbafc695fde22a3ed Mon Sep 17 00:00:00 2001 From: Nijso Date: Mon, 8 May 2023 08:35:27 +0200 Subject: [PATCH 011/139] Update config_template.cfg Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- config_template.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/config_template.cfg b/config_template.cfg index 33c27db6162..282da7f6161 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1202,6 +1202,7 @@ DYNAMIC_LOAD_TRANSFER= RAMP % Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), % i.e. primitive variables specified. MARKER_DISPLACEMENT= ( NONE ) + % ------------------------ WALL ROUGHNESS DEFINITION --------------------------% % The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m. % This is a list of (string, double) each element corresponding to the MARKER defined in WALL_TYPE. From 71f20939ced6a53350ca2701c449729abba9b2b8 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Mon, 8 May 2023 09:00:35 +0200 Subject: [PATCH 012/139] add tick again --- Common/src/CConfig.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index e74de8c4ea6..7dc34b47442 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -9454,6 +9454,14 @@ short CConfig::FindInterfaceMarker(unsigned short iInterface) const { return -1; } +void CConfig::Tick(double *val_start_time) { + +#ifdef PROFILE + *val_start_time = SU2_MPI::Wtime(); +#endif + +} + void CConfig::Tock(double val_start_time, const string& val_function_name, int val_group_id) { #ifdef PROFILE From 45a1737fc6f8835645831fac7bd7b336e4c93c12 Mon Sep 17 00:00:00 2001 From: Nijso Date: Tue, 16 May 2023 22:03:50 +0200 Subject: [PATCH 013/139] Update config_template.cfg Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- config_template.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config_template.cfg b/config_template.cfg index 282da7f6161..79e478c02e6 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1090,7 +1090,8 @@ KIND_INTERPOLATION= NEAREST_NEIGHBOR % Use conservative approach for interpolating between meshes CONSERVATIVE_INTERPOLATION= YES % -% Type of radial basis function to use for radial basis function interpolation +% Type of radial basis function to use for radial basis function interpolation +% (WENDLAND_C2, INV_MULTI_QUADRIC, GAUSSIAN, THIN_PLATE_SPLINE, MULTI_QUADRIC). KIND_RADIAL_BASIS_FUNCTION = WENDLAND_C2 % % Radius for radial basis function. From 7d43d9bff090796572e8a83d40ec4781e180501b Mon Sep 17 00:00:00 2001 From: Nijso Date: Tue, 16 May 2023 22:04:20 +0200 Subject: [PATCH 014/139] Update config_template.cfg Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- config_template.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_template.cfg b/config_template.cfg index 79e478c02e6..e1bc257f3a2 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1146,7 +1146,7 @@ CATALYTIC_EFFICIENCY= 0.2 % SST Model: (inlet_marker1, TurbIntensity1, RatioTurbLamViscosity1, inlet_marker2, TurbIntensity2, RatioTurbLamViscosity2, ...) MARKER_INLET_TURBULENT= (inlet1, 0.05, 15, inlet2, 0.02, ...) % -% Custom boundary marker(s) +% Custom boundary marker(s) (this has to be implemented by users in the code). MARKER_CUSTOM= ( NONE ) % % Smoluchowski/Maxwell slip wall boundary marker(s) From 5dbc7afd292f6f7cc3ab983f2ab93ddc8dd95d5d Mon Sep 17 00:00:00 2001 From: Nijso Date: Tue, 16 May 2023 22:04:46 +0200 Subject: [PATCH 015/139] Update config_template.cfg Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- config_template.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config_template.cfg b/config_template.cfg index e1bc257f3a2..ec98fc08d87 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -2391,8 +2391,10 @@ DEFINITION_DV= ( 1, 1.0 | airfoil | 0, 0.05 ); ( 1, 1.0 | airfoil | 0, 0.10 ); ( OPT_COMBINE_OBJECTIVE = NO % % -% Number of iterations to average the objective +% Number of iterations to average the objective function for unsteady adjoints, +% 0 averages over all time iterations, "N" averages over the last N iterations. ITER_AVERAGE_OBJ= 0 + % --------------------- LIBROM PARAMETERS -----------------------% % LibROM can be found here: https://github.com/LLNL/libROM % From 3e8ba472217acbc25b99fad22da985ad59226d4e Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Tue, 11 Jul 2023 13:24:32 -0400 Subject: [PATCH 016/139] add basic support for rotation changes --- Common/include/CConfig.hpp | 7 +++++++ SU2_CFD/include/drivers/CDriver.hpp | 1 + SU2_CFD/src/iteration/CIteration.cpp | 13 ++++++++++++- SU2_CFD/src/python_wrapper_structure.cpp | 7 +++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 39ebcf28c01..83d574deb1c 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5946,6 +5946,13 @@ class CConfig { * \return Rotation velocity of the marker. */ su2double GetMarkerRotationRate(unsigned short iMarkerMoving, unsigned short iDim) const { return MarkerRotation_Rate[3*iMarkerMoving + iDim];} + /*! + * \brief Set the rotation rate of the marker. + * \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving) + * \param[in] iDim - spatial component + * \return Rotation velocity of the marker. + */ + void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerRotation_Rate[3*iMarkerMoving + iDim] = val;} /*! * \brief Get the pitching rate of the mesh. diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 236c932b630..e6bcd68eb9a 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -536,6 +536,7 @@ class CDriver : public CDriverBase { */ void SetRotationRate(passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); + void SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); /// \} }; diff --git a/SU2_CFD/src/iteration/CIteration.cpp b/SU2_CFD/src/iteration/CIteration.cpp index 517f3bff2c4..4b6de158796 100644 --- a/SU2_CFD/src/iteration/CIteration.cpp +++ b/SU2_CFD/src/iteration/CIteration.cpp @@ -88,11 +88,18 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac } break; + + } - if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION)) { + if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION) || config->GetSurface_Movement(MOVING_WALL)) { /*--- Apply rigid mesh transformation to entire grid first, if necessary ---*/ + if (IntIter == 0) { + cout << "TESTING:\n"; + + cout << config->GetSurface_Movement(MOVING_WALL); + cout << "\n"; if (Kind_Grid_Movement == AEROELASTIC_RIGID_MOTION) { if (rank == MASTER_NODE) cout << endl << " Performing rigid mesh transformation." << endl; @@ -110,6 +117,10 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac grid_movement->UpdateMultiGrid(geometry, config); } + if(config->GetSurface_Movement(MOVING_WALL)){ + geometry[MESH_0]->SetWallVelocity(config, true); + + } } diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index ffcc36d2f54..ffa2b051065 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -166,4 +166,11 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived config_container[iZone]->SetRotation_Rate(2, rot_z); } } +void CDriver::SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z){ + for (iZone = 0; iZone < nZone; iZone++) { + config_container[iZone]->SetMarkerRotation_Rate(iMarker, 0, rot_x); + config_container[iZone]->SetMarkerRotation_Rate(iMarker, 1, rot_y); + config_container[iZone]->SetMarkerRotation_Rate(iMarker, 2, rot_z); + } +} From 5fdc66439e42de5175da68f6948e706b4ad84094 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Fri, 28 Jul 2023 10:38:09 +0200 Subject: [PATCH 017/139] add translation --- Common/include/CConfig.hpp | 11 ++++++++++- SU2_CFD/include/drivers/CDriver.hpp | 17 ++++++++++++++++- SU2_CFD/src/iteration/CIteration.cpp | 5 +---- SU2_CFD/src/python_wrapper_structure.cpp | 7 +++++++ 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 83d574deb1c..9955a9b010a 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5924,6 +5924,14 @@ class CConfig { */ su2double GetMarkerTranslationRate(unsigned short iMarkerMoving, unsigned short iDim) const { return MarkerTranslation_Rate[3*iMarkerMoving + iDim];} + /*! + * \brief Set the translation rate of the marker. + * \param[in] iDim - spatial component + * \param[in] val - translational velocity + * \return Translational velocity of the mesh. + */ + void SetMarkerTranslation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerTranslation_Rate[3*iMarkerMoving + iDim] = val;} + /*! * \brief Get the rotation rate of the mesh. * \param[in] iDim - spatial component @@ -5950,7 +5958,8 @@ class CConfig { * \brief Set the rotation rate of the marker. * \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving) * \param[in] iDim - spatial component - * \return Rotation velocity of the marker. + * \param[in] val - Rotational velocity + */ void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerRotation_Rate[3*iMarkerMoving + iDim] = val;} diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index e6bcd68eb9a..928753dc019 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -535,8 +535,23 @@ class CDriver : public CDriverBase { * \param[in] rot_z - Value of Angular velocity about z-axes. */ void SetRotationRate(passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); - + /*! + * \brief Set the moving wall marker rotation rates. + * \param[in] iMaker - Index of moving wall marker. + * \param[in] rot_x - Value of Angular velocity about x-axes. + * \param[in] rot_y - Value of Angular velocity about y-axes. + * \param[in] rot_z - Value of Angular velocity about z-axes. + */ void SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); + /*! + * \brief Set the moving wall marker rotation rates. + * \param[in] iMaker - Index of moving wall marker. + * \param[in] vel_x - Value of velocity about x-axes. + * \param[in] vel_y - Value of velocity about y-axes. + * \param[in] vel_z - Value of velocity about z-axes. + */ + void SetMarkerTranslationRate(short int iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z); + /// \} }; diff --git a/SU2_CFD/src/iteration/CIteration.cpp b/SU2_CFD/src/iteration/CIteration.cpp index 4b6de158796..8224b45950a 100644 --- a/SU2_CFD/src/iteration/CIteration.cpp +++ b/SU2_CFD/src/iteration/CIteration.cpp @@ -96,10 +96,7 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac /*--- Apply rigid mesh transformation to entire grid first, if necessary ---*/ if (IntIter == 0) { - cout << "TESTING:\n"; - - cout << config->GetSurface_Movement(MOVING_WALL); - cout << "\n"; + if (Kind_Grid_Movement == AEROELASTIC_RIGID_MOTION) { if (rank == MASTER_NODE) cout << endl << " Performing rigid mesh transformation." << endl; diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index ffa2b051065..ee7ae45a3e7 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -173,4 +173,11 @@ void CDriver::SetMarkerRotationRate(short int iMarker, passivedouble rot_x, pass config_container[iZone]->SetMarkerRotation_Rate(iMarker, 2, rot_z); } } +void CDriver::SetMarkerTranslationRate(short int iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z){ + for (iZone = 0; iZone < nZone; iZone++) { + config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 0, vel_x); + config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 1, vel_y); + config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 2, vel_z); + } +} From ba0e7328ab9eaff30c61e4e0ba95e16ebca8a4f4 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Fri, 28 Jul 2023 14:10:33 +0200 Subject: [PATCH 018/139] add example --- TestCases/py_wrapper/rotating_cylinder/run.py | 30 +++++ .../rotating_cylinder/spinning_cylinder.cfg | 115 ++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 TestCases/py_wrapper/rotating_cylinder/run.py create mode 100644 TestCases/py_wrapper/rotating_cylinder/spinning_cylinder.cfg diff --git a/TestCases/py_wrapper/rotating_cylinder/run.py b/TestCases/py_wrapper/rotating_cylinder/run.py new file mode 100644 index 00000000000..64e36c2eddb --- /dev/null +++ b/TestCases/py_wrapper/rotating_cylinder/run.py @@ -0,0 +1,30 @@ +import sys +from optparse import OptionParser # use a parser for configuration +import pysu2 # imports the SU2 wrapped module +from math import * +import os +import pysu2ad +from mpi4py import MPI +import numpy as np +import shutil +comm = MPI.COMM_WORLD +rank = comm.Get_rank() +ad_com = MPI.COMM_WORLD +rank_ad = ad_com.Get_rank() +n_of_steps = 10 +rotation_vector = np.zeros(n_of_steps)+20 +rotation_vector[5:9] = -rotation_vector[5:9] + +SU2Driver = pysu2.CSinglezoneDriver("spinning_cylinder.cfg",1, comm) + +for i in range(n_of_steps): + + SU2Driver.SetMarkerRotationRate(0,0,0,rotation_vector[n_of_steps-i-1]) + SU2Driver.Preprocess(i) + SU2Driver.Run() + SU2Driver.Postprocess() + SU2Driver.Output(i) + SU2Driver.Update() +SU2Driver.Finalize() + + \ No newline at end of file diff --git a/TestCases/py_wrapper/rotating_cylinder/spinning_cylinder.cfg b/TestCases/py_wrapper/rotating_cylinder/spinning_cylinder.cfg new file mode 100644 index 00000000000..194a46064dd --- /dev/null +++ b/TestCases/py_wrapper/rotating_cylinder/spinning_cylinder.cfg @@ -0,0 +1,115 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Laminar flow around a spinning cylinder % +% Author: Thomas D. Economon % +% Institution: Stanford University % +% Date: 2013.08.21 % +% File Version 7.5.1 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= NAVIER_STOKES +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL= NO + +% ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% +% +MACH_NUMBER= 0.1 +AOA= 0.0 +SIDESLIP_ANGLE= 0.0 +FREESTREAM_TEMPERATURE= 288.15 +REYNOLDS_NUMBER= 200.0 +REYNOLDS_LENGTH= 1.0 + +% ----------------------- DYNAMIC MESH DEFINITION -----------------------------% +% +SURFACE_MOVEMENT= MOVING_WALL +MACH_MOTION= 0.1 +MARKER_MOVING= ( cylinder ) +SURFACE_MOTION_ORIGIN= 0.5 0.0 0.0 +SURFACE_ROTATION_RATE = 0.0 0.0 -199.0738 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.00 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= ( cylinder, 0.0 ) +MARKER_FAR= ( farfield ) +MARKER_PLOTTING= ( cylinder ) +MARKER_MONITORING= ( cylinder ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 100.0 +CFL_ADAPT= NO +CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) +ITER= 99999 + +% ----------------------- SLOPE LIMITER DEFINITION ----------------------------% +% +VENKAT_LIMITER_COEFF= 0.03 +ADJ_SHARP_LIMITER_COEFF= 3.0 +REF_SHARP_EDGES= 3.0 +SENS_REMOVE_SHARP= NO + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= LU_SGS +LINEAR_SOLVER_ERROR= 1E-4 +LINEAR_SOLVER_ITER= 5 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +MGLEVEL= 3 +MGCYCLE= V_CYCLE +MG_PRE_SMOOTH= ( 1, 1, 1, 1 ) +MG_POST_SMOOTH= ( 0, 0, 0, 0 ) +MG_CORRECTION_SMOOTH= ( 0, 0, 0, 0 ) +MG_DAMP_RESTRICTION= 0.5 +MG_DAMP_PROLONGATION= 0.5 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= ROE +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +JST_SENSOR_COEFF= ( 0.5, 0.02 ) +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_RESIDUAL_MINVAL= -15 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-7 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= mesh_cylinder_lam.su2 +MESH_FORMAT= SU2 +MESH_OUT_FILENAME= mesh_out.su2 +SOLUTION_FILENAME= solution_flow.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat +TABULAR_FORMAT= CSV +CONV_FILENAME= history +RESTART_FILENAME= restart_flow.dat +RESTART_ADJ_FILENAME= restart_adj.dat +VOLUME_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint +GRAD_OBJFUNC_FILENAME= of_grad.dat +SURFACE_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint +OUTPUT_WRT_FREQ= 100 +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) From ce66598aa62f441d18349417e6d61252cb38c8b4 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Sat, 29 Jul 2023 08:50:19 +0200 Subject: [PATCH 019/139] remove unused imports --- TestCases/py_wrapper/rotating_cylinder/run.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/TestCases/py_wrapper/rotating_cylinder/run.py b/TestCases/py_wrapper/rotating_cylinder/run.py index 64e36c2eddb..cbf2d968686 100644 --- a/TestCases/py_wrapper/rotating_cylinder/run.py +++ b/TestCases/py_wrapper/rotating_cylinder/run.py @@ -1,12 +1,8 @@ -import sys -from optparse import OptionParser # use a parser for configuration import pysu2 # imports the SU2 wrapped module from math import * -import os -import pysu2ad from mpi4py import MPI import numpy as np -import shutil + comm = MPI.COMM_WORLD rank = comm.Get_rank() ad_com = MPI.COMM_WORLD From 5d90c340f9600fcacebc21e731d36b47d0505288 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Sat, 29 Jul 2023 21:43:29 +0200 Subject: [PATCH 020/139] i hope the test will pass --- Common/include/CConfig.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 77df929dc58..fd78b7e54ba 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5973,8 +5973,8 @@ class CConfig { * \brief Set the rotation rate of the marker. * \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving) * \param[in] iDim - spatial component - * \param[in] val - Rotational velocity - + * \param[in] val - Rotational velocity + */ void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerRotation_Rate[3*iMarkerMoving + iDim] = val;} From 7331adb1b8b1944d4212d1df4a4c0b8c8e9d75eb Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Sat, 29 Jul 2023 17:12:36 -0700 Subject: [PATCH 021/139] Apply suggestions from code review --- Common/include/CConfig.hpp | 13 ++++++++----- SU2_CFD/include/drivers/CDriver.hpp | 15 ++++++++------- SU2_CFD/src/iteration/CIteration.cpp | 9 ++++----- SU2_CFD/src/python_wrapper_structure.cpp | 6 ++++-- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index fd78b7e54ba..256444b7f37 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5943,9 +5943,10 @@ class CConfig { * \brief Set the translation rate of the marker. * \param[in] iDim - spatial component * \param[in] val - translational velocity - * \return Translational velocity of the mesh. */ - void SetMarkerTranslation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerTranslation_Rate[3*iMarkerMoving + iDim] = val;} + void SetMarkerTranslationRate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) { + MarkerTranslation_Rate[3 * iMarkerMoving + iDim] = val; + } /*! * \brief Get the rotation rate of the mesh. @@ -5969,14 +5970,16 @@ class CConfig { * \return Rotation velocity of the marker. */ su2double GetMarkerRotationRate(unsigned short iMarkerMoving, unsigned short iDim) const { return MarkerRotation_Rate[3*iMarkerMoving + iDim];} + /*! * \brief Set the rotation rate of the marker. - * \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving) + * \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving) * \param[in] iDim - spatial component * \param[in] val - Rotational velocity - */ - void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) const { MarkerRotation_Rate[3*iMarkerMoving + iDim] = val;} + void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) { + MarkerRotation_Rate[3 * iMarkerMoving + iDim] = val; + } /*! * \brief Get the pitching rate of the mesh. diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 928753dc019..74bc0c11059 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -542,15 +542,16 @@ class CDriver : public CDriverBase { * \param[in] rot_y - Value of Angular velocity about y-axes. * \param[in] rot_z - Value of Angular velocity about z-axes. */ - void SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); - /*! - * \brief Set the moving wall marker rotation rates. + void SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); + + /*! + * \brief Set the moving wall marker translation rates. * \param[in] iMaker - Index of moving wall marker. - * \param[in] vel_x - Value of velocity about x-axes. - * \param[in] vel_y - Value of velocity about y-axes. - * \param[in] vel_z - Value of velocity about z-axes. + * \param[in] vel_x - Value of velocity along x-axis. + * \param[in] vel_y - Value of velocity along y-axis. + * \param[in] vel_z - Value of velocity along z-axis. */ - void SetMarkerTranslationRate(short int iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z); + void SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z); /// \} }; diff --git a/SU2_CFD/src/iteration/CIteration.cpp b/SU2_CFD/src/iteration/CIteration.cpp index 8224b45950a..15d8106981d 100644 --- a/SU2_CFD/src/iteration/CIteration.cpp +++ b/SU2_CFD/src/iteration/CIteration.cpp @@ -88,8 +88,6 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac } break; - - } if (config->GetSurface_Movement(AEROELASTIC) || config->GetSurface_Movement(AEROELASTIC_RIGID_MOTION) || config->GetSurface_Movement(MOVING_WALL)) { @@ -114,9 +112,10 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac grid_movement->UpdateMultiGrid(geometry, config); } - if(config->GetSurface_Movement(MOVING_WALL)){ - geometry[MESH_0]->SetWallVelocity(config, true); - + if (config->GetSurface_Movement(MOVING_WALL)) { + for (auto iMGlevel = 0u; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { + geometry[iMGlevel]->SetWallVelocity(config, iMGlevel == 0u); + } } } diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index ee7ae45a3e7..155ec1e216d 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -166,14 +166,16 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived config_container[iZone]->SetRotation_Rate(2, rot_z); } } -void CDriver::SetMarkerRotationRate(short int iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z){ + +void CDriver::SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z) { for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetMarkerRotation_Rate(iMarker, 0, rot_x); config_container[iZone]->SetMarkerRotation_Rate(iMarker, 1, rot_y); config_container[iZone]->SetMarkerRotation_Rate(iMarker, 2, rot_z); } } -void CDriver::SetMarkerTranslationRate(short int iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z){ + +void CDriver::SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z) { for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 0, vel_x); config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 1, vel_y); From eb21853c7b28660cb663e00cd4abb5fc447cc60d Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Sat, 29 Jul 2023 17:13:45 -0700 Subject: [PATCH 022/139] Apply suggestions from code review --- Common/include/CConfig.hpp | 2 +- SU2_CFD/src/python_wrapper_structure.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 256444b7f37..56987e00989 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5977,7 +5977,7 @@ class CConfig { * \param[in] iDim - spatial component * \param[in] val - Rotational velocity */ - void SetMarkerRotation_Rate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) { + void SetMarkerRotationRate(unsigned short iMarkerMoving, unsigned short iDim, su2double val) { MarkerRotation_Rate[3 * iMarkerMoving + iDim] = val; } diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 155ec1e216d..61945348c4b 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -169,17 +169,17 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived void CDriver::SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z) { for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone]->SetMarkerRotation_Rate(iMarker, 0, rot_x); - config_container[iZone]->SetMarkerRotation_Rate(iMarker, 1, rot_y); - config_container[iZone]->SetMarkerRotation_Rate(iMarker, 2, rot_z); + config_container[iZone]->SetMarkerRotationRate(iMarker, 0, rot_x); + config_container[iZone]->SetMarkerRotationRate(iMarker, 1, rot_y); + config_container[iZone]->SetMarkerRotationRate(iMarker, 2, rot_z); } } void CDriver::SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z) { for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 0, vel_x); - config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 1, vel_y); - config_container[iZone]->SetMarkerTranslation_Rate(iMarker, 2, vel_z); + config_container[iZone]->SetMarkerTranslationRate(iMarker, 0, vel_x); + config_container[iZone]->SetMarkerTranslationRate(iMarker, 1, vel_y); + config_container[iZone]->SetMarkerTranslationRate(iMarker, 2, vel_z); } } From 4473418441ed03923e54cfe205fef8bde0ba030b Mon Sep 17 00:00:00 2001 From: bigfooted Date: Tue, 8 Aug 2023 13:23:50 +0200 Subject: [PATCH 023/139] update --- Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp index cf7c69573cd..bf91c423d05 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp @@ -34,9 +34,9 @@ CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig* val_config, unsigned sho myZone(val_iZone), nZones(val_nZone), meshFilename(config->GetMesh_FileName()) { - actuator_disk = (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && - ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || - ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF)))); + actuator_disk = + (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && + ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF)))); if (config->GetActDisk_DoubleSurface()) actuator_disk = false; /* Read the basic metadata and perform some basic error checks. */ From 6337414b1f606e79762f210548e571901df1afbc Mon Sep 17 00:00:00 2001 From: bigfooted Date: Tue, 8 Aug 2023 13:25:18 +0200 Subject: [PATCH 024/139] update --- config_template.cfg | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config_template.cfg b/config_template.cfg index f22620bfee6..746e901edc2 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1202,7 +1202,6 @@ CATALYTIC_EFFICIENCY= 0.2 % SST Model: (inlet_marker1, TurbIntensity1, RatioTurbLamViscosity1, inlet_marker2, TurbIntensity2, RatioTurbLamViscosity2, ...) MARKER_INLET_TURBULENT= (inlet1, 0.05, 15, inlet2, 0.02, ...) % -<<<<<<< HEAD % Custom boundary marker(s) (this has to be implemented by users in the code). MARKER_CUSTOM= ( NONE ) % @@ -1260,10 +1259,6 @@ DYNAMIC_LOAD_TRANSFER= RAMP % Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), % i.e. primitive variables specified. MARKER_DISPLACEMENT= ( NONE ) -======= -% list of markers species transport and flamelet model where strong boundary conditions should be used -MARKER_SPECIES_STRONG_BC= (inlet, wall) ->>>>>>> origin/develop % ------------------------ WALL ROUGHNESS DEFINITION --------------------------% % The equivalent sand grain roughness height (k_s) on each of the wall. This must be in m. From b4cd072548e239405b2a36778703a20745a89176 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Tue, 8 Aug 2023 14:32:19 +0200 Subject: [PATCH 025/139] clang formatting --- Common/src/CConfig.cpp | 6030 ++++++++++++++++++++++------------------ 1 file changed, 3371 insertions(+), 2659 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 1365f1a3cd9..1ee3a4548f2 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -50,22 +50,20 @@ vector Profile_Time_tp; /*!< \brief Vector of elapsed time for vector Profile_ID_tp; /*!< \brief Vector of group ID number for profiled functions. */ map > Profile_Map_tp; /*!< \brief Map containing the final results for profiled functions. */ -map GEMM_Profile_MNK; /*!< \brief Map, which maps the GEMM size to the index where - the data for this GEMM is stored in several vectors. */ -vector GEMM_Profile_NCalls; /*!< \brief Vector, which stores the number of calls to this - GEMM size. */ -vector GEMM_Profile_TotTime; /*!< \brief Total time spent for this GEMM size. */ -vector GEMM_Profile_MinTime; /*!< \brief Minimum time spent for this GEMM size. */ -vector GEMM_Profile_MaxTime; /*!< \brief Maximum time spent for this GEMM size. */ +map GEMM_Profile_MNK; /*!< \brief Map, which maps the GEMM size to the index where + the data for this GEMM is stored in several vectors. */ +vector GEMM_Profile_NCalls; /*!< \brief Vector, which stores the number of calls to this + GEMM size. */ +vector GEMM_Profile_TotTime; /*!< \brief Total time spent for this GEMM size. */ +vector GEMM_Profile_MinTime; /*!< \brief Minimum time spent for this GEMM size. */ +vector GEMM_Profile_MaxTime; /*!< \brief Maximum time spent for this GEMM size. */ //#pragma omp threadprivate(Profile_Function_tp, Profile_Time_tp, Profile_ID_tp, Profile_Map_tp) - 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 ---*/ - caseName = PrintingToolbox::split(string(case_filename),'.')[0]; + caseName = PrintingToolbox::split(string(case_filename), '.')[0]; base_config = true; @@ -101,13 +99,10 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software /*--- Configuration file output ---*/ - if ((rank == MASTER_NODE) && verb_high) - SetOutput(val_software, iZone); - + if ((rank == MASTER_NODE) && verb_high) SetOutput(val_software, iZone); } -CConfig::CConfig(istream &case_buffer, SU2_COMPONENT val_software, bool verb_high) { - +CConfig::CConfig(istream& case_buffer, SU2_COMPONENT val_software, bool verb_high) { base_config = true; iZone = 0; @@ -137,13 +132,11 @@ CConfig::CConfig(istream &case_buffer, SU2_COMPONENT val_software, bool verb_hig /*--- Configuration file output ---*/ - if ((rank == MASTER_NODE) && verb_high) - SetOutput(val_software, iZone); - + if ((rank == MASTER_NODE) && verb_high) SetOutput(val_software, iZone); } -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) { - +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(); unsigned short val_nDim; @@ -181,18 +174,15 @@ CConfig::CConfig(CConfig* config, char case_filename[MAX_STRING_SIZE], SU2_COMPO /*--- Configuration file output ---*/ - if ((rank == MASTER_NODE) && verb_high) - SetOutput(val_software, val_iZone); + if ((rank == MASTER_NODE) && verb_high) SetOutput(val_software, val_iZone); Multizone_Problem = config->GetMultizone_Problem(); - } CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software) { - /*--- Set the case name to the base config file name without extension ---*/ - caseName = PrintingToolbox::split(string(case_filename),'.')[0]; + caseName = PrintingToolbox::split(string(case_filename), '.')[0]; base_config = true; @@ -224,14 +214,12 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software /*--- Print the header --- */ SetHeader(val_software); - } -CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig *config) { - +CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig* config) { /*--- Set the case name to the base config file name without extension ---*/ - caseName = PrintingToolbox::split(string(case_filename),'.')[0]; + caseName = PrintingToolbox::split(string(case_filename), '.')[0]; base_config = true; @@ -250,19 +238,13 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig *config) { /*--- Update original config file ---*/ if (runtime_file) { - if (all_options.find("TIME_ITER") == all_options.end()) - config->SetnTime_Iter(nTimeIter); + if (all_options.find("TIME_ITER") == all_options.end()) config->SetnTime_Iter(nTimeIter); } } -SU2_MPI::Comm CConfig::GetMPICommunicator() const { - - return SU2_Communicator; - -} - -void CConfig::Init(){ +SU2_MPI::Comm CConfig::GetMPICommunicator() const { return SU2_Communicator; } +void CConfig::Init() { /*--- Store MPI rank and size ---*/ rank = SU2_MPI::GetRank(); @@ -275,16 +257,11 @@ void CConfig::Init(){ /*--- Reading config options ---*/ SetConfig_Options(); - } -void CConfig::SetMPICommunicator(SU2_MPI::Comm Communicator) { - - SU2_Communicator = Communicator; +void CConfig::SetMPICommunicator(SU2_MPI::Comm Communicator) { SU2_Communicator = Communicator; } -} - -void CConfig::addDoubleOption(const string& name, su2double & option_field, su2double default_value) { +void CConfig::addDoubleOption(const string& name, su2double& option_field, su2double default_value) { // Check if the key is already in the map. If this fails, it is coder error // and not user error, so throw. assert(option_map.find(name) == option_map.end()); @@ -300,198 +277,201 @@ void CConfig::addDoubleOption(const string& name, su2double & option_field, su2d // Create an association between the option name ("CFL") and the parser generated above. // During configuration, the parsing script will get the option name, and use this map // to find how to parse that option. - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addStringOption(const string& name, string & option_field, string default_value) { - +void CConfig::addStringOption(const string& name, string& option_field, string default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionString(name, option_field, std::move(default_value)); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addIntegerOption(const string& name, int & option_field, int default_value) { +void CConfig::addIntegerOption(const string& name, int& option_field, int default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionInt(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addUnsignedLongOption(const string& name, unsigned long & option_field, unsigned long default_value) { +void CConfig::addUnsignedLongOption(const string& name, unsigned long& option_field, unsigned long default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionULong(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addUnsignedShortOption(const string& name, unsigned short & option_field, unsigned short default_value) { +void CConfig::addUnsignedShortOption(const string& name, unsigned short& option_field, unsigned short default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionUShort(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addLongOption(const string& name, long & option_field, long default_value) { +void CConfig::addLongOption(const string& name, long& option_field, long default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionLong(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addBoolOption(const string& name, bool & option_field, bool default_value) { +void CConfig::addBoolOption(const string& name, bool& option_field, bool default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionBool(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } // 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, TField& option_field, const map& enum_map, Tenum default_value) { +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); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } // input_size is the number of options read in from the config file template -void CConfig::addEnumListOption(const string name, unsigned short& input_size, TField*& option_field, const map& enum_map) { +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); - option_map.insert( pair(name, val) ); + COptionBase* val = new COptionEnumList(name, enum_map, option_field, input_size); + option_map.insert(pair(name, val)); } void CConfig::addDoubleArrayOption(const string& name, const int size, su2double* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionArray(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } void CConfig::addUShortArrayOption(const string& name, const int size, unsigned short* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionArray(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addDoubleListOption(const string& name, unsigned short & size, su2double * & option_field) { +void CConfig::addDoubleListOption(const string& name, unsigned short& size, su2double*& option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionDoubleList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addShortListOption(const string& name, unsigned short & size, short * & option_field) { +void CConfig::addShortListOption(const string& name, unsigned short& size, short*& option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionShortList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addUShortListOption(const string& name, unsigned short & size, unsigned short * & option_field) { +void CConfig::addUShortListOption(const string& name, unsigned short& size, unsigned short*& option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionUShortList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addULongListOption(const string& name, unsigned short & size, unsigned long * & option_field) { +void CConfig::addULongListOption(const string& name, unsigned short& size, unsigned long*& option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionULongList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addStringListOption(const string& name, unsigned short & num_marker, string* & option_field) { +void CConfig::addStringListOption(const string& name, unsigned short& num_marker, string*& option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionStringList(name, num_marker, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addConvectOption(const string& name, unsigned short & space_field, CENTERED & centered_field, UPWIND & upwind_field) { +void CConfig::addConvectOption(const string& name, unsigned short& space_field, CENTERED& centered_field, + UPWIND& upwind_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionConvect(name, space_field, centered_field, upwind_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addConvectFEMOption(const string& name, unsigned short & space_field, unsigned short & fem_field) { +void CConfig::addConvectFEMOption(const string& name, unsigned short& space_field, unsigned short& fem_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFEMConvect(name, space_field, fem_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addMathProblemOption(const string& name, bool & ContinuousAdjoint, const bool & ContinuousAdjoint_default, - bool & DiscreteAdjoint, const bool & DiscreteAdjoint_default, - bool & Restart_Flow, const bool & Restart_Flow_default) { +void CConfig::addMathProblemOption(const string& name, bool& ContinuousAdjoint, const bool& ContinuousAdjoint_default, + bool& DiscreteAdjoint, const bool& DiscreteAdjoint_default, bool& Restart_Flow, + const bool& Restart_Flow_default) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionMathProblem(name, ContinuousAdjoint, ContinuousAdjoint_default, DiscreteAdjoint, DiscreteAdjoint_default, Restart_Flow, Restart_Flow_default); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionMathProblem(name, ContinuousAdjoint, ContinuousAdjoint_default, DiscreteAdjoint, + DiscreteAdjoint_default, Restart_Flow, Restart_Flow_default); + option_map.insert(pair(name, val)); } -void CConfig::addDVParamOption(const string& name, unsigned short & nDV_field, su2double** & paramDV, string* & FFDTag, - unsigned short* & design_variable) { +void CConfig::addDVParamOption(const string& name, unsigned short& nDV_field, su2double**& paramDV, string*& FFDTag, + unsigned short*& design_variable) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionDVParam(name, nDV_field, paramDV, FFDTag, design_variable); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addDVValueOption(const string& name, unsigned short* & nDVValue_field, su2double** & valueDV, unsigned short & nDV_field, su2double** & paramDV, - unsigned short* & design_variable) { +void CConfig::addDVValueOption(const string& name, unsigned short*& nDVValue_field, su2double**& valueDV, + unsigned short& nDV_field, su2double**& paramDV, unsigned short*& design_variable) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionDVValue(name, nDVValue_field, valueDV, nDV_field, paramDV, design_variable); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addFFDDefOption(const string& name, unsigned short & nFFD_field, su2double** & coordFFD, string* & FFDTag) { +void CConfig::addFFDDefOption(const string& name, unsigned short& nFFD_field, su2double**& coordFFD, string*& FFDTag) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFFDDef(name, nFFD_field, coordFFD, FFDTag); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addFFDDegreeOption(const string& name, unsigned short & nFFD_field, unsigned short** & degreeFFD) { +void CConfig::addFFDDegreeOption(const string& name, unsigned short& nFFD_field, unsigned short**& degreeFFD) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFFDDegree(name, nFFD_field, degreeFFD); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addStringDoubleListOption(const string& name, unsigned short & list_size, string * & string_field, - su2double* & double_field) { +void CConfig::addStringDoubleListOption(const string& name, unsigned short& list_size, string*& string_field, + su2double*& double_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionStringValuesList(name, list_size, string_field, double_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addInletOption(const string& name, unsigned short & nMarker_Inlet, string * & Marker_Inlet, - su2double* & Ttotal, su2double* & Ptotal, su2double** & FlowDir) { +void CConfig::addInletOption(const string& name, unsigned short& nMarker_Inlet, string*& Marker_Inlet, + su2double*& Ttotal, su2double*& Ptotal, su2double**& FlowDir) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionInlet(name, nMarker_Inlet, Marker_Inlet, Ttotal, Ptotal, FlowDir); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addInletSpeciesOption(const string& name, unsigned short & nMarker_Inlet_Species, - string * & Marker_Inlet_Species, su2double** & inlet_species_val, - unsigned short & nSpecies_per_Inlet) { +void CConfig::addInletSpeciesOption(const string& name, unsigned short& nMarker_Inlet_Species, + string*& Marker_Inlet_Species, su2double**& inlet_species_val, + unsigned short& nSpecies_per_Inlet) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionStringValuesList(name, nMarker_Inlet_Species, Marker_Inlet_Species, inlet_species_val, nSpecies_per_Inlet); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } void CConfig::addInletTurbOption(const string& name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb, @@ -504,83 +484,87 @@ void CConfig::addInletTurbOption(const string& name, unsigned short& nMarker_Inl } template -void CConfig::addRiemannOption(const string name, unsigned short & nMarker_Riemann, string * & Marker_Riemann, unsigned short* & option_field, const map & enum_map, - su2double* & var1, su2double* & var2, su2double** & FlowDir) { +void CConfig::addRiemannOption(const string name, unsigned short& nMarker_Riemann, string*& Marker_Riemann, + unsigned short*& option_field, const map& enum_map, su2double*& var1, + su2double*& var2, su2double**& FlowDir) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionRiemann(name, nMarker_Riemann, Marker_Riemann, option_field, enum_map, var1, var2, FlowDir); - option_map.insert(pair(name, val)); + COptionBase* val = + new COptionRiemann(name, nMarker_Riemann, Marker_Riemann, option_field, enum_map, var1, var2, FlowDir); + option_map.insert(pair(name, val)); } template -void CConfig::addGilesOption(const string name, unsigned short & nMarker_Giles, string * & Marker_Giles, unsigned short* & option_field, const map & enum_map, - su2double* & var1, su2double* & var2, su2double** & FlowDir, su2double* & relaxfactor1, su2double* & relaxfactor2) { +void CConfig::addGilesOption(const string name, unsigned short& nMarker_Giles, string*& Marker_Giles, + unsigned short*& option_field, const map& enum_map, su2double*& var1, + su2double*& var2, su2double**& FlowDir, su2double*& relaxfactor1, + su2double*& relaxfactor2) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionGiles(name, nMarker_Giles, Marker_Giles, option_field, enum_map, var1, var2, FlowDir, relaxfactor1, relaxfactor2); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionGiles(name, nMarker_Giles, Marker_Giles, option_field, enum_map, var1, var2, + FlowDir, relaxfactor1, relaxfactor2); + option_map.insert(pair(name, val)); } -void CConfig::addExhaustOption(const string& name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust, - su2double* & Ttotal, su2double* & Ptotal) { +void CConfig::addExhaustOption(const string& name, unsigned short& nMarker_Exhaust, string*& Marker_Exhaust, + su2double*& Ttotal, su2double*& Ptotal) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionExhaust(name, nMarker_Exhaust, Marker_Exhaust, Ttotal, Ptotal); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addPeriodicOption(const string & name, unsigned short & nMarker_PerBound, - string* & Marker_PerBound, string* & Marker_PerDonor, - su2double** & RotCenter, su2double** & RotAngles, su2double** & Translation) { +void CConfig::addPeriodicOption(const string& name, unsigned short& nMarker_PerBound, string*& Marker_PerBound, + string*& Marker_PerDonor, su2double**& RotCenter, su2double**& RotAngles, + su2double**& Translation) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionPeriodic(name, nMarker_PerBound, Marker_PerBound, Marker_PerDonor, RotCenter, RotAngles, Translation); - option_map.insert(pair(name, val)); + COptionBase* val = + new COptionPeriodic(name, nMarker_PerBound, Marker_PerBound, Marker_PerDonor, RotCenter, RotAngles, Translation); + option_map.insert(pair(name, val)); } -void CConfig::addTurboPerfOption(const string & name, unsigned short & nMarker_TurboPerf, - string* & Marker_TurboBoundIn, string* & Marker_TurboBoundOut) { +void CConfig::addTurboPerfOption(const string& name, unsigned short& nMarker_TurboPerf, string*& Marker_TurboBoundIn, + string*& Marker_TurboBoundOut) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionTurboPerformance(name, nMarker_TurboPerf, Marker_TurboBoundIn, Marker_TurboBoundOut); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addActDiskOption(const string & name, unsigned short & nMarker_ActDiskInlet, - unsigned short & nMarker_ActDiskOutlet, string* & Marker_ActDiskInlet, - string* & Marker_ActDiskOutlet, su2double** & ActDisk_PressJump, - su2double** & ActDisk_TempJump, su2double** & ActDisk_Omega) { +void CConfig::addActDiskOption(const string& name, unsigned short& nMarker_ActDiskInlet, + unsigned short& nMarker_ActDiskOutlet, string*& Marker_ActDiskInlet, + string*& Marker_ActDiskOutlet, su2double**& ActDisk_PressJump, + su2double**& ActDisk_TempJump, su2double**& ActDisk_Omega) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionActDisk(name, nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addWallFunctionOption(const string &name, unsigned short &list_size, string* &string_field, - WALL_FUNCTIONS* &val_Kind_WF, unsigned short** &val_IntInfo_WF, - su2double** &val_DoubleInfo_WF) { +void CConfig::addWallFunctionOption(const string& name, unsigned short& list_size, string*& string_field, + WALL_FUNCTIONS*& val_Kind_WF, unsigned short**& val_IntInfo_WF, + su2double**& val_DoubleInfo_WF) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionWallFunction(name, list_size, string_field, val_Kind_WF, - val_IntInfo_WF, val_DoubleInfo_WF); - option_map.insert(pair(name, val)); + COptionBase* val = + new COptionWallFunction(name, list_size, string_field, val_Kind_WF, val_IntInfo_WF, val_DoubleInfo_WF); + option_map.insert(pair(name, val)); } void CConfig::addPythonOption(const string& name) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionPython(name); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short val_format) { - int nZone = 1; /* Default value if nothing is specified. */ switch (val_format) { case SU2: { - /*--- Local variables for reading the SU2 file. ---*/ string text_line; ifstream mesh_file; @@ -588,35 +572,32 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short /*--- Check if the mesh file can be opened for reading. ---*/ mesh_file.open(val_mesh_filename.c_str(), ios::in); if (mesh_file.fail()) - SU2_MPI::Error(string("There is no geometry file called ") + val_mesh_filename, - CURRENT_FUNCTION); + SU2_MPI::Error(string("There is no geometry file called ") + val_mesh_filename, CURRENT_FUNCTION); /*--- Read the SU2 mesh file until the zone data is reached or when it can be decided that it is not present. ---*/ - while( getline (mesh_file, text_line) ) { - + while (getline(mesh_file, text_line)) { /*--- Search for the "NZONE" keyword to see if there are multiple Zones ---*/ - if(text_line.find ("NZONE=",0) != string::npos) { - text_line.erase (0,6); nZone = atoi(text_line.c_str()); + if (text_line.find("NZONE=", 0) != string::npos) { + text_line.erase(0, 6); + nZone = atoi(text_line.c_str()); break; } /*--- If one of the keywords IZONE, NELEM or NPOIN, NMARK is encountered, it can be assumed that the NZONE keyword is not present and the loop can be terminated. ---*/ - if(text_line.find ("IZONE=",0) != string::npos) break; - if(text_line.find ("NELEM=",0) != string::npos) break; - if(text_line.find ("NPOIN=",0) != string::npos) break; - if(text_line.find ("NMARK=",0) != string::npos) break; + if (text_line.find("IZONE=", 0) != string::npos) break; + if (text_line.find("NELEM=", 0) != string::npos) break; + if (text_line.find("NPOIN=", 0) != string::npos) break; + if (text_line.find("NMARK=", 0) != string::npos) break; } mesh_file.close(); break; - } case CGNS_GRID: { - #ifdef HAVE_CGNS /*--- Local variables which are needed when calling the CGNS mid-level API. ---*/ @@ -627,10 +608,9 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short /*--- Check whether the supplied file is truly a CGNS file. ---*/ - if ( cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK ) { - SU2_MPI::Error(val_mesh_filename + - string(" was not found or is not a properly formatted CGNS file.\n") + - string("Note that SU2 expects unstructured CGNS files in ADF data format."), + if (cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK) { + SU2_MPI::Error(val_mesh_filename + string(" was not found or is not a properly formatted CGNS file.\n") + + string("Note that SU2 expects unstructured CGNS files in ADF data format."), CURRENT_FUNCTION); } @@ -649,34 +629,30 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short error if there is because this reader can currently only handle one database. ---*/ - if ( nbases > 1 ) { - SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database." , - CURRENT_FUNCTION); + if (nbases > 1) { + SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database.", CURRENT_FUNCTION); } /*--- Read the databases. Note that the indexing starts at 1. ---*/ - for ( int i = 1; i <= nbases; i++ ) { - + for (int i = 1; i <= nbases; i++) { if (cg_base_read(fn, i, basename, &cell_dim, &phys_dim)) cg_error_exit(); /*--- Get the number of zones for this base. ---*/ if (cg_nzones(fn, i, &nzones)) cg_error_exit(); - } /*--- Close the CGNS file. ---*/ - if ( cg_close(fn) ) cg_error_exit(); + if (cg_close(fn)) cg_error_exit(); /*--- Set the number of zones as read from the CGNS file ---*/ nZone = nzones; #else - SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + - string(" To use CGNS, build SU2 accordingly."), + SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + string(" To use CGNS, build SU2 accordingly."), CURRENT_FUNCTION); #endif @@ -692,17 +668,14 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short } } - return (unsigned short) nZone; - + return (unsigned short)nZone; } unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short val_format) { - short nDim = -1; switch (val_format) { case SU2: { - /*--- Local variables for reading the SU2 file. ---*/ string text_line; ifstream mesh_file; @@ -710,41 +683,43 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short /*--- Open grid file ---*/ mesh_file.open(val_mesh_filename.c_str(), ios::in); if (mesh_file.fail()) { - SU2_MPI::Error(string("The SU2 mesh file named ") + val_mesh_filename + string(" was not found."), CURRENT_FUNCTION); + SU2_MPI::Error(string("The SU2 mesh file named ") + val_mesh_filename + string(" was not found."), + CURRENT_FUNCTION); } /*--- Read the SU2 mesh file until the dimension data is reached or when it can be decided that it is not present. ---*/ - while( getline (mesh_file, text_line) ) { - + while (getline(mesh_file, text_line)) { /*--- Search for the "NDIME" keyword to determine the number of dimensions. ---*/ - if(text_line.find ("NDIME=",0) != string::npos) { - text_line.erase (0,6); nDim = atoi(text_line.c_str()); + if (text_line.find("NDIME=", 0) != string::npos) { + text_line.erase(0, 6); + nDim = atoi(text_line.c_str()); break; } /*--- If one of the keywords NELEM or NPOIN, NMARK is encountered, it can be assumed that the NZONE keyword is not present and the loop can be terminated. ---*/ - if(text_line.find ("NELEM=",0) != string::npos) break; - if(text_line.find ("NPOIN=",0) != string::npos) break; - if(text_line.find ("NMARK=",0) != string::npos) break; + if (text_line.find("NELEM=", 0) != string::npos) break; + if (text_line.find("NPOIN=", 0) != string::npos) break; + if (text_line.find("NMARK=", 0) != string::npos) break; } mesh_file.close(); /*--- Throw an error if the dimension was not found. ---*/ if (nDim == -1) { - SU2_MPI::Error(val_mesh_filename + string(" is not an SU2 mesh file or has the wrong format \n ('NDIME=' not found). Please check."), - CURRENT_FUNCTION); + SU2_MPI::Error( + val_mesh_filename + + string(" is not an SU2 mesh file or has the wrong format \n ('NDIME=' not found). Please check."), + CURRENT_FUNCTION); } break; } case CGNS_GRID: { - #ifdef HAVE_CGNS /*--- Local variables which are needed when calling the CGNS mid-level API. ---*/ @@ -753,10 +728,9 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short char basename[CGNS_STRING_SIZE]; /*--- Check whether the supplied file is truly a CGNS file. ---*/ - if ( cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK ) { - SU2_MPI::Error(val_mesh_filename + - string(" was not found or is not a properly formatted CGNS file.\n") + - string("Note that SU2 expects unstructured CGNS files in ADF data format."), + if (cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK) { + SU2_MPI::Error(val_mesh_filename + string(" was not found or is not a properly formatted CGNS file.\n") + + string("Note that SU2 expects unstructured CGNS files in ADF data format."), CURRENT_FUNCTION); } @@ -772,9 +746,8 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short /*--- Check if there is more than one database. Throw an error if there is because this reader can currently only handle one database. ---*/ - if ( nbases > 1 ) - SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database." , - CURRENT_FUNCTION); + if (nbases > 1) + SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database.", CURRENT_FUNCTION); /*--- Read the database. Note that the indexing starts at 1. Afterwards close the file again. ---*/ @@ -785,8 +758,7 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short nDim = cell_dim; #else - SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + - string(" To use CGNS, build SU2 accordingly."), + SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + string(" To use CGNS, build SU2 accordingly."), CURRENT_FUNCTION); #endif @@ -805,192 +777,326 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short /*--- After reading the mesh, assert that the dimension is equal to 2 or 3. ---*/ assert((nDim == 2) || (nDim == 3)); - return (unsigned short) nDim; + return (unsigned short)nDim; } void CConfig::SetPointersNull() { - - Marker_CfgFile_GeoEval = nullptr; Marker_All_GeoEval = nullptr; - Marker_CfgFile_Monitoring = nullptr; Marker_All_Monitoring = nullptr; - Marker_CfgFile_Designing = nullptr; Marker_All_Designing = nullptr; - Marker_CfgFile_Plotting = nullptr; Marker_All_Plotting = nullptr; - Marker_CfgFile_Analyze = nullptr; Marker_All_Analyze = nullptr; - Marker_CfgFile_DV = nullptr; Marker_All_DV = nullptr; - Marker_CfgFile_Moving = nullptr; Marker_All_Moving = nullptr; - Marker_CfgFile_PerBound = nullptr; Marker_All_PerBound = nullptr; Marker_PerBound = nullptr; - Marker_CfgFile_Turbomachinery = nullptr; Marker_All_Turbomachinery = nullptr; - Marker_CfgFile_TurbomachineryFlag = nullptr; Marker_All_TurbomachineryFlag = nullptr; - Marker_CfgFile_MixingPlaneInterface = nullptr; Marker_All_MixingPlaneInterface = nullptr; + Marker_CfgFile_GeoEval = nullptr; + Marker_All_GeoEval = nullptr; + Marker_CfgFile_Monitoring = nullptr; + Marker_All_Monitoring = nullptr; + Marker_CfgFile_Designing = nullptr; + Marker_All_Designing = nullptr; + Marker_CfgFile_Plotting = nullptr; + Marker_All_Plotting = nullptr; + Marker_CfgFile_Analyze = nullptr; + Marker_All_Analyze = nullptr; + Marker_CfgFile_DV = nullptr; + Marker_All_DV = nullptr; + Marker_CfgFile_Moving = nullptr; + Marker_All_Moving = nullptr; + Marker_CfgFile_PerBound = nullptr; + Marker_All_PerBound = nullptr; + Marker_PerBound = nullptr; + Marker_CfgFile_Turbomachinery = nullptr; + Marker_All_Turbomachinery = nullptr; + Marker_CfgFile_TurbomachineryFlag = nullptr; + Marker_All_TurbomachineryFlag = nullptr; + Marker_CfgFile_MixingPlaneInterface = nullptr; + Marker_All_MixingPlaneInterface = nullptr; Marker_CfgFile_ZoneInterface = nullptr; - Marker_CfgFile_Deform_Mesh = nullptr; Marker_All_Deform_Mesh = nullptr; - Marker_CfgFile_Deform_Mesh_Sym_Plane = nullptr; Marker_All_Deform_Mesh_Sym_Plane = nullptr; - Marker_CfgFile_Fluid_Load = nullptr; Marker_All_Fluid_Load = nullptr; - Marker_CfgFile_SobolevBC = nullptr; Marker_All_SobolevBC = nullptr; - - Marker_CfgFile_Turbomachinery = nullptr; Marker_All_Turbomachinery = nullptr; - Marker_CfgFile_TurbomachineryFlag = nullptr; Marker_All_TurbomachineryFlag = nullptr; - Marker_CfgFile_MixingPlaneInterface = nullptr; Marker_All_MixingPlaneInterface = nullptr; - - Marker_CfgFile_PyCustom = nullptr; Marker_All_PyCustom = nullptr; - - Marker_DV = nullptr; Marker_Moving = nullptr; Marker_Monitoring = nullptr; - Marker_Designing = nullptr; Marker_GeoEval = nullptr; Marker_Plotting = nullptr; - Marker_Analyze = nullptr; Marker_PyCustom = nullptr; Marker_WallFunctions = nullptr; - Marker_CfgFile_KindBC = nullptr; Marker_All_KindBC = nullptr; Marker_SobolevBC = nullptr; - Marker_StrongBC = nullptr; - - Kind_WallFunctions = nullptr; - IntInfo_WallFunctions = nullptr; + Marker_CfgFile_Deform_Mesh = nullptr; + Marker_All_Deform_Mesh = nullptr; + Marker_CfgFile_Deform_Mesh_Sym_Plane = nullptr; + Marker_All_Deform_Mesh_Sym_Plane = nullptr; + Marker_CfgFile_Fluid_Load = nullptr; + Marker_All_Fluid_Load = nullptr; + Marker_CfgFile_SobolevBC = nullptr; + Marker_All_SobolevBC = nullptr; + + Marker_CfgFile_Turbomachinery = nullptr; + Marker_All_Turbomachinery = nullptr; + Marker_CfgFile_TurbomachineryFlag = nullptr; + Marker_All_TurbomachineryFlag = nullptr; + Marker_CfgFile_MixingPlaneInterface = nullptr; + Marker_All_MixingPlaneInterface = nullptr; + + Marker_CfgFile_PyCustom = nullptr; + Marker_All_PyCustom = nullptr; + + Marker_DV = nullptr; + Marker_Moving = nullptr; + Marker_Monitoring = nullptr; + Marker_Designing = nullptr; + Marker_GeoEval = nullptr; + Marker_Plotting = nullptr; + Marker_Analyze = nullptr; + Marker_PyCustom = nullptr; + Marker_WallFunctions = nullptr; + Marker_CfgFile_KindBC = nullptr; + Marker_All_KindBC = nullptr; + Marker_SobolevBC = nullptr; + Marker_StrongBC = nullptr; + + Kind_WallFunctions = nullptr; + IntInfo_WallFunctions = nullptr; DoubleInfo_WallFunctions = nullptr; Config_Filenames = nullptr; /*--- Marker Pointers ---*/ - Marker_Euler = nullptr; Marker_FarField = nullptr; Marker_Custom = nullptr; - Marker_SymWall = nullptr; Marker_PerBound = nullptr; - Marker_PerDonor = nullptr; Marker_NearFieldBound = nullptr; Marker_Inlet_Turb = nullptr; - Marker_Deform_Mesh = nullptr; Marker_Deform_Mesh_Sym_Plane= nullptr; Marker_Fluid_Load = nullptr; - Marker_Inlet = nullptr; Marker_Outlet = nullptr; Marker_Inlet_Species = nullptr; - Marker_Supersonic_Inlet = nullptr; Marker_Supersonic_Outlet = nullptr; Marker_Smoluchowski_Maxwell= nullptr; - Marker_Isothermal = nullptr; Marker_HeatFlux = nullptr; Marker_EngineInflow = nullptr; - Marker_Load = nullptr; Marker_Disp_Dir = nullptr; Marker_RoughWall = nullptr; - Marker_EngineExhaust = nullptr; Marker_Displacement = nullptr; Marker_Load = nullptr; - Marker_Load_Dir = nullptr; Marker_Clamped = nullptr; - Marker_Internal = nullptr; - Marker_All_TagBound = nullptr; Marker_CfgFile_TagBound = nullptr; Marker_All_KindBC = nullptr; - Marker_CfgFile_KindBC = nullptr; Marker_All_SendRecv = nullptr; Marker_All_PerBound = nullptr; - Marker_ZoneInterface = nullptr; Marker_All_ZoneInterface = nullptr; Marker_Riemann = nullptr; - Marker_Fluid_InterfaceBound = nullptr; Marker_CHTInterface = nullptr; Marker_Damper = nullptr; - Marker_Emissivity = nullptr; Marker_HeatTransfer = nullptr; - - /*--- Boundary Condition settings ---*/ - - Isothermal_Temperature = nullptr; HeatTransfer_Coeff = nullptr; HeatTransfer_WallTemp = nullptr; - Heat_Flux = nullptr; Displ_Value = nullptr; Load_Value = nullptr; - Damper_Constant = nullptr; Wall_Emissivity = nullptr; - Roughness_Height = nullptr; + Marker_Euler = nullptr; + Marker_FarField = nullptr; + Marker_Custom = nullptr; + Marker_SymWall = nullptr; + Marker_PerBound = nullptr; + Marker_PerDonor = nullptr; + Marker_NearFieldBound = nullptr; + Marker_Inlet_Turb = nullptr; + Marker_Deform_Mesh = nullptr; + Marker_Deform_Mesh_Sym_Plane = nullptr; + Marker_Fluid_Load = nullptr; + Marker_Inlet = nullptr; + Marker_Outlet = nullptr; + Marker_Inlet_Species = nullptr; + Marker_Supersonic_Inlet = nullptr; + Marker_Supersonic_Outlet = nullptr; + Marker_Smoluchowski_Maxwell = nullptr; + Marker_Isothermal = nullptr; + Marker_HeatFlux = nullptr; + Marker_EngineInflow = nullptr; + Marker_Load = nullptr; + Marker_Disp_Dir = nullptr; + Marker_RoughWall = nullptr; + Marker_EngineExhaust = nullptr; + Marker_Displacement = nullptr; + Marker_Load = nullptr; + Marker_Load_Dir = nullptr; + Marker_Clamped = nullptr; + Marker_Internal = nullptr; + Marker_All_TagBound = nullptr; + Marker_CfgFile_TagBound = nullptr; + Marker_All_KindBC = nullptr; + Marker_CfgFile_KindBC = nullptr; + Marker_All_SendRecv = nullptr; + Marker_All_PerBound = nullptr; + Marker_ZoneInterface = nullptr; + Marker_All_ZoneInterface = nullptr; + Marker_Riemann = nullptr; + Marker_Fluid_InterfaceBound = nullptr; + Marker_CHTInterface = nullptr; + Marker_Damper = nullptr; + Marker_Emissivity = nullptr; + Marker_HeatTransfer = nullptr; + + /*--- Boundary Condition settings ---*/ + + Isothermal_Temperature = nullptr; + HeatTransfer_Coeff = nullptr; + HeatTransfer_WallTemp = nullptr; + Heat_Flux = nullptr; + Displ_Value = nullptr; + Load_Value = nullptr; + Damper_Constant = nullptr; + Wall_Emissivity = nullptr; + Roughness_Height = nullptr; /*--- Inlet Outlet Boundary Condition settings ---*/ - Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr; - Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr; - Inlet_Velocity = nullptr; - Outlet_Pressure = nullptr; Inlet_SpeciesVal = nullptr; Inlet_TurbVal = nullptr; + Inlet_Ttotal = nullptr; + Inlet_Ptotal = nullptr; + Inlet_FlowDir = nullptr; + Inlet_Temperature = nullptr; + Inlet_Pressure = nullptr; + Inlet_Velocity = nullptr; + Outlet_Pressure = nullptr; + Inlet_SpeciesVal = nullptr; + Inlet_TurbVal = nullptr; /*--- Engine Boundary Condition settings ---*/ - Inflow_Pressure = nullptr; Inflow_MassFlow = nullptr; Inflow_ReverseMassFlow = nullptr; - Inflow_TotalPressure = nullptr; Inflow_Temperature = nullptr; Inflow_TotalTemperature = nullptr; - Inflow_RamDrag = nullptr; Inflow_Force = nullptr; Inflow_Power = nullptr; - Inflow_Mach = nullptr; - - Exhaust_Pressure = nullptr; Exhaust_Temperature = nullptr; Exhaust_MassFlow = nullptr; - Exhaust_TotalPressure = nullptr; Exhaust_TotalTemperature = nullptr; - Exhaust_GrossThrust = nullptr; Exhaust_Force = nullptr; - Exhaust_Power = nullptr; Exhaust_Temperature_Target = nullptr; + Inflow_Pressure = nullptr; + Inflow_MassFlow = nullptr; + Inflow_ReverseMassFlow = nullptr; + Inflow_TotalPressure = nullptr; + Inflow_Temperature = nullptr; + Inflow_TotalTemperature = nullptr; + Inflow_RamDrag = nullptr; + Inflow_Force = nullptr; + Inflow_Power = nullptr; + Inflow_Mach = nullptr; + + Exhaust_Pressure = nullptr; + Exhaust_Temperature = nullptr; + Exhaust_MassFlow = nullptr; + Exhaust_TotalPressure = nullptr; + Exhaust_TotalTemperature = nullptr; + Exhaust_GrossThrust = nullptr; + Exhaust_Force = nullptr; + Exhaust_Power = nullptr; + Exhaust_Temperature_Target = nullptr; Exhaust_Pressure_Target = nullptr; - Engine_Mach = nullptr; Engine_Force = nullptr; - Engine_Power = nullptr; Engine_NetThrust = nullptr; Engine_GrossThrust = nullptr; - Engine_Area = nullptr; EngineInflow_Target = nullptr; - - Exhaust_Temperature_Target = nullptr; Exhaust_Temperature = nullptr; Exhaust_Pressure = nullptr; - Exhaust_Pressure_Target = nullptr; Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr; - Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr; - Inlet_Velocity = nullptr; Inflow_Mach = nullptr; Inflow_Pressure = nullptr; - Outlet_Pressure = nullptr; Isothermal_Temperature = nullptr; - - ElasticityMod = nullptr; PoissonRatio = nullptr; MaterialDensity = nullptr; - - Load_Dir = nullptr; Load_Dir_Value = nullptr; Load_Dir_Multiplier = nullptr; - Disp_Dir = nullptr; Disp_Dir_Value = nullptr; Disp_Dir_Multiplier = nullptr; - Electric_Field_Mod = nullptr; Electric_Field_Dir = nullptr; RefNode_Displacement = nullptr; + Engine_Mach = nullptr; + Engine_Force = nullptr; + Engine_Power = nullptr; + Engine_NetThrust = nullptr; + Engine_GrossThrust = nullptr; + Engine_Area = nullptr; + EngineInflow_Target = nullptr; + + Exhaust_Temperature_Target = nullptr; + Exhaust_Temperature = nullptr; + Exhaust_Pressure = nullptr; + Exhaust_Pressure_Target = nullptr; + Inlet_Ttotal = nullptr; + Inlet_Ptotal = nullptr; + Inlet_FlowDir = nullptr; + Inlet_Temperature = nullptr; + Inlet_Pressure = nullptr; + Inlet_Velocity = nullptr; + Inflow_Mach = nullptr; + Inflow_Pressure = nullptr; + Outlet_Pressure = nullptr; + Isothermal_Temperature = nullptr; + + ElasticityMod = nullptr; + PoissonRatio = nullptr; + MaterialDensity = nullptr; + + Load_Dir = nullptr; + Load_Dir_Value = nullptr; + Load_Dir_Multiplier = nullptr; + Disp_Dir = nullptr; + Disp_Dir_Value = nullptr; + Disp_Dir_Multiplier = nullptr; + Electric_Field_Mod = nullptr; + Electric_Field_Dir = nullptr; + RefNode_Displacement = nullptr; Electric_Constant = nullptr; /*--- Actuator Disk Boundary Condition settings ---*/ - ActDiskInlet_Pressure = nullptr; ActDiskInlet_TotalPressure = nullptr; ActDiskInlet_Temperature = nullptr; - ActDiskInlet_TotalTemperature = nullptr; ActDiskInlet_MassFlow = nullptr; ActDiskInlet_RamDrag = nullptr; - ActDiskInlet_Force = nullptr; ActDiskInlet_Power = nullptr; - - ActDiskOutlet_Pressure = nullptr; - ActDiskOutlet_TotalPressure = nullptr; ActDiskOutlet_GrossThrust = nullptr; ActDiskOutlet_Force = nullptr; - ActDiskOutlet_Power = nullptr; ActDiskOutlet_Temperature = nullptr; ActDiskOutlet_TotalTemperature = nullptr; - ActDiskOutlet_MassFlow = nullptr; - - ActDisk_DeltaPress = nullptr; ActDisk_DeltaTemp = nullptr; - ActDisk_TotalPressRatio = nullptr; ActDisk_TotalTempRatio = nullptr; ActDisk_StaticPressRatio = nullptr; - ActDisk_StaticTempRatio = nullptr; ActDisk_NetThrust = nullptr; ActDisk_GrossThrust = nullptr; - ActDisk_Power = nullptr; ActDisk_MassFlow = nullptr; ActDisk_Area = nullptr; - ActDisk_ReverseMassFlow = nullptr; Surface_MassFlow = nullptr; Surface_Mach = nullptr; - Surface_Temperature = nullptr; Surface_Pressure = nullptr; Surface_Density = nullptr; Surface_Enthalpy = nullptr; - Surface_NormalVelocity = nullptr; Surface_TotalTemperature = nullptr; Surface_TotalPressure = nullptr; Surface_PressureDrop = nullptr; - Surface_DC60 = nullptr; Surface_IDC = nullptr; - Surface_Species_Variance = nullptr; Surface_Species_0 = nullptr; - - Outlet_MassFlow = nullptr; Outlet_Density = nullptr; Outlet_Area = nullptr; - - Surface_Uniformity = nullptr; Surface_SecondaryStrength = nullptr; Surface_SecondOverUniform = nullptr; + ActDiskInlet_Pressure = nullptr; + ActDiskInlet_TotalPressure = nullptr; + ActDiskInlet_Temperature = nullptr; + ActDiskInlet_TotalTemperature = nullptr; + ActDiskInlet_MassFlow = nullptr; + ActDiskInlet_RamDrag = nullptr; + ActDiskInlet_Force = nullptr; + ActDiskInlet_Power = nullptr; + + ActDiskOutlet_Pressure = nullptr; + ActDiskOutlet_TotalPressure = nullptr; + ActDiskOutlet_GrossThrust = nullptr; + ActDiskOutlet_Force = nullptr; + ActDiskOutlet_Power = nullptr; + ActDiskOutlet_Temperature = nullptr; + ActDiskOutlet_TotalTemperature = nullptr; + ActDiskOutlet_MassFlow = nullptr; + + ActDisk_DeltaPress = nullptr; + ActDisk_DeltaTemp = nullptr; + ActDisk_TotalPressRatio = nullptr; + ActDisk_TotalTempRatio = nullptr; + ActDisk_StaticPressRatio = nullptr; + ActDisk_StaticTempRatio = nullptr; + ActDisk_NetThrust = nullptr; + ActDisk_GrossThrust = nullptr; + ActDisk_Power = nullptr; + ActDisk_MassFlow = nullptr; + ActDisk_Area = nullptr; + ActDisk_ReverseMassFlow = nullptr; + Surface_MassFlow = nullptr; + Surface_Mach = nullptr; + Surface_Temperature = nullptr; + Surface_Pressure = nullptr; + Surface_Density = nullptr; + Surface_Enthalpy = nullptr; + Surface_NormalVelocity = nullptr; + Surface_TotalTemperature = nullptr; + Surface_TotalPressure = nullptr; + Surface_PressureDrop = nullptr; + Surface_DC60 = nullptr; + Surface_IDC = nullptr; + Surface_Species_Variance = nullptr; + Surface_Species_0 = nullptr; + + Outlet_MassFlow = nullptr; + Outlet_Density = nullptr; + Outlet_Area = nullptr; + + Surface_Uniformity = nullptr; + Surface_SecondaryStrength = nullptr; + Surface_SecondOverUniform = nullptr; Surface_MomentumDistortion = nullptr; - Surface_IDC_Mach = nullptr; Surface_IDR = nullptr; ActDisk_Mach = nullptr; - ActDisk_Force = nullptr; ActDisk_BCThrust = nullptr; ActDisk_BCThrust_Old = nullptr; + Surface_IDC_Mach = nullptr; + Surface_IDR = nullptr; + ActDisk_Mach = nullptr; + ActDisk_Force = nullptr; + ActDisk_BCThrust = nullptr; + ActDisk_BCThrust_Old = nullptr; /*--- Miscellaneous/unsorted ---*/ - Aeroelastic_plunge = nullptr; - Aeroelastic_pitch = nullptr; + Aeroelastic_plunge = nullptr; + Aeroelastic_pitch = nullptr; - CFL_AdaptParam = nullptr; - CFL = nullptr; - PlaneTag = nullptr; - ParamDV = nullptr; - DV_Value = nullptr; - Design_Variable = nullptr; + CFL_AdaptParam = nullptr; + CFL = nullptr; + PlaneTag = nullptr; + ParamDV = nullptr; + DV_Value = nullptr; + Design_Variable = nullptr; - TimeDOFsADER_DG = nullptr; - TimeIntegrationADER_DG = nullptr; + TimeDOFsADER_DG = nullptr; + TimeIntegrationADER_DG = nullptr; WeightsIntegrationADER_DG = nullptr; - RK_Alpha_Step = nullptr; - MG_CorrecSmooth = nullptr; - MG_PreSmooth = nullptr; - MG_PostSmooth = nullptr; - Int_Coeffs = nullptr; + RK_Alpha_Step = nullptr; + MG_CorrecSmooth = nullptr; + MG_PreSmooth = nullptr; + MG_PostSmooth = nullptr; + Int_Coeffs = nullptr; Kind_Inc_Inlet = nullptr; Kind_Inc_Outlet = nullptr; - Kind_ObjFunc = nullptr; + Kind_ObjFunc = nullptr; Weight_ObjFunc = nullptr; /*--- Species solver pointers. ---*/ - Species_Init = nullptr; - Species_Clipping_Min = nullptr; - Species_Clipping_Max = nullptr; + Species_Init = nullptr; + Species_Clipping_Min = nullptr; + Species_Clipping_Max = nullptr; /*--- Moving mesh pointers ---*/ nKind_SurfaceMovement = 0; Kind_SurfaceMovement = nullptr; - LocationStations = nullptr; - MarkerMotion_Origin = nullptr; - MarkerTranslation_Rate = nullptr; - MarkerRotation_Rate = nullptr; - MarkerPitching_Omega = nullptr; - MarkerPitching_Ampl = nullptr; - MarkerPitching_Phase = nullptr; - MarkerPlunging_Omega = nullptr; - MarkerPlunging_Ampl = nullptr; - RefOriginMoment_X = nullptr; RefOriginMoment_Y = nullptr; RefOriginMoment_Z = nullptr; - MoveMotion_Origin = nullptr; + LocationStations = nullptr; + MarkerMotion_Origin = nullptr; + MarkerTranslation_Rate = nullptr; + MarkerRotation_Rate = nullptr; + MarkerPitching_Omega = nullptr; + MarkerPitching_Ampl = nullptr; + MarkerPitching_Phase = nullptr; + MarkerPlunging_Omega = nullptr; + MarkerPlunging_Ampl = nullptr; + RefOriginMoment_X = nullptr; + RefOriginMoment_Y = nullptr; + RefOriginMoment_Z = nullptr; + MoveMotion_Origin = nullptr; /*--- Periodic BC pointers. ---*/ - Periodic_Translation= nullptr; Periodic_RotAngles = nullptr; Periodic_RotCenter = nullptr; + Periodic_Translation = nullptr; + Periodic_RotAngles = nullptr; + Periodic_RotCenter = nullptr; /* Harmonic Balance Frequency pointer */ @@ -998,35 +1104,35 @@ void CConfig::SetPointersNull() { /*--- Initialize some default arrays to NULL. ---*/ - Riemann_FlowDir = nullptr; - Giles_FlowDir = nullptr; - CoordFFDBox = nullptr; - DegreeFFDBox = nullptr; - FFDTag = nullptr; - nDV_Value = nullptr; - TagFFDBox = nullptr; - - Kind_Data_Riemann = nullptr; - Riemann_Var1 = nullptr; - Riemann_Var2 = nullptr; - Kind_Data_Giles = nullptr; - Giles_Var1 = nullptr; - Giles_Var2 = nullptr; - RelaxFactorAverage = nullptr; - RelaxFactorFourier = nullptr; - nSpan_iZones = nullptr; - Kind_TurboMachinery = nullptr; - - Marker_MixingPlaneInterface = nullptr; - Marker_TurboBoundIn = nullptr; - Marker_TurboBoundOut = nullptr; - Marker_Giles = nullptr; - Marker_Shroud = nullptr; - - nBlades = nullptr; - FreeStreamTurboNormal = nullptr; - - top_optim_kernels = nullptr; + Riemann_FlowDir = nullptr; + Giles_FlowDir = nullptr; + CoordFFDBox = nullptr; + DegreeFFDBox = nullptr; + FFDTag = nullptr; + nDV_Value = nullptr; + TagFFDBox = nullptr; + + Kind_Data_Riemann = nullptr; + Riemann_Var1 = nullptr; + Riemann_Var2 = nullptr; + Kind_Data_Giles = nullptr; + Giles_Var1 = nullptr; + Giles_Var2 = nullptr; + RelaxFactorAverage = nullptr; + RelaxFactorFourier = nullptr; + nSpan_iZones = nullptr; + Kind_TurboMachinery = nullptr; + + Marker_MixingPlaneInterface = nullptr; + Marker_TurboBoundIn = nullptr; + Marker_TurboBoundOut = nullptr; + Marker_Giles = nullptr; + Marker_Shroud = nullptr; + + nBlades = nullptr; + FreeStreamTurboNormal = nullptr; + + top_optim_kernels = nullptr; top_optim_kernel_params = nullptr; top_optim_filter_radius = nullptr; @@ -1039,10 +1145,10 @@ void CConfig::SetPointersNull() { /*--- Variable initialization ---*/ - TimeIter = 0; - InnerIter = 0; + TimeIter = 0; + InnerIter = 0; nIntCoeffs = 0; - OuterIter = 0; + OuterIter = 0; AoA_Offset = 0; AoS_Offset = 0; @@ -1065,11 +1171,9 @@ void CConfig::SetPointersNull() { Total_UnstTimeND = 0.0; Kind_TimeNumScheme = EULER_IMPLICIT; - } void CConfig::SetConfig_Options() { - // This config file is parsed by a number of programs to make it easy to write SU2 // wrapper scripts (in python, go, etc.) so please do // the best you can to follow the established format. It's very hard to parse c++ code @@ -1081,11 +1185,13 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Problem Definition \ingroup Config */ /*--- Options related to problem definition and partitioning ---*/ - /*!\brief SOLVER \n DESCRIPTION: Type of solver \n Options: see \link Solver_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief SOLVER \n DESCRIPTION: Type of solver \n Options: see \link Solver_Map \endlink \n DEFAULT: NONE \ingroup + * Config*/ addEnumOption("SOLVER", Kind_Solver, Solver_Map, MAIN_SOLVER::NONE); /*!\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: NONE \ingroup Config*/ + /*!\brief PHYSICAL_PROBLEM \n DESCRIPTION: Physical governing equations \n Options: see \link Solver_Map \endlink \n + * DEFAULT: NONE \ingroup Config*/ addEnumOption("MULTIZONE_SOLVER", Kind_MZSolver, Multizone_Map, ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL); #ifdef CODI_REVERSE_TYPE const bool discAdjDefault = true; @@ -1093,37 +1199,50 @@ void CConfig::SetConfig_Options() { const bool discAdjDefault = false; #endif /*!\brief MATH_PROBLEM \n DESCRIPTION: Mathematical problem \n Options: DIRECT, ADJOINT \ingroup Config*/ - addMathProblemOption("MATH_PROBLEM", ContinuousAdjoint, false, DiscreteAdjoint, discAdjDefault, Restart_Flow, discAdjDefault); - /*!\brief KIND_TURB_MODEL \n DESCRIPTION: Specify turbulence model \n Options: see \link Turb_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + addMathProblemOption("MATH_PROBLEM", ContinuousAdjoint, false, DiscreteAdjoint, discAdjDefault, Restart_Flow, + discAdjDefault); + /*!\brief KIND_TURB_MODEL \n DESCRIPTION: Specify turbulence model \n Options: see \link Turb_Model_Map \endlink \n + * DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_TURB_MODEL", Kind_Turb_Model, Turb_Model_Map, TURB_MODEL::NONE); - /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SST turbulence model options/corrections. \n Options: see \link SST_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SST turbulence model options/corrections. \n Options: see \link + * SST_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SST_OPTIONS", nSST_Options, SST_Options, SST_Options_Map); - /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link + * SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map); - /*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n + * DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE); - /*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link + * LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("LM_OPTIONS", nLM_Options, LM_Options, LM_Options_Map); /*!\brief HROUGHNESS \n DESCRIPTION: Value of RMS roughness for transition model \n DEFAULT: 1E-6 \ingroup Config*/ addDoubleOption("HROUGHNESS", hRoughness, 1e-6); - /*!\brief KIND_SCALAR_MODEL \n DESCRIPTION: Specify scalar transport model \n Options: see \link Scalar_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_SCALAR_MODEL \n DESCRIPTION: Specify scalar transport model \n Options: see \link Scalar_Model_Map + * \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_SCALAR_MODEL", Kind_Species_Model, Species_Model_Map, SPECIES_MODEL::NONE); - /*!\brief KIND_SGS_MODEL \n DESCRIPTION: Specify subgrid scale model OPTIONS: see \link SGS_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_SGS_MODEL \n DESCRIPTION: Specify subgrid scale model OPTIONS: see \link SGS_Model_Map \endlink \n + * DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_SGS_MODEL", Kind_SGS_Model, SGS_Model_Map, TURB_SGS_MODEL::NONE); - /*!\brief KIND_FEM_DG_SHOCK \n DESCRIPTION: Specify shock capturing method for DG OPTIONS: see \link ShockCapturingDG_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_FEM_DG_SHOCK \n DESCRIPTION: Specify shock capturing method for DG OPTIONS: see \link + * ShockCapturingDG_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_FEM_DG_SHOCK", Kind_FEM_Shock_Capturing_DG, ShockCapturingDG_Map, FEM_SHOCK_CAPTURING_DG::NONE); - /*!\brief KIND_VERIFICATION_SOLUTION \n DESCRIPTION: Specify the verification solution OPTIONS: see \link Verification_Solution_Map \endlink \n DEFAULT: NO_VERIFICATION_SOLUTION \ingroup Config*/ - addEnumOption("KIND_VERIFICATION_SOLUTION", Kind_Verification_Solution, Verification_Solution_Map, VERIFICATION_SOLUTION::NONE); + /*!\brief KIND_VERIFICATION_SOLUTION \n DESCRIPTION: Specify the verification solution OPTIONS: see \link + * Verification_Solution_Map \endlink \n DEFAULT: NO_VERIFICATION_SOLUTION \ingroup Config*/ + addEnumOption("KIND_VERIFICATION_SOLUTION", Kind_Verification_Solution, Verification_Solution_Map, + VERIFICATION_SOLUTION::NONE); - /*!\brief KIND_MATRIX_COLORING \n DESCRIPTION: Specify the method for matrix coloring for Jacobian computations OPTIONS: see \link MatrixColoring_Map \endlink \n DEFAULT GREEDY_COLORING \ingroup Config*/ + /*!\brief KIND_MATRIX_COLORING \n DESCRIPTION: Specify the method for matrix coloring for Jacobian computations + * OPTIONS: see \link MatrixColoring_Map \endlink \n DEFAULT GREEDY_COLORING \ingroup Config*/ addEnumOption("KIND_MATRIX_COLORING", Kind_Matrix_Coloring, MatrixColoring_Map, GREEDY_COLORING); - /*!\brief WEAKLY_COUPLED_HEAT_EQUATION \n DESCRIPTION: Enable heat equation for incompressible flows. \ingroup Config*/ + /*!\brief WEAKLY_COUPLED_HEAT_EQUATION \n DESCRIPTION: Enable heat equation for incompressible flows. \ingroup + * Config*/ addBoolOption("WEAKLY_COUPLED_HEAT_EQUATION", Weakly_Coupled_Heat, NO); /*\brief AXISYMMETRIC \n DESCRIPTION: Axisymmetric simulation \n DEFAULT: false \ingroup Config */ @@ -1134,46 +1253,61 @@ void CConfig::SetConfig_Options() { addBoolOption("VORTICITY_CONFINEMENT", VorticityConfinement, false); /* DESCRIPTION: Apply a body force as a source term (NO, YES) */ addBoolOption("BODY_FORCE", Body_Force, false); - body_force[0] = 0.0; body_force[1] = 0.0; body_force[2] = 0.0; + body_force[0] = 0.0; + body_force[1] = 0.0; + body_force[2] = 0.0; /* DESCRIPTION: Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) */ 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, ENUM_STREAMWISE_PERIODIC::NONE); + /* 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, + 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 */ + /* 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 */ addDoubleOption("STREAMWISE_PERIODIC_OUTLET_HEAT", Streamwise_Periodic_OutletHeat, 0.0); - /* DESCRIPTION: Delta pressure [Pa] on which basis body force will be computed, serves as initial value if MASSFLOW is chosen. \n DEFAULT: 1.0 \ingroup Config */ + /* DESCRIPTION: Delta pressure [Pa] on which basis body force will be computed, serves as initial value if MASSFLOW is + * chosen. \n DEFAULT: 1.0 \ingroup Config */ addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); - /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. \n DEFAULT: 0.0 \ingroup Config */ + /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. \n DEFAULT: 0.0 \ingroup Config */ addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_Periodic_TargetMassFlow, 0.0); - /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ + /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config + */ addBoolOption("RESTART_SOL", Restart, false); /*!\brief BINARY_RESTART \n DESCRIPTION: Read binary SU2 native restart files. \n Options: YES, NO \ingroup Config */ addBoolOption("READ_BINARY_RESTART", Read_Binary_Restart, true); - /*!\brief WRT_RESTART_OVERWRITE \n DESCRIPTION: overwrite restart files or append iteration number. \n Options: YES, NO \ingroup Config */ + /*!\brief WRT_RESTART_OVERWRITE \n DESCRIPTION: overwrite restart files or append iteration number. \n Options: YES, + * NO \ingroup Config */ addBoolOption("WRT_RESTART_OVERWRITE", Wrt_Restart_Overwrite, true); - /*!\brief WRT_SURFACE_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: YES, NO \ingroup Config */ + /*!\brief WRT_SURFACE_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: + * YES, NO \ingroup Config */ addBoolOption("WRT_SURFACE_OVERWRITE", Wrt_Surface_Overwrite, true); - /*!\brief WRT_VOLUME_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: YES, NO \ingroup Config */ + /*!\brief WRT_VOLUME_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: + * YES, NO \ingroup Config */ addBoolOption("WRT_VOLUME_OVERWRITE", Wrt_Volume_Overwrite, true); - /*!\brief SYSTEM_MEASUREMENTS \n DESCRIPTION: System of measurements \n OPTIONS: see \link Measurements_Map \endlink \n DEFAULT: SI \ingroup Config*/ + /*!\brief SYSTEM_MEASUREMENTS \n DESCRIPTION: System of measurements \n OPTIONS: see \link Measurements_Map \endlink + * \n DEFAULT: SI \ingroup Config*/ addEnumOption("SYSTEM_MEASUREMENTS", SystemMeasurements, Measurements_Map, SI); /*!\par CONFIG_CATEGORY: FluidModel \ingroup Config*/ - /*!\brief FLUID_MODEL \n DESCRIPTION: Fluid model \n OPTIONS: See \link FluidModel_Map \endlink \n DEFAULT: STANDARD_AIR \ingroup Config*/ + /*!\brief FLUID_MODEL \n DESCRIPTION: Fluid model \n OPTIONS: See \link FluidModel_Map \endlink \n DEFAULT: + * STANDARD_AIR \ingroup Config*/ addEnumOption("FLUID_MODEL", Kind_FluidModel, FluidModel_Map, STANDARD_AIR); - /*!\brief FLUID_NAME \n DESCRIPTION: Fluid name \n OPTIONS: see coolprop homepage \n DEFAULT: nitrogen \ingroup Config*/ + /*!\brief FLUID_NAME \n DESCRIPTION: Fluid name \n OPTIONS: see coolprop homepage \n DEFAULT: nitrogen \ingroup + * Config*/ addStringOption("FLUID_NAME", FluidName, string("nitrogen")); /*!\par CONFIG_CATEGORY: Data-driven fluid model parameters \ingroup Config*/ - /*!\brief INTERPOLATION_METHOD \n DESCRIPTION: Interpolation method used to determine the thermodynamic state of the fluid. \n OPTIONS: See \link DataDrivenMethod_Map \endlink DEFAULT: MLP \ingroup Config*/ - addEnumOption("INTERPOLATION_METHOD",Kind_DataDriven_Method, DataDrivenMethod_Map, ENUM_DATADRIVEN_METHOD::LUT); + /*!\brief INTERPOLATION_METHOD \n DESCRIPTION: Interpolation method used to determine the thermodynamic state of the + * fluid. \n OPTIONS: See \link DataDrivenMethod_Map \endlink DEFAULT: MLP \ingroup Config*/ + addEnumOption("INTERPOLATION_METHOD", Kind_DataDriven_Method, DataDrivenMethod_Map, ENUM_DATADRIVEN_METHOD::LUT); /*!\brief FILENAME_INTERPOLATOR \n DESCRIPTION: Input file for the interpolation method. \n \ingroup Config*/ addStringListOption("FILENAMES_INTERPOLATOR", n_Datadriven_files, DataDriven_Method_FileNames); - /*!\brief DATADRIVEN_NEWTON_RELAXATION \n DESCRIPTION: Relaxation factor for Newton solvers in data-driven fluid model. \n \ingroup Config*/ + /*!\brief DATADRIVEN_NEWTON_RELAXATION \n DESCRIPTION: Relaxation factor for Newton solvers in data-driven fluid + * model. \n \ingroup Config*/ addDoubleOption("DATADRIVEN_NEWTON_RELAXATION", DataDriven_Relaxation_Factor, 0.05); /*!\brief CONFINEMENT_PARAM \n DESCRIPTION: Input Confinement Parameter for Vorticity Confinement*/ @@ -1182,17 +1316,23 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Freestream Conditions \ingroup Config*/ /*--- Options related to freestream specification ---*/ - /*!\brief GAS_CONSTANT \n DESCRIPTION: Specific gas constant (287.058 J/kg*K (air), only for compressible flows) \ingroup Config*/ + /*!\brief GAS_CONSTANT \n DESCRIPTION: Specific gas constant (287.058 J/kg*K (air), only for compressible flows) + * \ingroup Config*/ addDoubleOption("GAS_CONSTANT", Gas_Constant, 287.058); - /*!\brief GAMMA_VALUE \n DESCRIPTION: Ratio of specific heats (1.4 (air), only for compressible flows) \ingroup Config*/ + /*!\brief GAMMA_VALUE \n DESCRIPTION: Ratio of specific heats (1.4 (air), only for compressible flows) \ingroup + * Config*/ addDoubleOption("GAMMA_VALUE", Gamma, 1.4); - /*!\brief THERMODYNAMIC_PRESSURE \n DESCRIPTION: Thermodynamics(operating) Pressure (101325 Pa), only for incompressible flows) \ingroup Config*/ + /*!\brief THERMODYNAMIC_PRESSURE \n DESCRIPTION: Thermodynamics(operating) Pressure (101325 Pa), only for + * incompressible flows) \ingroup Config*/ addDoubleOption("THERMODYNAMIC_PRESSURE", Pressure_Thermodynamic, 101325.0); - /*!\brief CP_VALUE \n DESCRIPTION: Specific heat at constant pressure, Cp (1004.703 J/kg*K (air), constant density incompressible fluids only) \ingroup Config*/ + /*!\brief CP_VALUE \n DESCRIPTION: Specific heat at constant pressure, Cp (1004.703 J/kg*K (air), constant density + * incompressible fluids only) \ingroup Config*/ addDoubleListOption("SPECIFIC_HEAT_CP", nSpecific_Heat_Cp, Specific_Heat_Cp); - /*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/ + /*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for + * Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/ addDoubleOption("THERMAL_EXPANSION_COEFF", Thermal_Expansion_Coeff, 0.00347); - /*!\brief MOLECULAR_WEIGHT \n DESCRIPTION: Molecular weight for an incompressible ideal gas (28.96 g/mol (air) default) \ingroup Config*/ + /*!\brief MOLECULAR_WEIGHT \n DESCRIPTION: Molecular weight for an incompressible ideal gas (28.96 g/mol (air) + * default) \ingroup Config*/ addDoubleListOption("MOLECULAR_WEIGHT", nMolecular_Weight, Molecular_Weight); ///* DESCRIPTION: Specify if Mutation++ library is used */ @@ -1205,7 +1345,8 @@ void CConfig::SetConfig_Options() { addDoubleListOption("GAS_COMPOSITION", nSpecies, Gas_Composition); /* DESCRIPTION: Specify mass fraction of each species for NEMO inlet*/ addDoubleListOption("INLET_GAS_COMPOSITION", nSpecies_inlet, Inlet_MassFrac); - /*!\brief INLET_TEMPERATURE_VE \n DESCRIPTION: NEMO inlet temperature_ve (K), if left 0 K, set to Ttr value \ingroup Config*/ + /*!\brief INLET_TEMPERATURE_VE \n DESCRIPTION: NEMO inlet temperature_ve (K), if left 0 K, set to Ttr value \ingroup + * Config*/ addDoubleOption("INLET_TEMPERATURE_VE", Inlet_Temperature_ve, 0.0); /* DESCRIPTION: Specify if mixture is frozen */ addBoolOption("FROZEN_MIXTURE", frozen, false); @@ -1221,7 +1362,8 @@ void CConfig::SetConfig_Options() { addDoubleListOption("SUPERCATALYTIC_WALL_COMPOSITION", nSpecies_Cat_Wall, Supercatalytic_Wall_Composition); /* DESCRIPTION: Specfify catalytic efficiency of wall if using gamma model */ addDoubleOption("CATALYTIC_EFFICIENCY", CatalyticEfficiency, 1.0); - /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/ + /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients + * \ingroup Config*/ /*--- Options related to VAN der WAALS MODEL and PENG ROBINSON ---*/ @@ -1234,10 +1376,11 @@ void CConfig::SetConfig_Options() { /*--- Options related to VAN der WAALS MODEL and PENG ROBINSON ---*/ /* DESCRIPTION: Critical Density, default value for MDM */ - addDoubleOption("ACENTRIC_FACTOR", Acentric_Factor, 0.035); + addDoubleOption("ACENTRIC_FACTOR", Acentric_Factor, 0.035); - /*--- Options related to Viscosity Model ---*/ - /*!\brief VISCOSITY_MODEL \n DESCRIPTION: model of the viscosity \n OPTIONS: See \link ViscosityModel_Map \endlink \n DEFAULT: SUTHERLAND \ingroup Config*/ + /*--- Options related to Viscosity Model ---*/ + /*!\brief VISCOSITY_MODEL \n DESCRIPTION: model of the viscosity \n OPTIONS: See \link ViscosityModel_Map \endlink \n + * DEFAULT: SUTHERLAND \ingroup Config*/ addEnumOption("VISCOSITY_MODEL", Kind_ViscosityModel, ViscosityModel_Map, VISCOSITYMODEL::SUTHERLAND); /*--- Options related to Constant Viscosity Model ---*/ @@ -1255,20 +1398,24 @@ void CConfig::SetConfig_Options() { addDoubleListOption("SUTHERLAND_CONSTANT", nMu_S, Mu_S); /*--- Options related to Viscosity Model ---*/ - /*!\brief MIXINGVISCOSITY_MODEL \n DESCRIPTION: Mixing model of the viscosity \n OPTIONS: See \link ViscosityModel_Map \endlink \n DEFAULT: DAVIDSON \ingroup Config*/ - addEnumOption("MIXING_VISCOSITY_MODEL", Kind_MixingViscosityModel, MixingViscosityModel_Map, MIXINGVISCOSITYMODEL::DAVIDSON); + /*!\brief MIXINGVISCOSITY_MODEL \n DESCRIPTION: Mixing model of the viscosity \n OPTIONS: See \link ViscosityModel_Map + * \endlink \n DEFAULT: DAVIDSON \ingroup Config*/ + addEnumOption("MIXING_VISCOSITY_MODEL", Kind_MixingViscosityModel, MixingViscosityModel_Map, + MIXINGVISCOSITYMODEL::DAVIDSON); /*--- Options related to Thermal Conductivity Model ---*/ - addEnumOption("CONDUCTIVITY_MODEL", Kind_ConductivityModel, ConductivityModel_Map, CONDUCTIVITYMODEL::CONSTANT_PRANDTL); + addEnumOption("CONDUCTIVITY_MODEL", Kind_ConductivityModel, ConductivityModel_Map, + CONDUCTIVITYMODEL::CONSTANT_PRANDTL); /* DESCRIPTION: Definition of the turbulent thermal conductivity model (CONSTANT_PRANDTL_TURB (default), NONE). */ - addEnumOption("TURBULENT_CONDUCTIVITY_MODEL", Kind_ConductivityModel_Turb, TurbConductivityModel_Map, CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL); + addEnumOption("TURBULENT_CONDUCTIVITY_MODEL", Kind_ConductivityModel_Turb, TurbConductivityModel_Map, + CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL); - /*--- Options related to Constant Thermal Conductivity Model ---*/ + /*--- Options related to Constant Thermal Conductivity Model ---*/ - /* DESCRIPTION: default value for AIR */ - addDoubleListOption("THERMAL_CONDUCTIVITY_CONSTANT", nThermal_Conductivity_Constant , Thermal_Conductivity_Constant); + /* DESCRIPTION: default value for AIR */ + addDoubleListOption("THERMAL_CONDUCTIVITY_CONSTANT", nThermal_Conductivity_Constant, Thermal_Conductivity_Constant); /*--- Options related to temperature polynomial coefficients for fluid models. ---*/ @@ -1279,24 +1426,31 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Definition of the temperature polynomial coefficients for specific heat Cp. */ addDoubleArrayOption("KT_POLYCOEFFS", N_POLY_COEFFS, kt_polycoeffs.data()); - /*!\brief REYNOLDS_NUMBER \n DESCRIPTION: Reynolds number (non-dimensional, based on the free-stream values). Needed for viscous solvers. For incompressible solvers the Reynolds length will always be 1.0 \n DEFAULT: 0.0 \ingroup Config */ + /*!\brief REYNOLDS_NUMBER \n DESCRIPTION: Reynolds number (non-dimensional, based on the free-stream values). Needed + * for viscous solvers. For incompressible solvers the Reynolds length will always be 1.0 \n DEFAULT: 0.0 \ingroup + * Config */ addDoubleOption("REYNOLDS_NUMBER", Reynolds, 0.0); - /*!\brief REYNOLDS_LENGTH \n DESCRIPTION: Reynolds length (1 m by default). Used for compressible solver: incompressible solver will use 1.0. \ingroup Config */ + /*!\brief REYNOLDS_LENGTH \n DESCRIPTION: Reynolds length (1 m by default). Used for compressible solver: + * incompressible solver will use 1.0. \ingroup Config */ addDoubleOption("REYNOLDS_LENGTH", Length_Reynolds, 1.0); - /*!\brief PRANDTL_LAM \n DESCRIPTION: Laminar Prandtl number (0.72 (air), only for compressible flows) \n DEFAULT: 0.72 \ingroup Config*/ - addDoubleListOption("PRANDTL_LAM", nPrandtl_Lam , Prandtl_Lam); - /*!\brief PRANDTL_TURB \n DESCRIPTION: Turbulent Prandtl number (0.9 (air), only for compressible flows) \n DEFAULT 0.90 \ingroup Config*/ - addDoubleListOption("PRANDTL_TURB", nPrandtl_Turb , Prandtl_Turb); + /*!\brief PRANDTL_LAM \n DESCRIPTION: Laminar Prandtl number (0.72 (air), only for compressible flows) \n DEFAULT: + * 0.72 \ingroup Config*/ + addDoubleListOption("PRANDTL_LAM", nPrandtl_Lam, Prandtl_Lam); + /*!\brief PRANDTL_TURB \n DESCRIPTION: Turbulent Prandtl number (0.9 (air), only for compressible flows) \n DEFAULT + * 0.90 \ingroup Config*/ + addDoubleListOption("PRANDTL_TURB", nPrandtl_Turb, Prandtl_Turb); /*--- Options related to wall models. ---*/ - /*!\brief WALLMODEL_KAPPA \n DESCRIPTION: von Karman constant used for the wall model \n DEFAULT 0.41 \ingroup Config*/ + /*!\brief WALLMODEL_KAPPA \n DESCRIPTION: von Karman constant used for the wall model \n DEFAULT 0.41 \ingroup + * Config*/ addDoubleOption("WALLMODEL_KAPPA", wallModel_Kappa, 0.41); /*!\brief WALLMODEL_MAXITER \n DESCRIPTION: Max iterations used for the wall model \n DEFAULT 200 \ingroup Config*/ addUnsignedShortOption("WALLMODEL_MAXITER", wallModel_MaxIter, 200); /*!\brief WALLMODEL_RELFAC \n DESCRIPTION: Relaxation factor used for the wall model \n DEFAULT 0.5 \ingroup Config*/ addDoubleOption("WALLMODEL_RELFAC", wallModel_RelFac, 0.5); - /*!\brief WALLMODEL_MINYPLUS \n DESCRIPTION: lower limit for Y+ used for the wall model \n DEFAULT 5.0 \ingroup Config*/ + /*!\brief WALLMODEL_MINYPLUS \n DESCRIPTION: lower limit for Y+ used for the wall model \n DEFAULT 5.0 \ingroup + * Config*/ addDoubleOption("WALLMODEL_MINYPLUS", wallModel_MinYplus, 5.0); /*!\brief WALLMODEL_B \n DESCRIPTION: constant B used for the wall model \n DEFAULT 5.5 \ingroup Config*/ addDoubleOption("WALLMODEL_B", wallModel_B, 5.5); @@ -1305,55 +1459,70 @@ void CConfig::SetConfig_Options() { addDoubleOption("BULK_MODULUS", Bulk_Modulus, 1.42E5); /* DESCRIPTION: Epsilon^2 multipier in Beta calculation for incompressible preconditioner. */ addDoubleOption("BETA_FACTOR", Beta_Factor, 4.1); - /*!\brief MACH_NUMBER \n DESCRIPTION: Mach number (non-dimensional, based on the free-stream values). 0.0 by default \ingroup Config*/ + /*!\brief MACH_NUMBER \n DESCRIPTION: Mach number (non-dimensional, based on the free-stream values). 0.0 by default + * \ingroup Config*/ addDoubleOption("MACH_NUMBER", Mach, 0.0); - /*!\brief INIT_OPTION \n DESCRIPTION: Init option to choose between Reynolds or thermodynamics quantities for initializing the solution \n OPTIONS: see \link InitOption_Map \endlink \n DEFAULT REYNOLDS \ingroup Config*/ + /*!\brief INIT_OPTION \n DESCRIPTION: Init option to choose between Reynolds or thermodynamics quantities for + * initializing the solution \n OPTIONS: see \link InitOption_Map \endlink \n DEFAULT REYNOLDS \ingroup Config*/ addEnumOption("INIT_OPTION", Kind_InitOption, InitOption_Map, REYNOLDS); /* DESCRIPTION: Free-stream option to choose between density and temperature for initializing the solution */ addEnumOption("FREESTREAM_OPTION", Kind_FreeStreamOption, FreeStreamOption_Map, FREESTREAM_OPTION::TEMPERATURE_FS); /*!\brief FREESTREAM_PRESSURE\n DESCRIPTION: Free-stream pressure (101325.0 N/m^2 by default) \ingroup Config*/ addDoubleOption("FREESTREAM_PRESSURE", Pressure_FreeStream, 101325.0); - /*!\brief FREESTREAM_DENSITY\n DESCRIPTION: Free-stream density (1.2886 Kg/m^3 (air), 998.2 Kg/m^3 (water)) \n DEFAULT -1.0 (calculated from others) \ingroup Config*/ + /*!\brief FREESTREAM_DENSITY\n DESCRIPTION: Free-stream density (1.2886 Kg/m^3 (air), 998.2 Kg/m^3 (water)) \n DEFAULT + * -1.0 (calculated from others) \ingroup Config*/ addDoubleOption("FREESTREAM_DENSITY", Density_FreeStream, -1.0); /*!\brief FREESTREAM_TEMPERATURE\n DESCRIPTION: Free-stream temperature (288.15 K by default) \ingroup Config*/ addDoubleOption("FREESTREAM_TEMPERATURE", Temperature_FreeStream, 288.15); - /*!\brief FREESTREAM_TEMPERATURE_VE\n DESCRIPTION: Free-stream vibrational-electronic temperature (288.15 K by default) \ingroup Config*/ + /*!\brief FREESTREAM_TEMPERATURE_VE\n DESCRIPTION: Free-stream vibrational-electronic temperature (288.15 K by + * default) \ingroup Config*/ addDoubleOption("FREESTREAM_TEMPERATURE_VE", Temperature_ve_FreeStream, 288.15); - /*--- 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, INC_DENSITYMODEL::CONSTANT); - /*!\brief ENERGY_EQUATION \n DESCRIPTION: Solve the energy equation in the incompressible flow solver. \ingroup Config*/ + /*!\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*/ addDoubleOption("INC_DENSITY_REF", Inc_Density_Ref, 1.0); - /*!\brief INC_VELOCITY_REF \n DESCRIPTION: Reference velocity for incompressible flows (1.0 by default) \ingroup Config*/ + /*!\brief INC_VELOCITY_REF \n DESCRIPTION: Reference velocity for incompressible flows (1.0 by default) \ingroup + * Config*/ addDoubleOption("INC_VELOCITY_REF", Inc_Velocity_Ref, 1.0); - /*!\brief INC_TEMPERATURE_REF \n DESCRIPTION: Reference temperature for incompressible flows with the energy equation (1.0 by default) \ingroup Config*/ + /*!\brief INC_TEMPERATURE_REF \n DESCRIPTION: Reference temperature for incompressible flows with the energy equation + * (1.0 by default) \ingroup Config*/ addDoubleOption("INC_TEMPERATURE_REF", Inc_Temperature_Ref, 1.0); - /*!\brief INC_DENSITY_INIT \n DESCRIPTION: Initial density for incompressible flows (1.2886 kg/m^3 by default) \ingroup Config*/ + /*!\brief INC_DENSITY_INIT \n DESCRIPTION: Initial density for incompressible flows (1.2886 kg/m^3 by default) + * \ingroup Config*/ addDoubleOption("INC_DENSITY_INIT", Inc_Density_Init, 1.2886); - /*!\brief INC_VELOCITY_INIT \n DESCRIPTION: Initial velocity for incompressible flows (1.0,0,0 m/s by default) \ingroup Config*/ - vel_init[0] = 1.0; vel_init[1] = 0.0; vel_init[2] = 0.0; + /*!\brief INC_VELOCITY_INIT \n DESCRIPTION: Initial velocity for incompressible flows (1.0,0,0 m/s by default) + * \ingroup Config*/ + vel_init[0] = 1.0; + vel_init[1] = 0.0; + vel_init[2] = 0.0; addDoubleArrayOption("INC_VELOCITY_INIT", 3, vel_init); - /*!\brief INC_TEMPERATURE_INIT \n DESCRIPTION: Initial temperature for incompressible flows with the energy equation (288.15 K by default) \ingroup Config*/ + /*!\brief INC_TEMPERATURE_INIT \n DESCRIPTION: Initial temperature for incompressible flows with the energy equation + * (288.15 K by default) \ingroup Config*/ addDoubleOption("INC_TEMPERATURE_INIT", Inc_Temperature_Init, 288.15); /*!\brief INC_NONDIM \n DESCRIPTION: Non-dimensionalization scheme for incompressible flows. \ingroup Config*/ addEnumOption("INC_NONDIM", Ref_Inc_NonDim, NonDim_Map, INITIAL_VALUES); - /*!\brief INC_INLET_USENORMAL \n DESCRIPTION: Use the local boundary normal for the flow direction with the incompressible pressure inlet. \ingroup Config*/ + /*!\brief INC_INLET_USENORMAL \n DESCRIPTION: Use the local boundary normal for the flow direction with the + * incompressible pressure inlet. \ingroup Config*/ addBoolOption("INC_INLET_USENORMAL", Inc_Inlet_UseNormal, false); - /*!\brief INC_INLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the velocity at a pressure inlet in incompressible flow (0.1 by default). \ingroup Config*/ + /*!\brief INC_INLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the velocity at a + * pressure inlet in incompressible flow (0.1 by default). \ingroup Config*/ addDoubleOption("INC_INLET_DAMPING", Inc_Inlet_Damping, 0.1); - /*!\brief INC_OUTLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the pressure at a mass flow outlet in incompressible flow (0.1 by default). \ingroup Config*/ + /*!\brief INC_OUTLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the pressure at a mass + * flow outlet in incompressible flow (0.1 by default). \ingroup Config*/ addDoubleOption("INC_OUTLET_DAMPING", Inc_Outlet_Damping, 0.1); /*--- Options related to the species solver. ---*/ /*!\brief SPECIES_INIT \n DESCRIPTION: Initial values for scalar transport \ingroup Config*/ addDoubleListOption("SPECIES_INIT", nSpecies_Init, Species_Init); - /*!\brief SPECIES_CLIPPING \n DESCRIPTION: Activate clipping for scalar transport equations \n DEFAULT: false \ingroup Config*/ + /*!\brief SPECIES_CLIPPING \n DESCRIPTION: Activate clipping for scalar transport equations \n DEFAULT: false \ingroup + * Config*/ addBoolOption("SPECIES_CLIPPING", Species_Clipping, false); /*!\brief SPECIES_CLIPPING_MAX \n DESCRIPTION: Maximum values for scalar clipping \ingroup Config*/ addDoubleListOption("SPECIES_CLIPPING_MAX", nSpecies_Clipping_Max, Species_Clipping_Max); @@ -1362,27 +1531,38 @@ void CConfig::SetConfig_Options() { /*!\brief FLAME_INIT \n DESCRIPTION: flame initialization using the flamelet model \ingroup Config*/ /*--- flame offset (x,y,z) ---*/ - flame_init[0] = 0.0; flame_init[1] = 0.0; flame_init[2] = 0.0; + flame_init[0] = 0.0; + flame_init[1] = 0.0; + flame_init[2] = 0.0; /*--- flame normal (nx, ny, nz) ---*/ - flame_init[3] = 1.0; flame_init[4] = 0.0; flame_init[5] = 0.0; + flame_init[3] = 1.0; + flame_init[4] = 0.0; + flame_init[5] = 0.0; /*--- flame thickness (x) and flame burnt thickness (after this thickness, we have unburnt conditions again) ---*/ - flame_init[6] = 0.5e-3; flame_init[7] = 1.0; - addDoubleArrayOption("FLAME_INIT", 8,flame_init); + flame_init[6] = 0.5e-3; + flame_init[7] = 1.0; + addDoubleArrayOption("FLAME_INIT", 8, flame_init); /*--- Options related to mass diffusivity and thereby the species solver. ---*/ /*!\brief DIFFUSIVITY_MODEL\n DESCRIPTION: mass diffusivity model \n DEFAULT constant disffusivity \ingroup Config*/ - addEnumOption("DIFFUSIVITY_MODEL", Kind_Diffusivity_Model, Diffusivity_Model_Map, DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY); - /*!\brief DIFFUSIVITY_CONSTANT\n DESCRIPTION: mass diffusivity if DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY is chosen \n DEFAULT 0.001 (Air) \ingroup Config*/ - addDoubleOption("DIFFUSIVITY_CONSTANT", Diffusivity_Constant , 0.001); - /*!\brief SCHMIDT_LAM \n DESCRIPTION: Laminar Schmidt number of mass diffusion \n DEFAULT 1.0 (~for Gases) \ingroup Config*/ + addEnumOption("DIFFUSIVITY_MODEL", Kind_Diffusivity_Model, Diffusivity_Model_Map, + DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY); + /*!\brief DIFFUSIVITY_CONSTANT\n DESCRIPTION: mass diffusivity if DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY is chosen \n + * DEFAULT 0.001 (Air) \ingroup Config*/ + addDoubleOption("DIFFUSIVITY_CONSTANT", Diffusivity_Constant, 0.001); + /*!\brief SCHMIDT_LAM \n DESCRIPTION: Laminar Schmidt number of mass diffusion \n DEFAULT 1.0 (~for Gases) \ingroup + * Config*/ addDoubleOption("SCHMIDT_NUMBER_LAMINAR", Schmidt_Number_Laminar, 1.0); - /*!\brief SCHMIDT_TURB \n DESCRIPTION: Turbulent Schmidt number of mass diffusion \n DEFAULT 0.70 (more or less experimental value) \ingroup Config*/ + /*!\brief SCHMIDT_TURB \n DESCRIPTION: Turbulent Schmidt number of mass diffusion \n DEFAULT 0.70 (more or less + * experimental value) \ingroup Config*/ addDoubleOption("SCHMIDT_NUMBER_TURBULENT", Schmidt_Number_Turbulent, 0.7); /*!\brief DESCRIPTION: Constant Lewis number for mass diffusion */ addDoubleListOption("CONSTANT_LEWIS_NUMBER", nConstant_Lewis_Number, Constant_Lewis_Number); - vel_inf[0] = 1.0; vel_inf[1] = 0.0; vel_inf[2] = 0.0; + vel_inf[0] = 1.0; + vel_inf[1] = 0.0; + vel_inf[2] = 0.0; /*!\brief FREESTREAM_VELOCITY\n DESCRIPTION: Free-stream velocity (m/s) */ addDoubleArrayOption("FREESTREAM_VELOCITY", 3, vel_inf); /* DESCRIPTION: Free-stream viscosity (1.853E-5 Ns/m^2 (air), 0.798E-3 Ns/m^2 (water)) */ @@ -1428,11 +1608,10 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Number of times Alpha is updated in a fix CL problem. */ addUnsignedLongOption("UPDATE_BCTHRUST", Update_BCThrust, 5); - /*!\par CONFIG_CATEGORY: Reference Conditions \ingroup Config*/ /*--- Options related to reference values for nondimensionalization ---*/ - Length_Ref = 1.0; //<---- NOTE: this should be given an option or set as a const + Length_Ref = 1.0; //<---- NOTE: this should be given an option or set as a const /*!\brief REF_ORIGIN_MOMENT_X\n DESCRIPTION: X Reference origin for moment computation \ingroup Config*/ addDoubleListOption("REF_ORIGIN_MOMENT_X", nRefOriginMoment_X, RefOriginMoment_X); @@ -1440,11 +1619,13 @@ void CConfig::SetConfig_Options() { addDoubleListOption("REF_ORIGIN_MOMENT_Y", nRefOriginMoment_Y, RefOriginMoment_Y); /*!\brief REF_ORIGIN_MOMENT_Z\n DESCRIPTION: Z Reference origin for moment computation \ingroup Config*/ addDoubleListOption("REF_ORIGIN_MOMENT_Z", nRefOriginMoment_Z, RefOriginMoment_Z); - /*!\brief REF_AREA\n DESCRIPTION: Reference area for force coefficients (0 implies automatic calculation) \ingroup Config*/ + /*!\brief REF_AREA\n DESCRIPTION: Reference area for force coefficients (0 implies automatic calculation) \ingroup + * Config*/ addDoubleOption("REF_AREA", RefArea, 1.0); /*!\brief SEMI_SPAN\n DESCRIPTION: Wing semi-span (0 implies automatic calculation) \ingroup Config*/ addDoubleOption("SEMI_SPAN", SemiSpan, 0.0); - /*!\brief REF_LENGTH\n DESCRIPTION: Reference length for pitching, rolling, and yawing non-dimensional moment \ingroup Config*/ + /*!\brief REF_LENGTH\n DESCRIPTION: Reference length for pitching, rolling, and yawing non-dimensional moment \ingroup + * Config*/ addDoubleOption("REF_LENGTH", RefLength, 1.0); /*!\brief REF_SHARP_EDGES\n DESCRIPTION: Reference coefficient for detecting sharp edges \ingroup Config*/ addDoubleOption("REF_SHARP_EDGES", RefSharpEdges, 3.0); @@ -1459,18 +1640,22 @@ void CConfig::SetConfig_Options() { /*--- Options related to various boundary markers ---*/ /*!\brief HTP_AXIS\n DESCRIPTION: Location of the HTP axis*/ - //htp_axis[0] = 0.0; htp_axis[1] = 0.0; - //addDoubleArrayOption("HTP_AXIS", 2, htp_axis); + // htp_axis[0] = 0.0; htp_axis[1] = 0.0; + // addDoubleArrayOption("HTP_AXIS", 2, htp_axis); /*!\brief MARKER_PLOTTING\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/ addStringListOption("MARKER_PLOTTING", nMarker_Plotting, Marker_Plotting); - /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/ + /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients + * \ingroup Config*/ addStringListOption("MARKER_MONITORING", nMarker_Monitoring, Marker_Monitoring); - /*!\brief MARKER_CONTROL_VOLUME\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/ + /*!\brief MARKER_CONTROL_VOLUME\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup + * Config*/ addStringListOption("MARKER_ANALYZE", nMarker_Analyze, Marker_Analyze); - /*!\brief MARKER_DESIGNING\n DESCRIPTION: Marker(s) of the surface where objective function (design problem) will be evaluated \ingroup Config*/ + /*!\brief MARKER_DESIGNING\n DESCRIPTION: Marker(s) of the surface where objective function (design problem) will be + * evaluated \ingroup Config*/ addStringListOption("MARKER_DESIGNING", nMarker_Designing, Marker_Designing); - /*!\brief GEO_MARKER\n DESCRIPTION: Marker(s) of the surface where evaluate the geometrical functions \ingroup Config*/ + /*!\brief GEO_MARKER\n DESCRIPTION: Marker(s) of the surface where evaluate the geometrical functions \ingroup + * Config*/ addStringListOption("GEO_MARKER", nMarker_GeoEval, Marker_GeoEval); /*!\brief MARKER_EULER\n DESCRIPTION: Euler wall boundary marker(s) \ingroup Config*/ addStringListOption("MARKER_EULER", nMarker_Euler, Marker_Euler); @@ -1500,37 +1685,41 @@ void CConfig::SetConfig_Options() { Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) */ - addPeriodicOption("MARKER_PERIODIC", nMarker_PerBound, Marker_PerBound, Marker_PerDonor, - Periodic_RotCenter, Periodic_RotAngles, Periodic_Translation); + addPeriodicOption("MARKER_PERIODIC", nMarker_PerBound, Marker_PerBound, Marker_PerDonor, Periodic_RotCenter, + Periodic_RotAngles, Periodic_Translation); /*!\brief MARKER_PYTHON_CUSTOM\n DESCRIPTION: Python customizable marker(s) \ingroup Config*/ addStringListOption("MARKER_PYTHON_CUSTOM", nMarker_PyCustom, Marker_PyCustom); /*!\brief MARKER_WALL_FUNCTIONS\n DESCRIPTION: Viscous wall markers for which wall functions must be applied. Format: (Wall function marker, wall function type, ...) \ingroup Config*/ - addWallFunctionOption("MARKER_WALL_FUNCTIONS", nMarker_WallFunctions, Marker_WallFunctions, - Kind_WallFunctions, IntInfo_WallFunctions, DoubleInfo_WallFunctions); + addWallFunctionOption("MARKER_WALL_FUNCTIONS", nMarker_WallFunctions, Marker_WallFunctions, Kind_WallFunctions, + IntInfo_WallFunctions, DoubleInfo_WallFunctions); /*!\brief MARKER_STRONG_BC\n DESCRIPTION: Markers where a strong BC must be applied.*/ addStringListOption("MARKER_SPECIES_STRONG_BC", nMarker_StrongBC, Marker_StrongBC); - /*!\brief ACTDISK_TYPE \n DESCRIPTION: Actuator Disk boundary type \n OPTIONS: see \link ActDisk_Map \endlink \n Default: VARIABLES_JUMP \ingroup Config*/ + /*!\brief ACTDISK_TYPE \n DESCRIPTION: Actuator Disk boundary type \n OPTIONS: see \link ActDisk_Map \endlink \n + * Default: VARIABLES_JUMP \ingroup Config*/ addEnumOption("ACTDISK_TYPE", Kind_ActDisk, ActDisk_Map, VARIABLES_JUMP); /*!\brief MARKER_ACTDISK\n DESCRIPTION: \ingroup Config*/ - addActDiskOption("MARKER_ACTDISK", - nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, - ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); + addActDiskOption("MARKER_ACTDISK", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, + Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); - /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/ + /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: + * actdiskinput.dat \ingroup Config*/ 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*/ + /*!\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, 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*/ + /*!\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*/ + /*!\brief INLET_FILENAME \n DESCRIPTION: Input file for a specified inlet profile (w/ extension) \n DEFAULT: inlet.dat + * \ingroup Config*/ addStringOption("INLET_FILENAME", Inlet_Filename, string("inlet.dat")); /*!\brief INLET_MATCHING_TOLERANCE * \n DESCRIPTION: If a file is provided to specify the inlet profile, @@ -1547,22 +1736,29 @@ void CConfig::SetConfig_Options() { addInletOption("MARKER_INLET", nMarker_Inlet, Marker_Inlet, Inlet_Ttotal, Inlet_Ptotal, Inlet_FlowDir); /*!\brief MARKER_INLET_SPECIES \n DESCRIPTION: Inlet Species boundary marker(s) with the following format Inlet Species: (inlet_marker, Species1, Species2, ..., SpeciesN-1, inlet_marker2, Species1, Species2, ...) */ - addInletSpeciesOption("MARKER_INLET_SPECIES",nMarker_Inlet_Species, Marker_Inlet_Species, Inlet_SpeciesVal, nSpecies_per_Inlet); + addInletSpeciesOption("MARKER_INLET_SPECIES", nMarker_Inlet_Species, Marker_Inlet_Species, Inlet_SpeciesVal, + nSpecies_per_Inlet); /*!\brief MARKER_INLET_TURBULENT \n DESCRIPTION: Inlet Turbulence boundary marker(s) with the following format Inlet Turbulent: (inlet_marker, TurbulentIntensity1, ViscosityRatio1, inlet_marker2, TurbulentIntensity2, ViscosityRatio2, ...) */ addInletTurbOption("MARKER_INLET_TURBULENT", nMarker_Inlet_Turb, Marker_Inlet_Turb, Inlet_TurbVal, nTurb_Properties); /*!\brief MARKER_RIEMANN \n DESCRIPTION: Riemann boundary marker(s) with the following formats, a unit vector. - * \n OPTIONS: See \link Riemann_Map \endlink. The variables indicated by the option and the flow direction unit vector must be specified. \ingroup Config*/ - addRiemannOption("MARKER_RIEMANN", nMarker_Riemann, Marker_Riemann, Kind_Data_Riemann, Riemann_Map, Riemann_Var1, Riemann_Var2, Riemann_FlowDir); + * \n OPTIONS: See \link Riemann_Map \endlink. The variables indicated by the option and the flow direction unit + * vector must be specified. \ingroup Config*/ + addRiemannOption("MARKER_RIEMANN", nMarker_Riemann, Marker_Riemann, Kind_Data_Riemann, Riemann_Map, Riemann_Var1, + Riemann_Var2, Riemann_FlowDir); /*!\brief MARKER_GILES \n DESCRIPTION: Giles boundary marker(s) with the following formats, a unit vector. */ - /* \n OPTIONS: See \link Giles_Map \endlink. The variables indicated by the option and the flow direction unit vector must be specified. \ingroup Config*/ - addGilesOption("MARKER_GILES", nMarker_Giles, Marker_Giles, Kind_Data_Giles, Giles_Map, Giles_Var1, Giles_Var2, Giles_FlowDir, RelaxFactorAverage, RelaxFactorFourier); + /* \n OPTIONS: See \link Giles_Map \endlink. The variables indicated by the option and the flow direction unit vector + * must be specified. \ingroup Config*/ + addGilesOption("MARKER_GILES", nMarker_Giles, Marker_Giles, Kind_Data_Giles, Giles_Map, Giles_Var1, Giles_Var2, + Giles_FlowDir, RelaxFactorAverage, RelaxFactorFourier); /*!\brief SPATIAL_FOURIER \n DESCRIPTION: Option to compute the spatial fourier trasformation for the Giles BC. */ addBoolOption("SPATIAL_FOURIER", SpatialFourier, false); - /*!\brief GILES_EXTRA_RELAXFACTOR \n DESCRIPTION: the 1st coeff the value of the under relaxation factor to apply to the shroud and hub, - * the 2nd coefficient is the the percentage of span-wise height influenced by this extra under relaxation factor.*/ - extrarelfac[0] = 0.1; extrarelfac[1] = 0.1; + /*!\brief GILES_EXTRA_RELAXFACTOR \n DESCRIPTION: the 1st coeff the value of the under relaxation factor to apply to + * the shroud and hub, the 2nd coefficient is the the percentage of span-wise height influenced by this extra under + * relaxation factor.*/ + extrarelfac[0] = 0.1; + extrarelfac[1] = 0.1; addDoubleArrayOption("GILES_EXTRA_RELAXFACTOR", 2, extrarelfac); /*!\brief AVERAGE_PROCESS_TYPE \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ @@ -1570,54 +1766,68 @@ void CConfig::SetConfig_Options() { /*!\brief AVERAGE_PROCESS_KIND \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ addEnumOption("AVERAGE_PROCESS_KIND", Kind_AverageProcess, AverageProcess_Map, AREA); - /*!\brief PERFORMANCE_AVERAGE_PROCESS_KIND \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries for performance computation. - \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ + /*!\brief PERFORMANCE_AVERAGE_PROCESS_KIND \n DESCRIPTION: types of mixing process for averaging quantities at the + boundaries for performance computation. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE + \ingroup Config*/ addEnumOption("PERFORMANCE_AVERAGE_PROCESS_KIND", Kind_PerformanceAverageProcess, AverageProcess_Map, AREA); - mixedout_coeff[0] = 1.0; mixedout_coeff[1] = 1.0E-05; mixedout_coeff[2] = 15.0; + mixedout_coeff[0] = 1.0; + mixedout_coeff[1] = 1.0E-05; + mixedout_coeff[2] = 15.0; /*!\brief MIXEDOUT_COEFF \n DESCRIPTION: the 1st coeff is an under relaxation factor for the Newton method, * the 2nd coefficient is the tolerance for the Newton method, 3rd coefficient is the maximum number of * iteration for the Newton Method.*/ addDoubleArrayOption("MIXEDOUT_COEFF", 3, mixedout_coeff); /*!\brief RAMP_ROTATING_FRAME\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/ addBoolOption("RAMP_ROTATING_FRAME", RampRotatingFrame, false); - rampRotFrame_coeff[0] = 0; rampRotFrame_coeff[1] = 1.0; rampRotFrame_coeff[2] = 1000.0; - /*!\brief RAMP_ROTATING_FRAME_COEFF \n DESCRIPTION: the 1st coeff is the staring velocity, + rampRotFrame_coeff[0] = 0; + rampRotFrame_coeff[1] = 1.0; + rampRotFrame_coeff[2] = 1000.0; + /*!\brief RAMP_ROTATING_FRAME_COEFF \n DESCRIPTION: the 1st coeff is the staring velocity, * the 2nd coeff is the number of iterations for the update, 3rd is the number of iteration */ addDoubleArrayOption("RAMP_ROTATING_FRAME_COEFF", 3, rampRotFrame_coeff); /* DESCRIPTION: AVERAGE_MACH_LIMIT is a limit value for average procedure based on the mass flux. */ addDoubleOption("AVERAGE_MACH_LIMIT", AverageMachLimit, 0.03); /*!\brief RAMP_OUTLET_PRESSURE\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/ addBoolOption("RAMP_OUTLET_PRESSURE", RampOutletPressure, false); - rampOutPres_coeff[0] = 100000.0; rampOutPres_coeff[1] = 1.0; rampOutPres_coeff[2] = 1000.0; + rampOutPres_coeff[0] = 100000.0; + rampOutPres_coeff[1] = 1.0; + rampOutPres_coeff[2] = 1000.0; /*!\brief RAMP_OUTLET_PRESSURE_COEFF \n DESCRIPTION: the 1st coeff is the staring outlet pressure, - * the 2nd coeff is the number of iterations for the update, 3rd is the number of total iteration till reaching the final outlet pressure value */ + * the 2nd coeff is the number of iterations for the update, 3rd is the number of total iteration till reaching the + * final outlet pressure value */ addDoubleArrayOption("RAMP_OUTLET_PRESSURE_COEFF", 3, rampOutPres_coeff); - /*!\brief MARKER_MIXINGPLANE \n DESCRIPTION: Identify the boundaries in which the mixing plane is applied. \ingroup Config*/ + /*!\brief MARKER_MIXINGPLANE \n DESCRIPTION: Identify the boundaries in which the mixing plane is applied. \ingroup + * Config*/ addStringListOption("MARKER_MIXINGPLANE_INTERFACE", nMarker_MixingPlaneInterface, Marker_MixingPlaneInterface); /*!\brief TURBULENT_MIXINGPLANE \n DESCRIPTION: Activate mixing plane also for turbulent quantities \ingroup Config*/ addBoolOption("TURBULENT_MIXINGPLANE", turbMixingPlane, false); - /*!\brief MARKER_TURBOMACHINERY \n DESCRIPTION: Identify the inflow and outflow boundaries in which the turbomachinery settings are applied. \ingroup Config*/ + /*!\brief MARKER_TURBOMACHINERY \n DESCRIPTION: Identify the inflow and outflow boundaries in which the turbomachinery + * settings are applied. \ingroup Config*/ addTurboPerfOption("MARKER_TURBOMACHINERY", nMarker_Turbomachinery, Marker_TurboBoundIn, Marker_TurboBoundOut); - /*!\brief NUM_SPANWISE_SECTIONS \n DESCRIPTION: Integer number of spanwise sections to compute 3D turbo BC and Performance for turbomachinery */ + /*!\brief NUM_SPANWISE_SECTIONS \n DESCRIPTION: Integer number of spanwise sections to compute 3D turbo BC and + * Performance for turbomachinery */ addUnsignedShortOption("NUM_SPANWISE_SECTIONS", nSpanWiseSections_User, 1); /*!\brief SPANWISE_KIND \n DESCRIPTION: type of algorithm to identify the span-wise sections at the turbo boundaries. \n OPTIONS: see \link SpanWise_Map \endlink \n Default: AUTOMATIC */ addEnumOption("SPANWISE_KIND", Kind_SpanWise, SpanWise_Map, AUTOMATIC); /*!\brief TURBOMACHINERY_KIND \n DESCRIPTION: types of turbomachinery architecture. \n OPTIONS: see \link TurboMachinery_Map \endlink \n Default: AXIAL */ - addEnumListOption("TURBOMACHINERY_KIND",nTurboMachineryKind, Kind_TurboMachinery, TurboMachinery_Map); + addEnumListOption("TURBOMACHINERY_KIND", nTurboMachineryKind, Kind_TurboMachinery, TurboMachinery_Map); /*!\brief MARKER_SHROUD \n DESCRIPTION: markers in which velocity is forced to 0.0. * \n Format: (shroud1, shroud2, ...)*/ addStringListOption("MARKER_SHROUD", nMarker_Shroud, Marker_Shroud); /*!\brief MARKER_SUPERSONIC_INLET \n DESCRIPTION: Supersonic inlet boundary marker(s) - * \n Format: (inlet marker, temperature, static pressure, velocity_x, velocity_y, velocity_z, ... ), i.e. primitive variables specified. \ingroup Config*/ - addInletOption("MARKER_SUPERSONIC_INLET", nMarker_Supersonic_Inlet, Marker_Supersonic_Inlet, Inlet_Temperature, Inlet_Pressure, Inlet_Velocity); + * \n Format: (inlet marker, temperature, static pressure, velocity_x, velocity_y, velocity_z, ... ), i.e. + * primitive variables specified. \ingroup Config*/ + addInletOption("MARKER_SUPERSONIC_INLET", nMarker_Supersonic_Inlet, Marker_Supersonic_Inlet, Inlet_Temperature, + Inlet_Pressure, Inlet_Velocity); /*!\brief MARKER_SUPERSONIC_OUTLET \n DESCRIPTION: Supersonic outlet boundary marker(s) \ingroup Config*/ addStringListOption("MARKER_SUPERSONIC_OUTLET", nMarker_Supersonic_Outlet, Marker_Supersonic_Outlet); /*!\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 outlet types for incompressible flows. List length must match number of inlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET. \ingroup Config*/ + /*!\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 */ @@ -1625,14 +1835,18 @@ void CConfig::SetConfig_Options() { /*!\brief MARKER_HEATFLUX \n DESCRIPTION: Specified heat flux wall boundary marker(s) Format: ( Heat flux marker, wall heat flux (static), ... ) \ingroup Config*/ addStringDoubleListOption("MARKER_HEATFLUX", nMarker_HeatFlux, Marker_HeatFlux, Heat_Flux); - /*!\brief INTEGRATED_HEATFLUX \n DESCRIPTION: Prescribe Heatflux in [W] instead of [W/m^2] \ingroup Config \default false */ + /*!\brief INTEGRATED_HEATFLUX \n DESCRIPTION: Prescribe Heatflux in [W] instead of [W/m^2] \ingroup Config \default + * false */ addBoolOption("INTEGRATED_HEATFLUX", Integrated_HeatFlux, false); /*!\brief MARKER_HEATTRANSFER DESCRIPTION: Heat flux with specified heat transfer coefficient boundary marker(s)\n * Format: ( Heat transfer marker, heat transfer coefficient, wall temperature (static), ... ) \ingroup Config */ - addExhaustOption("MARKER_HEATTRANSFER", nMarker_HeatTransfer, Marker_HeatTransfer, HeatTransfer_Coeff, HeatTransfer_WallTemp); - /*!\brief Smoluchowski/Maxwell wall boundary marker(s) \n DESCRIPTION: Slip velocity and temperature jump wall boundary marker(s) - Format: ( Heat flux marker, wall temperature (static), momentum accomodation coefficient, thermal accomodation coefficient ... ) \ingroup Config*/ - addStringDoubleListOption("MARKER_SMOLUCHOWSKI_MAXWELL", nMarker_Smoluchowski_Maxwell, Marker_Smoluchowski_Maxwell, Isothermal_Temperature); //Missing TMAC and TAC + addExhaustOption("MARKER_HEATTRANSFER", nMarker_HeatTransfer, Marker_HeatTransfer, HeatTransfer_Coeff, + HeatTransfer_WallTemp); + /*!\brief Smoluchowski/Maxwell wall boundary marker(s) \n DESCRIPTION: Slip velocity and temperature jump wall + boundary marker(s) Format: ( Heat flux marker, wall temperature (static), momentum accomodation coefficient, thermal + accomodation coefficient ... ) \ingroup Config*/ + addStringDoubleListOption("MARKER_SMOLUCHOWSKI_MAXWELL", nMarker_Smoluchowski_Maxwell, Marker_Smoluchowski_Maxwell, + Isothermal_Temperature); // Missing TMAC and TAC /*!\brief WALL_ROUGHNESS \n DESCRIPTION: Specified roughness heights at wall boundary marker(s) Format: ( Wall marker, roughness_height (static), ... ) \ingroup Config*/ addStringDoubleListOption("WALL_ROUGHNESS", nRough_Wall, Marker_RoughWall, Roughness_Height); @@ -1652,18 +1866,30 @@ void CConfig::SetConfig_Options() { // /* DESCRIPTION: Actuator disk double surface */ // addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); /* DESCRIPTION: Definition of the distortion rack (radial number of proves / circumferential density (degree) */ - distortion[0] = 5.0; distortion[1] = 15.0; + distortion[0] = 5.0; + distortion[1] = 15.0; addDoubleArrayOption("DISTORTION_RACK", 2, distortion); /* DESCRIPTION: Values of the box to impose a subsonic nacellle (mach, Pressure, Temperature) */ - eng_val[0]=0.0; eng_val[1]=0.0; eng_val[2]=0.0; eng_val[3]=0.0; eng_val[4]=0.0; + eng_val[0] = 0.0; + eng_val[1] = 0.0; + eng_val[2] = 0.0; + eng_val[3] = 0.0; + eng_val[4] = 0.0; addDoubleArrayOption("SUBSONIC_ENGINE_VALUES", 5, eng_val); - /* DESCRIPTION: Coordinates of the box to impose a subsonic nacellle cylinder (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax, Radius) */ - eng_cyl[0] = 0.0; eng_cyl[1] = 0.0; eng_cyl[2] = 0.0; - eng_cyl[3] = 1E15; eng_cyl[4] = 1E15; eng_cyl[5] = 1E15; eng_cyl[6] = 1E15; + /* DESCRIPTION: Coordinates of the box to impose a subsonic nacellle cylinder (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax, + * Radius) */ + eng_cyl[0] = 0.0; + eng_cyl[1] = 0.0; + eng_cyl[2] = 0.0; + eng_cyl[3] = 1E15; + eng_cyl[4] = 1E15; + eng_cyl[5] = 1E15; + eng_cyl[6] = 1E15; addDoubleArrayOption("SUBSONIC_ENGINE_CYL", 7, eng_cyl); /* DESCRIPTION: Engine exhaust boundary marker(s) Format: (nacelle exhaust marker, total nozzle temp, total nozzle pressure, ... )*/ - addExhaustOption("MARKER_ENGINE_EXHAUST", nMarker_EngineExhaust, Marker_EngineExhaust, Exhaust_Temperature_Target, Exhaust_Pressure_Target); + addExhaustOption("MARKER_ENGINE_EXHAUST", nMarker_EngineExhaust, Marker_EngineExhaust, Exhaust_Temperature_Target, + Exhaust_Pressure_Target); /* DESCRIPTION: Clamped boundary marker(s) */ addStringListOption("MARKER_CLAMPED", nMarker_Clamped, Marker_Clamped); /* DESCRIPTION: Displacement boundary marker(s) */ @@ -1677,25 +1903,31 @@ void CConfig::SetConfig_Options() { addInletOption("MARKER_LOAD", nMarker_Load_Dir, Marker_Load_Dir, Load_Dir_Value, Load_Dir_Multiplier, Load_Dir); /* DESCRIPTION: Load boundary marker(s) Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), i.e. primitive variables specified. */ - addInletOption("MARKER_DISPLACEMENT", nMarker_Disp_Dir, Marker_Disp_Dir, Disp_Dir_Value, Disp_Dir_Multiplier, Disp_Dir); + addInletOption("MARKER_DISPLACEMENT", nMarker_Disp_Dir, Marker_Disp_Dir, Disp_Dir_Value, Disp_Dir_Multiplier, + Disp_Dir); /* DESCRIPTION: Sine load boundary marker(s) Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), i.e. primitive variables specified. */ - //addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, Load_Sine_Dir); + // addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, + // Load_Sine_Dir); /*!\brief SINE_LOAD\n DESCRIPTION: option to apply the load as a sine*/ addBoolOption("SINE_LOAD", Sine_Load, false); - sineload_coeff[0] = 0.0; sineload_coeff[1] = 0.0; sineload_coeff[2] = 0.0; - /*!\brief SINE_LOAD_COEFF \n DESCRIPTION: the 1st coeff is the amplitude, the 2nd is the frequency, 3rd is the phase in radians */ + sineload_coeff[0] = 0.0; + sineload_coeff[1] = 0.0; + sineload_coeff[2] = 0.0; + /*!\brief SINE_LOAD_COEFF \n DESCRIPTION: the 1st coeff is the amplitude, the 2nd is the frequency, 3rd is the phase + * in radians */ addDoubleArrayOption("SINE_LOAD_COEFF", 3, sineload_coeff); /*!\brief RAMP_AND_RELEASE\n DESCRIPTION: release the load after applying the ramp*/ addBoolOption("RAMP_AND_RELEASE_LOAD", RampAndRelease, false); /* DESCRIPTION: Flow load boundary marker(s) */ - //addStringDoubleListOption("MARKER_FLOWLOAD", nMarker_FlowLoad, Marker_FlowLoad, FlowLoad_Value); + // addStringDoubleListOption("MARKER_FLOWLOAD", nMarker_FlowLoad, Marker_FlowLoad, FlowLoad_Value); /* DESCRIPTION: Damping factor for engine inlet condition */ addDoubleOption("DAMP_ENGINE_INFLOW", Damp_Engine_Inflow, 0.95); /* DESCRIPTION: Damping factor for engine exhaust condition */ addDoubleOption("DAMP_ENGINE_EXHAUST", Damp_Engine_Exhaust, 0.95); - /*!\brief ENGINE_INFLOW_TYPE \n DESCRIPTION: Inlet boundary type \n OPTIONS: see \link Engine_Inflow_Map \endlink \n Default: FAN_FACE_MACH \ingroup Config*/ + /*!\brief ENGINE_INFLOW_TYPE \n DESCRIPTION: Inlet boundary type \n OPTIONS: see \link Engine_Inflow_Map \endlink \n + * Default: FAN_FACE_MACH \ingroup Config*/ addEnumOption("ENGINE_INFLOW_TYPE", Kind_Engine_Inflow, Engine_Inflow_Map, FAN_FACE_MACH); /* DESCRIPTION: Evaluate a problem with engines */ addBoolOption("ENGINE", Engine, false); @@ -1709,7 +1941,8 @@ void CConfig::SetConfig_Options() { addBoolOption("NEWTON_KRYLOV", NewtonKrylov, false); /* DESCRIPTION: Integer parameters {startup iters, precond iters, initial tolerance relaxation}. */ addUShortArrayOption("NEWTON_KRYLOV_IPARAM", NK_IntParam.size(), NK_IntParam.data()); - /* DESCRIPTION: Double parameters {startup residual drop, precond tolerance, full tolerance residual drop, findiff step}. */ + /* DESCRIPTION: Double parameters {startup residual drop, precond tolerance, full tolerance residual drop, findiff + * step}. */ addDoubleArrayOption("NEWTON_KRYLOV_DPARAM", NK_DblParam.size(), NK_DblParam.data()); /* DESCRIPTION: Number of samples for quasi-Newton methods. */ @@ -1729,10 +1962,14 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Activate The adaptive CFL number. */ addBoolOption("CFL_ADAPT", CFL_Adapt, false); /* !\brief CFL_ADAPT_PARAM - * DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max), acceptable linear residual ) - * Factor down generally <1.0, factor up generally > 1.0 to cause the CFL to increase when the under-relaxation parameter is 1.0 - * and to decrease when the under-relaxation parameter is less than 0.1. Factor is multiplicative. \ingroup Config*/ - default_cfl_adapt[0] = 1.0; default_cfl_adapt[1] = 1.0; default_cfl_adapt[2] = 10.0; default_cfl_adapt[3] = 100.0; + * DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max), acceptable + * linear residual ) Factor down generally <1.0, factor up generally > 1.0 to cause the CFL to increase when the + * under-relaxation parameter is 1.0 and to decrease when the under-relaxation parameter is less than 0.1. Factor is + * multiplicative. \ingroup Config*/ + default_cfl_adapt[0] = 1.0; + default_cfl_adapt[1] = 1.0; + default_cfl_adapt[2] = 10.0; + default_cfl_adapt[3] = 100.0; default_cfl_adapt[4] = 0.001; addDoubleListOption("CFL_ADAPT_PARAM", nCFL_AdaptParam, CFL_AdaptParam); /* DESCRIPTION: Reduction factor of the CFL coefficient in the adjoint problem */ @@ -1741,7 +1978,8 @@ void CConfig::SetConfig_Options() { addDoubleOption("CFL_REDUCTION_TURB", CFLRedCoeff_Turb, 1.0); /* DESCRIPTION: Reduction factor of the CFL coefficient in the turbulent adjoint problem */ addDoubleOption("CFL_REDUCTION_ADJTURB", CFLRedCoeff_AdjTurb, 1.0); - /*!\brief CFL_REDUCTION_SPECIES \n DESCRIPTION: Reduction factor of the CFL coefficient in the species problem \n DEFAULT: 1.0 */ + /*!\brief CFL_REDUCTION_SPECIES \n DESCRIPTION: Reduction factor of the CFL coefficient in the species problem \n + * DEFAULT: 1.0 */ addDoubleOption("CFL_REDUCTION_SPECIES", CFLRedCoeff_Species, 1.0); /* DESCRIPTION: External iteration offset due to restart */ addUnsignedLongOption("EXT_ITER_OFFSET", ExtIter_OffSet, 0); @@ -1763,7 +2001,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Starting direct solver iteration for the unsteady adjoint */ addLongOption("UNST_ADJOINT_ITER", Unst_AdjointIter, 0); /* DESCRIPTION: Number of iterations to average the objective */ - addLongOption("ITER_AVERAGE_OBJ", Iter_Avg_Objective , 0); + addLongOption("ITER_AVERAGE_OBJ", Iter_Avg_Objective, 0); /* DESCRIPTION: Time discretization */ addEnumOption("TIME_DISCRE_FLOW", Kind_TimeIntScheme_Flow, Time_Int_Map, EULER_IMPLICIT); /* DESCRIPTION: Time discretization */ @@ -1791,10 +2029,12 @@ void CConfig::SetConfig_Options() { /*--- Options related to the linear solvers ---*/ /*!\brief LINEAR_SOLVER - * \n DESCRIPTION: Linear solver for the implicit, mesh deformation, or discrete adjoint systems \n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ + * \n DESCRIPTION: Linear solver for the implicit, mesh deformation, or discrete adjoint systems \n OPTIONS: see + * \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ addEnumOption("LINEAR_SOLVER", Kind_Linear_Solver, Linear_Solver_Map, FGMRES); /*!\brief LINEAR_SOLVER_PREC - * \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink \n DEFAULT: LU_SGS \ingroup Config*/ + * \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink + * \n DEFAULT: LU_SGS \ingroup Config*/ addEnumOption("LINEAR_SOLVER_PREC", Kind_Linear_Solver_Prec, Linear_Solver_Prec_Map, ILU); /* DESCRIPTION: Minimum error threshold for the linear solver for the implicit formulation */ addDoubleOption("LINEAR_SOLVER_ERROR", Linear_Solver_Error, 1E-6); @@ -1835,31 +2075,39 @@ void CConfig::SetConfig_Options() { /*!\brief CONV_FIELD\n DESCRIPTION: Output field to monitor \n Default: depends on solver \ingroup Config*/ addStringListOption("CONV_FIELD", nConvField, ConvField); - /*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 \ingroup Config*/ + /*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 + * \ingroup Config*/ addDoubleOption("CONV_RESIDUAL_MINVAL", MinLogResidual, -14.0); - /*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup Config*/ + /*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup + * Config*/ addUnsignedLongOption("CONV_STARTITER", StartConv_Iter, 5); /*!\brief CONV_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ addUnsignedShortOption("CONV_CAUCHY_ELEMS", Cauchy_Elems, 100); /*!\brief CONV_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-10 \ingroup Config*/ addDoubleOption("CONV_CAUCHY_EPS", Cauchy_Eps, 1E-10); - /*!\brief CONV_WINDOW_STARTITER\n DESCRIPTION: Iteration number after START_ITER_WND to begin convergence monitoring\n DEFAULT: 15 \ingroup Config*/ + /*!\brief CONV_WINDOW_STARTITER\n DESCRIPTION: Iteration number after START_ITER_WND to begin convergence + * monitoring\n DEFAULT: 15 \ingroup Config*/ addUnsignedLongOption("CONV_WINDOW_STARTITER", Wnd_StartConv_Iter, 15); - /*!\brief CONV_WINDOW_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-3 \ingroup Config*/ + /*!\brief CONV_WINDOW_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-3 \ingroup + * Config*/ addDoubleOption("CONV_WINDOW_CAUCHY_EPS", Wnd_Cauchy_Eps, 1E-3); - /*!\brief CONV_WINDOW_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ + /*!\brief CONV_WINDOW_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup + * Config*/ addUnsignedShortOption("CONV_WINDOW_CAUCHY_ELEMS", Wnd_Cauchy_Elems, 100); - /*!\brief WINDOW_CAUCHY_CRIT \n DESCRIPTION: Determines, if the cauchy convergence criterion should be used for windowed time averaged objective functions*/ - addBoolOption("WINDOW_CAUCHY_CRIT",Wnd_Cauchy_Crit, false); + /*!\brief WINDOW_CAUCHY_CRIT \n DESCRIPTION: Determines, if the cauchy convergence criterion should be used for + * windowed time averaged objective functions*/ + addBoolOption("WINDOW_CAUCHY_CRIT", Wnd_Cauchy_Crit, false); /*!\brief CONV_WINDOW_FIELD - * \n DESCRIPTION: Output fields for the Cauchy criterium for the TIME iteration. The criterium is applied to the windowed time average of the chosen funcion. */ - addStringListOption("CONV_WINDOW_FIELD",nWndConvField, WndConvField); + * \n DESCRIPTION: Output fields for the Cauchy criterium for the TIME iteration. The criterium is applied to the + * windowed time average of the chosen funcion. */ + addStringListOption("CONV_WINDOW_FIELD", nWndConvField, WndConvField); /*!\par CONFIG_CATEGORY: Multi-grid \ingroup Config*/ /*!\brief MGLEVEL\n DESCRIPTION: Multi-grid Levels. DEFAULT: 0 \ingroup Config*/ addUnsignedShortOption("MGLEVEL", nMGLevels, 0); - /*!\brief MGCYCLE\n DESCRIPTION: Multi-grid cycle. OPTIONS: See \link MG_Cycle_Map \endlink. Defualt V_CYCLE \ingroup Config*/ + /*!\brief MGCYCLE\n DESCRIPTION: Multi-grid cycle. OPTIONS: See \link MG_Cycle_Map \endlink. Defualt V_CYCLE \ingroup + * Config*/ addEnumOption("MGCYCLE", MGCycle, MG_Cycle_Map, V_CYCLE); /*!\brief MG_PRE_SMOOTH\n DESCRIPTION: Multi-grid pre-smoothing level \ingroup Config*/ addUShortListOption("MG_PRE_SMOOTH", nMG_PreSmooth, MG_PreSmooth); @@ -1867,74 +2115,96 @@ void CConfig::SetConfig_Options() { addUShortListOption("MG_POST_SMOOTH", nMG_PostSmooth, MG_PostSmooth); /*!\brief MG_CORRECTION_SMOOTH\n DESCRIPTION: Jacobi implicit smoothing of the correction \ingroup Config*/ addUShortListOption("MG_CORRECTION_SMOOTH", nMG_CorrecSmooth, MG_CorrecSmooth); - /*!\brief MG_DAMP_RESTRICTION\n DESCRIPTION: Damping factor for the residual restriction. DEFAULT: 0.75 \ingroup Config*/ + /*!\brief MG_DAMP_RESTRICTION\n DESCRIPTION: Damping factor for the residual restriction. DEFAULT: 0.75 \ingroup + * Config*/ addDoubleOption("MG_DAMP_RESTRICTION", Damp_Res_Restric, 0.75); - /*!\brief MG_DAMP_PROLONGATION\n DESCRIPTION: Damping factor for the correction prolongation. DEFAULT 0.75 \ingroup Config*/ + /*!\brief MG_DAMP_PROLONGATION\n DESCRIPTION: Damping factor for the correction prolongation. DEFAULT 0.75 \ingroup + * Config*/ addDoubleOption("MG_DAMP_PROLONGATION", Damp_Correc_Prolong, 0.75); /*!\par CONFIG_CATEGORY: Spatial Discretization \ingroup Config*/ /*--- Options related to the spatial discretization ---*/ /*!\brief NUM_METHOD_GRAD - * \n DESCRIPTION: Numerical method for spatial gradients \n OPTIONS: See \link Gradient_Map \endlink. \n DEFAULT: WEIGHTED_LEAST_SQUARES. \ingroup Config*/ + * \n DESCRIPTION: Numerical method for spatial gradients \n OPTIONS: See \link Gradient_Map \endlink. \n DEFAULT: + * WEIGHTED_LEAST_SQUARES. \ingroup Config*/ addEnumOption("NUM_METHOD_GRAD", Kind_Gradient_Method, Gradient_Map, WEIGHTED_LEAST_SQUARES); /*!\brief NUM_METHOD_GRAD - * \n DESCRIPTION: Numerical method for spatial gradients used only for upwind reconstruction \n OPTIONS: See \link Gradient_Map \endlink. \n DEFAULT: NO_GRADIENT. \ingroup Config*/ + * \n DESCRIPTION: Numerical method for spatial gradients used only for upwind reconstruction \n OPTIONS: See \link + * Gradient_Map \endlink. \n DEFAULT: NO_GRADIENT. \ingroup Config*/ addEnumOption("NUM_METHOD_GRAD_RECON", Kind_Gradient_Method_Recon, Gradient_Map, NO_GRADIENT); /*!\brief VENKAT_LIMITER_COEFF - * \n DESCRIPTION: Coefficient for the limiter. DEFAULT value 0.5. Larger values decrease the extent of limiting, values approaching zero cause lower-order approximation to the solution. \ingroup Config */ + * \n DESCRIPTION: Coefficient for the limiter. DEFAULT value 0.5. Larger values decrease the extent of limiting, + * values approaching zero cause lower-order approximation to the solution. \ingroup Config */ addDoubleOption("VENKAT_LIMITER_COEFF", Venkat_LimiterCoeff, 0.05); /*!\brief ADJ_SHARP_LIMITER_COEFF - * \n DESCRIPTION: Coefficient for detecting the limit of the sharp edges. DEFAULT value 3.0. Use with sharp edges limiter. \ingroup Config*/ + * \n DESCRIPTION: Coefficient for detecting the limit of the sharp edges. DEFAULT value 3.0. Use with sharp edges + * limiter. \ingroup Config*/ addDoubleOption("ADJ_SHARP_LIMITER_COEFF", AdjSharp_LimiterCoeff, 3.0); /*!\brief LIMITER_ITER - * \n DESCRIPTION: Freeze the value of the limiter after a number of iterations. DEFAULT value 999999. \ingroup Config*/ + * \n DESCRIPTION: Freeze the value of the limiter after a number of iterations. DEFAULT value 999999. \ingroup + * Config*/ addUnsignedLongOption("LIMITER_ITER", LimiterIter, 999999); /*!\brief CONV_NUM_METHOD_FLOW - * \n DESCRIPTION: Convective numerical method \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. \ingroup Config*/ + * \n DESCRIPTION: Convective numerical method \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map + * \endlink. \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_FLOW", Kind_ConvNumScheme_Flow, Kind_Centered_Flow, Kind_Upwind_Flow); /*!\brief NUM_METHOD_FEM_FLOW - * \n DESCRIPTION: Numerical method \n OPTIONS: See \link FEM_Map \endlink , \link Centered_Map \endlink. \ingroup Config*/ + * \n DESCRIPTION: Numerical method \n OPTIONS: See \link FEM_Map \endlink , \link Centered_Map \endlink. \ingroup + * Config*/ addConvectFEMOption("NUM_METHOD_FEM_FLOW", Kind_ConvNumScheme_FEM_Flow, Kind_FEM_Flow); /*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_FLOW", MUSCL_Flow, true); /*!\brief SLOPE_LIMITER_FLOW - * DESCRIPTION: Slope limiter for the direct solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ + * DESCRIPTION: Slope limiter for the direct solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT + * VENKATAKRISHNAN \ingroup Config*/ addEnumOption("SLOPE_LIMITER_FLOW", Kind_SlopeLimit_Flow, Limiter_Map, LIMITER::VENKATAKRISHNAN); - jst_coeff[0] = 0.5; jst_coeff[1] = 0.02; - /*!\brief JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the JST method \ingroup Config*/ + jst_coeff[0] = 0.5; + jst_coeff[1] = 0.02; + /*!\brief JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the JST method + * \ingroup Config*/ addDoubleArrayOption("JST_SENSOR_COEFF", 2, jst_coeff); - /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs method. \ingroup Config*/ + /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs + * method. \ingroup Config*/ addDoubleOption("LAX_SENSOR_COEFF", Kappa_1st_Flow, 0.15); - /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) \ingroup Config*/ + /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) + * \ingroup Config*/ addBoolOption("USE_ACCURATE_FLUX_JACOBIANS", Use_Accurate_Jacobians, false); - /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ + /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the + * global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ addDoubleOption("CENTRAL_JACOBIAN_FIX_FACTOR", Cent_Jac_Fix_Factor, 4.0); - /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Control numerical properties of the global Jacobian matrix using a multiplication factor for incompressible central schemes \ingroup Config*/ + /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Control numerical properties of the global Jacobian matrix using + * a multiplication factor for incompressible central schemes \ingroup Config*/ addDoubleOption("CENTRAL_INC_JACOBIAN_FIX_FACTOR", Cent_Inc_Jac_Fix_Factor, 1.0); /*!\brief CONV_NUM_METHOD_ADJFLOW * \n DESCRIPTION: Convective numerical method for the adjoint solver. - * \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. Note: not all methods are guaranteed to be implemented for the adjoint solver. \ingroup Config */ + * \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. Note: not all methods are guaranteed to + * be implemented for the adjoint solver. \ingroup Config */ addConvectOption("CONV_NUM_METHOD_ADJFLOW", Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, Kind_Upwind_AdjFlow); /*!\brief MUSCL_ADJFLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_ADJFLOW", MUSCL_AdjFlow, true); /*!\brief SLOPE_LIMITER_ADJFLOW - * DESCRIPTION: Slope limiter for the adjoint solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ + * DESCRIPTION: Slope limiter for the adjoint solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT + * VENKATAKRISHNAN \ingroup Config*/ addEnumOption("SLOPE_LIMITER_ADJFLOW", Kind_SlopeLimit_AdjFlow, Limiter_Map, LIMITER::VENKATAKRISHNAN); - jst_adj_coeff[0] = 0.5; jst_adj_coeff[1] = 0.02; - /*!\brief ADJ_JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the adjoint JST method. \ingroup Config*/ + jst_adj_coeff[0] = 0.5; + jst_adj_coeff[1] = 0.02; + /*!\brief ADJ_JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the adjoint + * JST method. \ingroup Config*/ addDoubleArrayOption("ADJ_JST_SENSOR_COEFF", 2, jst_adj_coeff); - /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the adjoint Lax-Friedrichs method. \ingroup Config*/ + /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the adjoint + * Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("ADJ_LAX_SENSOR_COEFF", Kappa_1st_AdjFlow, 0.15); /*!\brief MUSCL_TURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_TURB", MUSCL_Turb, false); /*!\brief SLOPE_LIMITER_TURB - * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ + * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup + * Config*/ addEnumOption("SLOPE_LIMITER_TURB", Kind_SlopeLimit_Turb, Limiter_Map, LIMITER::VENKATAKRISHNAN); /*!\brief CONV_NUM_METHOD_TURB * \n DESCRIPTION: Convective numerical method \ingroup Config*/ @@ -1943,21 +2213,25 @@ void CConfig::SetConfig_Options() { /*!\brief MUSCL_ADJTURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_ADJTURB", MUSCL_AdjTurb, false); /*!\brief SLOPE_LIMITER_ADJTURB - * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ + * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup + * Config */ addEnumOption("SLOPE_LIMITER_ADJTURB", Kind_SlopeLimit_AdjTurb, Limiter_Map, LIMITER::VENKATAKRISHNAN); - /*!\brief CONV_NUM_METHOD_ADJTURB\n DESCRIPTION: Convective numerical method for the adjoint/turbulent problem \ingroup Config*/ + /*!\brief CONV_NUM_METHOD_ADJTURB\n DESCRIPTION: Convective numerical method for the adjoint/turbulent problem + * \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_ADJTURB", Kind_ConvNumScheme_AdjTurb, Kind_Centered_AdjTurb, Kind_Upwind_AdjTurb); /*!\brief MUSCL_SPECIES \n DESCRIPTION: Check if the MUSCL scheme should be used \n DEFAULT false \ingroup Config*/ addBoolOption("MUSCL_SPECIES", MUSCL_Species, false); - /*!\brief SLOPE_LIMITER_SPECIES \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE \ingroup Config*/ + /*!\brief SLOPE_LIMITER_SPECIES \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT + * NONE \ingroup Config*/ addEnumOption("SLOPE_LIMITER_SPECIES", Kind_SlopeLimit_Species, Limiter_Map, LIMITER::NONE); /*!\brief CONV_NUM_METHOD_SPECIES \n DESCRIPTION: Convective numerical method for species transport \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_SPECIES", Kind_ConvNumScheme_Species, Kind_Centered_Species, Kind_Upwind_Species); /*!\brief MUSCL_HEAT \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_HEAT", MUSCL_Heat, false); - /*!\brief SLOPE_LIMITER_HEAT \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE \ingroup Config*/ + /*!\brief SLOPE_LIMITER_HEAT \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE + * \ingroup Config*/ addEnumOption("SLOPE_LIMITER_HEAT", Kind_SlopeLimit_Heat, Limiter_Map, LIMITER::NONE); /*!\brief CONV_NUM_METHOD_HEAT \n DESCRIPTION: Convective numerical method */ addConvectOption("CONV_NUM_METHOD_HEAT", Kind_ConvNumScheme_Heat, Kind_Centered_Heat, Kind_Upwind_Heat); @@ -1970,9 +2244,11 @@ void CConfig::SetConfig_Options() { /*!\brief MG_ADJFLOW\n DESCRIPTION: Multigrid with the adjoint problem. \n Defualt: YES \ingroup Config*/ addBoolOption("MG_ADJFLOW", MG_AdjointFlow, true); - /*!\brief OBJECTIVE_WEIGHT \n DESCRIPTION: Adjoint problem boundary condition weights. Applies scaling factor to objective(s) \ingroup Config*/ + /*!\brief OBJECTIVE_WEIGHT \n DESCRIPTION: Adjoint problem boundary condition weights. Applies scaling factor to + * objective(s) \ingroup Config*/ addDoubleListOption("OBJECTIVE_WEIGHT", nObjW, Weight_ObjFunc); - /*!\brief OBJECTIVE_FUNCTION \n DESCRIPTION: Adjoint problem boundary condition \n OPTIONS: see \link Objective_Map \endlink \n DEFAULT: DRAG_COEFFICIENT \ingroup Config*/ + /*!\brief OBJECTIVE_FUNCTION \n DESCRIPTION: Adjoint problem boundary condition \n OPTIONS: see \link Objective_Map + * \endlink \n DEFAULT: DRAG_COEFFICIENT \ingroup Config*/ addEnumListOption("OBJECTIVE_FUNCTION", nObj, Kind_ObjFunc, Objective_Map); /*!\brief CUSTOM_OBJFUNC \n DESCRIPTION: User-provided definition of a custom objective function. \ingroup Config*/ @@ -1989,7 +2265,8 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: parameter for the definition of a complex objective function */ addDoubleOption("DCMZ_DCL_VALUE", dCMz_dCL, 0.0); - geo_loc[0] = 0.0; geo_loc[1] = 1.0; + geo_loc[0] = 0.0; + geo_loc[1] = 1.0; /* DESCRIPTION: Definition of the airfoil section */ addDoubleArrayOption("GEO_BOUNDS", 2, geo_loc); /* DESCRIPTION: Identify the body to slice */ @@ -2000,8 +2277,11 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("GEO_NUMBER_STATIONS", nWingStations, 25); /* DESCRIPTION: Definition of the airfoil sections */ addDoubleListOption("GEO_LOCATION_STATIONS", nLocationStations, LocationStations); - nacelle_location[0] = 0.0; nacelle_location[1] = 0.0; nacelle_location[2] = 0.0; - nacelle_location[3] = 0.0; nacelle_location[4] = 0.0; + nacelle_location[0] = 0.0; + nacelle_location[1] = 0.0; + nacelle_location[2] = 0.0; + nacelle_location[3] = 0.0; + nacelle_location[4] = 0.0; /* DESCRIPTION: Definition of the nacelle location (higlite coordinates, tilt angle, toe angle) */ addDoubleArrayOption("GEO_NACELLE_LOCATION", 5, nacelle_location); /* DESCRIPTION: Output sectional forces for specified markers. */ @@ -2021,28 +2301,29 @@ void CConfig::SetConfig_Options() { addBoolOption("FROZEN_LIMITER_DISC", Frozen_Limiter_Disc, false); /* DESCRIPTION: Use an inconsistent (primal/dual) discrete adjoint formulation */ addBoolOption("INCONSISTENT_DISC", Inconsistent_Disc, false); - /* DESCRIPTION: */ + /* DESCRIPTION: */ addDoubleOption("FIX_AZIMUTHAL_LINE", FixAzimuthalLine, 90.0); /*!\brief SENS_REMOVE_SHARP - * \n DESCRIPTION: Remove sharp edges from the sensitivity evaluation \n Format: SENS_REMOVE_SHARP = YES \n DEFAULT: NO \ingroup Config*/ + * \n DESCRIPTION: Remove sharp edges from the sensitivity evaluation \n Format: SENS_REMOVE_SHARP = YES \n DEFAULT: + * NO \ingroup Config*/ addBoolOption("SENS_REMOVE_SHARP", Sens_Remove_Sharp, false); /* DESCRIPTION: Automatically reorient elements that seem flipped */ - addBoolOption("REORIENT_ELEMENTS",ReorientElements, true); + addBoolOption("REORIENT_ELEMENTS", ReorientElements, true); /*!\par CONFIG_CATEGORY: Sobolev Gradient Solver Parameters \ingroup Config */ /*--- Options related to the Sobolev smoothing solver ---*/ /* DESCRIPTION: Switch to activate gradient smoothing */ - addBoolOption("SMOOTH_GRADIENT",SmoothGradient, false); + addBoolOption("SMOOTH_GRADIENT", SmoothGradient, false); /* DESCRIPTION: Epsilon of the identity term in the Laplace Beltrami Operator */ - addDoubleOption("SMOOTHING_EPSILON1",SmoothingEps1, 1.0); + addDoubleOption("SMOOTHING_EPSILON1", SmoothingEps1, 1.0); /* DESCRIPTION: Epsilon of the Laplace term in the Laplace Beltrami Operator */ - addDoubleOption("SMOOTHING_EPSILON2",SmoothingEps2, 1.0); + addDoubleOption("SMOOTHING_EPSILON2", SmoothingEps2, 1.0); /* DESCRIPTION: Switch to calculate for each dimension separately */ addBoolOption("SEPARATE_DIMENSIONS", SmoothSepDim, false); /* DESCRIPTION: Switch to activate working on the design surfaces only */ - addBoolOption("SMOOTH_ON_SURFACE",SmoothOnSurface, false); + addBoolOption("SMOOTH_ON_SURFACE", SmoothOnSurface, false); /* DESCRIPTION: Switch to activate zero Dirichlet boundary for surface mode */ addBoolOption("DIRICHLET_SURFACE_BOUNDARY", SmoothDirichletSurfaceBound, false); /* DESCRIPTION: Switch to activate the debbuging modus */ @@ -2051,9 +2332,11 @@ void CConfig::SetConfig_Options() { * \n DESCRIPTION: Output filename for the Sobolev Hessian approximation. \ingroup Config*/ addStringOption("HESS_OBJFUNC_FILENAME", ObjFunc_Hess_FileName, string("of_hess.dat")); - /* DESCRIPTION: Linear solver for the gradient smoothing\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ + /* DESCRIPTION: Linear solver for the gradient smoothing\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: + * FGMRES \ingroup Config*/ addEnumOption("GRAD_LINEAR_SOLVER", Kind_Grad_Linear_Solver, Linear_Solver_Map, FGMRES); - /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink \n DEFAULT: ILU \ingroup Config*/ + /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink + * \n DEFAULT: ILU \ingroup Config*/ addEnumOption("GRAD_LINEAR_SOLVER_PREC", Kind_Grad_Linear_Solver_Prec, Linear_Solver_Prec_Map, ILU); /* DESCRIPTION: Minimum error threshold for the linear solver for the implicit formulation */ addDoubleOption("GRAD_LINEAR_SOLVER_ERROR", Grad_Linear_Solver_Error, 1E-14); @@ -2063,39 +2346,52 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Input/output files and formats \ingroup Config */ /*--- Options related to input/output files and formats ---*/ - /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ + /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n + * DEFAULT: TECPLOT \ingroup Config */ addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_OUTPUT::TAB_CSV); - /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ + /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY + * output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ addUnsignedShortOption("OUTPUT_PRECISION", output_precision, 10); /*!\brief ACTDISK_JUMP \n DESCRIPTION: The jump is given by the difference in values or a ratio */ addEnumOption("ACTDISK_JUMP", ActDisk_Jump, Jump_Map, DIFFERENCE); - /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ + /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 + * \ingroup Config*/ addEnumOption("MESH_FORMAT", Mesh_FileFormat, Input_Map, SU2); /* DESCRIPTION: Mesh input file */ addStringOption("MESH_FILENAME", Mesh_FileName, string("mesh.su2")); - /*!\brief MESH_OUT_FILENAME \n DESCRIPTION: Mesh output file name. Used when converting, scaling, or deforming a mesh. \n DEFAULT: mesh_out.su2 \ingroup Config*/ + /*!\brief MESH_OUT_FILENAME \n DESCRIPTION: Mesh output file name. Used when converting, scaling, or deforming a mesh. + * \n DEFAULT: mesh_out.su2 \ingroup Config*/ addStringOption("MESH_OUT_FILENAME", Mesh_Out_FileName, string("mesh_out.su2")); - /* DESCRIPTION: List of the number of grid points in the RECTANGLE or BOX grid in the x,y,z directions. (default: (33,33,33) ). */ + /* DESCRIPTION: List of the number of grid points in the RECTANGLE or BOX grid in the x,y,z directions. (default: + * (33,33,33) ). */ addShortListOption("MESH_BOX_SIZE", nMesh_Box_Size, Mesh_Box_Size); - /* DESCRIPTION: List of the length of the RECTANGLE or BOX grid in the x,y,z directions. (default: (1.0,1.0,1.0) ). */ - mesh_box_length[0] = 1.0; mesh_box_length[1] = 1.0; mesh_box_length[2] = 1.0; + /* DESCRIPTION: List of the length of the RECTANGLE or BOX grid in the x,y,z directions. (default: (1.0,1.0,1.0) ). */ + mesh_box_length[0] = 1.0; + mesh_box_length[1] = 1.0; + mesh_box_length[2] = 1.0; addDoubleArrayOption("MESH_BOX_LENGTH", 3, mesh_box_length); - /* DESCRIPTION: List of the offset from 0.0 of the RECTANGLE or BOX grid in the x,y,z directions. (default: (0.0,0.0,0.0) ). */ - mesh_box_offset[0] = 0.0; mesh_box_offset[1] = 0.0; mesh_box_offset[2] = 0.0; + /* DESCRIPTION: List of the offset from 0.0 of the RECTANGLE or BOX grid in the x,y,z directions. (default: + * (0.0,0.0,0.0) ). */ + mesh_box_offset[0] = 0.0; + mesh_box_offset[1] = 0.0; + mesh_box_offset[2] = 0.0; addDoubleArrayOption("MESH_BOX_OFFSET", 3, mesh_box_offset); /* DESCRIPTION: Determine if the mesh file supports multizone. \n DEFAULT: true (temporarily) */ addBoolOption("MULTIZONE_MESH", Multizone_Mesh, true); - /* DESCRIPTION: Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: false (temporarily) */ + /* DESCRIPTION: Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: false + * (temporarily) */ addBoolOption("MULTIZONE_RESIDUAL", Multizone_Residual, false); - /* !\brief CONTROLLING_VARIABLE_NAMES \n DESCRIPTION: Names of the variables used as inputs for the data regression method in flamelet or data-driven fluid models. */ + /* !\brief CONTROLLING_VARIABLE_NAMES \n DESCRIPTION: Names of the variables used as inputs for the data regression + * method in flamelet or data-driven fluid models. */ addStringListOption("CONTROLLING_VARIABLE_NAMES", n_control_vars, controlling_variable_names); - /* !\brief CONTROLLING_VARIABLE_SOURCE_NAMES \n DESCRIPTION: Names of the variables in the flamelet manifold corresponding to the source terms of the controlling variables. */ + /* !\brief CONTROLLING_VARIABLE_SOURCE_NAMES \n DESCRIPTION: Names of the variables in the flamelet manifold + * corresponding to the source terms of the controlling variables. */ addStringListOption("CONTROLLING_VARIABLE_SOURCE_NAMES", n_control_vars, cv_source_names); /* DESCRIPTION: Names of the passive lookup variables for flamelet LUT */ @@ -2107,17 +2403,21 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Names of the user scalar source terms. */ addStringListOption("USER_SOURCE_NAMES", n_user_sources, user_source_names); - /*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup Config*/ + /*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup + * Config*/ addStringOption("CONV_FILENAME", Conv_FileName, string("history")); /*!\brief BREAKDOWN_FILENAME \n DESCRIPTION: Output file forces breakdown \ingroup Config*/ addStringOption("BREAKDOWN_FILENAME", Breakdown_FileName, string("forces_breakdown.dat")); - /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart flow input file (the file output under the filename set by RESTART_FLOW_FILENAME) \n DEFAULT: solution_flow.dat \ingroup Config */ + /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart flow input file (the file output under the filename set by + * RESTART_FLOW_FILENAME) \n DEFAULT: solution_flow.dat \ingroup Config */ addStringOption("SOLUTION_FILENAME", Solution_FileName, string("solution.dat")); - /*!\brief SOLUTION_ADJ_FILENAME\n DESCRIPTION: Restart adjoint input file. Objective function abbreviation is expected. \ingroup Config*/ + /*!\brief SOLUTION_ADJ_FILENAME\n DESCRIPTION: Restart adjoint input file. Objective function abbreviation is + * expected. \ingroup Config*/ addStringOption("SOLUTION_ADJ_FILENAME", Solution_AdjFileName, string("solution_adj.dat")); /*!\brief RESTART_FLOW_FILENAME \n DESCRIPTION: Output file restart flow \ingroup Config*/ addStringOption("RESTART_FILENAME", Restart_FileName, string("restart.dat")); - /*!\brief RESTART_ADJ_FILENAME \n DESCRIPTION: Output file restart adjoint. Objective function abbreviation will be appended. \ingroup Config*/ + /*!\brief RESTART_ADJ_FILENAME \n DESCRIPTION: Output file restart adjoint. Objective function abbreviation will be + * appended. \ingroup Config*/ addStringOption("RESTART_ADJ_FILENAME", Restart_AdjFileName, string("restart_adj.dat")); /*!\brief VOLUME_FLOW_FILENAME \n DESCRIPTION: Output file flow (w/o extension) variables \ingroup Config */ addStringOption("VOLUME_FILENAME", Volume_FileName, string("vol_solution")); @@ -2161,7 +2461,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Type of mesh motion */ addEnumOption("GRID_MOVEMENT", Kind_GridMovement, GridMovement_Map, NO_MOVEMENT); /* DESCRIPTION: Type of surface motion */ - addEnumListOption("SURFACE_MOVEMENT",nKind_SurfaceMovement, Kind_SurfaceMovement, SurfaceMovement_Map); + addEnumListOption("SURFACE_MOVEMENT", nKind_SurfaceMovement, Kind_SurfaceMovement, SurfaceMovement_Map); /* DESCRIPTION: Marker(s) of moving surfaces (MOVING_WALL or DEFORMING grid motion). */ addStringListOption("MARKER_MOVING", nMarker_Moving, Marker_Moving); /* DESCRIPTION: Marker(s) of gradient problem boundaries. */ @@ -2218,7 +2518,8 @@ void CConfig::SetConfig_Options() { addDoubleOption("AIRFOIL_MASS_RATIO", AirfoilMassRatio, 60); /* DESCRIPTION: Distance in semichords by which the center of gravity lies behind the elastic axis. */ addDoubleOption("CG_LOCATION", CG_Location, 1.8); - /* DESCRIPTION: The radius of gyration squared (expressed in semichords) of the typical section about the elastic axis. */ + /* DESCRIPTION: The radius of gyration squared (expressed in semichords) of the typical section about the elastic + * axis. */ addDoubleOption("RADIUS_GYRATION_SQUARED", RadiusGyrationSquared, 3.48); /* DESCRIPTION: Solve the aeroelastic equations every given number of internal iterations. */ addUnsignedShortOption("AEROELASTIC_ITER", AeroelasticIter, 3); @@ -2266,7 +2567,9 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Evaluate equivalent area on the Near-Field */ addBoolOption("EQUIV_AREA", EquivArea, false); - ea_lim[0] = 0.0; ea_lim[1] = 1.0; ea_lim[2] = 1.0; + ea_lim[0] = 0.0; + ea_lim[1] = 1.0; + ea_lim[2] = 1.0; /* DESCRIPTION: Integration limits of the equivalent area ( xmin, xmax, Dist_NearField ) */ addDoubleArrayOption("EA_INT_LIMIT", 3, ea_lim); /* DESCRIPTION: Equivalent area scaling factor */ @@ -2305,16 +2608,23 @@ void CConfig::SetConfig_Options() { addDVValueOption("DV_VALUE", nDV_Value, DV_Value, nDV, ParamDV, Design_Variable); /* DESCRIPTION: Provide a file of surface positions from an external parameterization. */ addStringOption("DV_FILENAME", DV_Filename, string("surface_positions.dat")); - /* DESCRIPTION: File of sensitivities as an unordered ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each volume grid point. */ + /* DESCRIPTION: File of sensitivities as an unordered ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each + * volume grid point. */ addStringOption("DV_UNORDERED_SENS_FILENAME", DV_Unordered_Sens_Filename, string("unordered_sensitivity.dat")); - /* DESCRIPTION: File of sensitivities as an ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each surface grid point. */ + /* DESCRIPTION: File of sensitivities as an ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each surface grid + * point. */ addStringOption("DV_SENS_FILENAME", DV_Sens_Filename, string("surface_sensitivity.dat")); - /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link Output_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ + /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link Output_Map \endlink \n + * DEFAULT: TECPLOT \ingroup Config */ addEnumOption("DV_SENSITIVITY_FORMAT", Sensitivity_FileFormat, Sensitivity_Map, SU2_NATIVE); /* DESCRIPTION: Hold the grid fixed in a region */ addBoolOption("HOLD_GRID_FIXED", Hold_GridFixed, false); - grid_fix[0] = -1E15; grid_fix[1] = -1E15; grid_fix[2] = -1E15; - grid_fix[3] = 1E15; grid_fix[4] = 1E15; grid_fix[5] = 1E15; + grid_fix[0] = -1E15; + grid_fix[1] = -1E15; + grid_fix[2] = -1E15; + grid_fix[3] = 1E15; + grid_fix[4] = 1E15; + grid_fix[5] = 1E15; /* DESCRIPTION: Coordinates of the box where the grid will be deformed (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax) */ addDoubleArrayOption("HOLD_GRID_FIXED_COORD", 6, grid_fix); @@ -2330,7 +2640,8 @@ void CConfig::SetConfig_Options() { addDoubleOption("DEFORM_COEFF", Deform_Coeff, 1E6); /* DESCRIPTION: Deform limit in m or inches */ addDoubleOption("DEFORM_LIMIT", Deform_Limit, 1E6); - /* DESCRIPTION: Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, WALL_DISTANCE, CONSTANT_STIFFNESS) */ + /* DESCRIPTION: Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, WALL_DISTANCE, + * CONSTANT_STIFFNESS) */ addEnumOption("DEFORM_STIFFNESS_TYPE", Deform_StiffnessType, Deform_Stiffness_Map, SOLID_WALL_DISTANCE); /* DESCRIPTION: Young's modulus for constant stiffness FEA method of grid deformation */ addDoubleOption("DEFORM_ELASTICITY_MODULUS", Deform_ElasticityMod, 2E11); @@ -2338,9 +2649,11 @@ void CConfig::SetConfig_Options() { addDoubleOption("DEFORM_POISSONS_RATIO", Deform_PoissonRatio, 0.3); /* DESCRIPTION: Size of the layer of highest stiffness for wall distance-based mesh stiffness */ addDoubleOption("DEFORM_STIFF_LAYER_SIZE", Deform_StiffLayerSize, 0.0); - /* DESCRIPTION: Linear solver for the mesh deformation\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ + /* DESCRIPTION: Linear solver for the mesh deformation\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: + * FGMRES \ingroup Config*/ addEnumOption("DEFORM_LINEAR_SOLVER", Kind_Deform_Linear_Solver, Linear_Solver_Map, FGMRES); - /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink \n DEFAULT: LU_SGS \ingroup Config*/ + /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink + * \n DEFAULT: LU_SGS \ingroup Config*/ addEnumOption("DEFORM_LINEAR_SOLVER_PREC", Kind_Deform_Linear_Solver_Prec, Linear_Solver_Prec_Map, ILU); /* DESCRIPTION: Minimum error threshold for the linear solver for the implicit formulation */ addDoubleOption("DEFORM_LINEAR_SOLVER_ERROR", Deform_Linear_Solver_Error, 1E-14); @@ -2381,9 +2694,11 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: FEA solver \ingroup Config*/ /*--- Options related to the FEA solver ---*/ - /*!\brief FEA_FILENAME \n DESCRIPTION: Filename to input for element-based properties \n Default: default_element_properties.dat \ingroup Config */ + /*!\brief FEA_FILENAME \n DESCRIPTION: Filename to input for element-based properties \n Default: + * default_element_properties.dat \ingroup Config */ addStringOption("FEA_FILENAME", FEA_FileName, string("default_element_properties.dat")); - /* DESCRIPTION: Determine if advanced features are used from the element-based FEA analysis (NO, YES = experimental) */ + /* DESCRIPTION: Determine if advanced features are used from the element-based FEA analysis (NO, YES = experimental) + */ addBoolOption("FEA_ADVANCED_MODE", FEAAdvancedMode, false); /* DESCRIPTION: Modulus of elasticity */ @@ -2398,7 +2713,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("KNOWLES_N", Knowles_N, 1.0); /* DESCRIPTION: Include DE effects - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("DE_EFFECTS", DE_Effects, false); /*!\brief ELECTRIC_FIELD_CONST \n DESCRIPTION: Value of the Dielectric Elastomer constant */ addDoubleListOption("ELECTRIC_FIELD_CONST", nElectric_Constant, Electric_Constant); @@ -2408,18 +2723,22 @@ void CConfig::SetConfig_Options() { addDoubleListOption("ELECTRIC_FIELD_DIR", nDim_Electric_Field, Electric_Field_Dir); /*!\brief DESIGN_VARIABLE_FEA - * \n DESCRIPTION: Design variable for FEA problems \n OPTIONS: See \link DVFEA_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ + * \n DESCRIPTION: Design variable for FEA problems \n OPTIONS: See \link DVFEA_Map \endlink \n DEFAULT + * VENKATAKRISHNAN \ingroup Config */ addEnumOption("DESIGN_VARIABLE_FEA", Kind_DV_FEA, DVFEA_Map, NODV_FEA); /* DESCRIPTION: Consider a reference solution for the structure (optimization applications) - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("REFERENCE_GEOMETRY", RefGeom, false); /*!\brief REFERENCE_GEOMETRY_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_GEOMETRY_PENALTY", RefGeom_Penalty, 1E6); - /*!\brief REFERENCE_GEOMETRY_FILENAME \n DESCRIPTION: Reference geometry filename \n Default: reference_geometry.dat \ingroup Config */ + /*!\brief REFERENCE_GEOMETRY_FILENAME \n DESCRIPTION: Reference geometry filename \n Default: reference_geometry.dat + * \ingroup Config */ addStringOption("REFERENCE_GEOMETRY_FILENAME", RefGeom_FEMFileName, string("reference_geometry.dat")); - /*!\brief REFERENCE_GEOMETRY_FORMAT \n DESCRIPTION: Format of the reference geometry file \n OPTIONS: see \link Input_Ref_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ + /*!\brief REFERENCE_GEOMETRY_FORMAT \n DESCRIPTION: Format of the reference geometry file \n OPTIONS: see \link + * Input_Ref_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ addEnumOption("REFERENCE_GEOMETRY_FORMAT", RefGeom_FileFormat, Input_Ref_Map, SU2_REF); - /*!\brief REFERENCE_GEOMETRY_SURFACE\n DESCRIPTION: If true consider only the surfaces where loads are applied. \ingroup Config*/ + /*!\brief REFERENCE_GEOMETRY_SURFACE\n DESCRIPTION: If true consider only the surfaces where loads are applied. + * \ingroup Config*/ addBoolOption("REFERENCE_GEOMETRY_SURFACE", RefGeomSurf, false); /*!\brief REFERENCE_NODE\n DESCRIPTION: Reference node for the structure (optimization applications) */ @@ -2429,23 +2748,27 @@ void CConfig::SetConfig_Options() { /*!\brief REFERENCE_NODE_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_NODE_PENALTY", RefNode_Penalty, 1E3); - /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup Config*/ + /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup + * Config*/ addDoubleOption("TOTAL_DV_PENALTY", DV_Penalty, 0); - /*!\brief STRESS_PENALTY_PARAM\n DESCRIPTION: Maximum allowed stress and KS exponent for structural optimization \ingroup Config*/ + /*!\brief STRESS_PENALTY_PARAM\n DESCRIPTION: Maximum allowed stress and KS exponent for structural optimization + * \ingroup Config*/ addDoubleArrayOption("STRESS_PENALTY_PARAM", 2, StressPenaltyParam.data()); /*!\brief REGIME_TYPE \n DESCRIPTION: Geometric condition \n OPTIONS: see \link Struct_Map \endlink \ingroup Config*/ addEnumOption("GEOMETRIC_CONDITIONS", Kind_Struct_Solver, Struct_Map, STRUCT_DEFORMATION::SMALL); /*!\brief REGIME_TYPE \n DESCRIPTION: Material model \n OPTIONS: see \link Material_Map \endlink \ingroup Config*/ addEnumOption("MATERIAL_MODEL", Kind_Material, Material_Map, STRUCT_MODEL::LINEAR_ELASTIC); - /*!\brief REGIME_TYPE \n DESCRIPTION: Compressibility of the material \n OPTIONS: see \link MatComp_Map \endlink \ingroup Config*/ + /*!\brief REGIME_TYPE \n DESCRIPTION: Compressibility of the material \n OPTIONS: see \link MatComp_Map \endlink + * \ingroup Config*/ addEnumOption("MATERIAL_COMPRESSIBILITY", Kind_Material_Compress, MatComp_Map, STRUCT_COMPRESS::COMPRESSIBLE); /* DESCRIPTION: Consider a prestretch in the structural domain - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("PRESTRETCH", Prestretch, false); - /*!\brief PRESTRETCH_FILENAME \n DESCRIPTION: Filename to input for prestretching membranes \n Default: prestretch_file.dat \ingroup Config */ + /*!\brief PRESTRETCH_FILENAME \n DESCRIPTION: Filename to input for prestretching membranes \n Default: + * prestretch_file.dat \ingroup Config */ addStringOption("PRESTRETCH_FILENAME", Prestretch_FEMFileName, string("prestretch_file.dat")); /* DESCRIPTION: Iterative method for non-linear structural analysis */ @@ -2453,10 +2776,10 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Formulation for bidimensional elasticity solver */ addEnumOption("FORMULATION_ELASTICITY_2D", Kind_2DElasForm, ElasForm_2D, STRUCT_2DFORM::PLANE_STRAIN); /* DESCRIPTION: Apply dead loads - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("DEAD_LOAD", DeadLoad, false); /* DESCRIPTION: Temporary: pseudo static analysis (no density in dynamic analysis) - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("PSEUDO_STATIC", PseudoStatic, false); /* DESCRIPTION: Parameter alpha for Newmark scheme (s) */ addDoubleOption("NEWMARK_BETA", Newmark_beta, 0.25); @@ -2477,7 +2800,9 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Maximum number of increments of the */ addUnsignedLongOption("NUMBER_INCREMENTS", IncLoad_Nincrements, 10); - inc_crit[0] = 0.0; inc_crit[1] = 0.0; inc_crit[2] = 0.0; + inc_crit[0] = 0.0; + inc_crit[1] = 0.0; + inc_crit[2] = 0.0; /* DESCRIPTION: Definition of the UTOL RTOL ETOL*/ addDoubleArrayOption("INCREMENTAL_CRITERIA", 3, inc_crit); @@ -2495,7 +2820,8 @@ 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, ENUM_PROJECTION_FUNCTION::NONE); + 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 */ @@ -2541,7 +2867,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Determines if the forces breakdown is written out */ addBoolOption("WRT_FORCES_BREAKDOWN", Wrt_ForcesBreakdown, false); - /*!\par KIND_INTERPOLATION \n * DESCRIPTION: Type of interpolation to use for multi-zone problems. \n OPTIONS: see \link Interpolator_Map \endlink * Sets Kind_Interpolation \ingroup Config @@ -2554,13 +2879,14 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("NUM_NEAREST_NEIGHBORS", NumNearestNeighbors, 1); /*!\par KIND_INTERPOLATION \n - * DESCRIPTION: Type of radial basis function to use for radial basis function interpolation. \n OPTIONS: see \link RadialBasis_Map \endlink - * Sets Kind_RadialBasis \ingroup Config + * DESCRIPTION: Type of radial basis function to use for radial basis function interpolation. \n OPTIONS: see \link + * RadialBasis_Map \endlink Sets Kind_RadialBasis \ingroup Config */ - addEnumOption("KIND_RADIAL_BASIS_FUNCTION", Kind_RadialBasisFunction, RadialBasisFunction_Map, RADIAL_BASIS::WENDLAND_C2); + addEnumOption("KIND_RADIAL_BASIS_FUNCTION", Kind_RadialBasisFunction, RadialBasisFunction_Map, + RADIAL_BASIS::WENDLAND_C2); /* DESCRIPTION: Use polynomial term in radial basis function interpolation. - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("RADIAL_BASIS_FUNCTION_POLYNOMIAL_TERM", RadialBasisFunction_PolynomialOption, true); /* DESCRIPTION: Radius for radial basis function. */ @@ -2569,17 +2895,19 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Tolerance to prune small coefficients from the RBF interpolation matrix. */ addDoubleOption("RADIAL_BASIS_FUNCTION_PRUNE_TOLERANCE", RadialBasisFunction_PruneTol, 1e-6); - /*!\par INLETINTERPOLATION \n - * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link Inlet_SpanwiseInterpolation_Map \endlink - * Sets Kind_InletInterpolation \ingroup Config + /*!\par INLETINTERPOLATION \n + * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link + * Inlet_SpanwiseInterpolation_Map \endlink Sets Kind_InletInterpolation \ingroup Config */ - addEnumOption("INLET_INTERPOLATION_FUNCTION",Kind_InletInterpolationFunction, Inlet_SpanwiseInterpolation_Map, INLET_SPANWISE_INTERP::NONE); + addEnumOption("INLET_INTERPOLATION_FUNCTION", Kind_InletInterpolationFunction, Inlet_SpanwiseInterpolation_Map, + INLET_SPANWISE_INTERP::NONE); - /*!\par INLETINTERPOLATION \n - * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link Inlet_SpanwiseInterpolation_Map \endlink - * Sets Kind_InletInterpolation \ingroup Config + /*!\par INLETINTERPOLATION \n + * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link + * Inlet_SpanwiseInterpolation_Map \endlink Sets Kind_InletInterpolation \ingroup Config */ - addEnumOption("INLET_INTERPOLATION_DATA_TYPE", Kind_Inlet_InterpolationType, Inlet_SpanwiseInterpolationType_Map, INLET_INTERP_TYPE::VR_VTHETA); + addEnumOption("INLET_INTERPOLATION_DATA_TYPE", Kind_Inlet_InterpolationType, Inlet_SpanwiseInterpolationType_Map, + INLET_INTERP_TYPE::VR_VTHETA); addBoolOption("PRINT_INLET_INTERPOLATED_DATA", PrintInlet_InterpolatedData, false); @@ -2617,10 +2945,14 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Rotation of the volumetric heat source respect to Z axis */ addDoubleOption("HEAT_SOURCE_ROTATION_Z", Heat_Source_Rot_Z, 0.0); /* DESCRIPTION: Position of heat source center (Heat_Source_Center_X, Heat_Source_Center_Y, Heat_Source_Center_Z) */ - hs_center[0] = 0.0; hs_center[1] = 0.0; hs_center[2] = 0.0; + hs_center[0] = 0.0; + hs_center[1] = 0.0; + hs_center[2] = 0.0; addDoubleArrayOption("HEAT_SOURCE_CENTER", 3, hs_center); /* DESCRIPTION: Vector of heat source radii (Heat_Source_Axes_A, Heat_Source_Axes_B, Heat_Source_Axes_C) */ - hs_axes[0] = 1.0; hs_axes[1] = 1.0; hs_axes[2] = 1.0; + hs_axes[0] = 1.0; + hs_axes[1] = 1.0; + hs_axes[2] = 1.0; addDoubleArrayOption("HEAT_SOURCE_AXES", 3, hs_axes); /*!\brief MARKER_EMISSIVITY DESCRIPTION: Wall emissivity of the marker for radiation purposes \n @@ -2635,7 +2967,8 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: CHT interface coupling methods */ /* Options: NO, YES \ingroup Config */ - addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX); + addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, + CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX); /*!\par CONFIG_CATEGORY: Visualize Control Volumes \ingroup Config*/ /*--- options related to visualizing control volumes ---*/ @@ -2680,7 +3013,9 @@ void CConfig::SetConfig_Options() { addEnumOption("FFD_COORD_SYSTEM", FFD_CoordSystem, CoordSystem_Map, CARTESIAN); /* DESCRIPTION: Axis information for the spherical and cylindrical coord system */ - ffd_axis[0] = 0.0; ffd_axis[1] = 0.0; ffd_axis[2] =0.0; + ffd_axis[0] = 0.0; + ffd_axis[1] = 0.0; + ffd_axis[2] = 0.0; addDoubleArrayOption("FFD_AXIS", 3, ffd_axis); /* DESCRIPTION: Number of total iterations in the FFD point inversion */ @@ -2717,10 +3052,12 @@ void CConfig::SetConfig_Options() { addEnumOption("FFD_CONTINUITY", FFD_Continuity, Continuity_Map, DERIVATIVE_2ND); /* DESCRIPTION: Kind of blending for the FFD definition */ - addEnumOption("FFD_BLENDING", FFD_Blending, Blending_Map, BEZIER ); + addEnumOption("FFD_BLENDING", FFD_Blending, Blending_Map, BEZIER); /* DESCRIPTION: Order of the BSplines for BSpline Blending function */ - ffd_coeff[0] = 2; ffd_coeff[1] = 2; ffd_coeff[2] = 2; + ffd_coeff[0] = 2; + ffd_coeff[1] = 2; + ffd_coeff[2] = 2; addDoubleArrayOption("FFD_BSPLINE_ORDER", 3, ffd_coeff); /*--- Options for the automatic differentiation methods ---*/ @@ -2925,11 +3262,9 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("ROM_SAVE_FREQ", rom_save_freq, 1); /* END_CONFIG_OPTIONS */ - } void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) { - ifstream case_file; /*--- Read the configuration file ---*/ @@ -2943,32 +3278,29 @@ void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) { SetConfig_Parsing(case_file); case_file.close(); - } -void CConfig::SetConfig_Parsing(istream& config_buffer){ - +void CConfig::SetConfig_Parsing(istream& config_buffer) { string text_line, option_name; vector option_value; string errorString; - const int max_err_count = 30; // Maximum number of errors to print before stopping - int err_count = 0; // How many errors have we found in the config file + const int max_err_count = 30; // Maximum number of errors to print before stopping + int err_count = 0; // How many errors have we found in the config file int line_count = 1; map included_options; /*--- Parse the configuration file and set the options ---*/ - while (getline (config_buffer, text_line)) { - + while (getline(config_buffer, text_line)) { if (err_count >= max_err_count) { errorString.append("Too many errors, stopping parse."); break; } - PrintingToolbox::trim(text_line); + PrintingToolbox::trim(text_line); /*--- Check if there is a line continuation character at the * end of the current line or somewhere in between (the rest is ignored then). @@ -2976,74 +3308,78 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ * If there is a statement after a cont. char * throw an error. ---*/ - if (!text_line.empty() && (text_line.front() != '%')){ - while (text_line.back() == '\\' || - (PrintingToolbox::split(text_line, '\\').size() > 1)){ - string tmp; - getline (config_buffer, tmp); - line_count++; - if (tmp.find_first_of('=') != string::npos){ - errorString.append("Line " + to_string(line_count) + ": Statement found after continuation character.\n"); - } - PrintingToolbox::trim(tmp); - if (tmp.front() != '%'){ - text_line = PrintingToolbox::split(text_line, '\\')[0]; - text_line += " " + tmp; - } - } - } + if (!text_line.empty() && (text_line.front() != '%')) { + while (text_line.back() == '\\' || (PrintingToolbox::split(text_line, '\\').size() > 1)) { + string tmp; + getline(config_buffer, tmp); + line_count++; + if (tmp.find_first_of('=') != string::npos) { + errorString.append("Line " + to_string(line_count) + ": Statement found after continuation character.\n"); + } + PrintingToolbox::trim(tmp); + if (tmp.front() != '%') { + text_line = PrintingToolbox::split(text_line, '\\')[0]; + text_line += " " + tmp; + } + } + } if (TokenizeString(text_line, option_name, option_value)) { /*--- See if it's a python option ---*/ if (option_map.find(option_name) == option_map.end()) { - string newString; - newString.append("Line " + to_string(line_count) + " " + option_name); - newString.append(": invalid option name"); - newString.append(". Check current SU2 options in config_template.cfg."); - newString.append("\n"); - if (!option_name.compare("SINGLEZONE_DRIVER")) - newString.append("Option SINGLEZONE_DRIVER is deprecated, it does not have a replacement.\n\n"); - else if (!option_name.compare("DYN_TIMESTEP")) - newString.append("DYN_TIMESTEP is deprecated. Use TIME_STEP instead.\n\n"); - else if (!option_name.compare("DYN_TIME")) - newString.append("DYN_TIME is deprecated. Use MAX_TIME instead.\n\n"); - else if (!option_name.compare("DYNAMIC_ANALYSIS")) - newString.append("DYNAMIC_ANALYSIS is deprecated. Use TIME_DOMAIN instead.\n\n"); - else if (!option_name.compare("SPECIES_USE_STRONG_BC")) - newString.append("SPECIES_USE_STRONG_BC is deprecated. Use MARKER_SPECIES_STRONG_BC= (marker1, ...) instead.\n\n"); - else { - /*--- Find the most likely candidate for the unrecognized option, based on the length - of start and end character sequences shared by candidates and the option. ---*/ - auto countMatchChars = [&option_name](const string& candidate) { - const size_t sz1 = option_name.size(), sz2 = candidate.size(); - size_t nMatch = 0; - for (size_t i=0; i maxScore) { - maxScore = score; - match = candidate.first; - } + string newString; + newString.append("Line " + to_string(line_count) + " " + option_name); + newString.append(": invalid option name"); + newString.append(". Check current SU2 options in config_template.cfg."); + newString.append("\n"); + if (!option_name.compare("SINGLEZONE_DRIVER")) + newString.append("Option SINGLEZONE_DRIVER is deprecated, it does not have a replacement.\n\n"); + else if (!option_name.compare("DYN_TIMESTEP")) + newString.append("DYN_TIMESTEP is deprecated. Use TIME_STEP instead.\n\n"); + else if (!option_name.compare("DYN_TIME")) + newString.append("DYN_TIME is deprecated. Use MAX_TIME instead.\n\n"); + else if (!option_name.compare("DYNAMIC_ANALYSIS")) + newString.append("DYNAMIC_ANALYSIS is deprecated. Use TIME_DOMAIN instead.\n\n"); + else if (!option_name.compare("SPECIES_USE_STRONG_BC")) + newString.append( + "SPECIES_USE_STRONG_BC is deprecated. Use MARKER_SPECIES_STRONG_BC= (marker1, ...) instead.\n\n"); + else { + /*--- Find the most likely candidate for the unrecognized option, based on the length + of start and end character sequences shared by candidates and the option. ---*/ + auto countMatchChars = [&option_name](const string& candidate) { + const size_t sz1 = option_name.size(), sz2 = candidate.size(); + size_t nMatch = 0; + for (size_t i = 0; i < min(sz1, sz2); ++i) { + if (option_name[i] == candidate[i]) + nMatch++; + else + break; + } + for (size_t i = 0; i < min(sz1, sz2); ++i) { + if (option_name[sz1 - 1 - i] == candidate[sz2 - 1 - i]) + nMatch++; + else + break; + } + return nMatch; + }; + string match; + size_t maxScore = 0; + for (auto& candidate : option_map) { + auto score = countMatchChars(candidate.first); + if (score > maxScore) { + maxScore = score; + match = candidate.first; } - newString.append("Did you mean "); - newString.append(match); - newString.append("?\n"); } - errorString.append(newString); - err_count++; - line_count++; + newString.append("Did you mean "); + newString.append(match); + newString.append("?\n"); + } + errorString.append(newString); + err_count++; + line_count++; continue; } @@ -3051,7 +3387,7 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ if (included_options.find(option_name) != included_options.end()) { string newString; - newString.append("Line " + to_string(line_count) + " " + option_name); + newString.append("Line " + to_string(line_count) + " " + option_name); newString.append(": option appears twice"); newString.append("\n"); errorString.append(newString); @@ -3072,18 +3408,27 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ /*--- valid option, but deprecated value ---*/ if (!option_name.compare("KIND_TURB_MODEL")) { if (option_value[0] == "SST_SUST") - errorString.append("Option KIND_TURB_MODEL=SST_SUST is deprecated. Use KIND_TURB_MODEL=SST, SST_OPTIONS=SUSTAINING instead.\n"); + errorString.append( + "Option KIND_TURB_MODEL=SST_SUST is deprecated. Use KIND_TURB_MODEL=SST, SST_OPTIONS=SUSTAINING " + "instead.\n"); else if (option_value[0] == "SA_NEG") - errorString.append("Option KIND_TURB_MODEL=SA_NEG is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=NEGATIVE instead.\n"); + errorString.append( + "Option KIND_TURB_MODEL=SA_NEG is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=NEGATIVE instead.\n"); else if (option_value[0] == "SA_E") - errorString.append("Option KIND_TURB_MODEL=SA_E is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS instead.\n"); + errorString.append( + "Option KIND_TURB_MODEL=SA_E is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS instead.\n"); else if (option_value[0] == "SA_COMP") - errorString.append("Option KIND_TURB_MODEL=SA_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=COMPRESSIBILITY instead.\n"); + errorString.append( + "Option KIND_TURB_MODEL=SA_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=COMPRESSIBILITY " + "instead.\n"); else if (option_value[0] == "SA_E_COMP") - errorString.append("Option KIND_TURB_MODEL=SA_E_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS,COMPRESSIBILITY instead.\n"); + errorString.append( + "Option KIND_TURB_MODEL=SA_E_COMP is deprecated. Use KIND_TURB_MODEL=SA, " + "SA_OPTIONS=EDWARDS,COMPRESSIBILITY instead.\n"); } else if (!option_name.compare("KIND_TRANS_MODEL")) { if (option_value[0] == "BC") - errorString.append("Option KIND_TRANS_MODEL=BC is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=BCM instead.\n"); + errorString.append( + "Option KIND_TRANS_MODEL=BC is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=BCM instead.\n"); } errorString.append(out); errorString.append("\n"); @@ -3100,28 +3445,25 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ } } -void CConfig::SetDefaultFromConfig(CConfig *config){ - - map noInheritance = {{"SCREEN_OUTPUT", true},{"HISTORY_OUTPUT", true}}; +void CConfig::SetDefaultFromConfig(CConfig* config) { + map noInheritance = {{"SCREEN_OUTPUT", true}, {"HISTORY_OUTPUT", true}}; map::iterator iter = all_options.begin(), curr_iter; - while (iter != all_options.end()){ + while (iter != all_options.end()) { curr_iter = iter++; - if (!config->option_map[curr_iter->first]->GetValue().empty() && !noInheritance[curr_iter->first]){ + if (!config->option_map[curr_iter->first]->GetValue().empty() && !noInheritance[curr_iter->first]) { option_map[curr_iter->first]->SetValue(config->option_map[curr_iter->first]->GetValue()); all_options.erase(curr_iter); } } } -void CConfig::SetDefault(){ - +void CConfig::SetDefault() { /*--- Set the default values for all of the options that weren't set ---*/ for (auto iter = all_options.begin(); iter != all_options.end(); ++iter) { - if (option_map[iter->first]->GetValue().empty()) - option_map[iter->first]->SetDefault(); + if (option_map[iter->first]->GetValue().empty()) option_map[iter->first]->SetDefault(); } } @@ -3134,28 +3476,27 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { case_file.open(case_filename, ios::in); - if (case_file.fail()) { return false; } + if (case_file.fail()) { + return false; + } string errorString; - int err_count = 0; // How many errors have we found in the config file - const int max_err_count = 30; // Maximum number of errors to print before stopping + int err_count = 0; // How many errors have we found in the config file + const int max_err_count = 30; // Maximum number of errors to print before stopping map included_options; /*--- Parse the configuration file and set the options ---*/ - while (getline (case_file, text_line)) { - + while (getline(case_file, text_line)) { if (err_count >= max_err_count) { errorString.append("Too many errors, stopping parse."); break; } if (TokenizeString(text_line, option_name, option_value)) { - if (option_map.find(option_name) == option_map.end()) { - /*--- See if it's a python option ---*/ string newString; @@ -3192,7 +3533,6 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { errorString.append("\n"); err_count++; } - } } @@ -3211,11 +3551,9 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { case_file.close(); return true; - } -void CConfig::SetHeader(SU2_COMPONENT val_software) const{ - +void CConfig::SetHeader(SU2_COMPONENT val_software) const { if ((iZone == 0) && (rank == MASTER_NODE)) { cout << "\n"; cout << "-------------------------------------------------------------------------\n"; @@ -3223,11 +3561,21 @@ void CConfig::SetHeader(SU2_COMPONENT val_software) const{ cout << "| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |\n"; cout << "| \\__ \\ |_| |/ / |\n"; switch (val_software) { - case SU2_COMPONENT::SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n"; break; - case SU2_COMPONENT::SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |\n"; break; - case SU2_COMPONENT::SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |\n"; break; - case SU2_COMPONENT::SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |\n"; break; - case SU2_COMPONENT::SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |\n"; break; + case SU2_COMPONENT::SU2_CFD: + cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n"; + break; + case SU2_COMPONENT::SU2_DEF: + cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |\n"; + break; + case SU2_COMPONENT::SU2_DOT: + cout << "| |___/\\___//___| Suite (Gradient Projection Code) |\n"; + break; + case SU2_COMPONENT::SU2_GEO: + cout << "| |___/\\___//___| Suite (Geometry Definition Code) |\n"; + break; + case SU2_COMPONENT::SU2_SOL: + cout << "| |___/\\___//___| Suite (Solution Exporting Code) |\n"; + break; } cout << "| |\n"; cout << "-------------------------------------------------------------------------\n"; @@ -3252,90 +3600,80 @@ void CConfig::SetHeader(SU2_COMPONENT val_software) const{ cout << "| License along with SU2. If not, see . |\n"; cout << "-------------------------------------------------------------------------" << endl; } - } -void CConfig::SetnZone(){ - +void CConfig::SetnZone() { /*--- Just as a clarification --- */ - if (Multizone_Problem == NO && Kind_Solver != MAIN_SOLVER::MULTIPHYSICS){ + if (Multizone_Problem == NO && Kind_Solver != MAIN_SOLVER::MULTIPHYSICS) { nZone = 1; } - if (Kind_Solver == MAIN_SOLVER::MULTIPHYSICS){ + if (Kind_Solver == MAIN_SOLVER::MULTIPHYSICS) { Multizone_Problem = YES; - if (nConfig_Files == 0){ + if (nConfig_Files == 0) { SU2_MPI::Error("CONFIG_LIST must be provided if PHYSICAL_PROBLEM=MULTIPHYSICS", CURRENT_FUNCTION); } } - if (Multizone_Problem == YES){ - + if (Multizone_Problem == YES) { /*--- Some basic multizone checks ---*/ - if (nMarker_ZoneInterface % 2 != 0){ + if (nMarker_ZoneInterface % 2 != 0) { SU2_MPI::Error("Number of markers in MARKER_ZONE_INTERFACE must be a multiple of 2", CURRENT_FUNCTION); } - if (Multizone_Mesh){ - + if (Multizone_Mesh) { /*--- Get the number of zones from the mesh file --- */ nZone = GetnZone(Mesh_FileName, Mesh_FileFormat); /*--- If config list is set, make sure number matches number of zones in mesh file --- */ - if (nConfig_Files != 0 && (nZone != nConfig_Files)){ + if (nConfig_Files != 0 && (nZone != nConfig_Files)) { SU2_MPI::Error("Number of CONFIG_LIST must match number of zones in mesh file.", CURRENT_FUNCTION); } } else { - /*--- Number of zones is determined from the number of config files provided --- */ - if (nConfig_Files == 0){ - SU2_MPI::Error("If MULTIZONE_MESH is set to YES, you must provide a list of config files using CONFIG_LIST option", CURRENT_FUNCTION); + if (nConfig_Files == 0) { + SU2_MPI::Error( + "If MULTIZONE_MESH is set to YES, you must provide a list of config files using CONFIG_LIST option", + CURRENT_FUNCTION); } nZone = nConfig_Files; - } /*--- Check if subconfig files exist --- */ - if (nConfig_Files != 0){ - for (unsigned short iConfig = 0; iConfig < nConfig_Files; iConfig++){ + if (nConfig_Files != 0) { + for (unsigned short iConfig = 0; iConfig < nConfig_Files; iConfig++) { ifstream f(Config_Filenames[iConfig].c_str()); - if (!f.good()){ - SU2_MPI::Error("Config file " + Config_Filenames[iConfig] + " defined in CONFIG_FILES does not exist", CURRENT_FUNCTION); + if (!f.good()) { + SU2_MPI::Error("Config file " + Config_Filenames[iConfig] + " defined in CONFIG_FILES does not exist", + CURRENT_FUNCTION); } } } - } - } 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) || - (Kind_FluidModel == IDEAL_GAS) || - (Kind_FluidModel == INC_IDEAL_GAS) || - (Kind_FluidModel == FLUID_MIXTURE) || - (Kind_FluidModel == FLUID_FLAMELET) || - (Kind_FluidModel == INC_IDEAL_GAS_POLY) || - (Kind_FluidModel == CONSTANT_DENSITY)); - bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) || - (Kind_FluidModel == SU2_NONEQ)); + bool ideal_gas = + ((Kind_FluidModel == STANDARD_AIR) || (Kind_FluidModel == IDEAL_GAS) || (Kind_FluidModel == INC_IDEAL_GAS) || + (Kind_FluidModel == FLUID_MIXTURE) || (Kind_FluidModel == FLUID_FLAMELET) || + (Kind_FluidModel == INC_IDEAL_GAS_POLY) || (Kind_FluidModel == CONSTANT_DENSITY)); + bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) || (Kind_FluidModel == SU2_NONEQ)); bool standard_air = ((Kind_FluidModel == STANDARD_AIR)); bool nemo = GetNEMOProblem(); - if (nZone > 1){ + if (nZone > 1) { Multizone_Problem = YES; } /*--- Set the default output files ---*/ - if (!OptionIsSet("OUTPUT_FILES")){ + if (!OptionIsSet("OUTPUT_FILES")) { nVolumeOutputFiles = 3; VolumeOutputFiles = new OUTPUT_TYPE[nVolumeOutputFiles]; VolumeOutputFiles[0] = OUTPUT_TYPE::RESTART_BINARY; @@ -3344,35 +3682,38 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } /*--- Set the default output frequencies ---*/ - if (!OptionIsSet("OUTPUT_WRT_FREQ")){ + if (!OptionIsSet("OUTPUT_WRT_FREQ")) { nVolumeOutputFrequencies = nVolumeOutputFiles; - VolumeOutputFrequencies = new unsigned long [nVolumeOutputFrequencies]; + VolumeOutputFrequencies = new unsigned long[nVolumeOutputFrequencies]; /*--- Using default frequency of 250 for all files when steady, and 1 for unsteady. ---*/ - for (auto iVolumeFreq = 0; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++){ + for (auto iVolumeFreq = 0; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++) { VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : 250; } } else if (nVolumeOutputFrequencies < nVolumeOutputFiles) { /*--- If there are fewer frequencies than files, repeat the last frequency. - * This is useful to define 1 frequency for the restart file and 1 frequency for all the visualization files. ---*/ + * This is useful to define 1 frequency for the restart file and 1 frequency for all the visualization files. + * ---*/ auto* newFrequencies = new unsigned long[nVolumeOutputFiles]; for (unsigned short i = 0; i < nVolumeOutputFrequencies; ++i) { newFrequencies[i] = VolumeOutputFrequencies[i]; } for (auto i = nVolumeOutputFrequencies; i < nVolumeOutputFiles; ++i) { - newFrequencies[i] = newFrequencies[i-1]; + newFrequencies[i] = newFrequencies[i - 1]; } - delete [] VolumeOutputFrequencies; + delete[] VolumeOutputFrequencies; VolumeOutputFrequencies = newFrequencies; nVolumeOutputFrequencies = nVolumeOutputFiles; } /*--- Check if SU2 was build with TecIO support, as that is required for Tecplot Binary output. ---*/ #ifndef HAVE_TECIO - for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++){ + for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++) { if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::TECPLOT_BINARY || VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::SURFACE_TECPLOT_BINARY) { - SU2_MPI::Error(string("Tecplot binary file requested in option OUTPUT_FILES but SU2 was built without TecIO support.\n"), CURRENT_FUNCTION); + SU2_MPI::Error( + string("Tecplot binary file requested in option OUTPUT_FILES but SU2 was built without TecIO support.\n"), + CURRENT_FUNCTION); } } #endif @@ -3382,7 +3723,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++) { if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::CGNS || VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::SURFACE_CGNS) { - SU2_MPI::Error(string("CGNS file requested in option OUTPUT_FILES but SU2 was built without CGNS support.\n"),CURRENT_FUNCTION); + SU2_MPI::Error(string("CGNS file requested in option OUTPUT_FILES but SU2 was built without CGNS support.\n"), + CURRENT_FUNCTION); } } #endif @@ -3394,10 +3736,12 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- STL_BINARY output not implemented yet, but already a value in option_structure.hpp---*/ for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++) { - if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY){ - SU2_MPI::Error(string("OUTPUT_FILES: 'STL_BINARY' output not implemented. Use 'STL' for ASCII output.\n"), CURRENT_FUNCTION); + if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY) { + SU2_MPI::Error(string("OUTPUT_FILES: 'STL_BINARY' output not implemented. Use 'STL' for ASCII output.\n"), + CURRENT_FUNCTION); } - if (val_nDim == 2 && (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_ASCII || VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY)) { + if (val_nDim == 2 && (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_ASCII || + VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY)) { SU2_MPI::Error(string("OUTPUT_FILES: 'STL(_BINARY)' output only reasonable for 3D cases.\n"), CURRENT_FUNCTION); } } @@ -3405,7 +3749,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check if MESH_QUALITY is requested in VOLUME_OUTPUT and set the config boolean accordingly. ---*/ Wrt_MeshQuality = false; for (unsigned short iField = 0; iField < nVolumeOutput; iField++) { - if(VolumeOutput[iField].find("MESH_QUALITY") != string::npos) { + if (VolumeOutput[iField].find("MESH_QUALITY") != string::npos) { Wrt_MeshQuality = true; } } @@ -3413,21 +3757,21 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check if MULTIGRID is requested in VOLUME_OUTPUT and set the config boolean accordingly. ---*/ Wrt_MultiGrid = false; for (unsigned short iField = 0; iField < nVolumeOutput; iField++) { - if(VolumeOutput[iField].find("MULTIGRID") != string::npos) { + if (VolumeOutput[iField].find("MULTIGRID") != string::npos) { Wrt_MultiGrid = true; } } - if (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE){ + if (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE) { SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= NAVIER_STOKES", CURRENT_FUNCTION); } - if (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE){ + if (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE) { SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= INC_NAVIER_STOKES", CURRENT_FUNCTION); } - if (Kind_Solver == MAIN_SOLVER::RANS && Kind_Turb_Model == TURB_MODEL::NONE){ + if (Kind_Solver == MAIN_SOLVER::RANS && Kind_Turb_Model == TURB_MODEL::NONE) { SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= RANS", CURRENT_FUNCTION); } - if (Kind_Solver == MAIN_SOLVER::INC_RANS && Kind_Turb_Model == TURB_MODEL::NONE){ + if (Kind_Solver == MAIN_SOLVER::INC_RANS && Kind_Turb_Model == TURB_MODEL::NONE) { SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= INC_RANS", CURRENT_FUNCTION); } @@ -3439,7 +3783,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } /*--- Check if turbulence model can be used for AXISYMMETRIC case---*/ - if (Axisymmetric && Kind_Turb_Model != TURB_MODEL::NONE && Kind_Turb_Model != TURB_MODEL::SST){ + if (Axisymmetric && Kind_Turb_Model != TURB_MODEL::NONE && Kind_Turb_Model != TURB_MODEL::SST) { SU2_MPI::Error("Axisymmetry is currently only supported for KIND_TURB_MODEL chosen as SST", CURRENT_FUNCTION); } @@ -3459,21 +3803,23 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Wall_Functions = false; if (nMarker_WallFunctions > 0) { for (iMarker = 0; iMarker < nMarker_WallFunctions; iMarker++) { - if (Kind_WallFunctions[iMarker] != WALL_FUNCTIONS::NONE) - Wall_Functions = true; + if (Kind_WallFunctions[iMarker] != WALL_FUNCTIONS::NONE) Wall_Functions = true; if ((Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::ADAPTIVE_FUNCTION) || (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::SCALABLE_FUNCTION) || (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::NONEQUILIBRIUM_MODEL)) - SU2_MPI::Error(string("For RANS problems, use NONE, STANDARD_WALL_FUNCTION or EQUILIBRIUM_WALL_MODEL.\n"), CURRENT_FUNCTION); + SU2_MPI::Error(string("For RANS problems, use NONE, STANDARD_WALL_FUNCTION or EQUILIBRIUM_WALL_MODEL.\n"), + CURRENT_FUNCTION); if (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::STANDARD_FUNCTION) { if ((Kind_Solver != MAIN_SOLVER::RANS) && (Kind_Solver != MAIN_SOLVER::INC_RANS)) - SU2_MPI::Error(string("Wall model STANDARD_FUNCTION only available for RANS or INC_RANS.\n"), CURRENT_FUNCTION); + SU2_MPI::Error(string("Wall model STANDARD_FUNCTION only available for RANS or INC_RANS.\n"), + CURRENT_FUNCTION); if (nRough_Wall != 0) - SU2_MPI::Error(string("Wall model STANDARD_FUNCTION and WALL_ROUGHNESS migh not be compatible. Checking required!\n"), CURRENT_FUNCTION); + SU2_MPI::Error( + string("Wall model STANDARD_FUNCTION and WALL_ROUGHNESS migh not be compatible. Checking required!\n"), + CURRENT_FUNCTION); } - } } @@ -3481,10 +3827,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i solver. This is typically unused (often internal flows). Also fixed CL mode for incompressible flows is not implemented ---*/ - if (Kind_Solver == MAIN_SOLVER::INC_EULER || - Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || + if (Kind_Solver == MAIN_SOLVER::INC_EULER || Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::INC_RANS) { - /*--- Compute x-velocity with a safegaurd for 0.0. ---*/ su2double Vx = 1e-10; @@ -3496,10 +3840,10 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i su2double alpha = 0.0, beta = 0.0; if (val_nDim == 2) { - alpha = atan(vel_init[1]/Vx)*180.0/PI_NUMBER; + alpha = atan(vel_init[1] / Vx) * 180.0 / PI_NUMBER; } else { - alpha = atan(vel_init[2]/Vx)*180.0/PI_NUMBER; - beta = atan(vel_init[1]/Vx)*180.0/PI_NUMBER; + alpha = atan(vel_init[2] / Vx) * 180.0 / PI_NUMBER; + beta = atan(vel_init[1] / Vx) * 180.0 / PI_NUMBER; } /*--- Set alpha and beta in the config class. ---*/ @@ -3513,7 +3857,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Inc CHT simulation, but energy equation of fluid is inactive. ---*/ if (Multizone_Problem && (nMarker_CHTInterface > 0) && !Energy_Equation) - SU2_MPI::Error(string("You probably want to set INC_ENERGY_EQUATION= YES for the fluid solver. \n"), CURRENT_FUNCTION); + SU2_MPI::Error(string("You probably want to set INC_ENERGY_EQUATION= YES for the fluid solver. \n"), + CURRENT_FUNCTION); } /*--- By default, in 2D we should use TWOD_AIRFOIL (independenly from the input file) ---*/ @@ -3560,9 +3905,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Set the default for thrust in ActDisk ---*/ - if ((Kind_ActDisk == NET_THRUST) || (Kind_ActDisk == BC_THRUST) - || (Kind_ActDisk == DRAG_MINUS_THRUST) || (Kind_ActDisk == MASSFLOW) - || (Kind_ActDisk == POWER)) + if ((Kind_ActDisk == NET_THRUST) || (Kind_ActDisk == BC_THRUST) || (Kind_ActDisk == DRAG_MINUS_THRUST) || + (Kind_ActDisk == MASSFLOW) || (Kind_ActDisk == POWER)) ActDisk_Jump = RATIO; /*--- Error-catching and automatic array adjustments for objective, marker, and weights arrays --- */ @@ -3574,60 +3918,60 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Kind_ObjFunc[0] = DRAG_COEFFICIENT; Weight_ObjFunc = new su2double[1]; Weight_ObjFunc[0] = 1.0; - nObj=1; - nObjW=1; + nObj = 1; + nObjW = 1; } /*--- Maker sure that arrays are the same length ---*/ - if (nObj>0) { - if (nMarker_Monitoring!=nObj && Marker_Monitoring!= nullptr) { - if (nMarker_Monitoring==1) { - /*-- If only one marker was listed with multiple objectives, set that marker as the marker for each objective ---*/ + if (nObj > 0) { + if (nMarker_Monitoring != nObj && Marker_Monitoring != nullptr) { + if (nMarker_Monitoring == 1) { + /*-- If only one marker was listed with multiple objectives, set that marker as the marker for each objective + * ---*/ nMarker_Monitoring = nObj; string marker = Marker_Monitoring[0]; delete[] Marker_Monitoring; Marker_Monitoring = new string[nMarker_Monitoring]; - for (iMarker=0; iMarker1) { - SU2_MPI::Error("When using more than one OBJECTIVE_FUNCTION, MARKER_MONITORING must be the same length or length 1.\n" - "For multiple surfaces per objective, either use one objective or list the objective multiple times.\n" - "For multiple objectives per marker either use one marker or list the marker multiple times.\n" - "Similar rules apply for multi-objective optimization using OPT_OBJECTIVE rather than OBJECTIVE_FUNCTION.", - CURRENT_FUNCTION); + } else if (nObj > 1) { + SU2_MPI::Error( + "When using more than one OBJECTIVE_FUNCTION, MARKER_MONITORING must be the same length or length 1.\n" + "For multiple surfaces per objective, either use one objective or list the objective multiple times.\n" + "For multiple objectives per marker either use one marker or list the marker multiple times.\n" + "Similar rules apply for multi-objective optimization using OPT_OBJECTIVE rather than OBJECTIVE_FUNCTION.", + CURRENT_FUNCTION); } } } /*-- Correct for case where Weight_ObjFunc has not been provided or has length < kind_objfunc---*/ - if (nObjW1) { - SU2_MPI::Error("The option OBJECTIVE_WEIGHT must either have the same length as OBJECTIVE_FUNCTION,\n" - "be lenght 1, or be deleted from the config file (equal weights will be applied).", CURRENT_FUNCTION); + if (nObjW < nObj) { + if (Weight_ObjFunc != nullptr && nObjW > 1) { + SU2_MPI::Error( + "The option OBJECTIVE_WEIGHT must either have the same length as OBJECTIVE_FUNCTION,\n" + "be lenght 1, or be deleted from the config file (equal weights will be applied).", + CURRENT_FUNCTION); } Weight_ObjFunc = new su2double[nObj]; - for (unsigned short iObj=0; iObj 1) { unsigned short Obj_0 = Kind_ObjFunc[0]; - for (unsigned short iObj=1; iObj 0){ + if (nObj > 0) { if (Kind_ObjFunc[0] == CUSTOM_OBJFUNC && CustomObjFunc.empty() && !Multizone_Problem) { - SU2_MPI::Error("The expression for the custom objective function was not set.\n" - "For example, CUSTOM_OBJFUNC= LIFT/DRAG", CURRENT_FUNCTION); + SU2_MPI::Error( + "The expression for the custom objective function was not set.\n" + "For example, CUSTOM_OBJFUNC= LIFT/DRAG", + CURRENT_FUNCTION); } } /*--- Check for unsteady problem ---*/ - 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); + 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); } - if (Time_Domain){ + if (Time_Domain) { Delta_UnstTime = Time_Step; - if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ InnerIter = 1; } + if (TimeMarching == TIME_MARCHING::TIME_STEPPING) { + InnerIter = 1; + } /*--- Set History write freq for inner and outer iteration to zero by default, so only time iterations write. ---*/ - if (!OptionIsSet("HISTORY_WRT_FREQ_INNER")) { HistoryWrtFreq[2] = 0; } - if (!OptionIsSet("HISTORY_WRT_FREQ_OUTER")) { HistoryWrtFreq[1] = 0; } + if (!OptionIsSet("HISTORY_WRT_FREQ_INNER")) { + HistoryWrtFreq[2] = 0; + } + if (!OptionIsSet("HISTORY_WRT_FREQ_OUTER")) { + HistoryWrtFreq[1] = 0; + } if (Restart == NO) { Restart_Iter = 0; } else { - if(nTimeIter <= Restart_Iter) SU2_MPI::Error("TIME_ITER must be larger than RESTART_ITER.", CURRENT_FUNCTION); + if (nTimeIter <= Restart_Iter) SU2_MPI::Error("TIME_ITER must be larger than RESTART_ITER.", CURRENT_FUNCTION); } - /*--- WINDOW_START_ITER must be larger than or equal to: RESTART_ITER. Otherwise, the running average is wrong. ---*/ + /*--- WINDOW_START_ITER must be larger than or equal to: RESTART_ITER. Otherwise, the running average is wrong. + * ---*/ if (OptionIsSet("WINDOW_START_ITER")) { if (StartWindowIteration < Restart_Iter) { SU2_MPI::Error("WINDOW_START_ITER must be larger than or equal to: RESTART_ITER!", CURRENT_FUNCTION); } } else { /*--- Enforced default behavior: start of the window is the first new iteration. ---*/ - if (rank == MASTER_NODE) cout << "WARNING: Setting WINDOW_START_ITER = RESTART_ITER for meaningful running average.\n"; + if (rank == MASTER_NODE) + cout << "WARNING: Setting WINDOW_START_ITER = RESTART_ITER for meaningful running average.\n"; StartWindowIteration = Restart_Iter; } - if (Time_Step <= 0.0 && Unst_CFL == 0.0){ SU2_MPI::Error("Invalid value for TIME_STEP.", CURRENT_FUNCTION); } + if (Time_Step <= 0.0 && Unst_CFL == 0.0) { + SU2_MPI::Error("Invalid value for TIME_STEP.", CURRENT_FUNCTION); + } } else { nTimeIter = 1; Time_Step = 0; /*--- Entry 0 corresponds to unsteady simulation so for steady simulation are just set to 1. ---*/ - ScreenWrtFreq[0] = 1; + ScreenWrtFreq[0] = 1; HistoryWrtFreq[0] = 1; - if (TimeMarching != TIME_MARCHING::HARMONIC_BALANCE) { TimeMarching = TIME_MARCHING::STEADY; } + if (TimeMarching != TIME_MARCHING::HARMONIC_BALANCE) { + TimeMarching = TIME_MARCHING::STEADY; + } } - if (Time_Domain && !GetWrt_Restart_Overwrite()){ - SU2_MPI::Error("Appending iterations to the filename (WRT_RESTART_OVERWRITE=NO) is incompatible with transient problems.", CURRENT_FUNCTION); + if (Time_Domain && !GetWrt_Restart_Overwrite()) { + SU2_MPI::Error( + "Appending iterations to the filename (WRT_RESTART_OVERWRITE=NO) is incompatible with transient problems.", + CURRENT_FUNCTION); } - if (Time_Domain && !GetWrt_Surface_Overwrite()){ - SU2_MPI::Error("Appending iterations to the filename (WRT_SURFACE_OVERWRITE=NO) is incompatible with transient problems.", CURRENT_FUNCTION); + if (Time_Domain && !GetWrt_Surface_Overwrite()) { + SU2_MPI::Error( + "Appending iterations to the filename (WRT_SURFACE_OVERWRITE=NO) is incompatible with transient problems.", + CURRENT_FUNCTION); } - if (Time_Domain && !GetWrt_Volume_Overwrite()){ - SU2_MPI::Error("Appending iterations to the filename (WRT_VOLUME_OVERWRITE=NO) is incompatible with transient problems.", CURRENT_FUNCTION); + if (Time_Domain && !GetWrt_Volume_Overwrite()) { + SU2_MPI::Error( + "Appending iterations to the filename (WRT_VOLUME_OVERWRITE=NO) is incompatible with transient problems.", + CURRENT_FUNCTION); } - /*--- Ensure that Discard_InFiles is false, owerwise the gradient could be wrong ---*/ - if ((ContinuousAdjoint || DiscreteAdjoint) && Fixed_CL_Mode && !Eval_dOF_dCX) - Discard_InFiles = false; + if ((ContinuousAdjoint || DiscreteAdjoint) && Fixed_CL_Mode && !Eval_dOF_dCX) Discard_InFiles = false; /*--- Deactivate the multigrid in the adjoint problem ---*/ - if ((ContinuousAdjoint && !MG_AdjointFlow) || - (TimeMarching == TIME_MARCHING::TIME_STEPPING)) { nMGLevels = 0; } - - if (Kind_Solver == MAIN_SOLVER::EULER || - Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::RANS || - Kind_Solver == MAIN_SOLVER::NEMO_EULER || - Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::FEM_EULER || - Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::FEM_RANS || - Kind_Solver == MAIN_SOLVER::FEM_LES){ + if ((ContinuousAdjoint && !MG_AdjointFlow) || (TimeMarching == TIME_MARCHING::TIME_STEPPING)) { + nMGLevels = 0; + } + + if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::RANS || Kind_Solver == MAIN_SOLVER::NEMO_EULER || + Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::FEM_EULER || + Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::FEM_RANS || + Kind_Solver == MAIN_SOLVER::FEM_LES) { Kind_Regime = ENUM_REGIME::COMPRESSIBLE; - } else if (Kind_Solver == MAIN_SOLVER::INC_EULER || - Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::INC_RANS){ + } else if (Kind_Solver == MAIN_SOLVER::INC_EULER || Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::INC_RANS) { Kind_Regime = ENUM_REGIME::INCOMPRESSIBLE; - } else { + } else { Kind_Regime = ENUM_REGIME::NO_FLOW; } - if ((rank == MASTER_NODE) && ContinuousAdjoint && (Ref_NonDim == DIMENSIONAL) && (Kind_SU2 == SU2_COMPONENT::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; } /*--- Initialize non-physical points/reconstructions to zero ---*/ - Nonphys_Points = 0; + Nonphys_Points = 0; Nonphys_Reconstr = 0; /*--- Set the number of external iterations to 1 for the steady state problem ---*/ if (Kind_Solver == MAIN_SOLVER::FEM_ELASTICITY) { nMGLevels = 0; - if (Kind_Struct_Solver == STRUCT_DEFORMATION::SMALL){ + if (Kind_Struct_Solver == STRUCT_DEFORMATION::SMALL) { MinLogResidual = log10(Linear_Solver_Error); } } @@ -3785,7 +4148,9 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check for unsupported features. ---*/ - if ((Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS) && (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE)){ + if ((Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS) && + (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE)) { SU2_MPI::Error("Harmonic Balance not yet implemented for the incompressible solver.", CURRENT_FUNCTION); } @@ -3798,7 +4163,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } -/*--- Set default values for various fluid properties. ---*/ + /*--- Set default values for various fluid properties. ---*/ const su2double Molecular_Weight_Default = 28.96; const su2double Mu_Constant_Default = (SystemMeasurements == SI) ? 1.716E-5 : (1.716E-5 / 47.88025898); @@ -3806,7 +4171,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i const su2double Mu_Temperature_Ref_Default = (SystemMeasurements == SI) ? 273.15 : (273.15 * 1.8); const su2double Mu_S_Default = (SystemMeasurements == SI) ? 110.4 : (110.4 * 1.8); const su2double Specific_Heat_Cp_Default = 1004.703; - const su2double Thermal_Conductivity_Constant_Default = (SystemMeasurements == SI) ? 2.57E-2 : (2.57E-2 * 0.577789317); + const su2double Thermal_Conductivity_Constant_Default = + (SystemMeasurements == SI) ? 2.57E-2 : (2.57E-2 * 0.577789317); const su2double Prandtl_Lam_Default = 0.72; const su2double Prandtl_Turb_Default = 0.9; const su2double Lewis_Number_Default = 1.0; @@ -3833,210 +4199,218 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SetDefaultIfEmpty(Prandtl_Turb, nPrandtl_Turb, Prandtl_Turb_Default); SetDefaultIfEmpty(Constant_Lewis_Number, nConstant_Lewis_Number, Lewis_Number_Default); - Variable_Density = ((Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) || (Kind_DensityModel == INC_DENSITYMODEL::FLAMELET)); + Variable_Density = + ((Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) || (Kind_DensityModel == INC_DENSITYMODEL::FLAMELET)); /*--- Check whether inputs for FLUID_MIXTURE are correctly specified. ---*/ - if (Kind_FluidModel == FLUID_MIXTURE) { - /*--- Check whether the number of entries of each specified fluid property equals the number of transported scalar - equations solved + 1. nMolecular_Weight and nSpecific_Heat_Cp are used because it is required for the fluid mixing models. - * Cp is required in case of MIXTURE_FLUID_MODEL because the energy equation needs to be active.--- */ - if (nMolecular_Weight != nSpecies_Init + 1 || nSpecific_Heat_Cp != nSpecies_Init + 1) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for MOLECULAR_WEIGHT and SPECIFIC_HEAT_CP,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } - /*--- Check whether the density model used is correct, in the case of FLUID_MIXTURE the density model must be - VARIABLE. Otherwise, if the density model is CONSTANT, the scalars will not have influence the mixture density - and it will remain constant through the complete domain. --- */ - if (Kind_DensityModel != INC_DENSITYMODEL::VARIABLE) { - SU2_MPI::Error("The use of FLUID_MIXTURE requires the INC_DENSITY_MODEL option to be VARIABLE", - CURRENT_FUNCTION); - } + if (Kind_FluidModel == FLUID_MIXTURE) { + /*--- Check whether the number of entries of each specified fluid property equals the number of transported scalar + equations solved + 1. nMolecular_Weight and nSpecific_Heat_Cp are used because it is required for the fluid mixing + models. + * Cp is required in case of MIXTURE_FLUID_MODEL because the energy equation needs to be active.--- */ + if (nMolecular_Weight != nSpecies_Init + 1 || nSpecific_Heat_Cp != nSpecies_Init + 1) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for MOLECULAR_WEIGHT and SPECIFIC_HEAT_CP,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } + /*--- Check whether the density model used is correct, in the case of FLUID_MIXTURE the density model must be + VARIABLE. Otherwise, if the density model is CONSTANT, the scalars will not have influence the mixture density + and it will remain constant through the complete domain. --- */ + if (Kind_DensityModel != INC_DENSITYMODEL::VARIABLE) { + SU2_MPI::Error("The use of FLUID_MIXTURE requires the INC_DENSITY_MODEL option to be VARIABLE", CURRENT_FUNCTION); + } + + switch (Kind_ViscosityModel) { + case VISCOSITYMODEL::CONSTANT: + if (nMu_Constant != nSpecies_Init + 1) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for MU_CONSTANT,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } + break; + case VISCOSITYMODEL::SUTHERLAND: + if ((nMu_Ref != nSpecies_Init + 1) || (nMu_Temperature_Ref != nSpecies_Init + 1) || + (nMu_S != nSpecies_Init + 1)) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for MU_REF, MU_T_REF and " + "SUTHERLAND_CONSTANT,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } + break; + default: + if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Fluid mixture: viscosity model not available.", CURRENT_FUNCTION); + break; + } - switch (Kind_ViscosityModel) { - case VISCOSITYMODEL::CONSTANT: - if (nMu_Constant != nSpecies_Init + 1) { + switch (Kind_ConductivityModel) { + case CONDUCTIVITYMODEL::CONSTANT: + if ((Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) && + (Kind_Turb_Model != TURB_MODEL::NONE)) { + if ((nThermal_Conductivity_Constant != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for MU_CONSTANT,\n" + "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT and " + "PRANDTL_TURB,\n" "to be equal to the number of entries of SPECIES_INIT + 1", CURRENT_FUNCTION); } - break; - case VISCOSITYMODEL::SUTHERLAND: - if ((nMu_Ref != nSpecies_Init + 1) || (nMu_Temperature_Ref != nSpecies_Init + 1) || - (nMu_S != nSpecies_Init + 1)) { + } else { + if (nThermal_Conductivity_Constant != nSpecies_Init + 1) { SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for MU_REF, MU_T_REF and " - "SUTHERLAND_CONSTANT,\n" + "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT,\n" "to be equal to the number of entries of SPECIES_INIT + 1", CURRENT_FUNCTION); } - break; - default: - if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Fluid mixture: viscosity model not available.", CURRENT_FUNCTION); - break; - } - - switch (Kind_ConductivityModel) { - case CONDUCTIVITYMODEL::CONSTANT: - if ((Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) && - (Kind_Turb_Model != TURB_MODEL::NONE)) { - if ((nThermal_Conductivity_Constant != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT and " - "PRANDTL_TURB,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } - } else { - if (nThermal_Conductivity_Constant != nSpecies_Init + 1) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } + } + break; + case CONDUCTIVITYMODEL::CONSTANT_PRANDTL: + if (Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) { + if ((nPrandtl_Lam != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM and PRANDTL_TURB,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); } - break; - case CONDUCTIVITYMODEL::CONSTANT_PRANDTL: - if (Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) { - if ((nPrandtl_Lam != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM and PRANDTL_TURB,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } - } else { - if (nPrandtl_Lam != nSpecies_Init + 1) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } + } else { + if (nPrandtl_Lam != nSpecies_Init + 1) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); } - break; - default: - if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Conductivity model not available.", CURRENT_FUNCTION); - break; - } + } + break; + default: + if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Conductivity model not available.", CURRENT_FUNCTION); + break; } + } + if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { + if (Kind_FluidModel != FLUID_FLAMELET) { + SU2_MPI::Error("The use of SCALAR_MODEL= FLAMELET requires the FLUID_MODEL option to be FLUID_FLAMELET", + CURRENT_FUNCTION); + } - if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { - - if (Kind_FluidModel != FLUID_FLAMELET) { - SU2_MPI::Error("The use of SCALAR_MODEL= FLAMELET requires the FLUID_MODEL option to be FLUID_FLAMELET", - CURRENT_FUNCTION); - } + if (!Variable_Density) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the INC_DENSITY_MODEL option to be VARIABLE or FLAMELET", + CURRENT_FUNCTION); + } - if (!Variable_Density) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the INC_DENSITY_MODEL option to be VARIABLE or FLAMELET", - CURRENT_FUNCTION); - } + if (Kind_ConductivityModel != CONDUCTIVITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the CONDUCTIVITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } - if (Kind_ConductivityModel != CONDUCTIVITYMODEL::FLAMELET) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the CONDUCTIVITY_MODEL option to be FLAMELET", - CURRENT_FUNCTION); - } + if (Kind_Diffusivity_Model != DIFFUSIVITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the DIFFUSIVITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } - if (Kind_Diffusivity_Model != DIFFUSIVITYMODEL::FLAMELET) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the DIFFUSIVITY_MODEL option to be FLAMELET", - CURRENT_FUNCTION); - } + if (Kind_ViscosityModel != VISCOSITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the VISCOSITY_MODEL option to be FLAMELET", CURRENT_FUNCTION); + } - if (Kind_ViscosityModel != VISCOSITYMODEL::FLAMELET) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the VISCOSITY_MODEL option to be FLAMELET", - CURRENT_FUNCTION); - } - - if (Weakly_Coupled_Heat) { - SU2_MPI::Error("The use of FLUID_FLAMELET is incompatible with WEAKLY_COUPLED_HEAT in the same zone.", - CURRENT_FUNCTION); - } + if (Weakly_Coupled_Heat) { + SU2_MPI::Error("The use of FLUID_FLAMELET is incompatible with WEAKLY_COUPLED_HEAT in the same zone.", + CURRENT_FUNCTION); } + } - /*--- Check for Measurement System ---*/ + /*--- Check for Measurement System ---*/ - if (SystemMeasurements == US && !standard_air) { - SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION); - } + if (SystemMeasurements == US && !standard_air) { + SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION); + } - /* --- Check for NEMO compatibility issues ---*/ - if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) ) { - SU2_MPI::Error("Transport model not available for NEMO solver using SU2TCLIB. Please use the WILKE, SUTHERLAND or GUPTAYOS transport model instead.", CURRENT_FUNCTION); - } + /* --- Check for NEMO compatibility issues ---*/ + if (Kind_FluidModel == SU2_NONEQ && + (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND && + Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS)) { + SU2_MPI::Error( + "Transport model not available for NEMO solver using SU2TCLIB. Please use the WILKE, SUTHERLAND or GUPTAYOS " + "transport model instead.", + CURRENT_FUNCTION); + } - if (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) { - if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) { - SU2_MPI::Error("Only Gupta-Yos transport model available for ionized flows using SU2TCLIB.", CURRENT_FUNCTION); - } + if (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) { + if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) { + SU2_MPI::Error("Only Gupta-Yos transport model available for ionized flows using SU2TCLIB.", CURRENT_FUNCTION); } + } - if (Kind_FluidModel == MUTATIONPP && - (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) { - SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE or CHAPMANN_ENSKOG transport model instead..", - CURRENT_FUNCTION); - } + if (Kind_FluidModel == MUTATIONPP && + (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) { + SU2_MPI::Error( + "Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE or CHAPMANN_ENSKOG " + "transport model instead..", + CURRENT_FUNCTION); + } - if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && nWall_Catalytic != 0) { - SU2_MPI::Error("Catalytic wall recombination is not yet available for ionized flows in SU2_NEMO.", CURRENT_FUNCTION); - } + if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && nWall_Catalytic != 0) { + SU2_MPI::Error("Catalytic wall recombination is not yet available for ionized flows in SU2_NEMO.", + CURRENT_FUNCTION); + } - if (!ideal_gas && !nemo) { - if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) { - SU2_MPI::Error("Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", CURRENT_FUNCTION); - } + if (!ideal_gas && !nemo) { + if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) { + SU2_MPI::Error( + "Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", + CURRENT_FUNCTION); } + } - if (GetBoolTurbomachinery()) { - nBlades = new su2double[nZone]; - FreeStreamTurboNormal = new su2double[3]; - } + if (GetBoolTurbomachinery()) { + nBlades = new su2double[nZone]; + FreeStreamTurboNormal = new su2double[3]; + } - /*--- Check if Giles are used with turbo markers ---*/ + /*--- Check if Giles are used with turbo markers ---*/ - if (nMarker_Giles > 0 && !GetBoolTurbomachinery()) { - SU2_MPI::Error("Giles Boundary conditions can only be used with turbomachinery markers", CURRENT_FUNCTION); - } + if (nMarker_Giles > 0 && !GetBoolTurbomachinery()) { + SU2_MPI::Error("Giles Boundary conditions can only be used with turbomachinery markers", CURRENT_FUNCTION); + } - /*--- Check for Boundary condition available for NICFD ---*/ + /*--- Check for Boundary condition available for NICFD ---*/ - if ((!ideal_gas) && (!noneq_gas)) { - if (nMarker_Inlet != 0) { - SU2_MPI::Error( - "Riemann Boundary conditions or Giles must be used for inlet and outlet with Not Ideal Compressible " - "Fluids ", - CURRENT_FUNCTION); - } - if (nMarker_Outlet != 0) { - SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", - CURRENT_FUNCTION); - } + if ((!ideal_gas) && (!noneq_gas)) { + if (nMarker_Inlet != 0) { + SU2_MPI::Error( + "Riemann Boundary conditions or Giles must be used for inlet and outlet with Not Ideal Compressible " + "Fluids ", + CURRENT_FUNCTION); + } + if (nMarker_Outlet != 0) { + SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", + CURRENT_FUNCTION); + } - if (nMarker_FarField != 0) { - SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", - CURRENT_FUNCTION); - } + if (nMarker_FarField != 0) { + SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", + CURRENT_FUNCTION); } + } - /*--- Check for Boundary condition available for NICF ---*/ + /*--- Check for Boundary condition available for NICF ---*/ - if (ideal_gas && (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && - Kind_Solver != MAIN_SOLVER::INC_RANS)) { - if (SystemMeasurements == US && standard_air) { - if (Kind_ViscosityModel != VISCOSITYMODEL::SUTHERLAND) { - SU2_MPI::Error("Only SUTHERLAND viscosity model can be used with US Measurement", CURRENT_FUNCTION); - } - } - if (Kind_ConductivityModel != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) { - SU2_MPI::Error("Only CONSTANT_PRANDTL thermal conductivity model can be used with STANDARD_AIR and IDEAL_GAS", - CURRENT_FUNCTION); + if (ideal_gas && (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::INC_RANS)) { + if (SystemMeasurements == US && standard_air) { + if (Kind_ViscosityModel != VISCOSITYMODEL::SUTHERLAND) { + SU2_MPI::Error("Only SUTHERLAND viscosity model can be used with US Measurement", CURRENT_FUNCTION); } } - /*--- Check for Boundary condition option agreement ---*/ - if (Kind_InitOption == REYNOLDS){ - if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::RANS) && Reynolds <=0){ + if (Kind_ConductivityModel != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) { + SU2_MPI::Error("Only CONSTANT_PRANDTL thermal conductivity model can be used with STANDARD_AIR and IDEAL_GAS", + CURRENT_FUNCTION); + } + } + /*--- Check for Boundary condition option agreement ---*/ + if (Kind_InitOption == REYNOLDS) { + if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::RANS) && Reynolds <= 0) { SU2_MPI::Error("Reynolds number required for NAVIER_STOKES and RANS !!", CURRENT_FUNCTION); } } @@ -4045,45 +4419,44 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SU2_MPI::Error("Number of SURFACE_MOVEMENT must match number of MARKER_MOVING", CURRENT_FUNCTION); } - if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ - nIter = 1; - nInnerIter = 1; + if (TimeMarching == TIME_MARCHING::TIME_STEPPING) { + nIter = 1; + nInnerIter = 1; } - if (!Multizone_Problem){ - ScreenWrtFreq[1] = 0; + if (!Multizone_Problem) { + ScreenWrtFreq[1] = 0; HistoryWrtFreq[1] = 0; - if (!Time_Domain){ + if (!Time_Domain) { /*--- If not running multizone or unsteady, INNER_ITER and ITER are interchangeable, * but precedence will be given to INNER_ITER if both options are present. ---*/ - if (!OptionIsSet("INNER_ITER")){ + if (!OptionIsSet("INNER_ITER")) { nInnerIter = nIter; } } } - - if ((Multizone_Problem || Time_Domain) && OptionIsSet("ITER")){ - SU2_MPI::Error("ITER must not be used when running multizone and/or unsteady problems.\n" - "Use TIME_ITER, OUTER_ITER or INNER_ITER to specify number of time iterations,\n" - "outer iterations or inner iterations, respectively.", CURRENT_FUNCTION); + if ((Multizone_Problem || Time_Domain) && OptionIsSet("ITER")) { + SU2_MPI::Error( + "ITER must not be used when running multizone and/or unsteady problems.\n" + "Use TIME_ITER, OUTER_ITER or INNER_ITER to specify number of time iterations,\n" + "outer iterations or inner iterations, respectively.", + CURRENT_FUNCTION); } /*--- If we're solving a purely steady problem with no prescribed grid movement (both rotating frame and moving walls can be steady), make sure that there is no grid motion ---*/ - if (GetGrid_Movement()){ + if (GetGrid_Movement()) { 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) && - (Kind_GridMovement != NONE)){ + (TimeMarching == TIME_MARCHING::STEADY && !Time_Domain)) { + if ((Kind_GridMovement != ROTATING_FRAME) && (Kind_GridMovement != STEADY_TRANSLATION) && + (Kind_GridMovement != NONE)) { SU2_MPI::Error("Unsupported kind of grid movement for steady state problems.", CURRENT_FUNCTION); } - for (iMarker = 0; iMarker < nMarker_Moving; iMarker++){ - if (Kind_SurfaceMovement[iMarker] != MOVING_WALL){ + for (iMarker = 0; iMarker < nMarker_Moving; iMarker++) { + if (Kind_SurfaceMovement[iMarker] != MOVING_WALL) { SU2_MPI::Error("Unsupported kind of surface movement for steady state problems.", CURRENT_FUNCTION); } } @@ -4099,8 +4472,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- If it is not specified, set the mesh motion mach number equal to the freestream value. ---*/ - if (GetDynamic_Grid() && Mach_Motion == 0.0) - Mach_Motion = Mach; + if (GetDynamic_Grid() && Mach_Motion == 0.0) Mach_Motion = Mach; /*--- Set the boolean flag if we are in a rotating frame (source term). ---*/ @@ -4110,72 +4482,88 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i config file, set them equal to zero for safety. Also check to make sure that for each option, a value has been declared for each moving marker. ---*/ - if (nMarker_Moving > 0){ - if (nMarkerMotion_Origin == 0){ - nMarkerMotion_Origin = 3*nMarker_Moving; - MarkerMotion_Origin = new su2double[nMarkerMotion_Origin] (); + if (nMarker_Moving > 0) { + if (nMarkerMotion_Origin == 0) { + nMarkerMotion_Origin = 3 * nMarker_Moving; + MarkerMotion_Origin = new su2double[nMarkerMotion_Origin](); } - if (nMarkerMotion_Origin/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_MOTION_ORIGIN must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerMotion_Origin / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_MOTION_ORIGIN must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMarkerTranslation == 0){ - nMarkerTranslation = 3*nMarker_Moving; - MarkerTranslation_Rate = new su2double[nMarkerTranslation] (); + if (nMarkerTranslation == 0) { + nMarkerTranslation = 3 * nMarker_Moving; + MarkerTranslation_Rate = new su2double[nMarkerTranslation](); } - if (nMarkerTranslation/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_TRANSLATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerTranslation / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_TRANSLATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMarkerRotation_Rate == 0){ - nMarkerRotation_Rate = 3*nMarker_Moving; - MarkerRotation_Rate = new su2double[nMarkerRotation_Rate] (); + if (nMarkerRotation_Rate == 0) { + nMarkerRotation_Rate = 3 * nMarker_Moving; + MarkerRotation_Rate = new su2double[nMarkerRotation_Rate](); } - if (nMarkerRotation_Rate/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_ROTATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerRotation_Rate / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_ROTATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMarkerPlunging_Ampl == 0){ - nMarkerPlunging_Ampl = 3*nMarker_Moving; - MarkerPlunging_Ampl = new su2double[nMarkerPlunging_Ampl] (); + if (nMarkerPlunging_Ampl == 0) { + nMarkerPlunging_Ampl = 3 * nMarker_Moving; + MarkerPlunging_Ampl = new su2double[nMarkerPlunging_Ampl](); } - if (nMarkerPlunging_Ampl/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_PLUNGING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerPlunging_Ampl / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_PLUNGING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMarkerPlunging_Omega == 0){ - nMarkerPlunging_Omega = 3*nMarker_Moving; - MarkerPlunging_Omega = new su2double[nMarkerPlunging_Omega] (); + if (nMarkerPlunging_Omega == 0) { + nMarkerPlunging_Omega = 3 * nMarker_Moving; + MarkerPlunging_Omega = new su2double[nMarkerPlunging_Omega](); } - if (nMarkerPlunging_Omega/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_PLUNGING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerPlunging_Omega / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_PLUNGING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMarkerPitching_Ampl == 0){ - nMarkerPitching_Ampl = 3*nMarker_Moving; - MarkerPitching_Ampl = new su2double[nMarkerPitching_Ampl] (); + if (nMarkerPitching_Ampl == 0) { + nMarkerPitching_Ampl = 3 * nMarker_Moving; + MarkerPitching_Ampl = new su2double[nMarkerPitching_Ampl](); } - if (nMarkerPitching_Ampl/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_PITCHING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerPitching_Ampl / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_PITCHING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMarkerPitching_Omega == 0){ - nMarkerPitching_Omega = 3*nMarker_Moving; - MarkerPitching_Omega = new su2double[nMarkerPitching_Omega] (); + if (nMarkerPitching_Omega == 0) { + nMarkerPitching_Omega = 3 * nMarker_Moving; + MarkerPitching_Omega = new su2double[nMarkerPitching_Omega](); } - if (nMarkerPitching_Omega/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_PITCHING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerPitching_Omega / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_PITCHING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMarkerPitching_Phase == 0){ - nMarkerPitching_Phase = 3*nMarker_Moving; - MarkerPitching_Phase = new su2double[nMarkerPitching_Phase] (); + if (nMarkerPitching_Phase == 0) { + nMarkerPitching_Phase = 3 * nMarker_Moving; + MarkerPitching_Phase = new su2double[nMarkerPitching_Phase](); } - if (nMarkerPitching_Phase/3 != nMarker_Moving){ - SU2_MPI::Error("Number of SURFACE_PITCHING_PHASE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); + if (nMarkerPitching_Phase / 3 != nMarker_Moving) { + SU2_MPI::Error( + "Number of SURFACE_PITCHING_PHASE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", + CURRENT_FUNCTION); } - if (nMoveMotion_Origin == 0){ + if (nMoveMotion_Origin == 0) { nMoveMotion_Origin = nMarker_Moving; MoveMotion_Origin = new unsigned short[nMoveMotion_Origin]; - for (iMarker = 0; iMarker < nMarker_Moving; iMarker++){ + for (iMarker = 0; iMarker < nMarker_Moving; iMarker++) { MoveMotion_Origin[iMarker] = NO; } } - if (nMoveMotion_Origin != nMarker_Moving){ + if (nMoveMotion_Origin != nMarker_Moving) { SU2_MPI::Error("Number of MOVE_MOTION_ORIGIN must match number of MARKER_MOVING.", CURRENT_FUNCTION); } } @@ -4184,61 +4572,61 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE) { HarmonicBalance_Period = GetHarmonicBalance_Period(); - if (HarmonicBalance_Period < 0) { + if (HarmonicBalance_Period < 0) { SU2_MPI::Error("Not a valid value for time period!!", CURRENT_FUNCTION); } /* Initialize the Harmonic balance Frequency pointer */ if (Omega_HB == nullptr) { Omega_HB = new su2double[nOmega_HB]; - for (unsigned short iZone = 0; iZone < nOmega_HB; iZone++ ) - Omega_HB[iZone] = 0.0; - } else { + for (unsigned short iZone = 0; iZone < nOmega_HB; iZone++) Omega_HB[iZone] = 0.0; + } else { if (nOmega_HB != nTimeInstances) { - SU2_MPI::Error("Length of omega_HB must match the number TIME_INSTANCES!!" , CURRENT_FUNCTION); + SU2_MPI::Error("Length of omega_HB must match the number TIME_INSTANCES!!", CURRENT_FUNCTION); } } } /*--- Force number of span-wise section to 1 if 2D case ---*/ - if(val_nDim ==2){ - nSpanWiseSections_User=1; - Kind_SpanWise= EQUISPACED; + if (val_nDim == 2) { + nSpanWiseSections_User = 1; + Kind_SpanWise = EQUISPACED; } /*--- Set number of TurboPerformance markers ---*/ - if(nMarker_Turbomachinery > 0){ - if(nMarker_Turbomachinery > 1){ - nMarker_TurboPerformance = nMarker_Turbomachinery + SU2_TYPE::Int(nMarker_Turbomachinery/2) + 1; - }else{ + if (nMarker_Turbomachinery > 0) { + if (nMarker_Turbomachinery > 1) { + nMarker_TurboPerformance = nMarker_Turbomachinery + SU2_TYPE::Int(nMarker_Turbomachinery / 2) + 1; + } else { nMarker_TurboPerformance = nMarker_Turbomachinery; } } else { nMarker_TurboPerformance = 0; - nSpanWiseSections =1; + nSpanWiseSections = 1; } /*--- Set number of TurboPerformance markers ---*/ - if(nMarker_Turbomachinery != 0){ + if (nMarker_Turbomachinery != 0) { nSpan_iZones = new unsigned short[nZone]; } /*--- Set number of TurboPerformance markers ---*/ - if(GetGrid_Movement() && RampRotatingFrame && !DiscreteAdjoint){ + if (GetGrid_Movement() && RampRotatingFrame && !DiscreteAdjoint) { FinalRotation_Rate_Z = Rotation_Rate[2]; - if(abs(FinalRotation_Rate_Z) > 0.0){ + if (abs(FinalRotation_Rate_Z) > 0.0) { Rotation_Rate[2] = rampRotFrame_coeff[0]; } } - if(RampOutletPressure && !DiscreteAdjoint){ - for (iMarker = 0; iMarker < nMarker_Giles; iMarker++){ - if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM ){ + if (RampOutletPressure && !DiscreteAdjoint) { + for (iMarker = 0; iMarker < nMarker_Giles; iMarker++) { + if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || + Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM) { FinalOutletPressure = Giles_Var1[iMarker]; Giles_Var1[iMarker] = rampOutPres_coeff[0]; } } - for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++){ - if (Kind_Data_Riemann[iMarker] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker] == RADIAL_EQUILIBRIUM){ + for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++) { + if (Kind_Data_Riemann[iMarker] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker] == RADIAL_EQUILIBRIUM) { FinalOutletPressure = Riemann_Var1[iMarker]; Riemann_Var1[iMarker] = rampOutPres_coeff[0]; } @@ -4246,12 +4634,12 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } /*--- Check on extra Relaxation factor for Giles---*/ - if(extrarelfac[1] > 0.5){ + if (extrarelfac[1] > 0.5) { extrarelfac[1] = 0.5; } - /*--- Use the various rigid-motion input frequencies to determine the period to be used with harmonic balance cases. - There are THREE types of motion to consider, namely: rotation, pitching, and plunging. - The largest period of motion is the one to be used for harmonic balance calculations. ---*/ + /*--- Use the various rigid-motion input frequencies to determine the period to be used with harmonic balance cases. + There are THREE types of motion to consider, namely: rotation, pitching, and plunging. + The largest period of motion is the one to be used for harmonic balance calculations. ---*/ /*if (Unsteady_Simulation == HARMONIC_BALANCE) { if (!(GetGrid_Movement())) { @@ -4266,27 +4654,21 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i //--- rotation: ---// - su2double Omega_mag_rot = sqrt(pow(Rotation_Rate_X[ZONE_0],2)+pow(Rotation_Rate_Y[ZONE_0],2)+pow(Rotation_Rate_Z[ZONE_0],2)); - if (Omega_mag_rot > 0) - periods[0] = 2*PI_NUMBER/Omega_mag_rot; - else - periods[0] = 0.0; + su2double Omega_mag_rot = + sqrt(pow(Rotation_Rate_X[ZONE_0],2)+pow(Rotation_Rate_Y[ZONE_0],2)+pow(Rotation_Rate_Z[ZONE_0],2)); if (Omega_mag_rot + > 0) periods[0] = 2*PI_NUMBER/Omega_mag_rot; else periods[0] = 0.0; //--- pitching: ---// - su2double Omega_mag_pitch = sqrt(pow(Pitching_Omega_X[ZONE_0],2)+pow(Pitching_Omega_Y[ZONE_0],2)+pow(Pitching_Omega_Z[ZONE_0],2)); - if (Omega_mag_pitch > 0) - periods[1] = 2*PI_NUMBER/Omega_mag_pitch; - else - periods[1] = 0.0; + su2double Omega_mag_pitch = + sqrt(pow(Pitching_Omega_X[ZONE_0],2)+pow(Pitching_Omega_Y[ZONE_0],2)+pow(Pitching_Omega_Z[ZONE_0],2)); if + (Omega_mag_pitch > 0) periods[1] = 2*PI_NUMBER/Omega_mag_pitch; else periods[1] = 0.0; //--- plunging: ---// - su2double Omega_mag_plunge = sqrt(pow(Plunging_Omega_X[ZONE_0],2)+pow(Plunging_Omega_Y[ZONE_0],2)+pow(Plunging_Omega_Z[ZONE_0],2)); - if (Omega_mag_plunge > 0) - periods[2] = 2*PI_NUMBER/Omega_mag_plunge; - else - periods[2] = 0.0; + su2double Omega_mag_plunge = + sqrt(pow(Plunging_Omega_X[ZONE_0],2)+pow(Plunging_Omega_Y[ZONE_0],2)+pow(Plunging_Omega_Z[ZONE_0],2)); if + (Omega_mag_plunge > 0) periods[2] = 2*PI_NUMBER/Omega_mag_plunge; else periods[2] = 0.0; //--- determine which period is largest ---// @@ -4302,85 +4684,76 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i }*/ - /*--- In case the moment origin coordinates have not been declared in the config file, set them equal to zero for safety. Also check to make sure that for each marker, a value has been declared for the moment origin. Unless only one value was specified, then set this value for all the markers being monitored. ---*/ - - if ((nRefOriginMoment_X != nRefOriginMoment_Y) || (nRefOriginMoment_X != nRefOriginMoment_Z) ) { - SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_X, REF_ORIGIN_MOMENT_Y and REF_ORIGIN_MOMENT_Z must be the same!!", CURRENT_FUNCTION); + if ((nRefOriginMoment_X != nRefOriginMoment_Y) || (nRefOriginMoment_X != nRefOriginMoment_Z)) { + SU2_MPI::Error( + "ERROR: Length of REF_ORIGIN_MOMENT_X, REF_ORIGIN_MOMENT_Y and REF_ORIGIN_MOMENT_Z must be the same!!", + CURRENT_FUNCTION); } if (RefOriginMoment_X == nullptr) { RefOriginMoment_X = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) - RefOriginMoment_X[iMarker] = 0.0; + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_X[iMarker] = 0.0; } else { if (nRefOriginMoment_X == 1) { - su2double aux_RefOriginMoment_X = RefOriginMoment_X[0]; - delete [] RefOriginMoment_X; + delete[] RefOriginMoment_X; RefOriginMoment_X = new su2double[nMarker_Monitoring]; nRefOriginMoment_X = nMarker_Monitoring; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) - RefOriginMoment_X[iMarker] = aux_RefOriginMoment_X; - } - else if (nRefOriginMoment_X != nMarker_Monitoring) { - SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_X must match number of Monitoring Markers!!", CURRENT_FUNCTION); + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_X[iMarker] = aux_RefOriginMoment_X; + } else if (nRefOriginMoment_X != nMarker_Monitoring) { + SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_X must match number of Monitoring Markers!!", + CURRENT_FUNCTION); } } if (RefOriginMoment_Y == nullptr) { RefOriginMoment_Y = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) - RefOriginMoment_Y[iMarker] = 0.0; + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Y[iMarker] = 0.0; } else { if (nRefOriginMoment_Y == 1) { - su2double aux_RefOriginMoment_Y = RefOriginMoment_Y[0]; - delete [] RefOriginMoment_Y; + delete[] RefOriginMoment_Y; RefOriginMoment_Y = new su2double[nMarker_Monitoring]; nRefOriginMoment_Y = nMarker_Monitoring; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) - RefOriginMoment_Y[iMarker] = aux_RefOriginMoment_Y; - } - else if (nRefOriginMoment_Y != nMarker_Monitoring) { - SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Y must match number of Monitoring Markers!!", CURRENT_FUNCTION); + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Y[iMarker] = aux_RefOriginMoment_Y; + } else if (nRefOriginMoment_Y != nMarker_Monitoring) { + SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Y must match number of Monitoring Markers!!", + CURRENT_FUNCTION); } } if (RefOriginMoment_Z == nullptr) { RefOriginMoment_Z = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) - RefOriginMoment_Z[iMarker] = 0.0; + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Z[iMarker] = 0.0; } else { if (nRefOriginMoment_Z == 1) { - su2double aux_RefOriginMoment_Z = RefOriginMoment_Z[0]; - delete [] RefOriginMoment_Z; + delete[] RefOriginMoment_Z; RefOriginMoment_Z = new su2double[nMarker_Monitoring]; nRefOriginMoment_Z = nMarker_Monitoring; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) - RefOriginMoment_Z[iMarker] = aux_RefOriginMoment_Z; - } - else if (nRefOriginMoment_Z != nMarker_Monitoring) { - SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Z must match number of Monitoring Markers!!", CURRENT_FUNCTION); + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Z[iMarker] = aux_RefOriginMoment_Z; + } else if (nRefOriginMoment_Z != nMarker_Monitoring) { + SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Z must match number of Monitoring Markers!!", + CURRENT_FUNCTION); } } /*--- Set the boolean flag if we are carrying out an aeroelastic simulation. ---*/ - Aeroelastic_Simulation = GetGrid_Movement() && (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION)); + Aeroelastic_Simulation = + GetGrid_Movement() && (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION)); /*--- Initializing the size for the solutions of the Aeroelastic problem. ---*/ - if (GetGrid_Movement() && Aeroelastic_Simulation) { Aeroelastic_np1.resize(nMarker_Monitoring); Aeroelastic_n.resize(nMarker_Monitoring); @@ -4389,11 +4762,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Aeroelastic_np1[iMarker].resize(2); Aeroelastic_n[iMarker].resize(2); Aeroelastic_n1[iMarker].resize(2); - for (int i =0; i<2; i++) { + for (int i = 0; i < 2; i++) { Aeroelastic_np1[iMarker][i].resize(2); Aeroelastic_n[iMarker][i].resize(2); Aeroelastic_n1[iMarker][i].resize(2); - for (int j=0; j<2; j++) { + for (int j = 0; j < 2; j++) { Aeroelastic_np1[iMarker][i][j] = 0.0; Aeroelastic_n[iMarker][i][j] = 0.0; Aeroelastic_n1[iMarker][i][j] = 0.0; @@ -4407,7 +4780,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (GetGrid_Movement() && Aeroelastic_Simulation) { Aeroelastic_pitch = new su2double[nMarker_Monitoring]; Aeroelastic_plunge = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) { + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) { Aeroelastic_pitch[iMarker] = 0.0; Aeroelastic_plunge[iMarker] = 0.0; } @@ -4416,18 +4789,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i FinestMesh = MESH_0; if (MGCycle == FULLMG_CYCLE) FinestMesh = nMGLevels; - if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) && - (Kind_Turb_Model != TURB_MODEL::NONE)) + if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) && (Kind_Turb_Model != TURB_MODEL::NONE)) Kind_Solver = MAIN_SOLVER::RANS; - if ((Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) && - (Kind_Turb_Model != TURB_MODEL::NONE)) + if ((Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) && (Kind_Turb_Model != TURB_MODEL::NONE)) Kind_Solver = MAIN_SOLVER::INC_RANS; - if (Kind_Solver == MAIN_SOLVER::EULER || - Kind_Solver == MAIN_SOLVER::INC_EULER || - Kind_Solver == MAIN_SOLVER::NEMO_EULER || - Kind_Solver == MAIN_SOLVER::FEM_EULER) + if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::INC_EULER || + Kind_Solver == MAIN_SOLVER::NEMO_EULER || Kind_Solver == MAIN_SOLVER::FEM_EULER) Kind_Turb_Model = TURB_MODEL::NONE; Kappa_2nd_Flow = jst_coeff[0]; @@ -4438,113 +4807,89 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Make the MG_PreSmooth, MG_PostSmooth, and MG_CorrecSmooth arrays consistent with nMGLevels ---*/ - auto * tmp_smooth = new unsigned short[nMGLevels+1]; - - if ((nMG_PreSmooth != nMGLevels+1) && (nMG_PreSmooth != 0)) { - if (nMG_PreSmooth > nMGLevels+1) { + auto* tmp_smooth = new unsigned short[nMGLevels + 1]; + if ((nMG_PreSmooth != nMGLevels + 1) && (nMG_PreSmooth != 0)) { + if (nMG_PreSmooth > nMGLevels + 1) { /*--- Truncate by removing unnecessary elements at the end ---*/ - for (unsigned int i = 0; i <= nMGLevels; i++) - tmp_smooth[i] = MG_PreSmooth[i]; - delete [] MG_PreSmooth; - MG_PreSmooth=nullptr; - } - else { - + for (unsigned int i = 0; i <= nMGLevels; i++) tmp_smooth[i] = MG_PreSmooth[i]; + delete[] MG_PreSmooth; + MG_PreSmooth = nullptr; + } else { /*--- Add additional elements equal to last element ---*/ - for (unsigned int i = 0; i < nMG_PreSmooth; i++) - tmp_smooth[i] = MG_PreSmooth[i]; - for (unsigned int i = nMG_PreSmooth; i <= nMGLevels; i++) - tmp_smooth[i] = MG_PreSmooth[nMG_PreSmooth-1]; - delete [] MG_PreSmooth; - MG_PreSmooth=nullptr; + for (unsigned int i = 0; i < nMG_PreSmooth; i++) tmp_smooth[i] = MG_PreSmooth[i]; + for (unsigned int i = nMG_PreSmooth; i <= nMGLevels; i++) tmp_smooth[i] = MG_PreSmooth[nMG_PreSmooth - 1]; + delete[] MG_PreSmooth; + MG_PreSmooth = nullptr; } - nMG_PreSmooth = nMGLevels+1; + nMG_PreSmooth = nMGLevels + 1; MG_PreSmooth = new unsigned short[nMG_PreSmooth]; - for (unsigned int i = 0; i < nMG_PreSmooth; i++) - MG_PreSmooth[i] = tmp_smooth[i]; + for (unsigned int i = 0; i < nMG_PreSmooth; i++) MG_PreSmooth[i] = tmp_smooth[i]; } if ((nMGLevels != 0) && (nMG_PreSmooth == 0)) { - delete [] MG_PreSmooth; - nMG_PreSmooth = nMGLevels+1; + delete[] MG_PreSmooth; + nMG_PreSmooth = nMGLevels + 1; MG_PreSmooth = new unsigned short[nMG_PreSmooth]; - for (unsigned int i = 0; i < nMG_PreSmooth; i++) - MG_PreSmooth[i] = i+1; + for (unsigned int i = 0; i < nMG_PreSmooth; i++) MG_PreSmooth[i] = i + 1; } - if ((nMG_PostSmooth != nMGLevels+1) && (nMG_PostSmooth != 0)) { - if (nMG_PostSmooth > nMGLevels+1) { - + if ((nMG_PostSmooth != nMGLevels + 1) && (nMG_PostSmooth != 0)) { + if (nMG_PostSmooth > nMGLevels + 1) { /*--- Truncate by removing unnecessary elements at the end ---*/ - for (unsigned int i = 0; i <= nMGLevels; i++) - tmp_smooth[i] = MG_PostSmooth[i]; - delete [] MG_PostSmooth; - MG_PostSmooth=nullptr; - } - else { - + for (unsigned int i = 0; i <= nMGLevels; i++) tmp_smooth[i] = MG_PostSmooth[i]; + delete[] MG_PostSmooth; + MG_PostSmooth = nullptr; + } else { /*--- Add additional elements equal to last element ---*/ - for (unsigned int i = 0; i < nMG_PostSmooth; i++) - tmp_smooth[i] = MG_PostSmooth[i]; - for (unsigned int i = nMG_PostSmooth; i <= nMGLevels; i++) - tmp_smooth[i] = MG_PostSmooth[nMG_PostSmooth-1]; - delete [] MG_PostSmooth; - MG_PostSmooth=nullptr; + for (unsigned int i = 0; i < nMG_PostSmooth; i++) tmp_smooth[i] = MG_PostSmooth[i]; + for (unsigned int i = nMG_PostSmooth; i <= nMGLevels; i++) tmp_smooth[i] = MG_PostSmooth[nMG_PostSmooth - 1]; + delete[] MG_PostSmooth; + MG_PostSmooth = nullptr; } - nMG_PostSmooth = nMGLevels+1; + nMG_PostSmooth = nMGLevels + 1; MG_PostSmooth = new unsigned short[nMG_PostSmooth]; - for (unsigned int i = 0; i < nMG_PostSmooth; i++) - MG_PostSmooth[i] = tmp_smooth[i]; - + for (unsigned int i = 0; i < nMG_PostSmooth; i++) MG_PostSmooth[i] = tmp_smooth[i]; } if ((nMGLevels != 0) && (nMG_PostSmooth == 0)) { - delete [] MG_PostSmooth; - nMG_PostSmooth = nMGLevels+1; + delete[] MG_PostSmooth; + nMG_PostSmooth = nMGLevels + 1; MG_PostSmooth = new unsigned short[nMG_PostSmooth]; - for (unsigned int i = 0; i < nMG_PostSmooth; i++) - MG_PostSmooth[i] = 0; + for (unsigned int i = 0; i < nMG_PostSmooth; i++) MG_PostSmooth[i] = 0; } - if ((nMG_CorrecSmooth != nMGLevels+1) && (nMG_CorrecSmooth != 0)) { - if (nMG_CorrecSmooth > nMGLevels+1) { - + if ((nMG_CorrecSmooth != nMGLevels + 1) && (nMG_CorrecSmooth != 0)) { + if (nMG_CorrecSmooth > nMGLevels + 1) { /*--- Truncate by removing unnecessary elements at the end ---*/ - for (unsigned int i = 0; i <= nMGLevels; i++) - tmp_smooth[i] = MG_CorrecSmooth[i]; - delete [] MG_CorrecSmooth; + for (unsigned int i = 0; i <= nMGLevels; i++) tmp_smooth[i] = MG_CorrecSmooth[i]; + delete[] MG_CorrecSmooth; MG_CorrecSmooth = nullptr; - } - else { - + } else { /*--- Add additional elements equal to last element ---*/ - for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) - tmp_smooth[i] = MG_CorrecSmooth[i]; + for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) tmp_smooth[i] = MG_CorrecSmooth[i]; for (unsigned int i = nMG_CorrecSmooth; i <= nMGLevels; i++) - tmp_smooth[i] = MG_CorrecSmooth[nMG_CorrecSmooth-1]; - delete [] MG_CorrecSmooth; + tmp_smooth[i] = MG_CorrecSmooth[nMG_CorrecSmooth - 1]; + delete[] MG_CorrecSmooth; MG_CorrecSmooth = nullptr; } - nMG_CorrecSmooth = nMGLevels+1; + nMG_CorrecSmooth = nMGLevels + 1; MG_CorrecSmooth = new unsigned short[nMG_CorrecSmooth]; - for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) - MG_CorrecSmooth[i] = tmp_smooth[i]; + for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) MG_CorrecSmooth[i] = tmp_smooth[i]; } if ((nMGLevels != 0) && (nMG_CorrecSmooth == 0)) { - delete [] MG_CorrecSmooth; - nMG_CorrecSmooth = nMGLevels+1; + delete[] MG_CorrecSmooth; + nMG_CorrecSmooth = nMGLevels + 1; MG_CorrecSmooth = new unsigned short[nMG_CorrecSmooth]; - for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) - MG_CorrecSmooth[i] = 0; + for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) MG_CorrecSmooth[i] = 0; } /*--- Override MG Smooth parameters ---*/ @@ -4564,27 +4909,29 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Kind_Solver == MAIN_SOLVER::RANS) Kind_Solver = MAIN_SOLVER::ADJ_RANS; } - nCFL = nMGLevels+1; + nCFL = nMGLevels + 1; CFL = new su2double[nCFL]; CFL[0] = CFLFineGrid; /*--- Handle optional CFL adapt parameter values ---*/ if (nCFL_AdaptParam < default_cfl_adapt.size()) { - auto newParam = new su2double [default_cfl_adapt.size()]; + auto newParam = new su2double[default_cfl_adapt.size()]; for (iCFL = 0; iCFL < default_cfl_adapt.size(); ++iCFL) { - if (iCFL < nCFL_AdaptParam) newParam[iCFL] = CFL_AdaptParam[iCFL]; - else newParam[iCFL] = default_cfl_adapt[iCFL]; + if (iCFL < nCFL_AdaptParam) + newParam[iCFL] = CFL_AdaptParam[iCFL]; + else + newParam[iCFL] = default_cfl_adapt[iCFL]; } swap(newParam, CFL_AdaptParam); - delete [] newParam; + delete[] newParam; nCFL_AdaptParam = default_cfl_adapt.size(); } /*--- Evaluate when the Cl should be evaluated ---*/ - Iter_Fixed_CM = SU2_TYPE::Int(nInnerIter / (su2double(Update_iH)+1)); - Iter_Fixed_NetThrust = SU2_TYPE::Int(nInnerIter / (su2double(Update_BCThrust)+1)); + Iter_Fixed_CM = SU2_TYPE::Int(nInnerIter / (su2double(Update_iH) + 1)); + Iter_Fixed_NetThrust = SU2_TYPE::Int(nInnerIter / (su2double(Update_BCThrust) + 1)); /*--- Setting relaxation factor and CFL for the adjoint runs ---*/ @@ -4592,8 +4939,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i CFL[0] = CFL[0] * CFLRedCoeff_AdjFlow; CFL_AdaptParam[2] *= CFLRedCoeff_AdjFlow; CFL_AdaptParam[3] *= CFLRedCoeff_AdjFlow; - Iter_Fixed_CM = SU2_TYPE::Int(su2double (Iter_Fixed_CM) / CFLRedCoeff_AdjFlow); - Iter_Fixed_NetThrust = SU2_TYPE::Int(su2double (Iter_Fixed_NetThrust) / CFLRedCoeff_AdjFlow); + Iter_Fixed_CM = SU2_TYPE::Int(su2double(Iter_Fixed_CM) / CFLRedCoeff_AdjFlow); + Iter_Fixed_NetThrust = SU2_TYPE::Int(su2double(Iter_Fixed_NetThrust) / CFLRedCoeff_AdjFlow); } if ((DiscreteAdjoint) && (Inconsistent_Disc)) { @@ -4607,40 +4954,46 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Update_AoA_Iter_Limit == 0 && Fixed_CL_Mode) { SU2_MPI::Error("ERROR: Please specify non-zero UPDATE_AOA_ITER_LIMIT.", CURRENT_FUNCTION); } - if (Iter_Fixed_CM == 0) { Iter_Fixed_CM = nInnerIter+1; Update_iH = 0; } - if (Iter_Fixed_NetThrust == 0) { Iter_Fixed_NetThrust = nInnerIter+1; Update_BCThrust = 0; } + if (Iter_Fixed_CM == 0) { + Iter_Fixed_CM = nInnerIter + 1; + Update_iH = 0; + } + if (Iter_Fixed_NetThrust == 0) { + Iter_Fixed_NetThrust = nInnerIter + 1; + Update_BCThrust = 0; + } - for (iCFL = 1; iCFL < nCFL; iCFL++) - CFL[iCFL] = CFL[iCFL-1]; + for (iCFL = 1; iCFL < nCFL; iCFL++) CFL[iCFL] = CFL[iCFL - 1]; if (nRKStep == 0) { nRKStep = 1; - RK_Alpha_Step = new su2double[1]; RK_Alpha_Step[0] = 1.0; + RK_Alpha_Step = new su2double[1]; + RK_Alpha_Step[0] = 1.0; } /* Check if the byte alignment of the matrix multiplications is a multiple of 64. */ - if( byteAlignmentMatMul%64 ) { + if (byteAlignmentMatMul % 64) { SU2_MPI::Error("ALIGNED_BYTES_MATMUL must be a multiple of 64.", CURRENT_FUNCTION); } /* Determine the value of sizeMatMulPadding, which is the matrix size in the vectorization direction when padding is applied to have optimal performance in the matrix multiplications. */ - sizeMatMulPadding = byteAlignmentMatMul/sizeof(passivedouble); + sizeMatMulPadding = byteAlignmentMatMul / sizeof(passivedouble); /* Correct the number of time levels for time accurate local time stepping, if needed. */ - if (nLevels_TimeAccurateLTS == 0) nLevels_TimeAccurateLTS = 1; - if (nLevels_TimeAccurateLTS > 15) nLevels_TimeAccurateLTS = 15; + if (nLevels_TimeAccurateLTS == 0) nLevels_TimeAccurateLTS = 1; + if (nLevels_TimeAccurateLTS > 15) nLevels_TimeAccurateLTS = 15; /* Check that no time accurate local time stepping is specified for time integration schemes other than ADER. */ if (Kind_TimeIntScheme_FEM_Flow != ADER_DG && nLevels_TimeAccurateLTS != 1) { - - if (rank==MASTER_NODE) { - cout << endl << "WARNING: " - << nLevels_TimeAccurateLTS << " levels specified for time accurate local time stepping." << endl + if (rank == MASTER_NODE) { + cout << endl + << "WARNING: " << nLevels_TimeAccurateLTS << " levels specified for time accurate local time stepping." + << endl << "Time accurate local time stepping is only possible for ADER, hence this option is not used." << endl << endl; } @@ -4649,15 +5002,13 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } if (Kind_TimeIntScheme_FEM_Flow == ADER_DG) { - 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. */ if (nLevels_TimeAccurateLTS != 1) { - if(Unst_CFL == 0.0) - SU2_MPI::Error("ERROR: Unsteady CFL not specified for time accurate local time stepping.", - CURRENT_FUNCTION); + if (Unst_CFL == 0.0) + SU2_MPI::Error("ERROR: Unsteady CFL not specified for time accurate local time stepping.", CURRENT_FUNCTION); } /* Determine the location of the ADER time DOFs, which are the Gauss-Legendre @@ -4667,75 +5018,86 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i GaussJacobi.GetQuadraturePoints(0.0, 0.0, -1.0, 1.0, GLPoints, GLWeights); TimeDOFsADER_DG = new su2double[nTimeDOFsADER_DG]; - for(unsigned short i=0; i1) { + else if (top_optim_nKernelParams == 1 && top_optim_nKernel > 1) { su2double tmp = top_optim_kernel_params[0]; - delete [] top_optim_kernel_params; + delete[] top_optim_kernel_params; top_optim_nKernelParams = top_optim_nKernel; - top_optim_kernel_params = new su2double [top_optim_nKernel]; - for (unsigned short i=0; i1) { + else if (top_optim_nRadius == 1 && top_optim_nKernel > 1) { su2double tmp = top_optim_filter_radius[0]; - delete [] top_optim_filter_radius; + delete[] top_optim_filter_radius; top_optim_nRadius = top_optim_nKernel; - top_optim_filter_radius = new su2double [top_optim_nKernel]; - for (unsigned short i=0; i 1) { - SU2_MPI::Error("SURFACE_SPECIES_0 and SURFACE_SPECIES_VARIANCE currently can only handle one entry to MARKER_ANALYZE.", CURRENT_FUNCTION); + SU2_MPI::Error( + "SURFACE_SPECIES_0 and SURFACE_SPECIES_VARIANCE currently can only handle one entry to MARKER_ANALYZE.", + CURRENT_FUNCTION); } } - if(Kind_TimeIntScheme_Species != EULER_IMPLICIT && - Kind_TimeIntScheme_Species != EULER_EXPLICIT){ - SU2_MPI::Error("Only TIME_DISCRE_TURB = EULER_IMPLICIT, EULER_EXPLICIT have been implemented in the scalar solver.", CURRENT_FUNCTION); + if (Kind_TimeIntScheme_Species != EULER_IMPLICIT && Kind_TimeIntScheme_Species != EULER_EXPLICIT) { + SU2_MPI::Error( + "Only TIME_DISCRE_TURB = EULER_IMPLICIT, EULER_EXPLICIT have been implemented in the scalar solver.", + CURRENT_FUNCTION); } /*--- If Species clipping is on, make sure bounds are given by the user. ---*/ if (Species_Clipping) if (!(OptionIsSet("SPECIES_CLIPPING_MIN") && OptionIsSet("SPECIES_CLIPPING_MAX"))) - SU2_MPI::Error("SPECIES_CLIPPING= YES requires the options SPECIES_CLIPPING_MIN/MAX to set the clipping values.", CURRENT_FUNCTION); + SU2_MPI::Error( + "SPECIES_CLIPPING= YES requires the options SPECIES_CLIPPING_MIN/MAX to set the clipping values.", + CURRENT_FUNCTION); /*--- Make sure a Diffusivity has been set for Constant Diffusivity. ---*/ - if (Kind_Diffusivity_Model == DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY && - !(OptionIsSet("DIFFUSIVITY_CONSTANT"))) - SU2_MPI::Error("A DIFFUSIVITY_CONSTANT= has to be set with DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY.", CURRENT_FUNCTION); + if (Kind_Diffusivity_Model == DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY && !(OptionIsSet("DIFFUSIVITY_CONSTANT"))) + SU2_MPI::Error("A DIFFUSIVITY_CONSTANT= has to be set with DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY.", + CURRENT_FUNCTION); /*--- Check whether the number of entries of the constant Lewis number equals the number of transported scalar equations solved. nConstant_Lewis_Number is used because it is required for the diffusivity fluid mixing @@ -5439,8 +5849,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i nSpecies_options.push_back(nSpecies_Init); if (Species_Clipping) nSpecies_options.insert(nSpecies_options.end(), {nSpecies_Clipping_Min, nSpecies_Clipping_Max}); - if (nMarker_Inlet_Species > 0) - nSpecies_options.push_back(nSpecies_per_Inlet); + if (nMarker_Inlet_Species > 0) nSpecies_options.push_back(nSpecies_per_Inlet); // Add more options for size check here. /*--- nSpecies_Init is the master, but it simply checks for consistency. ---*/ @@ -5451,7 +5860,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Once consistency is checked set the var that is used throughout the code. ---*/ nSpecies = nSpecies_Init; - /*--- Check whether some variables (or their sums) are in physical bounds. [0,1] for species related quantities. ---*/ + /*--- Check whether some variables (or their sums) are in physical bounds. [0,1] for species related quantities. + * ---*/ /*--- Note, only for species transport, not for flamelet model ---*/ if (Kind_Species_Model == SPECIES_MODEL::SPECIES_TRANSPORT) { su2double Species_Init_Sum = 0.0; @@ -5471,14 +5881,15 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } - } // species transport checks + } // species transport checks /*--- Define some variables for flamelet model. ---*/ if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { /*--- The controlling variables are progress variable, total enthalpy, and optionally mixture fraction ---*/ - //n_control_vars = nSpecies - n_user_scalars; + // n_control_vars = nSpecies - n_user_scalars; if (n_control_vars != (nSpecies - n_user_scalars)) - SU2_MPI::Error("Number of initial species incompatbile with number of controlling variables and user scalars.", CURRENT_FUNCTION); + SU2_MPI::Error("Number of initial species incompatbile with number of controlling variables and user scalars.", + CURRENT_FUNCTION); /*--- We can have additional user defined transported scalars ---*/ n_scalars = n_control_vars + n_user_scalars; } @@ -5489,40 +5900,32 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } void CConfig::SetMarkers(SU2_COMPONENT val_software) { - - unsigned short iMarker_All, iMarker_CfgFile, iMarker_Euler, iMarker_Custom, - iMarker_FarField, iMarker_SymWall, iMarker_PerBound, - iMarker_NearFieldBound, iMarker_Fluid_InterfaceBound, - iMarker_Inlet, iMarker_Riemann, iMarker_Giles, iMarker_Outlet, - iMarker_Smoluchowski_Maxwell, - iMarker_Isothermal,iMarker_HeatFlux,iMarker_HeatTansfer, - iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Damper, - iMarker_Displacement, iMarker_Load, iMarker_Internal, - iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, - iMarker_DV, iMarker_Moving, iMarker_SobolevBC, iMarker_PyCustom, iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, - iMarker_Clamped, iMarker_ZoneInterface, iMarker_CHTInterface, iMarker_Load_Dir, iMarker_Disp_Dir, - iMarker_Fluid_Load, iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, - iMarker_ActDiskInlet, iMarker_ActDiskOutlet, - iMarker_Turbomachinery, iMarker_MixingPlaneInterface; + unsigned short iMarker_All, iMarker_CfgFile, iMarker_Euler, iMarker_Custom, iMarker_FarField, iMarker_SymWall, + iMarker_PerBound, iMarker_NearFieldBound, iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, + iMarker_Giles, iMarker_Outlet, iMarker_Smoluchowski_Maxwell, iMarker_Isothermal, iMarker_HeatFlux, + iMarker_HeatTansfer, iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Damper, iMarker_Displacement, + iMarker_Load, iMarker_Internal, iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, + iMarker_Analyze, iMarker_DV, iMarker_Moving, iMarker_SobolevBC, iMarker_PyCustom, iMarker_Supersonic_Inlet, + iMarker_Supersonic_Outlet, iMarker_Clamped, iMarker_ZoneInterface, iMarker_CHTInterface, iMarker_Load_Dir, + iMarker_Disp_Dir, iMarker_Fluid_Load, iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, iMarker_ActDiskInlet, + iMarker_ActDiskOutlet, iMarker_Turbomachinery, iMarker_MixingPlaneInterface; int size = SINGLE_NODE; SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); /*--- Compute the total number of markers in the config file ---*/ - nMarker_CfgFile = nMarker_Euler + nMarker_FarField + nMarker_SymWall + - nMarker_PerBound + nMarker_NearFieldBound + nMarker_Fluid_InterfaceBound + - nMarker_CHTInterface + nMarker_Inlet + nMarker_Riemann + nMarker_Smoluchowski_Maxwell + - nMarker_Giles + nMarker_Outlet + nMarker_Isothermal + - nMarker_HeatFlux + nMarker_HeatTransfer + - nMarker_EngineInflow + nMarker_EngineExhaust + nMarker_Internal + - nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + nMarker_Load + - nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + - nMarker_Clamped + nMarker_Load_Dir + nMarker_Disp_Dir + - nMarker_ActDiskInlet + nMarker_ActDiskOutlet + nMarker_ZoneInterface; + nMarker_CfgFile = nMarker_Euler + nMarker_FarField + nMarker_SymWall + nMarker_PerBound + nMarker_NearFieldBound + + nMarker_Fluid_InterfaceBound + nMarker_CHTInterface + nMarker_Inlet + nMarker_Riemann + + nMarker_Smoluchowski_Maxwell + nMarker_Giles + nMarker_Outlet + nMarker_Isothermal + + nMarker_HeatFlux + nMarker_HeatTransfer + nMarker_EngineInflow + nMarker_EngineExhaust + + nMarker_Internal + nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + + nMarker_Load + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + nMarker_Clamped + + nMarker_Load_Dir + nMarker_Disp_Dir + nMarker_ActDiskInlet + nMarker_ActDiskOutlet + + nMarker_ZoneInterface; /*--- Add the possible send/receive domains ---*/ - nMarker_Max = nMarker_CfgFile + OVERHEAD*size; + nMarker_Max = nMarker_CfgFile + OVERHEAD * size; /*--- Basic dimensionalization of the markers (worst scenario) ---*/ @@ -5530,26 +5933,33 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Allocate the memory (markers in each domain) ---*/ - Marker_All_TagBound = new string[nMarker_All]; // Store the tag that correspond with each marker. - Marker_All_SendRecv = new short[nMarker_All] (); // +#domain (send), -#domain (receive). - Marker_All_KindBC = new unsigned short[nMarker_All] (); // Store the kind of boundary condition. - Marker_All_Monitoring = new unsigned short[nMarker_All] (); // Store whether the boundary should be monitored. - Marker_All_Designing = new unsigned short[nMarker_All] (); // Store whether the boundary should be designed. - Marker_All_Plotting = new unsigned short[nMarker_All] (); // Store whether the boundary should be plotted. - Marker_All_Analyze = new unsigned short[nMarker_All] (); // Store whether the boundary should be plotted. - Marker_All_ZoneInterface = new unsigned short[nMarker_All] (); // Store whether the boundary is in the FSI interface. - Marker_All_GeoEval = new unsigned short[nMarker_All] (); // Store whether the boundary should be geometry evaluation. - Marker_All_DV = new unsigned short[nMarker_All] (); // Store whether the boundary should be affected by design variables. - Marker_All_Moving = new unsigned short[nMarker_All] (); // Store whether the boundary should be in motion. - Marker_All_Deform_Mesh = new unsigned short[nMarker_All] (); // Store whether the boundary is deformable. - Marker_All_Deform_Mesh_Sym_Plane = new unsigned short[nMarker_All] (); //Store wheter the boundary will follow the deformation - Marker_All_Fluid_Load = new unsigned short[nMarker_All] (); // Store whether the boundary computes/applies fluid loads. - Marker_All_PyCustom = new unsigned short[nMarker_All] (); // Store whether the boundary is Python customizable. - Marker_All_PerBound = new short[nMarker_All] (); // Store whether the boundary belongs to a periodic boundary. - Marker_All_Turbomachinery = new unsigned short[nMarker_All] (); // Store whether the boundary is in needed for Turbomachinery computations. - Marker_All_TurbomachineryFlag = new unsigned short[nMarker_All] (); // Store whether the boundary has a flag for Turbomachinery computations. - Marker_All_MixingPlaneInterface = new unsigned short[nMarker_All] (); // Store whether the boundary has a in the MixingPlane interface. - Marker_All_SobolevBC = new unsigned short[nMarker_All] (); // Store wether the boundary should apply to the gradient smoothing. + Marker_All_TagBound = new string[nMarker_All]; // Store the tag that correspond with each marker. + Marker_All_SendRecv = new short[nMarker_All](); // +#domain (send), -#domain (receive). + Marker_All_KindBC = new unsigned short[nMarker_All](); // Store the kind of boundary condition. + Marker_All_Monitoring = new unsigned short[nMarker_All](); // Store whether the boundary should be monitored. + Marker_All_Designing = new unsigned short[nMarker_All](); // Store whether the boundary should be designed. + Marker_All_Plotting = new unsigned short[nMarker_All](); // Store whether the boundary should be plotted. + Marker_All_Analyze = new unsigned short[nMarker_All](); // Store whether the boundary should be plotted. + Marker_All_ZoneInterface = new unsigned short[nMarker_All](); // Store whether the boundary is in the FSI interface. + Marker_All_GeoEval = new unsigned short[nMarker_All](); // Store whether the boundary should be geometry evaluation. + Marker_All_DV = + new unsigned short[nMarker_All](); // Store whether the boundary should be affected by design variables. + Marker_All_Moving = new unsigned short[nMarker_All](); // Store whether the boundary should be in motion. + Marker_All_Deform_Mesh = new unsigned short[nMarker_All](); // Store whether the boundary is deformable. + Marker_All_Deform_Mesh_Sym_Plane = + new unsigned short[nMarker_All](); // Store wheter the boundary will follow the deformation + Marker_All_Fluid_Load = + new unsigned short[nMarker_All](); // Store whether the boundary computes/applies fluid loads. + Marker_All_PyCustom = new unsigned short[nMarker_All](); // Store whether the boundary is Python customizable. + Marker_All_PerBound = new short[nMarker_All](); // Store whether the boundary belongs to a periodic boundary. + Marker_All_Turbomachinery = + new unsigned short[nMarker_All](); // Store whether the boundary is in needed for Turbomachinery computations. + Marker_All_TurbomachineryFlag = + new unsigned short[nMarker_All](); // Store whether the boundary has a flag for Turbomachinery computations. + Marker_All_MixingPlaneInterface = + new unsigned short[nMarker_All](); // Store whether the boundary has a in the MixingPlane interface. + Marker_All_SobolevBC = + new unsigned short[nMarker_All](); // Store wether the boundary should apply to the gradient smoothing. for (iMarker_All = 0; iMarker_All < nMarker_All; iMarker_All++) { Marker_All_TagBound[iMarker_All] = "SEND_RECEIVE"; @@ -5557,25 +5967,25 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Allocate the memory (markers in the config file) ---*/ - Marker_CfgFile_TagBound = new string[nMarker_CfgFile]; - Marker_CfgFile_KindBC = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Monitoring = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Designing = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Plotting = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Analyze = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_GeoEval = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_ZoneInterface = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_DV = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Moving = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Deform_Mesh = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Deform_Mesh_Sym_Plane= new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Fluid_Load = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_PerBound = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_Turbomachinery = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_TurbomachineryFlag = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_MixingPlaneInterface = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_PyCustom = new unsigned short[nMarker_CfgFile] (); - Marker_CfgFile_SobolevBC = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_TagBound = new string[nMarker_CfgFile]; + Marker_CfgFile_KindBC = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Monitoring = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Designing = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Plotting = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Analyze = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_GeoEval = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_ZoneInterface = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_DV = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Moving = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Deform_Mesh = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Deform_Mesh_Sym_Plane = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Fluid_Load = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_PerBound = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_Turbomachinery = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_TurbomachineryFlag = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_MixingPlaneInterface = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_PyCustom = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_SobolevBC = new unsigned short[nMarker_CfgFile](); for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = "SEND_RECEIVE"; @@ -5583,26 +5993,26 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Allocate memory to store surface information (Analyze BC) ---*/ - Surface_MassFlow = new su2double[nMarker_Analyze] (); - Surface_Mach = new su2double[nMarker_Analyze] (); - Surface_Temperature = new su2double[nMarker_Analyze] (); - Surface_Pressure = new su2double[nMarker_Analyze] (); - Surface_Density = new su2double[nMarker_Analyze] (); - Surface_Enthalpy = new su2double[nMarker_Analyze] (); - Surface_NormalVelocity = new su2double[nMarker_Analyze] (); - Surface_Uniformity = new su2double[nMarker_Analyze] (); - Surface_SecondaryStrength = new su2double[nMarker_Analyze] (); - Surface_SecondOverUniform = new su2double[nMarker_Analyze] (); - Surface_MomentumDistortion = new su2double[nMarker_Analyze] (); - Surface_TotalTemperature = new su2double[nMarker_Analyze] (); - Surface_TotalPressure = new su2double[nMarker_Analyze] (); - Surface_PressureDrop = new su2double[nMarker_Analyze] (); - Surface_Species_0 = new su2double[nMarker_Analyze] (); - Surface_Species_Variance = new su2double[nMarker_Analyze] (); - Surface_DC60 = new su2double[nMarker_Analyze] (); - Surface_IDC = new su2double[nMarker_Analyze] (); - Surface_IDC_Mach = new su2double[nMarker_Analyze] (); - Surface_IDR = new su2double[nMarker_Analyze] (); + Surface_MassFlow = new su2double[nMarker_Analyze](); + Surface_Mach = new su2double[nMarker_Analyze](); + Surface_Temperature = new su2double[nMarker_Analyze](); + Surface_Pressure = new su2double[nMarker_Analyze](); + Surface_Density = new su2double[nMarker_Analyze](); + Surface_Enthalpy = new su2double[nMarker_Analyze](); + Surface_NormalVelocity = new su2double[nMarker_Analyze](); + Surface_Uniformity = new su2double[nMarker_Analyze](); + Surface_SecondaryStrength = new su2double[nMarker_Analyze](); + Surface_SecondOverUniform = new su2double[nMarker_Analyze](); + Surface_MomentumDistortion = new su2double[nMarker_Analyze](); + Surface_TotalTemperature = new su2double[nMarker_Analyze](); + Surface_TotalPressure = new su2double[nMarker_Analyze](); + Surface_PressureDrop = new su2double[nMarker_Analyze](); + Surface_Species_0 = new su2double[nMarker_Analyze](); + Surface_Species_Variance = new su2double[nMarker_Analyze](); + Surface_DC60 = new su2double[nMarker_Analyze](); + Surface_IDC = new su2double[nMarker_Analyze](); + Surface_IDC_Mach = new su2double[nMarker_Analyze](); + Surface_IDR = new su2double[nMarker_Analyze](); /*--- Populate the marker information in the config file (all domains) ---*/ @@ -5632,31 +6042,31 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - ActDisk_DeltaPress = new su2double[nMarker_ActDiskInlet] (); - ActDisk_DeltaTemp = new su2double[nMarker_ActDiskInlet] (); - ActDisk_TotalPressRatio = new su2double[nMarker_ActDiskInlet] (); - ActDisk_TotalTempRatio = new su2double[nMarker_ActDiskInlet] (); - ActDisk_StaticPressRatio = new su2double[nMarker_ActDiskInlet] (); - ActDisk_StaticTempRatio = new su2double[nMarker_ActDiskInlet] (); - ActDisk_Power = new su2double[nMarker_ActDiskInlet] (); - ActDisk_MassFlow = new su2double[nMarker_ActDiskInlet] (); - ActDisk_Mach = new su2double[nMarker_ActDiskInlet] (); - ActDisk_Force = new su2double[nMarker_ActDiskInlet] (); - ActDisk_NetThrust = new su2double[nMarker_ActDiskInlet] (); - ActDisk_BCThrust = new su2double[nMarker_ActDiskInlet] (); - ActDisk_BCThrust_Old = new su2double[nMarker_ActDiskInlet] (); - ActDisk_GrossThrust = new su2double[nMarker_ActDiskInlet] (); - ActDisk_Area = new su2double[nMarker_ActDiskInlet] (); - ActDisk_ReverseMassFlow = new su2double[nMarker_ActDiskInlet] (); - - ActDiskInlet_MassFlow = new su2double[nMarker_ActDiskInlet] (); - ActDiskInlet_Temperature = new su2double[nMarker_ActDiskInlet] (); - ActDiskInlet_TotalTemperature = new su2double[nMarker_ActDiskInlet] (); - ActDiskInlet_Pressure = new su2double[nMarker_ActDiskInlet] (); - ActDiskInlet_TotalPressure = new su2double[nMarker_ActDiskInlet] (); - ActDiskInlet_RamDrag = new su2double[nMarker_ActDiskInlet] (); - ActDiskInlet_Force = new su2double[nMarker_ActDiskInlet] (); - ActDiskInlet_Power = new su2double[nMarker_ActDiskInlet] (); + ActDisk_DeltaPress = new su2double[nMarker_ActDiskInlet](); + ActDisk_DeltaTemp = new su2double[nMarker_ActDiskInlet](); + ActDisk_TotalPressRatio = new su2double[nMarker_ActDiskInlet](); + ActDisk_TotalTempRatio = new su2double[nMarker_ActDiskInlet](); + ActDisk_StaticPressRatio = new su2double[nMarker_ActDiskInlet](); + ActDisk_StaticTempRatio = new su2double[nMarker_ActDiskInlet](); + ActDisk_Power = new su2double[nMarker_ActDiskInlet](); + ActDisk_MassFlow = new su2double[nMarker_ActDiskInlet](); + ActDisk_Mach = new su2double[nMarker_ActDiskInlet](); + ActDisk_Force = new su2double[nMarker_ActDiskInlet](); + ActDisk_NetThrust = new su2double[nMarker_ActDiskInlet](); + ActDisk_BCThrust = new su2double[nMarker_ActDiskInlet](); + ActDisk_BCThrust_Old = new su2double[nMarker_ActDiskInlet](); + ActDisk_GrossThrust = new su2double[nMarker_ActDiskInlet](); + ActDisk_Area = new su2double[nMarker_ActDiskInlet](); + ActDisk_ReverseMassFlow = new su2double[nMarker_ActDiskInlet](); + + ActDiskInlet_MassFlow = new su2double[nMarker_ActDiskInlet](); + ActDiskInlet_Temperature = new su2double[nMarker_ActDiskInlet](); + ActDiskInlet_TotalTemperature = new su2double[nMarker_ActDiskInlet](); + ActDiskInlet_Pressure = new su2double[nMarker_ActDiskInlet](); + ActDiskInlet_TotalPressure = new su2double[nMarker_ActDiskInlet](); + ActDiskInlet_RamDrag = new su2double[nMarker_ActDiskInlet](); + ActDiskInlet_Force = new su2double[nMarker_ActDiskInlet](); + ActDiskInlet_Power = new su2double[nMarker_ActDiskInlet](); for (iMarker_ActDiskInlet = 0; iMarker_ActDiskInlet < nMarker_ActDiskInlet; iMarker_ActDiskInlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_ActDiskInlet[iMarker_ActDiskInlet]; @@ -5664,14 +6074,14 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - ActDiskOutlet_MassFlow = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_Temperature = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_TotalTemperature = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_Pressure = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_TotalPressure = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_GrossThrust = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_Force = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_Power = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_MassFlow = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_Temperature = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_TotalTemperature = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_Pressure = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_TotalPressure = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_GrossThrust = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_Force = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_Power = new su2double[nMarker_ActDiskOutlet](); for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_ActDiskOutlet[iMarker_ActDiskOutlet]; @@ -5679,9 +6089,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - Outlet_MassFlow = new su2double[nMarker_Outlet] (); - Outlet_Density = new su2double[nMarker_Outlet] (); - Outlet_Area = new su2double[nMarker_Outlet] (); + Outlet_MassFlow = new su2double[nMarker_Outlet](); + Outlet_Density = new su2double[nMarker_Outlet](); + Outlet_Area = new su2double[nMarker_Outlet](); for (iMarker_NearFieldBound = 0; iMarker_NearFieldBound < nMarker_NearFieldBound; iMarker_NearFieldBound++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_NearFieldBound[iMarker_NearFieldBound]; @@ -5689,7 +6099,8 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - for (iMarker_Fluid_InterfaceBound = 0; iMarker_Fluid_InterfaceBound < nMarker_Fluid_InterfaceBound; iMarker_Fluid_InterfaceBound++) { + for (iMarker_Fluid_InterfaceBound = 0; iMarker_Fluid_InterfaceBound < nMarker_Fluid_InterfaceBound; + iMarker_Fluid_InterfaceBound++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Fluid_InterfaceBound[iMarker_Fluid_InterfaceBound]; Marker_CfgFile_KindBC[iMarker_CfgFile] = FLUID_INTERFACE; iMarker_CfgFile++; @@ -5719,23 +6130,23 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - Engine_Power = new su2double[nMarker_EngineInflow] (); - Engine_Mach = new su2double[nMarker_EngineInflow] (); - Engine_Force = new su2double[nMarker_EngineInflow] (); - Engine_NetThrust = new su2double[nMarker_EngineInflow] (); - Engine_GrossThrust = new su2double[nMarker_EngineInflow] (); - Engine_Area = new su2double[nMarker_EngineInflow] (); - - Inflow_Mach = new su2double[nMarker_EngineInflow] (); - Inflow_Pressure = new su2double[nMarker_EngineInflow] (); - Inflow_MassFlow = new su2double[nMarker_EngineInflow] (); - Inflow_ReverseMassFlow = new su2double[nMarker_EngineInflow] (); - Inflow_TotalPressure = new su2double[nMarker_EngineInflow] (); - Inflow_Temperature = new su2double[nMarker_EngineInflow] (); - Inflow_TotalTemperature = new su2double[nMarker_EngineInflow] (); - Inflow_RamDrag = new su2double[nMarker_EngineInflow] (); - Inflow_Force = new su2double[nMarker_EngineInflow] (); - Inflow_Power = new su2double[nMarker_EngineInflow] (); + Engine_Power = new su2double[nMarker_EngineInflow](); + Engine_Mach = new su2double[nMarker_EngineInflow](); + Engine_Force = new su2double[nMarker_EngineInflow](); + Engine_NetThrust = new su2double[nMarker_EngineInflow](); + Engine_GrossThrust = new su2double[nMarker_EngineInflow](); + Engine_Area = new su2double[nMarker_EngineInflow](); + + Inflow_Mach = new su2double[nMarker_EngineInflow](); + Inflow_Pressure = new su2double[nMarker_EngineInflow](); + Inflow_MassFlow = new su2double[nMarker_EngineInflow](); + Inflow_ReverseMassFlow = new su2double[nMarker_EngineInflow](); + Inflow_TotalPressure = new su2double[nMarker_EngineInflow](); + Inflow_Temperature = new su2double[nMarker_EngineInflow](); + Inflow_TotalTemperature = new su2double[nMarker_EngineInflow](); + Inflow_RamDrag = new su2double[nMarker_EngineInflow](); + Inflow_Force = new su2double[nMarker_EngineInflow](); + Inflow_Power = new su2double[nMarker_EngineInflow](); for (iMarker_EngineInflow = 0; iMarker_EngineInflow < nMarker_EngineInflow; iMarker_EngineInflow++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_EngineInflow[iMarker_EngineInflow]; @@ -5743,14 +6154,14 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - Exhaust_Pressure = new su2double[nMarker_EngineExhaust] (); - Exhaust_Temperature = new su2double[nMarker_EngineExhaust] (); - Exhaust_MassFlow = new su2double[nMarker_EngineExhaust] (); - Exhaust_TotalPressure = new su2double[nMarker_EngineExhaust] (); - Exhaust_TotalTemperature = new su2double[nMarker_EngineExhaust] (); - Exhaust_GrossThrust = new su2double[nMarker_EngineExhaust] (); - Exhaust_Force = new su2double[nMarker_EngineExhaust] (); - Exhaust_Power = new su2double[nMarker_EngineExhaust] (); + Exhaust_Pressure = new su2double[nMarker_EngineExhaust](); + Exhaust_Temperature = new su2double[nMarker_EngineExhaust](); + Exhaust_MassFlow = new su2double[nMarker_EngineExhaust](); + Exhaust_TotalPressure = new su2double[nMarker_EngineExhaust](); + Exhaust_TotalTemperature = new su2double[nMarker_EngineExhaust](); + Exhaust_GrossThrust = new su2double[nMarker_EngineExhaust](); + Exhaust_Force = new su2double[nMarker_EngineExhaust](); + Exhaust_Power = new su2double[nMarker_EngineExhaust](); for (iMarker_EngineExhaust = 0; iMarker_EngineExhaust < nMarker_EngineExhaust; iMarker_EngineExhaust++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_EngineExhaust[iMarker_EngineExhaust]; @@ -5764,7 +6175,8 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - for (iMarker_Supersonic_Outlet = 0; iMarker_Supersonic_Outlet < nMarker_Supersonic_Outlet; iMarker_Supersonic_Outlet++) { + for (iMarker_Supersonic_Outlet = 0; iMarker_Supersonic_Outlet < nMarker_Supersonic_Outlet; + iMarker_Supersonic_Outlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Supersonic_Outlet[iMarker_Supersonic_Outlet]; Marker_CfgFile_KindBC[iMarker_CfgFile] = SUPERSONIC_OUTLET; iMarker_CfgFile++; @@ -5794,7 +6206,8 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - for (iMarker_Smoluchowski_Maxwell = 0; iMarker_Smoluchowski_Maxwell < nMarker_Smoluchowski_Maxwell; iMarker_Smoluchowski_Maxwell++) { + for (iMarker_Smoluchowski_Maxwell = 0; iMarker_Smoluchowski_Maxwell < nMarker_Smoluchowski_Maxwell; + iMarker_Smoluchowski_Maxwell++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Smoluchowski_Maxwell[iMarker_Smoluchowski_Maxwell]; Marker_CfgFile_KindBC[iMarker_CfgFile] = SMOLUCHOWSKI_MAXWELL; iMarker_CfgFile++; @@ -5900,17 +6313,17 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Identification of Turbomachinery markers and flag them---*/ for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { - unsigned short indexMarker=0; + unsigned short indexMarker = 0; Marker_CfgFile_Turbomachinery[iMarker_CfgFile] = NO; Marker_CfgFile_TurbomachineryFlag[iMarker_CfgFile] = NO; - for (iMarker_Turbomachinery = 0; iMarker_Turbomachinery < nMarker_Turbomachinery; iMarker_Turbomachinery++){ - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundIn[iMarker_Turbomachinery]){ - indexMarker=(iMarker_Turbomachinery+1); + for (iMarker_Turbomachinery = 0; iMarker_Turbomachinery < nMarker_Turbomachinery; iMarker_Turbomachinery++) { + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundIn[iMarker_Turbomachinery]) { + indexMarker = (iMarker_Turbomachinery + 1); Marker_CfgFile_Turbomachinery[iMarker_CfgFile] = indexMarker; Marker_CfgFile_TurbomachineryFlag[iMarker_CfgFile] = INFLOW; } - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundOut[iMarker_Turbomachinery]){ - indexMarker=(iMarker_Turbomachinery+1); + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundOut[iMarker_Turbomachinery]) { + indexMarker = (iMarker_Turbomachinery + 1); Marker_CfgFile_Turbomachinery[iMarker_CfgFile] = indexMarker; Marker_CfgFile_TurbomachineryFlag[iMarker_CfgFile] = OUTFLOW; } @@ -5920,19 +6333,19 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Identification of MixingPlane interface markers ---*/ for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { - unsigned short indexMarker=0; + unsigned short indexMarker = 0; Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile] = NO; - for (iMarker_MixingPlaneInterface = 0; iMarker_MixingPlaneInterface < nMarker_MixingPlaneInterface; iMarker_MixingPlaneInterface++) + for (iMarker_MixingPlaneInterface = 0; iMarker_MixingPlaneInterface < nMarker_MixingPlaneInterface; + iMarker_MixingPlaneInterface++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_MixingPlaneInterface[iMarker_MixingPlaneInterface]) - indexMarker=(int)(iMarker_MixingPlaneInterface/2+1); + indexMarker = (int)(iMarker_MixingPlaneInterface / 2 + 1); Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile] = indexMarker; } for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_DV[iMarker_CfgFile] = NO; for (iMarker_DV = 0; iMarker_DV < nMarker_DV; iMarker_DV++) - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_DV[iMarker_DV]) - Marker_CfgFile_DV[iMarker_CfgFile] = YES; + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_DV[iMarker_DV]) Marker_CfgFile_DV[iMarker_CfgFile] = YES; } /*--- Add an extra check for DV_MARKER to make sure that any given marker @@ -5947,15 +6360,18 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { } } - if(!found) { - if (nZone==1) - SU2_MPI::Error("DV_MARKER contains marker names that do not exist in the lists of BCs in the config file.", CURRENT_FUNCTION); + if (!found) { + if (nZone == 1) + SU2_MPI::Error("DV_MARKER contains marker names that do not exist in the lists of BCs in the config file.", + CURRENT_FUNCTION); // In case of multiple zones, the markers might appear only in zonal config and not in the Master. // A loop over all zones would need to be included which is not straight forward as this can only be // checked once all zonal configs are read. else if (rank == MASTER_NODE) - cout << "Warning: DV_MARKER contains marker names that do not exist in the lists of BCs of the master config file.\n" - "Make sure the marker names exist in the zonal config files" << endl; + cout << "Warning: DV_MARKER contains marker names that do not exist in the lists of BCs of the master config " + "file.\n" + "Make sure the marker names exist in the zonal config files" + << endl; } } @@ -5975,7 +6391,8 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_Deform_Mesh_Sym_Plane[iMarker_CfgFile] = NO; - for (iMarker_Deform_Mesh_Sym_Plane = 0; iMarker_Deform_Mesh_Sym_Plane < nMarker_Deform_Mesh_Sym_Plane; iMarker_Deform_Mesh_Sym_Plane++) + for (iMarker_Deform_Mesh_Sym_Plane = 0; iMarker_Deform_Mesh_Sym_Plane < nMarker_Deform_Mesh_Sym_Plane; + iMarker_Deform_Mesh_Sym_Plane++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_Deform_Mesh_Sym_Plane[iMarker_Deform_Mesh_Sym_Plane]) Marker_CfgFile_Deform_Mesh_Sym_Plane[iMarker_CfgFile] = YES; } @@ -5987,9 +6404,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { Marker_CfgFile_Fluid_Load[iMarker_CfgFile] = YES; } - for (iMarker_CfgFile=0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { + for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_PyCustom[iMarker_CfgFile] = NO; - for(iMarker_PyCustom=0; iMarker_PyCustom < nMarker_PyCustom; iMarker_PyCustom++) + for (iMarker_PyCustom = 0; iMarker_PyCustom < nMarker_PyCustom; iMarker_PyCustom++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_PyCustom[iMarker_PyCustom]) Marker_CfgFile_PyCustom[iMarker_CfgFile] = YES; } @@ -6000,58 +6417,61 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_SobolevBC[iMarker_SobolevBC]) Marker_CfgFile_SobolevBC[iMarker_CfgFile] = YES; } - } 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, - iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, - iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, iMarker_Fluid_Load, - iMarker_Smoluchowski_Maxwell, iWall_Catalytic, - iMarker_Giles, iMarker_Outlet, iMarker_Isothermal, iMarker_HeatFlux, iMarker_HeatTransfer, - iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Displacement, iMarker_Damper, - iMarker_Load, iMarker_Internal, iMarker_Monitoring, - iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iDV_Value, - iMarker_ZoneInterface, iMarker_PyCustom, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Clamped, - iMarker_Moving, iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, iMarker_ActDiskInlet, - iMarker_Emissivity, iMarker_StrongBC, - iMarker_ActDiskOutlet, iMarker_MixingPlaneInterface, - iMarker_SobolevBC; + unsigned short iMarker_Euler, iMarker_Custom, iMarker_FarField, iMarker_SymWall, iMarker_PerBound, + iMarker_NearFieldBound, iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, iMarker_Deform_Mesh, + iMarker_Deform_Mesh_Sym_Plane, iMarker_Fluid_Load, iMarker_Smoluchowski_Maxwell, iWall_Catalytic, iMarker_Giles, + iMarker_Outlet, iMarker_Isothermal, iMarker_HeatFlux, iMarker_HeatTransfer, iMarker_EngineInflow, + iMarker_EngineExhaust, iMarker_Displacement, iMarker_Damper, iMarker_Load, iMarker_Internal, iMarker_Monitoring, + iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iDV_Value, + iMarker_ZoneInterface, iMarker_PyCustom, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Clamped, iMarker_Moving, + iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, iMarker_ActDiskInlet, iMarker_Emissivity, iMarker_StrongBC, + iMarker_ActDiskOutlet, iMarker_MixingPlaneInterface, iMarker_SobolevBC; bool fea = ((Kind_Solver == MAIN_SOLVER::FEM_ELASTICITY) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM)); - cout << endl <<"----------------- Physical Case Definition ( Zone " << iZone << " ) -------------------" << endl; + cout << endl << "----------------- Physical Case Definition ( Zone " << iZone << " ) -------------------" << endl; if (val_software == SU2_COMPONENT::SU2_CFD) { - if (FSI_Problem) - cout << "Fluid-Structure Interaction." << endl; + if (FSI_Problem) cout << "Fluid-Structure Interaction." << endl; if (DiscreteAdjoint) { - cout <<"Discrete Adjoint equations using Algorithmic Differentiation\n"; - cout <<"based on the physical case: "; + cout << "Discrete Adjoint equations using Algorithmic Differentiation\n"; + cout << "based on the physical case: "; } switch (Kind_Solver) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::DISC_ADJ_EULER: - case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_EULER: - case MAIN_SOLVER::FEM_EULER: case MAIN_SOLVER::DISC_ADJ_FEM_EULER: + case MAIN_SOLVER::EULER: + case MAIN_SOLVER::DISC_ADJ_EULER: + case MAIN_SOLVER::INC_EULER: + case MAIN_SOLVER::DISC_ADJ_INC_EULER: + case MAIN_SOLVER::FEM_EULER: + case MAIN_SOLVER::DISC_ADJ_FEM_EULER: if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible Euler equations." << endl; if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible Euler equations." << endl; break; - case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: - case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: - case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_FEM_NS: + case MAIN_SOLVER::NAVIER_STOKES: + case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: + case MAIN_SOLVER::INC_NAVIER_STOKES: + case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: + case MAIN_SOLVER::FEM_NAVIER_STOKES: + case MAIN_SOLVER::DISC_ADJ_FEM_NS: 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; + if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) + cout << "Incompressible Laminar Navier-Stokes' equations." << endl; break; - case MAIN_SOLVER::RANS: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::INC_RANS: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - case MAIN_SOLVER::FEM_RANS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: + case MAIN_SOLVER::RANS: + case MAIN_SOLVER::DISC_ADJ_RANS: + case MAIN_SOLVER::INC_RANS: + case MAIN_SOLVER::DISC_ADJ_INC_RANS: + case MAIN_SOLVER::FEM_RANS: + case MAIN_SOLVER::DISC_ADJ_FEM_RANS: 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 TURB_MODEL::NONE: break; + case TURB_MODEL::NONE: + break; case TURB_MODEL::SA: switch (saParsedOptions.version) { case SA_OPTIONS::NEG: @@ -6074,8 +6494,10 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; case TURB_MODEL::SST: cout << "Menter's k-omega SST"; - if (sstParsedOptions.version == SST_OPTIONS::V1994) cout << "-1994"; - else cout << "-2003"; + if (sstParsedOptions.version == SST_OPTIONS::V1994) + cout << "-1994"; + else + cout << "-2003"; if (sstParsedOptions.modified) cout << "m"; if (sstParsedOptions.sust) cout << " with sustaining terms, and"; @@ -6098,7 +6520,8 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; } switch (Kind_Trans_Model) { - case TURB_TRANS_MODEL::NONE: break; + case TURB_TRANS_MODEL::NONE: + break; case TURB_TRANS_MODEL::LM: { cout << "Transition model: Langtry and Menter's 4 equation model"; if (lmParsedOptions.LM2015) { @@ -6110,72 +6533,121 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } } if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) { - cout << "Correlation Functions: "; switch (lmParsedOptions.Correlation) { - case TURB_TRANS_CORRELATION::MALAN: cout << "Malan et al. (2009)" << endl; break; - case TURB_TRANS_CORRELATION::SULUKSNA: cout << "Suluksna et al. (2009)" << endl; break; - case TURB_TRANS_CORRELATION::KRAUSE: cout << "Krause et al. (2008)" << endl; break; - case TURB_TRANS_CORRELATION::KRAUSE_HYPER: cout << "Krause et al. (2008, paper)" << endl; break; - case TURB_TRANS_CORRELATION::MEDIDA_BAEDER: cout << "Medida and Baeder (2011)" << endl; break; - case TURB_TRANS_CORRELATION::MEDIDA: cout << "Medida PhD (2014)" << endl; break; - case TURB_TRANS_CORRELATION::MENTER_LANGTRY: cout << "Menter and Langtry (2009)" << endl; break; + case TURB_TRANS_CORRELATION::MALAN: + cout << "Malan et al. (2009)" << endl; + break; + case TURB_TRANS_CORRELATION::SULUKSNA: + cout << "Suluksna et al. (2009)" << endl; + break; + case TURB_TRANS_CORRELATION::KRAUSE: + cout << "Krause et al. (2008)" << endl; + break; + case TURB_TRANS_CORRELATION::KRAUSE_HYPER: + cout << "Krause et al. (2008, paper)" << endl; + break; + case TURB_TRANS_CORRELATION::MEDIDA_BAEDER: + cout << "Medida and Baeder (2011)" << endl; + break; + case TURB_TRANS_CORRELATION::MEDIDA: + cout << "Medida PhD (2014)" << endl; + break; + case TURB_TRANS_CORRELATION::MENTER_LANGTRY: + cout << "Menter and Langtry (2009)" << endl; + break; case TURB_TRANS_CORRELATION::DEFAULT: switch (Kind_Turb_Model) { - case TURB_MODEL::SA: cout << "Malan et al. (2009)" << endl; break; - case TURB_MODEL::SST: cout << "Menter and Langtry (2009)" << endl; break; - case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but LM transition model is active.", CURRENT_FUNCTION); break; + case TURB_MODEL::SA: + cout << "Malan et al. (2009)" << endl; + break; + case TURB_MODEL::SST: + cout << "Menter and Langtry (2009)" << endl; + break; + case TURB_MODEL::NONE: + SU2_MPI::Error("No turbulence model has been selected but LM transition model is active.", + CURRENT_FUNCTION); + break; } break; } } cout << "Hybrid RANS/LES: "; switch (Kind_HybridRANSLES) { - case NO_HYBRIDRANSLES: cout << "No Hybrid RANS/LES" << endl; break; - case SA_DES: cout << "Detached Eddy Simulation (DES97) " << endl; break; - case SA_DDES: cout << "Delayed Detached Eddy Simulation (DDES) with Standard SGS" << endl; break; - case SA_ZDES: cout << "Delayed Detached Eddy Simulation (DDES) with Vorticity-based SGS" << endl; break; - case SA_EDDES: cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; break; + case NO_HYBRIDRANSLES: + cout << "No Hybrid RANS/LES" << endl; + break; + case SA_DES: + cout << "Detached Eddy Simulation (DES97) " << endl; + break; + case SA_DDES: + cout << "Delayed Detached Eddy Simulation (DDES) with Standard SGS" << endl; + break; + case SA_ZDES: + cout << "Delayed Detached Eddy Simulation (DDES) with Vorticity-based SGS" << endl; + break; + case SA_EDDES: + cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; + break; } break; case MAIN_SOLVER::NEMO_EULER: - if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl; - if (Kind_FluidModel == SU2_NONEQ){ + 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 != "AIR-7") && (GasModel != "ARGON")) - SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION); + SU2_MPI::Error( + "The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or " + "ARGON.", + CURRENT_FUNCTION); } break; case MAIN_SOLVER::NEMO_NAVIER_STOKES: - if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl; - if (Kind_FluidModel == SU2_NONEQ){ + 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 != "AIR-7") && (GasModel != "ARGON")) - SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION); + SU2_MPI::Error( + "The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or " + "ARGON.", + CURRENT_FUNCTION); } break; case MAIN_SOLVER::FEM_LES: - if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible 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 << "LES Subgrid Scale model: "; switch (Kind_SGS_Model) { - case TURB_SGS_MODEL::IMPLICIT_LES: cout << "Implicit LES" << endl; break; - case TURB_SGS_MODEL::SMAGORINSKY: cout << "Smagorinsky " << endl; break; - case TURB_SGS_MODEL::WALE: cout << "WALE" << endl; break; - case TURB_SGS_MODEL::VREMAN: cout << "VREMAN" << endl; break; + case TURB_SGS_MODEL::IMPLICIT_LES: + cout << "Implicit LES" << endl; + break; + case TURB_SGS_MODEL::SMAGORINSKY: + cout << "Smagorinsky " << endl; + break; + case TURB_SGS_MODEL::WALE: + cout << "WALE" << endl; + break; + case TURB_SGS_MODEL::VREMAN: + cout << "VREMAN" << endl; + break; default: SU2_MPI::Error("Subgrid Scale model not specified.", CURRENT_FUNCTION); - } break; - case MAIN_SOLVER::FEM_ELASTICITY: case MAIN_SOLVER::DISC_ADJ_FEM: + case MAIN_SOLVER::FEM_ELASTICITY: + case MAIN_SOLVER::DISC_ADJ_FEM: if (Kind_Struct_Solver == STRUCT_DEFORMATION::SMALL) cout << "Geometrically linear elasticity solver." << endl; - if (Kind_Struct_Solver == STRUCT_DEFORMATION::LARGE) cout << "Geometrically non-linear elasticity solver." << endl; + if (Kind_Struct_Solver == STRUCT_DEFORMATION::LARGE) + cout << "Geometrically non-linear elasticity solver." << endl; if (Kind_Material == STRUCT_MODEL::LINEAR_ELASTIC) cout << "Linear elastic material." << endl; if (Kind_Material == STRUCT_MODEL::NEO_HOOKEAN) { if (Kind_Material_Compress == STRUCT_COMPRESS::COMPRESSIBLE) cout << "Compressible Neo-Hookean material model." << endl; } break; - case MAIN_SOLVER::ADJ_EULER: cout << "Continuous Euler adjoint equations." << endl; break; + case MAIN_SOLVER::ADJ_EULER: + cout << "Continuous Euler adjoint equations." << endl; + break; case MAIN_SOLVER::ADJ_NAVIER_STOKES: if (Frozen_Visc_Cont) cout << "Continuous Navier-Stokes adjoint equations with frozen (laminar) viscosity." << endl; @@ -6188,7 +6660,8 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { else cout << "Continuous RANS adjoint equations." << endl; break; - case MAIN_SOLVER::HEAT_EQUATION: case MAIN_SOLVER::DISC_ADJ_HEAT: + case MAIN_SOLVER::HEAT_EQUATION: + case MAIN_SOLVER::DISC_ADJ_HEAT: cout << "Heat solver" << endl; break; case MAIN_SOLVER::MULTIPHYSICS: @@ -6196,100 +6669,138 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; default: SU2_MPI::Error("No valid solver was chosen", CURRENT_FUNCTION); - } if ((Kind_Regime == ENUM_REGIME::COMPRESSIBLE) && (Kind_Solver != MAIN_SOLVER::FEM_ELASTICITY)) { - cout << "Mach number: " << Mach <<"."<< endl; - cout << "Angle of attack (AoA): " << AoA <<" deg, and angle of sideslip (AoS): " << AoS <<" deg."<< endl; + cout << "Mach number: " << Mach << "." << endl; + cout << "Angle of attack (AoA): " << AoA << " deg, and angle of sideslip (AoS): " << AoS << " deg." << endl; if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES)) - cout << "Reynolds number: " << Reynolds <<". Reference length " << Length_Reynolds << "." << endl; + cout << "Reynolds number: " << Reynolds << ". Reference length " << Length_Reynolds << "." << endl; if (Fixed_CL_Mode) { cout << "Fixed CL mode, target value: " << Target_CL << "." << endl; } } if (EquivArea) { - cout <<"The equivalent area is going to be evaluated on the near-field."<< endl; - cout <<"The lower integration limit is "< 1) || (nRefOriginMoment_Y > 1) || (nRefOriginMoment_Z > 1)) { cout << "Surface(s) where the force coefficients are evaluated and \n"; cout << "their reference origin for moment computation: \n"; for (iMarker_Monitoring = 0; iMarker_Monitoring < nMarker_Monitoring; iMarker_Monitoring++) { - cout << " - " << Marker_Monitoring[iMarker_Monitoring] << " (" << RefOriginMoment_X[iMarker_Monitoring] <<", "< value <-> param):" << endl; + if ((Design_Variable[iDV] != NO_DEFORMATION) && (Design_Variable[iDV] != FFD_SETTING) && + (Design_Variable[iDV] != SCALE_GRID) && (Design_Variable[iDV] != TRANSLATE_GRID) && + (Design_Variable[iDV] != ROTATE_GRID) && (Design_Variable[iDV] != SURFACE_FILE)) { + if (iDV == 0) cout << "Design variables definition (markers <-> value <-> param):" << endl; switch (Design_Variable[iDV]) { - case FFD_CONTROL_POINT_2D: cout << "FFD 2D (control point) <-> "; break; - case FFD_CAMBER_2D: cout << "FFD 2D (camber) <-> "; break; - case FFD_THICKNESS_2D: cout << "FFD 2D (thickness) <-> "; break; - case HICKS_HENNE: cout << "Hicks Henne <-> " ; break; - case SURFACE_BUMP: cout << "Surface bump <-> " ; break; - case ANGLE_OF_ATTACK: cout << "Angle of attack <-> " ; break; - case CST: cout << "Kulfan parameter number (CST) <-> " ; break; - case TRANSLATION: cout << "Translation design variable."; break; - case SCALE: cout << "Scale design variable."; break; - case NACA_4DIGITS: cout << "NACA four digits <-> "; break; - case PARABOLIC: cout << "Parabolic <-> "; break; - case AIRFOIL: cout << "Airfoil <-> "; break; - case ROTATION: cout << "Rotation <-> "; break; - case FFD_CONTROL_POINT: cout << "FFD (control point) <-> "; break; - case FFD_NACELLE: cout << "FFD (nacelle) <-> "; break; - case FFD_GULL: cout << "FFD (gull) <-> "; break; - case FFD_TWIST: cout << "FFD (twist) <-> "; break; - case FFD_ROTATION: cout << "FFD (rotation) <-> "; break; - case FFD_CONTROL_SURFACE: cout << "FFD (control surface) <-> "; break; - case FFD_CAMBER: cout << "FFD (camber) <-> "; break; - case FFD_THICKNESS: cout << "FFD (thickness) -> "; break; - case FFD_ANGLE_OF_ATTACK: cout << "FFD (angle of attack) <-> "; break; + case FFD_CONTROL_POINT_2D: + cout << "FFD 2D (control point) <-> "; + break; + case FFD_CAMBER_2D: + cout << "FFD 2D (camber) <-> "; + break; + case FFD_THICKNESS_2D: + cout << "FFD 2D (thickness) <-> "; + break; + case HICKS_HENNE: + cout << "Hicks Henne <-> "; + break; + case SURFACE_BUMP: + cout << "Surface bump <-> "; + break; + case ANGLE_OF_ATTACK: + cout << "Angle of attack <-> "; + break; + case CST: + cout << "Kulfan parameter number (CST) <-> "; + break; + case TRANSLATION: + cout << "Translation design variable."; + break; + case SCALE: + cout << "Scale design variable."; + break; + case NACA_4DIGITS: + cout << "NACA four digits <-> "; + break; + case PARABOLIC: + cout << "Parabolic <-> "; + break; + case AIRFOIL: + cout << "Airfoil <-> "; + break; + case ROTATION: + cout << "Rotation <-> "; + break; + case FFD_CONTROL_POINT: + cout << "FFD (control point) <-> "; + break; + case FFD_NACELLE: + cout << "FFD (nacelle) <-> "; + break; + case FFD_GULL: + cout << "FFD (gull) <-> "; + break; + case FFD_TWIST: + cout << "FFD (twist) <-> "; + break; + case FFD_ROTATION: + cout << "FFD (rotation) <-> "; + break; + case FFD_CONTROL_SURFACE: + cout << "FFD (control surface) <-> "; + break; + case FFD_CAMBER: + cout << "FFD (camber) <-> "; + break; + case FFD_THICKNESS: + cout << "FFD (thickness) -> "; + break; + case FFD_ANGLE_OF_ATTACK: + cout << "FFD (angle of attack) <-> "; + break; } for (iMarker_DV = 0; iMarker_DV < nMarker_DV; iMarker_DV++) { cout << Marker_DV[iMarker_DV]; - if (iMarker_DV < nMarker_DV-1) cout << ", "; - else cout << " <-> "; + if (iMarker_DV < nMarker_DV - 1) + cout << ", "; + else + cout << " <-> "; } for (iDV_Value = 0; iDV_Value < nDV_Value[iDV]; iDV_Value++) { cout << DV_Value[iDV][iDV_Value]; - if (iDV_Value != nDV_Value[iDV]-1) cout << ", "; + if (iDV_Value != nDV_Value[iDV] - 1) cout << ", "; } cout << " <-> "; - if ((Design_Variable[iDV] == NO_DEFORMATION) || - (Design_Variable[iDV] == FFD_SETTING) || - (Design_Variable[iDV] == SCALE) ) nParamDV = 0; + if ((Design_Variable[iDV] == NO_DEFORMATION) || (Design_Variable[iDV] == FFD_SETTING) || + (Design_Variable[iDV] == SCALE)) + nParamDV = 0; if (Design_Variable[iDV] == ANGLE_OF_ATTACK) nParamDV = 1; - if ((Design_Variable[iDV] == FFD_CAMBER_2D) || - (Design_Variable[iDV] == FFD_THICKNESS_2D) || - (Design_Variable[iDV] == HICKS_HENNE) || - (Design_Variable[iDV] == PARABOLIC) || - (Design_Variable[iDV] == AIRFOIL) || - (Design_Variable[iDV] == FFD_GULL) || - (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK) ) nParamDV = 2; - if ((Design_Variable[iDV] == TRANSLATION) || - (Design_Variable[iDV] == NACA_4DIGITS) || - (Design_Variable[iDV] == CST) || - (Design_Variable[iDV] == SURFACE_BUMP) || - (Design_Variable[iDV] == FFD_CAMBER) || - (Design_Variable[iDV] == FFD_THICKNESS) ) nParamDV = 3; + if ((Design_Variable[iDV] == FFD_CAMBER_2D) || (Design_Variable[iDV] == FFD_THICKNESS_2D) || + (Design_Variable[iDV] == HICKS_HENNE) || (Design_Variable[iDV] == PARABOLIC) || + (Design_Variable[iDV] == AIRFOIL) || (Design_Variable[iDV] == FFD_GULL) || + (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK)) + nParamDV = 2; + if ((Design_Variable[iDV] == TRANSLATION) || (Design_Variable[iDV] == NACA_4DIGITS) || + (Design_Variable[iDV] == CST) || (Design_Variable[iDV] == SURFACE_BUMP) || + (Design_Variable[iDV] == FFD_CAMBER) || (Design_Variable[iDV] == FFD_THICKNESS)) + nParamDV = 3; if (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) nParamDV = 5; if (Design_Variable[iDV] == ROTATION) nParamDV = 6; - if ((Design_Variable[iDV] == FFD_CONTROL_POINT) || - (Design_Variable[iDV] == FFD_ROTATION) || - (Design_Variable[iDV] == FFD_CONTROL_SURFACE) ) nParamDV = 7; + if ((Design_Variable[iDV] == FFD_CONTROL_POINT) || (Design_Variable[iDV] == FFD_ROTATION) || + (Design_Variable[iDV] == FFD_CONTROL_SURFACE)) + nParamDV = 7; if (Design_Variable[iDV] == FFD_TWIST) nParamDV = 8; for (unsigned short iParamDV = 0; iParamDV < nParamDV; iParamDV++) { - if (iParamDV == 0) cout << "( "; if ((iParamDV == 0) && - ((Design_Variable[iDV] == NO_DEFORMATION) || - (Design_Variable[iDV] == FFD_SETTING) || - (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK) || - (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) || - (Design_Variable[iDV] == FFD_CAMBER_2D) || - (Design_Variable[iDV] == FFD_THICKNESS_2D) || - (Design_Variable[iDV] == FFD_CONTROL_POINT) || - (Design_Variable[iDV] == FFD_NACELLE) || - (Design_Variable[iDV] == FFD_GULL) || - (Design_Variable[iDV] == FFD_TWIST) || - (Design_Variable[iDV] == FFD_ROTATION) || - (Design_Variable[iDV] == FFD_CONTROL_SURFACE) || - (Design_Variable[iDV] == FFD_CAMBER) || - (Design_Variable[iDV] == FFD_THICKNESS))) cout << FFDTag[iDV]; - else cout << ParamDV[iDV][iParamDV]; - - if (iParamDV < nParamDV-1) cout << ", "; - else cout <<" )"<< endl; + ((Design_Variable[iDV] == NO_DEFORMATION) || (Design_Variable[iDV] == FFD_SETTING) || + (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK) || (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) || + (Design_Variable[iDV] == FFD_CAMBER_2D) || (Design_Variable[iDV] == FFD_THICKNESS_2D) || + (Design_Variable[iDV] == FFD_CONTROL_POINT) || (Design_Variable[iDV] == FFD_NACELLE) || + (Design_Variable[iDV] == FFD_GULL) || (Design_Variable[iDV] == FFD_TWIST) || + (Design_Variable[iDV] == FFD_ROTATION) || (Design_Variable[iDV] == FFD_CONTROL_SURFACE) || + (Design_Variable[iDV] == FFD_CAMBER) || (Design_Variable[iDV] == FFD_THICKNESS))) + cout << FFDTag[iDV]; + else + cout << ParamDV[iDV][iParamDV]; + if (iParamDV < nParamDV - 1) + cout << ", "; + else + cout << " )" << endl; } } @@ -6523,19 +7079,19 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } else if (Design_Variable[iDV] == FFD_SETTING) { - cout << "Setting the FFD box structure." << endl; cout << "FFD boxes definition (FFD tag <-> degree <-> coord):" << endl; for (unsigned short iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { - cout << TagFFDBox[iFFDBox] << " <-> "; for (unsigned short iDegreeFFD = 0; iDegreeFFD < 3; iDegreeFFD++) { if (iDegreeFFD == 0) cout << "( "; cout << DegreeFFDBox[iFFDBox][iDegreeFFD]; - if (iDegreeFFD < 2) cout << ", "; - else cout <<" )"; + if (iDegreeFFD < 2) + cout << ", "; + else + cout << " )"; } cout << " <-> "; @@ -6543,78 +7099,148 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { for (unsigned short iCoordFFD = 0; iCoordFFD < 24; iCoordFFD++) { if (iCoordFFD == 0) cout << "( "; cout << CoordFFDBox[iFFDBox][iCoordFFD]; - if (iCoordFFD < 23) cout << ", "; - else cout <<" )"<< endl; + if (iCoordFFD < 23) + cout << ", "; + else + cout << " )" << endl; } - } } - else cout << endl; - + else + cout << endl; } } - 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) { + 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) { switch (Kind_ObjFunc[0]) { - case DRAG_COEFFICIENT: cout << "CD objective function"; - if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCD/dCL = " << dCD_dCL << "." << endl; } - else { cout << "." << endl; } + case DRAG_COEFFICIENT: + cout << "CD objective function"; + if (Fixed_CL_Mode) { + cout << " using fixed CL mode, dCD/dCL = " << dCD_dCL << "." << endl; + } else { + cout << "." << endl; + } break; - case LIFT_COEFFICIENT: cout << "CL objective function." << endl; break; - case MOMENT_X_COEFFICIENT: cout << "CMx objective function" << endl; - if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCMx/dCL = " << dCMx_dCL << "." << endl; } - else { cout << "." << endl; } + case LIFT_COEFFICIENT: + cout << "CL objective function." << endl; break; - case MOMENT_Y_COEFFICIENT: cout << "CMy objective function" << endl; - if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCMy/dCL = " << dCMy_dCL << "." << endl; } - else { cout << "." << endl; } + case MOMENT_X_COEFFICIENT: + cout << "CMx objective function" << endl; + if (Fixed_CL_Mode) { + cout << " using fixed CL mode, dCMx/dCL = " << dCMx_dCL << "." << endl; + } else { + cout << "." << endl; + } break; - case MOMENT_Z_COEFFICIENT: cout << "CMz objective function" << endl; - if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCMz/dCL = " << dCMz_dCL << "." << endl; } - else { cout << "." << endl; } + case MOMENT_Y_COEFFICIENT: + cout << "CMy objective function" << endl; + if (Fixed_CL_Mode) { + cout << " using fixed CL mode, dCMy/dCL = " << dCMy_dCL << "." << endl; + } else { + cout << "." << endl; + } + break; + case MOMENT_Z_COEFFICIENT: + cout << "CMz objective function" << endl; + if (Fixed_CL_Mode) { + cout << " using fixed CL mode, dCMz/dCL = " << dCMz_dCL << "." << endl; + } else { + cout << "." << endl; + } + break; + case INVERSE_DESIGN_PRESSURE: + cout << "Inverse design (Cp) objective function." << endl; + break; + case INVERSE_DESIGN_HEATFLUX: + cout << "Inverse design (Heat Flux) objective function." << endl; + break; + case SIDEFORCE_COEFFICIENT: + cout << "Side force objective function." << endl; + break; + case EFFICIENCY: + cout << "CL/CD objective function." << endl; + break; + case EQUIVALENT_AREA: + cout << "Equivalent area objective function. CD weight: " << WeightCd << "." << endl; + break; + case NEARFIELD_PRESSURE: + cout << "Nearfield pressure objective function. CD weight: " << WeightCd << "." << endl; + break; + case FORCE_X_COEFFICIENT: + cout << "X-force objective function." << endl; + break; + case FORCE_Y_COEFFICIENT: + cout << "Y-force objective function." << endl; + break; + case FORCE_Z_COEFFICIENT: + cout << "Z-force objective function." << endl; + break; + case THRUST_COEFFICIENT: + cout << "Thrust objective function." << endl; + break; + case TORQUE_COEFFICIENT: + cout << "Torque efficiency objective function." << endl; + break; + case TOTAL_HEATFLUX: + cout << "Total heat flux objective function." << endl; + break; + case MAXIMUM_HEATFLUX: + cout << "Maximum heat flux objective function." << endl; + break; + case FIGURE_OF_MERIT: + cout << "Rotor Figure of Merit objective function." << endl; + break; + case BUFFET_SENSOR: + cout << "Buffet sensor objective function." << endl; + break; + case SURFACE_TOTAL_PRESSURE: + cout << "Average total pressure objective function." << endl; + break; + case SURFACE_STATIC_PRESSURE: + cout << "Average static pressure objective function." << endl; + break; + case SURFACE_STATIC_TEMPERATURE: + cout << "Average static temperature objective function." << endl; + break; + case SURFACE_MASSFLOW: + cout << "Mass flow rate objective function." << endl; + break; + case SURFACE_MACH: + cout << "Mach number objective function." << endl; + break; + case CUSTOM_OBJFUNC: + cout << "Custom objective function." << endl; + break; + case REFERENCE_GEOMETRY: + cout << "Target geometry objective function." << endl; + break; + case REFERENCE_NODE: + cout << "Target node displacement objective function." << endl; + break; + case VOLUME_FRACTION: + cout << "Volume fraction objective function." << endl; + break; + case TOPOL_DISCRETENESS: + cout << "Topology discreteness objective function." << endl; + break; + case TOPOL_COMPLIANCE: + cout << "Topology compliance objective function." << endl; + break; + case STRESS_PENALTY: + cout << "Stress penalty objective function." << endl; break; - case INVERSE_DESIGN_PRESSURE: cout << "Inverse design (Cp) objective function." << endl; break; - case INVERSE_DESIGN_HEATFLUX: cout << "Inverse design (Heat Flux) objective function." << endl; break; - case SIDEFORCE_COEFFICIENT: cout << "Side force objective function." << endl; break; - case EFFICIENCY: cout << "CL/CD objective function." << endl; break; - case EQUIVALENT_AREA: cout << "Equivalent area objective function. CD weight: " << WeightCd <<"."<< endl; break; - case NEARFIELD_PRESSURE: cout << "Nearfield pressure objective function. CD weight: " << WeightCd <<"."<< endl; break; - case FORCE_X_COEFFICIENT: cout << "X-force objective function." << endl; break; - case FORCE_Y_COEFFICIENT: cout << "Y-force objective function." << endl; break; - case FORCE_Z_COEFFICIENT: cout << "Z-force objective function." << endl; break; - case THRUST_COEFFICIENT: cout << "Thrust objective function." << endl; break; - case TORQUE_COEFFICIENT: cout << "Torque efficiency objective function." << endl; break; - case TOTAL_HEATFLUX: cout << "Total heat flux objective function." << endl; break; - case MAXIMUM_HEATFLUX: cout << "Maximum heat flux objective function." << endl; break; - case FIGURE_OF_MERIT: cout << "Rotor Figure of Merit objective function." << endl; break; - case BUFFET_SENSOR: cout << "Buffet sensor objective function." << endl; break; - case SURFACE_TOTAL_PRESSURE: cout << "Average total pressure objective function." << endl; break; - case SURFACE_STATIC_PRESSURE: cout << "Average static pressure objective function." << endl; break; - case SURFACE_STATIC_TEMPERATURE: cout << "Average static temperature objective function." << endl; break; - case SURFACE_MASSFLOW: cout << "Mass flow rate objective function." << endl; break; - case SURFACE_MACH: cout << "Mach number objective function." << endl; break; - case CUSTOM_OBJFUNC: cout << "Custom objective function." << endl; break; - case REFERENCE_GEOMETRY: cout << "Target geometry objective function." << endl; break; - case REFERENCE_NODE: cout << "Target node displacement objective function." << endl; break; - case VOLUME_FRACTION: cout << "Volume fraction objective function." << endl; break; - case TOPOL_DISCRETENESS: cout << "Topology discreteness objective function." << endl; break; - case TOPOL_COMPLIANCE: cout << "Topology compliance objective function." << endl; break; - case STRESS_PENALTY: cout << "Stress penalty objective function." << endl; break; } - } - else { + } else { cout << "Weighted sum objective function." << endl; } - } if (val_software == SU2_COMPONENT::SU2_CFD) { - auto PrintLimiterInfo = [&](const LIMITER kind_limiter) { cout << "Second order integration in space, with slope limiter.\n"; switch (kind_limiter) { @@ -6649,12 +7275,14 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { case LIMITER::SHARP_EDGES: cout << "Sharp edges slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; cout << "The reference element size is: " << RefElemLength << ".\n"; - cout << "The reference sharp edge distance is: " << AdjSharp_LimiterCoeff*RefElemLength*Venkat_LimiterCoeff << "." << endl; + cout << "The reference sharp edge distance is: " + << AdjSharp_LimiterCoeff * RefElemLength * Venkat_LimiterCoeff << "." << endl; break; case LIMITER::WALL_DISTANCE: cout << "Wall distance slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; cout << "The reference element size is: " << RefElemLength << ".\n"; - cout << "The reference wall distance is: " << AdjSharp_LimiterCoeff*RefElemLength*Venkat_LimiterCoeff << "." << endl; + cout << "The reference wall distance is: " << AdjSharp_LimiterCoeff * RefElemLength * Venkat_LimiterCoeff + << "." << endl; break; default: SU2_MPI::Error("Unknown or invalid limiter type.", CURRENT_FUNCTION); @@ -6662,53 +7290,69 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } }; - cout << endl <<"--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; + cout << endl << "--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; if (SmoothNumGrid) cout << "There are some smoothing iterations on the grid coordinates." << endl; - if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || - (Kind_Solver == MAIN_SOLVER::INC_EULER) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || - (Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) ) { - + if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_EULER) || + (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || + (Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { if (Kind_ConvNumScheme_Flow == SPACE_CENTERED) { if (Kind_Centered_Flow == CENTERED::LAX) { cout << "Lax-Friedrich scheme (1st order in space) for the flow inviscid terms.\n"; cout << "Lax viscous coefficients (1st): " << Kappa_1st_Flow << ".\n"; cout << "First order integration." << endl; - } - else { + } else { cout << "Jameson-Schmidt-Turkel scheme (2nd order in space) for the flow inviscid terms.\n"; cout << "JST viscous coefficients (2nd & 4th): " << Kappa_2nd_Flow << ", " << Kappa_4th_Flow << ".\n"; - cout << "The method includes a grid stretching correction (p = 0.3)."<< endl; + cout << "The method includes a grid stretching correction (p = 0.3)." << endl; } } if (Kind_ConvNumScheme_Flow == SPACE_UPWIND) { - if (Kind_Upwind_Flow == UPWIND::ROE) cout << "Roe (with entropy fix = "<< EntropyFix_Coeff <<") solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::TURKEL) cout << "Roe-Turkel solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::AUSM) cout << "AUSM solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::HLLC) cout << "HLLC solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::SW) cout << "Steger-Warming solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::MSW) cout << "Modified Steger-Warming solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::L2ROE) cout << "L2ROE Low Mach ROE solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::LMROE) cout << "Rieper Low Mach ROE solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::SLAU) cout << "Simple Low-Dissipation AUSM solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::SLAU2) cout << "Simple Low-Dissipation AUSM 2 solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::FDS) cout << "Flux difference splitting (FDS) upwind scheme for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP) cout << "AUSM+-up solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP2) cout << "AUSM+-up2 solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::AUSMPLUSM) cout << "AUSM+M solver for the flow inviscid terms."<< endl; - - if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER || + if (Kind_Upwind_Flow == UPWIND::ROE) + cout << "Roe (with entropy fix = " << EntropyFix_Coeff << ") solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::TURKEL) cout << "Roe-Turkel solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::AUSM) cout << "AUSM solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::HLLC) cout << "HLLC solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::SW) cout << "Steger-Warming solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::MSW) + cout << "Modified Steger-Warming solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::L2ROE) cout << "L2ROE Low Mach ROE solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::LMROE) + cout << "Rieper Low Mach ROE solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::SLAU) + cout << "Simple Low-Dissipation AUSM solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::SLAU2) + cout << "Simple Low-Dissipation AUSM 2 solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::FDS) + cout << "Flux difference splitting (FDS) upwind scheme for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP) cout << "AUSM+-up solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP2) cout << "AUSM+-up2 solver for the flow inviscid terms." << endl; + if (Kind_Upwind_Flow == UPWIND::AUSMPLUSM) cout << "AUSM+M solver for the flow inviscid terms." << endl; + + if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER || Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::RANS || Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) { + Kind_Solver == MAIN_SOLVER::RANS || Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) { switch (Kind_RoeLowDiss) { - case NO_ROELOWDISS: cout << "Standard Roe without low-dissipation function."<< endl; break; - case NTS: cout << "Roe with NTS low-dissipation function."<< endl; break; - case FD: cout << "Roe with DDES's FD low-dissipation function."<< endl; break; - case NTS_DUCROS: cout << "Roe with NTS low-dissipation function + Ducros shock sensor."<< endl; break; - case FD_DUCROS: cout << "Roe with DDES's FD low-dissipation function + Ducros shock sensor."<< endl; break; + case NO_ROELOWDISS: + cout << "Standard Roe without low-dissipation function." << endl; + break; + case NTS: + cout << "Roe with NTS low-dissipation function." << endl; + break; + case FD: + cout << "Roe with DDES's FD low-dissipation function." << endl; + break; + case NTS_DUCROS: + cout << "Roe with NTS low-dissipation function + Ducros shock sensor." << endl; + break; + case FD_DUCROS: + cout << "Roe with DDES's FD low-dissipation function + Ducros shock sensor." << endl; + break; } } @@ -6717,9 +7361,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } else { cout << "First order integration in space." << endl; } - } - } if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { @@ -6733,24 +7375,25 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } } - if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { - + if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { if (Kind_ConvNumScheme_AdjFlow == SPACE_CENTERED) { if (Kind_Centered_AdjFlow == CENTERED::JST) { - cout << "Jameson-Schmidt-Turkel scheme for the adjoint inviscid terms."<< endl; - cout << "JST viscous coefficients (1st, 2nd, & 4th): " << Kappa_1st_AdjFlow - << ", " << Kappa_2nd_AdjFlow << ", " << Kappa_4th_AdjFlow <<"."<< endl; - cout << "The method includes a grid stretching correction (p = 0.3)."<< endl; + cout << "Jameson-Schmidt-Turkel scheme for the adjoint inviscid terms." << endl; + cout << "JST viscous coefficients (1st, 2nd, & 4th): " << Kappa_1st_AdjFlow << ", " << Kappa_2nd_AdjFlow + << ", " << Kappa_4th_AdjFlow << "." << endl; + cout << "The method includes a grid stretching correction (p = 0.3)." << endl; cout << "Second order integration." << endl; } if (Kind_Centered_AdjFlow == CENTERED::LAX) { - cout << "Lax-Friedrich scheme for the adjoint inviscid terms."<< endl; + cout << "Lax-Friedrich scheme for the adjoint inviscid terms." << endl; cout << "First order integration." << endl; } } if (Kind_ConvNumScheme_AdjFlow == SPACE_UPWIND) { - if (Kind_Upwind_AdjFlow == UPWIND::ROE) cout << "Roe (with entropy fix = "<< EntropyFix_Coeff <<") solver for the adjoint inviscid terms."<< endl; + if (Kind_Upwind_AdjFlow == UPWIND::ROE) + cout << "Roe (with entropy fix = " << EntropyFix_Coeff << ") solver for the adjoint inviscid terms." << endl; if (MUSCL_AdjFlow) { PrintLimiterInfo(Kind_SlopeLimit_AdjFlow); } else { @@ -6758,13 +7401,14 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } } - cout << "The reference sharp edge distance is: " << AdjSharp_LimiterCoeff*RefElemLength*Venkat_LimiterCoeff <<". "<< endl; - + cout << "The reference sharp edge distance is: " << AdjSharp_LimiterCoeff * RefElemLength * Venkat_LimiterCoeff + << ". " << endl; } if ((Kind_Solver == MAIN_SOLVER::ADJ_RANS) && (!Frozen_Visc_Cont)) { if (Kind_ConvNumScheme_AdjTurb == SPACE_UPWIND) { - if (Kind_Upwind_Turb == UPWIND::SCALAR_UPWIND) cout << "Scalar upwind solver for the adjoint turbulence model." << endl; + if (Kind_Upwind_Turb == UPWIND::SCALAR_UPWIND) + cout << "Scalar upwind solver for the adjoint turbulence model." << endl; if (MUSCL_AdjTurb) { PrintLimiterInfo(Kind_SlopeLimit_AdjTurb); } else { @@ -6775,62 +7419,85 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || - (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { - cout << "Average of gradients with correction (viscous flow terms)." << endl; + (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { + cout << "Average of gradients with correction (viscous flow terms)." << endl; } if ((Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { cout << "Average of gradients with correction (viscous adjoint terms)." << endl; } - if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) ) { + if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || + (Kind_Solver == MAIN_SOLVER::INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS)) { cout << "Average of gradients with correction (viscous turbulence terms)." << endl; } if ((Kind_Solver == MAIN_SOLVER::ADJ_RANS) && (!Frozen_Visc_Cont)) { - cout << "Average of gradients with correction (2nd order) for computation of adjoint viscous turbulence terms." << endl; - if (Kind_TimeIntScheme_AdjTurb == EULER_IMPLICIT) cout << "Euler implicit method for the turbulent adjoint equation." << endl; + cout << "Average of gradients with correction (2nd order) for computation of adjoint viscous turbulence terms." + << endl; + if (Kind_TimeIntScheme_AdjTurb == EULER_IMPLICIT) + cout << "Euler implicit method for the turbulent adjoint equation." << endl; } - if(Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && - Kind_Solver != MAIN_SOLVER::FEM_RANS && Kind_Solver != MAIN_SOLVER::FEM_LES && - Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_NS && - Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_RANS) { - if (!fea){ + if (Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::FEM_RANS && Kind_Solver != MAIN_SOLVER::FEM_LES && + Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_NS && + Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_RANS) { + if (!fea) { switch (Kind_Gradient_Method_Recon) { - case GREEN_GAUSS: cout << "Gradient for upwind reconstruction: Green-Gauss." << endl; break; - case LEAST_SQUARES: cout << "Gradient for upwind reconstruction: unweighted Least-Squares." << endl; break; - case WEIGHTED_LEAST_SQUARES: cout << "Gradient for upwind reconstruction: inverse-distance weighted Least-Squares." << endl; break; + case GREEN_GAUSS: + cout << "Gradient for upwind reconstruction: Green-Gauss." << endl; + break; + case LEAST_SQUARES: + cout << "Gradient for upwind reconstruction: unweighted Least-Squares." << endl; + break; + case WEIGHTED_LEAST_SQUARES: + cout << "Gradient for upwind reconstruction: inverse-distance weighted Least-Squares." << endl; + break; } switch (Kind_Gradient_Method) { - case GREEN_GAUSS: cout << "Gradient for viscous and source terms: Green-Gauss." << endl; break; - case LEAST_SQUARES: cout << "Gradient for viscous and source terms: unweighted Least-Squares." << endl; break; - case WEIGHTED_LEAST_SQUARES: cout << "Gradient for viscous and source terms: inverse-distance weighted Least-Squares." << endl; break; + case GREEN_GAUSS: + cout << "Gradient for viscous and source terms: Green-Gauss." << endl; + break; + case LEAST_SQUARES: + cout << "Gradient for viscous and source terms: unweighted Least-Squares." << endl; + break; + case WEIGHTED_LEAST_SQUARES: + cout << "Gradient for viscous and source terms: inverse-distance weighted Least-Squares." << endl; + break; } - } - else{ + } else { cout << "Spatial discretization using the Finite Element Method." << endl; } } - if(Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES || - Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS || - Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS) { - if(Kind_FEM_Flow == DG) { + if (Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES || + Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS || + Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS) { + if (Kind_FEM_Flow == DG) { cout << "Discontinuous Galerkin Finite element solver" << endl; - switch( Riemann_Solver_FEM ) { - case UPWIND::ROE: cout << "Roe (with entropy fix) solver for inviscid fluxes over the faces" << endl; break; - case UPWIND::LAX_FRIEDRICH: cout << "Lax-Friedrich solver for inviscid fluxes over the faces" << endl; break; - case UPWIND::AUSM: cout << "AUSM solver inviscid fluxes over the faces" << endl; break; - case UPWIND::HLLC: cout << "HLLC solver inviscid fluxes over the faces" << endl; break; - default: break; + switch (Riemann_Solver_FEM) { + case UPWIND::ROE: + cout << "Roe (with entropy fix) solver for inviscid fluxes over the faces" << endl; + break; + case UPWIND::LAX_FRIEDRICH: + cout << "Lax-Friedrich solver for inviscid fluxes over the faces" << endl; + break; + case UPWIND::AUSM: + cout << "AUSM solver inviscid fluxes over the faces" << endl; + break; + case UPWIND::HLLC: + cout << "HLLC solver inviscid fluxes over the faces" << endl; + break; + default: + break; } - if(Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER) { + if (Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER) { cout << "Theta symmetrizing terms interior penalty: " << Theta_Interior_Penalty_DGFEM << endl; } } @@ -6842,50 +7509,58 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "Padded matrix size for optimal performance: " << sizeMatMulPadding << endl; } - cout << endl <<"--------------- Time Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; + cout << endl << "--------------- Time Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; if (!fea) { - switch (TimeMarching) { - 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; + switch (TimeMarching) { + case TIME_MARCHING::STEADY: + cout << "Local time stepping (steady state simulation)." << 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; + 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; - default: - break; - } - } - else { - if (Time_Domain) { - cout << "Dynamic structural analysis."<< endl; - cout << "Time step provided by the user for the dynamic analysis(s): "<< Time_Step << "." << endl; + 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 { - cout << "Static structural analysis." << endl; + if (Time_Domain) { + cout << "Dynamic structural analysis." << endl; + cout << "Time step provided by the user for the dynamic analysis(s): " << Time_Step << "." << endl; + } else { + cout << "Static structural analysis." << endl; + } } - } - if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || - (Kind_Solver == MAIN_SOLVER::INC_EULER) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || + if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_EULER) || + (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || (Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS)) { + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS)) { switch (Kind_TimeIntScheme_Flow) { case RUNGE_KUTTA_EXPLICIT: cout << "Runge-Kutta explicit method for the flow equations." << endl; @@ -6902,7 +7577,8 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { case EULER_IMPLICIT: cout << "Euler implicit method for the flow equations." << endl; if (Kind_FluidModel == MUTATIONPP) - SU2_MPI::Error("Implicit time scheme is not yet implemented with Mutation++. Use EULER_EXPLICIT.", CURRENT_FUNCTION); + SU2_MPI::Error("Implicit time scheme is not yet implemented with Mutation++. Use EULER_EXPLICIT.", + CURRENT_FUNCTION); switch (Kind_Linear_Solver) { case BCGSTAB: case FGMRES: @@ -6912,24 +7588,40 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { else cout << "FGMRES is used for solving the linear system." << endl; switch (Kind_Linear_Solver_Prec) { - case ILU: cout << "Using a ILU("<< Linear_Solver_ILU_n <<") preconditioning."<< endl; break; - case LINELET: cout << "Using a linelet preconditioning."<< endl; break; - case LU_SGS: cout << "Using a LU-SGS preconditioning."<< endl; break; - case JACOBI: cout << "Using a Jacobi preconditioning."<< endl; break; + case ILU: + cout << "Using a ILU(" << Linear_Solver_ILU_n << ") preconditioning." << endl; + break; + case LINELET: + cout << "Using a linelet preconditioning." << endl; + break; + case LU_SGS: + cout << "Using a LU-SGS preconditioning." << endl; + break; + case JACOBI: + cout << "Using a Jacobi preconditioning." << endl; + break; } break; case SMOOTHER: switch (Kind_Linear_Solver_Prec) { - case ILU: cout << "A ILU(" << Linear_Solver_ILU_n << ")"; break; - case LINELET: cout << "A Linelet"; break; - case LU_SGS: cout << "A LU-SGS"; break; - case JACOBI: cout << "A Jacobi"; break; + case ILU: + cout << "A ILU(" << Linear_Solver_ILU_n << ")"; + break; + case LINELET: + cout << "A Linelet"; + break; + case LU_SGS: + cout << "A LU-SGS"; + break; + case JACOBI: + cout << "A Jacobi"; + break; } cout << " method is used for smoothing the linear system." << endl; break; } - cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; - cout << "Max number of linear iterations: "<< Linear_Solver_Iter <<"."<< endl; + cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; + cout << "Max number of linear iterations: " << Linear_Solver_Iter << "." << endl; break; case CLASSICAL_RK4_EXPLICIT: cout << "Classical RK4 explicit method for the flow equations." << endl; @@ -6950,25 +7642,27 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { switch (Kind_Linear_Solver) { case BCGSTAB: cout << "BCGSTAB is used for solving the linear system." << endl; - cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; - cout << "Max number of iterations: "<< Linear_Solver_Iter <<"."<< endl; + cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; + cout << "Max number of iterations: " << Linear_Solver_Iter << "." << endl; break; - case FGMRES: case RESTARTED_FGMRES: + case FGMRES: + case RESTARTED_FGMRES: cout << "FGMRES is used for solving the linear system." << endl; - cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; - cout << "Max number of iterations: "<< Linear_Solver_Iter <<"."<< endl; + cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; + cout << "Max number of iterations: " << Linear_Solver_Iter << "." << endl; break; case CONJUGATE_GRADIENT: cout << "A Conjugate Gradient method is used for solving the linear system." << endl; - cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; - cout << "Max number of iterations: "<< Linear_Solver_Iter <<"."<< endl; + cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; + cout << "Max number of iterations: " << Linear_Solver_Iter << "." << endl; break; } break; } } - if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { + if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { switch (Kind_TimeIntScheme_AdjFlow) { case RUNGE_KUTTA_EXPLICIT: cout << "Runge-Kutta explicit method for the adjoint equations." << endl; @@ -6979,13 +7673,17 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } cout << endl; break; - case EULER_EXPLICIT: cout << "Euler explicit method for the adjoint equations." << endl; break; - case EULER_IMPLICIT: cout << "Euler implicit method for the adjoint equations." << endl; break; + case EULER_EXPLICIT: + cout << "Euler explicit method for the adjoint equations." << endl; + break; + case EULER_IMPLICIT: + cout << "Euler implicit method for the adjoint equations." << endl; + break; } } - if(Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES) { + if (Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES) { switch (Kind_TimeIntScheme_FEM_Flow) { case RUNGE_KUTTA_EXPLICIT: cout << "Runge-Kutta explicit method for the flow equations." << endl; @@ -7004,13 +7702,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; case ADER_DG: - if(nLevels_TimeAccurateLTS == 1) + if (nLevels_TimeAccurateLTS == 1) cout << "ADER-DG for the flow equations with global time stepping." << endl; else cout << "ADER-DG for the flow equations with " << nLevels_TimeAccurateLTS << " levels for time accurate local time stepping." << endl; - switch( Kind_ADER_Predictor ) { + switch (Kind_ADER_Predictor) { case ADER_ALIASED_PREDICTOR: cout << "An aliased approach is used in the predictor step. " << endl; break; @@ -7020,19 +7718,19 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } cout << "Number of time DOFs ADER-DG predictor step: " << nTimeDOFsADER_DG << endl; cout << "Location of time DOFs ADER-DG on the interval [-1,1]: "; - for (unsigned short iDOF=0; iDOF & option_value) { +bool CConfig::TokenizeString(string& str, string& option_name, vector& option_value) { const string delimiters(" (){}:,\t\n\v\f\r"); // check for comments or empty string string::size_type pos, last_pos; pos = str.find_first_of('%'); - if ( (str.length() == 0) || (pos == 0) ) { + if ((str.length() == 0) || (pos == 0)) { // str is empty or a comment line, so no option here return false; } @@ -7596,24 +8305,22 @@ bool CConfig::TokenizeString(string & str, string & option_name, pos = str.find('='); if (pos == string::npos) { cerr << "Error in TokenizeString(): " - << "line in the configuration file with no \"=\" sign." - << endl; + << "line in the configuration file with no \"=\" sign." << endl; cout << "Look for: " << str << endl; cout << "str.length() = " << str.length() << endl; throw(-1); } name_part = str.substr(0, pos); - value_part = str.substr(pos+1, string::npos); - //cout << "name_part = |" << name_part << "|" << endl; - //cout << "value_part = |" << value_part << "|" << endl; + value_part = str.substr(pos + 1, string::npos); + // cout << "name_part = |" << name_part << "|" << endl; + // cout << "value_part = |" << value_part << "|" << endl; // the first_part should consist of one string with no interior delimiters last_pos = name_part.find_first_not_of(delimiters, 0); pos = name_part.find_first_of(delimiters, last_pos); - if ( (name_part.length() == 0) || (last_pos == string::npos) ) { + if ((name_part.length() == 0) || (last_pos == string::npos)) { cerr << "Error in CConfig::TokenizeString(): " - << "line in the configuration file with no name before the \"=\" sign." - << endl; + << "line in the configuration file with no name before the \"=\" sign." << endl; throw(-1); } if (pos == string::npos) pos = name_part.length(); @@ -7621,14 +8328,13 @@ bool CConfig::TokenizeString(string & str, string & option_name, last_pos = name_part.find_first_not_of(delimiters, pos); if (last_pos != string::npos) { cerr << "Error in TokenizeString(): " - << "two or more options before an \"=\" sign in the configuration file." - << endl; + << "two or more options before an \"=\" sign in the configuration file." << endl; throw(-1); } StringToUpperCase(option_name); - //cout << "option_name = |" << option_name << "|" << endl; - //cout << "pos = " << pos << ": last_pos = " << last_pos << endl; + // cout << "option_name = |" << option_name << "|" << endl; + // cout << "pos = " << pos << ": last_pos = " << last_pos << endl; // now fill the option value vector option_value.clear(); @@ -7636,7 +8342,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, // detect a raw string if (value_part[last_pos] == '\'' && value_part.back() == '\'') { - option_value.push_back(value_part.substr(last_pos+1, value_part.size()-last_pos-2)); + option_value.push_back(value_part.substr(last_pos + 1, value_part.size() - last_pos - 2)); return true; } @@ -7651,8 +8357,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, } if (option_value.empty()) { cerr << "Error in TokenizeString(): " - << "option " << option_name << " in configuration file with no value assigned." - << endl; + << "option " << option_name << " in configuration file with no value assigned." << endl; throw(-1); } @@ -7675,7 +8380,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, pos = it->find(';'); if (pos != string::npos) { string before_semi = it->substr(0, pos); - string after_semi= it->substr(pos+1, string::npos); + string after_semi = it->substr(pos + 1, string::npos); if (before_semi.empty()) { *it = ";"; it++; @@ -7685,14 +8390,13 @@ bool CConfig::TokenizeString(string & str, string & option_name, it++; vector to_insert; to_insert.emplace_back(";"); - if (!after_semi.empty()) - to_insert.push_back(after_semi); + if (!after_semi.empty()) to_insert.push_back(after_semi); option_value.insert(it, to_insert.begin(), to_insert.end()); } - it = option_value.begin(); // go back to beginning; not efficient + it = option_value.begin(); // go back to beginning; not efficient continue; - } it++; - + } + it++; } #if 0 cout << "option value(s) = "; @@ -7726,14 +8430,13 @@ bool CConfig::TokenizeString(string & str, string & option_name, } unsigned short CConfig::GetMarker_CfgFile_TagBound(const string& val_marker) const { - unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) - return iMarker_CfgFile; + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) return iMarker_CfgFile; } - SU2_MPI::Error(string("The configuration file doesn't have any definition for marker ") + val_marker, CURRENT_FUNCTION); + SU2_MPI::Error(string("The configuration file doesn't have any definition for marker ") + val_marker, + CURRENT_FUNCTION); return 0; } @@ -7848,7 +8551,7 @@ unsigned short CConfig::GetMarker_CfgFile_Fluid_Load(const string& val_marker) c unsigned short CConfig::GetMarker_CfgFile_PyCustom(const string& val_marker) const { unsigned short iMarker_CfgFile; - for (iMarker_CfgFile=0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) + for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_PyCustom[iMarker_CfgFile]; } @@ -7875,70 +8578,64 @@ unsigned short CConfig::GetMarker_CfgFile_SobolevBC(const string& val_marker) co } bool CConfig::GetViscous_Wall(unsigned short iMarker) const { - - return (Marker_All_KindBC[iMarker] == HEAT_FLUX || - Marker_All_KindBC[iMarker] == ISOTHERMAL || - Marker_All_KindBC[iMarker] == HEAT_TRANSFER || - Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL || + return (Marker_All_KindBC[iMarker] == HEAT_FLUX || Marker_All_KindBC[iMarker] == ISOTHERMAL || + Marker_All_KindBC[iMarker] == HEAT_TRANSFER || Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL || Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE); } bool CConfig::GetCatalytic_Wall(unsigned short iMarker) const { - bool catalytic = false; - for (unsigned short iMarker_Catalytic = 0; iMarker_Catalytic < nWall_Catalytic; iMarker_Catalytic++){ + for (unsigned short iMarker_Catalytic = 0; iMarker_Catalytic < nWall_Catalytic; iMarker_Catalytic++) { string Catalytic_Tag = Wall_Catalytic[iMarker_Catalytic]; - if (Catalytic_Tag == Marker_All_TagBound[iMarker]) { catalytic = true; break; } + if (Catalytic_Tag == Marker_All_TagBound[iMarker]) { + catalytic = true; + break; + } } return catalytic; } bool CConfig::GetSolid_Wall(unsigned short iMarker) const { - - return GetViscous_Wall(iMarker) || - Marker_All_KindBC[iMarker] == EULER_WALL; + return GetViscous_Wall(iMarker) || Marker_All_KindBC[iMarker] == EULER_WALL; } void CConfig::SetSurface_Movement(unsigned short iMarker, unsigned short kind_movement) { - auto* new_surface_movement = new unsigned short[nMarker_Moving + 1]; - auto* new_marker_moving = new string[nMarker_Moving+1]; + auto* new_marker_moving = new string[nMarker_Moving + 1]; - for (unsigned short iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++){ + for (unsigned short iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++) { new_surface_movement[iMarker_Moving] = Kind_SurfaceMovement[iMarker_Moving]; new_marker_moving[iMarker_Moving] = Marker_Moving[iMarker_Moving]; } - if (nKind_SurfaceMovement > 0){ - delete [] Marker_Moving; - delete [] Kind_SurfaceMovement; + if (nKind_SurfaceMovement > 0) { + delete[] Marker_Moving; + delete[] Kind_SurfaceMovement; } Kind_SurfaceMovement = new_surface_movement; - Marker_Moving = new_marker_moving; + Marker_Moving = new_marker_moving; Kind_SurfaceMovement[nMarker_Moving] = kind_movement; Marker_Moving[nMarker_Moving] = Marker_All_TagBound[iMarker]; nMarker_Moving++; nKind_SurfaceMovement++; - } CConfig::~CConfig() { - unsigned long iDV, iMarker; /*--- Delete all of the option objects in the global option map ---*/ - for(auto itr = option_map.begin(); itr != option_map.end(); itr++) { + for (auto itr = option_map.begin(); itr != option_map.end(); itr++) { delete itr->second; } - delete [] TimeDOFsADER_DG; - delete [] TimeIntegrationADER_DG; - delete [] WeightsIntegrationADER_DG; + delete[] TimeDOFsADER_DG; + delete[] TimeIntegrationADER_DG; + delete[] WeightsIntegrationADER_DG; /*--- Free memory for Aeroelastic problems. ---*/ @@ -8008,12 +8705,12 @@ CConfig::~CConfig() { if (DV_Value != nullptr) { for (iDV = 0; iDV < nDV; iDV++) delete[] DV_Value[iDV]; - delete [] DV_Value; + delete[] DV_Value; } if (ParamDV != nullptr) { for (iDV = 0; iDV < nDV; iDV++) delete[] ParamDV[iDV]; - delete [] ParamDV; + delete[] ParamDV; } delete[] Exhaust_Pressure; @@ -8104,15 +8801,13 @@ CConfig::~CConfig() { delete[] Surface_IDR; if (Riemann_FlowDir != nullptr) { - for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++) - delete [] Riemann_FlowDir[iMarker]; - delete [] Riemann_FlowDir; + for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++) delete[] Riemann_FlowDir[iMarker]; + delete[] Riemann_FlowDir; } if (Giles_FlowDir != nullptr) { - for (iMarker = 0; iMarker < nMarker_Giles; iMarker++) - delete [] Giles_FlowDir[iMarker]; - delete [] Giles_FlowDir; + for (iMarker = 0; iMarker < nMarker_Giles; iMarker++) delete[] Giles_FlowDir[iMarker]; + delete[] Giles_FlowDir; } delete[] PlaneTag; @@ -8120,30 +8815,29 @@ CConfig::~CConfig() { /*--- Delete some arrays needed just for initializing options. ---*/ - delete [] FFDTag; - delete [] nDV_Value; + delete[] FFDTag; + delete[] nDV_Value; - delete [] Kind_Data_Riemann; - delete [] Riemann_Var1; - delete [] Riemann_Var2; - delete [] Kind_Data_Giles; - delete [] Giles_Var1; - delete [] Giles_Var2; - delete [] RelaxFactorAverage; - delete [] RelaxFactorFourier; - delete [] nSpan_iZones; + delete[] Kind_Data_Riemann; + delete[] Riemann_Var1; + delete[] Riemann_Var2; + delete[] Kind_Data_Giles; + delete[] Giles_Var1; + delete[] Giles_Var2; + delete[] RelaxFactorAverage; + delete[] RelaxFactorFourier; + delete[] nSpan_iZones; - delete [] Marker_TurboBoundIn; - delete [] Marker_TurboBoundOut; - delete [] Marker_Riemann; - delete [] Marker_Giles; + delete[] Marker_TurboBoundIn; + delete[] Marker_TurboBoundOut; + delete[] Marker_Riemann; + delete[] Marker_Giles; - delete [] nBlades; - delete [] FreeStreamTurboNormal; + delete[] nBlades; + delete[] FreeStreamTurboNormal; } string CConfig::GetFilename(string filename, const string& ext, int timeIter) const { - /*--- Remove any extension --- */ unsigned short lastindex = filename.find_last_of('.'); @@ -8154,22 +8848,21 @@ string CConfig::GetFilename(string filename, const string& ext, int timeIter) co filename = filename + string(ext); /*--- Append the zone number if multizone problems ---*/ - if (Multizone_Problem) - filename = GetMultizone_FileName(filename, GetiZone(), ext); + if (Multizone_Problem) filename = GetMultizone_FileName(filename, GetiZone(), ext); /*--- Append the zone number if multiple instance problems ---*/ - if (GetnTimeInstances() > 1) - filename = GetMultiInstance_FileName(filename, GetiInst(), ext); + if (GetnTimeInstances() > 1) filename = GetMultiInstance_FileName(filename, GetiInst(), ext); /*--- Append the iteration number for unsteady problems ---*/ - if (GetTime_Domain()){ + if (GetTime_Domain()) { filename = GetUnsteady_FileName(filename, timeIter, ext); } return filename; } -string CConfig::GetFilename_Iter(const string& filename_iter, unsigned long curInnerIter, unsigned long curOuterIter) const { +string CConfig::GetFilename_Iter(const string& filename_iter, unsigned long curInnerIter, + unsigned long curOuterIter) const { const auto iter = GetMultizone_Problem() ? curOuterIter : curInnerIter; std::stringstream iter_ss; iter_ss << filename_iter << "_" << std::setw(6) << std::setfill('0') << iter; @@ -8177,7 +8870,6 @@ string CConfig::GetFilename_Iter(const string& filename_iter, unsigned long curI } string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, const string& ext) const { - string UnstExt, UnstFilename = std::move(val_filename); char buffer[50]; @@ -8193,12 +8885,11 @@ string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, const st /*--- Append iteration number for unsteady cases ---*/ if (Time_Domain) { - - if ((val_iter >= 0) && (val_iter < 10)) SPRINTF (buffer, "_0000%d", val_iter); - if ((val_iter >= 10) && (val_iter < 100)) SPRINTF (buffer, "_000%d", val_iter); - if ((val_iter >= 100) && (val_iter < 1000)) SPRINTF (buffer, "_00%d", val_iter); - if ((val_iter >= 1000) && (val_iter < 10000)) SPRINTF (buffer, "_0%d", val_iter); - if (val_iter >= 10000) SPRINTF (buffer, "_%d", val_iter); + if ((val_iter >= 0) && (val_iter < 10)) SPRINTF(buffer, "_0000%d", val_iter); + if ((val_iter >= 10) && (val_iter < 100)) SPRINTF(buffer, "_000%d", val_iter); + if ((val_iter >= 100) && (val_iter < 1000)) SPRINTF(buffer, "_00%d", val_iter); + if ((val_iter >= 1000) && (val_iter < 10000)) SPRINTF(buffer, "_0%d", val_iter); + if (val_iter >= 10000) SPRINTF(buffer, "_%d", val_iter); UnstExt = string(buffer); } UnstExt += ext; @@ -8208,152 +8899,234 @@ string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, const st } string CConfig::GetMultizone_FileName(string val_filename, int val_iZone, const string& ext) const { + string multizone_filename = std::move(val_filename); + char buffer[50]; - string multizone_filename = std::move(val_filename); - char buffer[50]; - - unsigned short lastindex = multizone_filename.find_last_of('.'); - multizone_filename = multizone_filename.substr(0, lastindex); + unsigned short lastindex = multizone_filename.find_last_of('.'); + multizone_filename = multizone_filename.substr(0, lastindex); - if (Multizone_Problem) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - multizone_filename.append(string(buffer)); - } + if (Multizone_Problem) { + SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iZone)); + multizone_filename.append(string(buffer)); + } - multizone_filename += ext; - return multizone_filename; + multizone_filename += ext; + return multizone_filename; } string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone, const string& ext) const { - - string multizone_filename = std::move(val_filename); - char buffer[50]; - unsigned short lastindex = multizone_filename.find_last_of('.'); - multizone_filename = multizone_filename.substr(0, lastindex); - if (Multizone_Problem) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - multizone_filename.append(string(buffer)); - } - multizone_filename += ext; - return multizone_filename; + string multizone_filename = std::move(val_filename); + char buffer[50]; + unsigned short lastindex = multizone_filename.find_last_of('.'); + multizone_filename = multizone_filename.substr(0, lastindex); + if (Multizone_Problem) { + SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iZone)); + multizone_filename.append(string(buffer)); + } + multizone_filename += ext; + return multizone_filename; } string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, const string& ext) const { - string multizone_filename = std::move(val_filename); char buffer[50]; unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst)); + SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iInst)); multizone_filename.append(string(buffer)); multizone_filename += ext; return multizone_filename; } string CConfig::GetMultiInstance_HistoryFileName(string val_filename, int val_iInst) const { - string multizone_filename = std::move(val_filename); char buffer[50]; unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst)); + SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iInst)); multizone_filename.append(string(buffer)); return multizone_filename; } string CConfig::GetObjFunc_Extension(string val_filename) const { - string AdjExt, Filename = std::move(val_filename); if (ContinuousAdjoint || DiscreteAdjoint) { - /*--- Remove filename extension (.dat) ---*/ unsigned short lastindex = Filename.find_last_of('.'); Filename = Filename.substr(0, lastindex); - if (nObj==1) { + if (nObj == 1) { switch (Kind_ObjFunc[0]) { - case DRAG_COEFFICIENT: AdjExt = "_cd"; break; - case LIFT_COEFFICIENT: AdjExt = "_cl"; break; - case SIDEFORCE_COEFFICIENT: AdjExt = "_csf"; break; - case INVERSE_DESIGN_PRESSURE: AdjExt = "_invpress"; break; - case INVERSE_DESIGN_HEATFLUX: AdjExt = "_invheat"; break; - case MOMENT_X_COEFFICIENT: AdjExt = "_cmx"; break; - case MOMENT_Y_COEFFICIENT: AdjExt = "_cmy"; break; - case MOMENT_Z_COEFFICIENT: AdjExt = "_cmz"; break; - case EFFICIENCY: AdjExt = "_eff"; break; - case EQUIVALENT_AREA: AdjExt = "_ea"; break; - case NEARFIELD_PRESSURE: AdjExt = "_nfp"; break; - case FORCE_X_COEFFICIENT: AdjExt = "_cfx"; break; - case FORCE_Y_COEFFICIENT: AdjExt = "_cfy"; break; - case FORCE_Z_COEFFICIENT: AdjExt = "_cfz"; break; - case THRUST_COEFFICIENT: AdjExt = "_ct"; break; - case TORQUE_COEFFICIENT: AdjExt = "_cq"; break; - case TOTAL_HEATFLUX: AdjExt = "_totheat"; break; - case MAXIMUM_HEATFLUX: AdjExt = "_maxheat"; break; - case AVG_TEMPERATURE: AdjExt = "_avtp"; break; - case FIGURE_OF_MERIT: AdjExt = "_merit"; break; - case BUFFET_SENSOR: AdjExt = "_buffet"; break; - case SURFACE_TOTAL_PRESSURE: AdjExt = "_pt"; break; - case SURFACE_STATIC_PRESSURE: AdjExt = "_pe"; break; - case SURFACE_STATIC_TEMPERATURE: AdjExt = "_T"; break; - case SURFACE_MASSFLOW: AdjExt = "_mfr"; break; - case SURFACE_UNIFORMITY: AdjExt = "_uniform"; break; - case SURFACE_SECONDARY: AdjExt = "_second"; break; - case SURFACE_MOM_DISTORTION: AdjExt = "_distort"; break; - case SURFACE_SECOND_OVER_UNIFORM: AdjExt = "_sou"; break; - case SURFACE_PRESSURE_DROP: AdjExt = "_dp"; break; - case SURFACE_SPECIES_0: AdjExt = "_avgspec0"; break; - case SURFACE_SPECIES_VARIANCE: AdjExt = "_specvar"; break; - case SURFACE_MACH: AdjExt = "_mach"; break; - case CUSTOM_OBJFUNC: AdjExt = "_custom"; break; - case REFERENCE_GEOMETRY: AdjExt = "_refgeom"; break; - case REFERENCE_NODE: AdjExt = "_refnode"; break; - case VOLUME_FRACTION: AdjExt = "_volfrac"; break; - case TOPOL_DISCRETENESS: AdjExt = "_topdisc"; break; - case TOPOL_COMPLIANCE: AdjExt = "_topcomp"; break; - case STRESS_PENALTY: AdjExt = "_stress"; break; + case DRAG_COEFFICIENT: + AdjExt = "_cd"; + break; + case LIFT_COEFFICIENT: + AdjExt = "_cl"; + break; + case SIDEFORCE_COEFFICIENT: + AdjExt = "_csf"; + break; + case INVERSE_DESIGN_PRESSURE: + AdjExt = "_invpress"; + break; + case INVERSE_DESIGN_HEATFLUX: + AdjExt = "_invheat"; + break; + case MOMENT_X_COEFFICIENT: + AdjExt = "_cmx"; + break; + case MOMENT_Y_COEFFICIENT: + AdjExt = "_cmy"; + break; + case MOMENT_Z_COEFFICIENT: + AdjExt = "_cmz"; + break; + case EFFICIENCY: + AdjExt = "_eff"; + break; + case EQUIVALENT_AREA: + AdjExt = "_ea"; + break; + case NEARFIELD_PRESSURE: + AdjExt = "_nfp"; + break; + case FORCE_X_COEFFICIENT: + AdjExt = "_cfx"; + break; + case FORCE_Y_COEFFICIENT: + AdjExt = "_cfy"; + break; + case FORCE_Z_COEFFICIENT: + AdjExt = "_cfz"; + break; + case THRUST_COEFFICIENT: + AdjExt = "_ct"; + break; + case TORQUE_COEFFICIENT: + AdjExt = "_cq"; + break; + case TOTAL_HEATFLUX: + AdjExt = "_totheat"; + break; + case MAXIMUM_HEATFLUX: + AdjExt = "_maxheat"; + break; + case AVG_TEMPERATURE: + AdjExt = "_avtp"; + break; + case FIGURE_OF_MERIT: + AdjExt = "_merit"; + break; + case BUFFET_SENSOR: + AdjExt = "_buffet"; + break; + case SURFACE_TOTAL_PRESSURE: + AdjExt = "_pt"; + break; + case SURFACE_STATIC_PRESSURE: + AdjExt = "_pe"; + break; + case SURFACE_STATIC_TEMPERATURE: + AdjExt = "_T"; + break; + case SURFACE_MASSFLOW: + AdjExt = "_mfr"; + break; + case SURFACE_UNIFORMITY: + AdjExt = "_uniform"; + break; + case SURFACE_SECONDARY: + AdjExt = "_second"; + break; + case SURFACE_MOM_DISTORTION: + AdjExt = "_distort"; + break; + case SURFACE_SECOND_OVER_UNIFORM: + AdjExt = "_sou"; + break; + case SURFACE_PRESSURE_DROP: + AdjExt = "_dp"; + break; + case SURFACE_SPECIES_0: + AdjExt = "_avgspec0"; + break; + case SURFACE_SPECIES_VARIANCE: + AdjExt = "_specvar"; + break; + case SURFACE_MACH: + AdjExt = "_mach"; + break; + case CUSTOM_OBJFUNC: + AdjExt = "_custom"; + break; + case REFERENCE_GEOMETRY: + AdjExt = "_refgeom"; + break; + case REFERENCE_NODE: + AdjExt = "_refnode"; + break; + case VOLUME_FRACTION: + AdjExt = "_volfrac"; + break; + case TOPOL_DISCRETENESS: + AdjExt = "_topdisc"; + break; + case TOPOL_COMPLIANCE: + AdjExt = "_topcomp"; + break; + case STRESS_PENALTY: + AdjExt = "_stress"; + break; } - } - else{ + } else { AdjExt = "_combo"; } Filename.append(AdjExt); /*--- Lastly, add the .dat extension ---*/ Filename.append(".dat"); - } return Filename; } unsigned short CConfig::GetContainerPosition(unsigned short val_eqsystem) { - switch (val_eqsystem) { - case RUNTIME_FLOW_SYS: return FLOW_SOL; - case RUNTIME_TURB_SYS: return TURB_SOL; - case RUNTIME_TRANS_SYS: return TRANS_SOL; - case RUNTIME_SPECIES_SYS: return SPECIES_SOL; - case RUNTIME_HEAT_SYS: return HEAT_SOL; - case RUNTIME_FEA_SYS: return FEA_SOL; - case RUNTIME_ADJFLOW_SYS: return ADJFLOW_SOL; - case RUNTIME_ADJTURB_SYS: return ADJTURB_SOL; - case RUNTIME_ADJSPECIES_SYS:return ADJSPECIES_SOL; - case RUNTIME_ADJFEA_SYS: return ADJFEA_SOL; - case RUNTIME_RADIATION_SYS: return RAD_SOL; - case RUNTIME_MULTIGRID_SYS: return 0; + case RUNTIME_FLOW_SYS: + return FLOW_SOL; + case RUNTIME_TURB_SYS: + return TURB_SOL; + case RUNTIME_TRANS_SYS: + return TRANS_SOL; + case RUNTIME_SPECIES_SYS: + return SPECIES_SOL; + case RUNTIME_HEAT_SYS: + return HEAT_SOL; + case RUNTIME_FEA_SYS: + return FEA_SOL; + case RUNTIME_ADJFLOW_SYS: + return ADJFLOW_SOL; + case RUNTIME_ADJTURB_SYS: + return ADJTURB_SOL; + case RUNTIME_ADJSPECIES_SYS: + return ADJSPECIES_SOL; + case RUNTIME_ADJFEA_SYS: + return ADJFEA_SOL; + case RUNTIME_RADIATION_SYS: + return RAD_SOL; + case RUNTIME_MULTIGRID_SYS: + return 0; } return 0; } -void CConfig::SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, - CENTERED val_kind_centered, UPWIND val_kind_upwind, - LIMITER val_kind_slopelimit, bool val_muscl, +void CConfig::SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, CENTERED val_kind_centered, + UPWIND val_kind_upwind, LIMITER val_kind_slopelimit, bool val_muscl, unsigned short val_kind_fem) { Kind_ConvNumScheme = val_kind_convnumscheme; Kind_Centered = val_kind_centered; @@ -8361,23 +9134,19 @@ void CConfig::SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, Kind_FEM = val_kind_fem; Kind_SlopeLimit = val_kind_slopelimit; MUSCL = val_muscl; - } -void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, - unsigned short val_system) { - +void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, unsigned short val_system) { /*--- Set the simulation global time ---*/ - Current_UnstTime = static_cast(TimeIter)*Delta_UnstTime; - Current_UnstTimeND = static_cast(TimeIter)*Delta_UnstTimeND; + Current_UnstTime = static_cast(TimeIter) * Delta_UnstTime; + Current_UnstTimeND = static_cast(TimeIter) * Delta_UnstTimeND; /*--- Set the solver methods ---*/ auto SetFlowParam = [&]() { if (val_system == RUNTIME_FLOW_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Flow, Kind_Centered_Flow, - Kind_Upwind_Flow, Kind_SlopeLimit_Flow, + SetKind_ConvNumScheme(Kind_ConvNumScheme_Flow, Kind_Centered_Flow, Kind_Upwind_Flow, Kind_SlopeLimit_Flow, MUSCL_Flow, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Flow); } @@ -8385,8 +9154,7 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, auto SetTurbParam = [&]() { if (val_system == RUNTIME_TURB_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, - Kind_Upwind_Turb, Kind_SlopeLimit_Turb, + SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, Kind_Upwind_Turb, Kind_SlopeLimit_Turb, MUSCL_Turb, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Turb); } @@ -8394,51 +9162,56 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, auto SetHeatParam = [&]() { if (val_system == RUNTIME_HEAT_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Heat, Kind_Centered_Heat, - Kind_Upwind_Heat, Kind_SlopeLimit_Heat, MUSCL_Heat, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_Heat, Kind_Centered_Heat, Kind_Upwind_Heat, Kind_SlopeLimit_Heat, + MUSCL_Heat, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Heat); } }; auto SetSpeciesParam = [&]() { if (val_system == RUNTIME_SPECIES_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Species, Kind_Centered_Species, - Kind_Upwind_Species, Kind_SlopeLimit_Species, - MUSCL_Species, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_Species, Kind_Centered_Species, Kind_Upwind_Species, + Kind_SlopeLimit_Species, MUSCL_Species, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Species); } }; auto SetAdjFlowParam = [&]() { if (val_system == RUNTIME_ADJFLOW_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, - Kind_Upwind_AdjFlow, Kind_SlopeLimit_AdjFlow, - MUSCL_AdjFlow, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, Kind_Upwind_AdjFlow, + Kind_SlopeLimit_AdjFlow, MUSCL_AdjFlow, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_AdjFlow); } }; switch (val_solver) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::NEMO_EULER: - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_INC_EULER: + case MAIN_SOLVER::EULER: + case MAIN_SOLVER::INC_EULER: + case MAIN_SOLVER::NEMO_EULER: + case MAIN_SOLVER::DISC_ADJ_EULER: + case MAIN_SOLVER::DISC_ADJ_INC_EULER: SetFlowParam(); break; - case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::NEMO_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: + case MAIN_SOLVER::NAVIER_STOKES: + case MAIN_SOLVER::INC_NAVIER_STOKES: + case MAIN_SOLVER::NEMO_NAVIER_STOKES: + case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: + case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: SetFlowParam(); SetSpeciesParam(); SetHeatParam(); break; - case MAIN_SOLVER::RANS: case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::DISC_ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_INC_RANS: + case MAIN_SOLVER::RANS: + case MAIN_SOLVER::INC_RANS: + case MAIN_SOLVER::DISC_ADJ_RANS: + case MAIN_SOLVER::DISC_ADJ_INC_RANS: SetFlowParam(); SetTurbParam(); SetSpeciesParam(); SetHeatParam(); if (val_system == RUNTIME_TRANS_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, - Kind_Upwind_Turb, Kind_SlopeLimit_Turb, + SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, Kind_Upwind_Turb, Kind_SlopeLimit_Turb, MUSCL_Turb, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Turb); } @@ -8451,8 +9224,7 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, case MAIN_SOLVER::DISC_ADJ_FEM_NS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: if (val_system == RUNTIME_FLOW_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_FEM_Flow, Kind_Centered_Flow, - Kind_Upwind_Flow, Kind_SlopeLimit_Flow, + SetKind_ConvNumScheme(Kind_ConvNumScheme_FEM_Flow, Kind_Centered_Flow, Kind_Upwind_Flow, Kind_SlopeLimit_Flow, MUSCL_Flow, Kind_FEM_Flow); SetKind_TimeIntScheme(Kind_TimeIntScheme_FEM_Flow); } @@ -8468,9 +9240,8 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, SetAdjFlowParam(); if (val_system == RUNTIME_ADJTURB_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjTurb, Kind_Centered_AdjTurb, - Kind_Upwind_AdjTurb, Kind_SlopeLimit_AdjTurb, - MUSCL_AdjTurb, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjTurb, Kind_Centered_AdjTurb, Kind_Upwind_AdjTurb, + Kind_SlopeLimit_AdjTurb, MUSCL_AdjTurb, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_AdjTurb); } break; @@ -8537,113 +9308,115 @@ unsigned short CConfig::GetMarker_Periodic_Donor(const string& val_marker) const su2double CConfig::GetActDisk_NetThrust(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_NetThrust[iMarker_ActDisk]; } su2double CConfig::GetActDisk_Power(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_Power[iMarker_ActDisk]; } su2double CConfig::GetActDisk_MassFlow(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_MassFlow[iMarker_ActDisk]; } su2double CConfig::GetActDisk_Mach(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_Mach[iMarker_ActDisk]; } su2double CConfig::GetActDisk_Force(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_Force[iMarker_ActDisk]; } su2double CConfig::GetActDisk_BCThrust(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_BCThrust[iMarker_ActDisk]; } su2double CConfig::GetActDisk_BCThrust_Old(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_BCThrust_Old[iMarker_ActDisk]; } void CConfig::SetActDisk_BCThrust(const string& val_marker, su2double val_actdisk_bcthrust) { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; ActDisk_BCThrust[iMarker_ActDisk] = val_actdisk_bcthrust; } void CConfig::SetActDisk_BCThrust_Old(const string& val_marker, su2double val_actdisk_bcthrust_old) { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; ActDisk_BCThrust_Old[iMarker_ActDisk] = val_actdisk_bcthrust_old; } su2double CConfig::GetActDisk_Area(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_Area[iMarker_ActDisk]; } su2double CConfig::GetActDisk_ReverseMassFlow(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_ReverseMassFlow[iMarker_ActDisk]; } su2double CConfig::GetActDisk_PressJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; return ActDisk_PressJump[iMarker_ActDisk][val_value]; } su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_TempJump[iMarker_ActDisk][val_value];; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; + return ActDisk_TempJump[iMarker_ActDisk][val_value]; + ; } su2double CConfig::GetActDisk_Omega(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_Omega[iMarker_ActDisk][val_value];; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) + break; + return ActDisk_Omega[iMarker_ActDisk][val_value]; + ; } su2double CConfig::GetOutlet_MassFlow(const string& val_marker) const { @@ -8702,24 +9475,21 @@ unsigned short CConfig::GetMarker_CfgFile_EngineExhaust(const string& val_marker bool CConfig::GetVolumetric_Movement() const { bool volumetric_movement = false; - if (GetSurface_Movement(AEROELASTIC) || - GetSurface_Movement(AEROELASTIC_RIGID_MOTION)|| - GetSurface_Movement(EXTERNAL) || - GetSurface_Movement(EXTERNAL_ROTATION)){ + if (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION) || + GetSurface_Movement(EXTERNAL) || GetSurface_Movement(EXTERNAL_ROTATION)) { volumetric_movement = true; } - if (Kind_SU2 == SU2_COMPONENT::SU2_DEF || - Kind_SU2 == SU2_COMPONENT::SU2_DOT || - DirectDiff) - { volumetric_movement = true;} + if (Kind_SU2 == SU2_COMPONENT::SU2_DEF || Kind_SU2 == SU2_COMPONENT::SU2_DOT || DirectDiff) { + volumetric_movement = true; + } return volumetric_movement; } bool CConfig::GetSurface_Movement(unsigned short kind_movement) const { - for (unsigned short iMarkerMoving = 0; iMarkerMoving < nKind_SurfaceMovement; iMarkerMoving++){ - if (Kind_SurfaceMovement[iMarkerMoving] == kind_movement){ + for (unsigned short iMarkerMoving = 0; iMarkerMoving < nKind_SurfaceMovement; iMarkerMoving++) { + if (Kind_SurfaceMovement[iMarkerMoving] == kind_movement) { return true; } } @@ -8821,8 +9591,7 @@ su2double CConfig::GetInlet_Ptotal(const string& val_marker) const { void CConfig::SetInlet_Ptotal(su2double val_pressure, const string& val_marker) { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) - if (Marker_Inlet[iMarker_Inlet] == val_marker) - Inlet_Ptotal[iMarker_Inlet] = val_pressure; + if (Marker_Inlet[iMarker_Inlet] == val_marker) Inlet_Ptotal[iMarker_Inlet] = val_pressure; } const su2double* CConfig::GetInlet_FlowDir(const string& val_marker) const { @@ -8881,8 +9650,7 @@ su2double CConfig::GetOutlet_Pressure(const string& val_marker) const { void CConfig::SetOutlet_Pressure(su2double val_pressure, const string& val_marker) { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) - if (Marker_Outlet[iMarker_Outlet] == val_marker) - Outlet_Pressure[iMarker_Outlet] = val_pressure; + if (Marker_Outlet[iMarker_Outlet] == val_marker) Outlet_Pressure[iMarker_Outlet] = val_pressure; } su2double CConfig::GetRiemann_Var1(const string& val_marker) const { @@ -8965,29 +9733,31 @@ unsigned short CConfig::GetKind_Data_Giles(const string& val_marker) const { su2double CConfig::GetPressureOut_BC() const { unsigned short iMarker_BC; su2double pres_out = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ - if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM ){ + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { + if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || + Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM) { pres_out = Giles_Var1[iMarker_BC]; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ - if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM){ + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { + if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM) { pres_out = Riemann_Var1[iMarker_BC]; } } - return pres_out/Pressure_Ref; + return pres_out / Pressure_Ref; } void CConfig::SetPressureOut_BC(su2double val_press) { unsigned short iMarker_BC; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ - if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM ){ - Giles_Var1[iMarker_BC] = val_press*Pressure_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { + if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || + Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM) { + Giles_Var1[iMarker_BC] = val_press * Pressure_Ref; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ - if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM){ - Riemann_Var1[iMarker_BC] = val_press*Pressure_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { + if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM) { + Riemann_Var1[iMarker_BC] = val_press * Pressure_Ref; } } } @@ -8995,175 +9765,159 @@ void CConfig::SetPressureOut_BC(su2double val_press) { su2double CConfig::GetTotalPressureIn_BC() const { unsigned short iMarker_BC; su2double tot_pres_in = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { tot_pres_in = Giles_Var1[iMarker_BC]; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { tot_pres_in = Riemann_Var1[iMarker_BC]; } } - if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ + if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { tot_pres_in = Inlet_Ptotal[0]; } - return tot_pres_in/Pressure_Ref; + return tot_pres_in / Pressure_Ref; } su2double CConfig::GetTotalTemperatureIn_BC() const { unsigned short iMarker_BC; su2double tot_temp_in = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { tot_temp_in = Giles_Var2[iMarker_BC]; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { tot_temp_in = Riemann_Var2[iMarker_BC]; } } - if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ + if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { tot_temp_in = Inlet_Ttotal[0]; } - return tot_temp_in/Temperature_Ref; + return tot_temp_in / Temperature_Ref; } void CConfig::SetTotalTemperatureIn_BC(su2double val_temp) { unsigned short iMarker_BC; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ - Giles_Var2[iMarker_BC] = val_temp*Temperature_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { + Giles_Var2[iMarker_BC] = val_temp * Temperature_Ref; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ - Riemann_Var2[iMarker_BC] = val_temp*Temperature_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { + Riemann_Var2[iMarker_BC] = val_temp * Temperature_Ref; } } - if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ - Inlet_Ttotal[0] = val_temp*Temperature_Ref; + if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { + Inlet_Ttotal[0] = val_temp * Temperature_Ref; } } su2double CConfig::GetFlowAngleIn_BC() const { unsigned short iMarker_BC; su2double alpha_in = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ - alpha_in = atan(Giles_FlowDir[iMarker_BC][1]/Giles_FlowDir[iMarker_BC][0]); + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { + alpha_in = atan(Giles_FlowDir[iMarker_BC][1] / Giles_FlowDir[iMarker_BC][0]); } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ - alpha_in = atan(Riemann_FlowDir[iMarker_BC][1]/Riemann_FlowDir[iMarker_BC][0]); + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { + alpha_in = atan(Riemann_FlowDir[iMarker_BC][1] / Riemann_FlowDir[iMarker_BC][0]); } } - if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ - alpha_in = atan(Inlet_FlowDir[0][1]/Inlet_FlowDir[0][0]); + if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { + alpha_in = atan(Inlet_FlowDir[0][1] / Inlet_FlowDir[0][0]); } return alpha_in; } su2double CConfig::GetIncInlet_BC() const { - su2double val_out = 0.0; if (nMarker_Inlet > 0) { if (Kind_Inc_Inlet[0] == INLET_TYPE::VELOCITY_INLET) - val_out = Inlet_Ptotal[0]/Velocity_Ref; + val_out = Inlet_Ptotal[0] / Velocity_Ref; else if (Kind_Inc_Inlet[0] == INLET_TYPE::PRESSURE_INLET) - val_out = Inlet_Ptotal[0]/Pressure_Ref; + val_out = Inlet_Ptotal[0] / Pressure_Ref; } return val_out; } void CConfig::SetIncInlet_BC(su2double val_in) { - if (nMarker_Inlet > 0) { if (Kind_Inc_Inlet[0] == INLET_TYPE::VELOCITY_INLET) - Inlet_Ptotal[0] = val_in*Velocity_Ref; + Inlet_Ptotal[0] = val_in * Velocity_Ref; else if (Kind_Inc_Inlet[0] == INLET_TYPE::PRESSURE_INLET) - Inlet_Ptotal[0] = val_in*Pressure_Ref; + Inlet_Ptotal[0] = val_in * Pressure_Ref; } } su2double CConfig::GetIncTemperature_BC() const { - su2double val_out = 0.0; - if (nMarker_Inlet > 0) - val_out = Inlet_Ttotal[0]/Temperature_Ref; + if (nMarker_Inlet > 0) val_out = Inlet_Ttotal[0] / Temperature_Ref; return val_out; } void CConfig::SetIncTemperature_BC(su2double val_temperature) { - if (nMarker_Inlet > 0) - Inlet_Ttotal[0] = val_temperature*Temperature_Ref; + if (nMarker_Inlet > 0) Inlet_Ttotal[0] = val_temperature * Temperature_Ref; } su2double CConfig::GetIncPressureOut_BC() const { - su2double pressure_out = 0.0; - if (nMarker_FarField > 0){ + if (nMarker_FarField > 0) { pressure_out = Pressure_FreeStreamND; } else if (nMarker_Outlet > 0) { - pressure_out = Outlet_Pressure[0]/Pressure_Ref; + pressure_out = Outlet_Pressure[0] / Pressure_Ref; } return pressure_out; } void CConfig::SetIncPressureOut_BC(su2double val_pressure) { - - if (nMarker_FarField > 0){ + if (nMarker_FarField > 0) { Pressure_FreeStreamND = val_pressure; } else if (nMarker_Outlet > 0) { - Outlet_Pressure[0] = val_pressure*Pressure_Ref; + Outlet_Pressure[0] = val_pressure * Pressure_Ref; } - } su2double CConfig::GetIsothermal_Temperature(const string& val_marker) const { - for (unsigned short iMarker_Isothermal = 0; iMarker_Isothermal < nMarker_Isothermal; iMarker_Isothermal++) - if (Marker_Isothermal[iMarker_Isothermal] == val_marker) - return Isothermal_Temperature[iMarker_Isothermal]; + if (Marker_Isothermal[iMarker_Isothermal] == val_marker) return Isothermal_Temperature[iMarker_Isothermal]; return Isothermal_Temperature[0]; } su2double CConfig::GetWall_HeatFlux(const string& val_marker) const { - for (unsigned short iMarker_HeatFlux = 0; iMarker_HeatFlux < nMarker_HeatFlux; iMarker_HeatFlux++) - if (Marker_HeatFlux[iMarker_HeatFlux] == val_marker) - return Heat_Flux[iMarker_HeatFlux]; + if (Marker_HeatFlux[iMarker_HeatFlux] == val_marker) return Heat_Flux[iMarker_HeatFlux]; return Heat_Flux[0]; } su2double CConfig::GetWall_HeatTransfer_Coefficient(const string& val_marker) const { - for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) - if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) - return HeatTransfer_Coeff[iMarker_HeatTransfer]; + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) return HeatTransfer_Coeff[iMarker_HeatTransfer]; return HeatTransfer_Coeff[0]; } su2double CConfig::GetWall_HeatTransfer_Temperature(const string& val_marker) const { - for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) - if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) - return HeatTransfer_WallTemp[iMarker_HeatTransfer]; + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) return HeatTransfer_WallTemp[iMarker_HeatTransfer]; return HeatTransfer_WallTemp[0]; } @@ -9180,11 +9934,10 @@ pair CConfig::GetWallRoughnessProperties(const string& val } WALL_FUNCTIONS CConfig::GetWallFunction_Treatment(const string& val_marker) const { - WALL_FUNCTIONS WallFunction = WALL_FUNCTIONS::NONE; - for(unsigned short iMarker=0; iMarker 0) { @@ -9540,7 +10292,6 @@ su2double CConfig::GetWall_Emissivity(const string& val_marker) const { } bool CConfig::GetMarker_StrongBC(const string& val_marker) const { - unsigned short iMarker_StrongBC = 0; for (iMarker_StrongBC = 0; iMarker_StrongBC < nMarker_StrongBC; iMarker_StrongBC++) @@ -9550,10 +10301,9 @@ bool CConfig::GetMarker_StrongBC(const string& val_marker) const { } short CConfig::FindInterfaceMarker(unsigned short iInterface) const { - /*--- The names of the two markers that form the interface. ---*/ - const auto& sideA = Marker_ZoneInterface[2*iInterface]; - const auto& sideB = Marker_ZoneInterface[2*iInterface+1]; + const auto& sideA = Marker_ZoneInterface[2 * iInterface]; + const auto& sideB = Marker_ZoneInterface[2 * iInterface + 1]; for (unsigned short iMarker = 0; iMarker < nMarker_All; iMarker++) { /*--- If the marker is sideA or sideB of the interface (order does not matter). ---*/ const auto& tag = Marker_All_TagBound[iMarker]; @@ -9562,16 +10312,13 @@ short CConfig::FindInterfaceMarker(unsigned short iInterface) const { return -1; } -void CConfig::Tick(double *val_start_time) { - +void CConfig::Tick(double* val_start_time) { #ifdef PROFILE *val_start_time = SU2_MPI::Wtime(); #endif - } void CConfig::Tock(double val_start_time, const string& val_function_name, int val_group_id) { - #ifdef PROFILE double val_stop_time = 0.0, val_elapsed_time = 0.0; @@ -9587,11 +10334,9 @@ void CConfig::Tock(double val_start_time, const string& val_function_name, int v Profile_ID_tp.push_back(val_group_id); #endif - } void CConfig::SetProfilingCSV() { - #ifdef PROFILE int rank = MASTER_NODE; @@ -9609,21 +10354,18 @@ void CConfig::SetProfilingCSV() { min and max values for each function. ---*/ for (unsigned int i = 0; i < Profile_Function_tp.size(); i++) { - /*--- Add the function and initialize if not already stored (the ID only needs to be stored the first time).---*/ if (Profile_Map_tp.find(Profile_Function_tp[i]) == Profile_Map_tp.end()) { - - vector profile; profile.push_back(i); - Profile_Map_tp.insert(pair >(Profile_Function_tp[i],profile)); + vector profile; + profile.push_back(i); + Profile_Map_tp.insert(pair >(Profile_Function_tp[i], profile)); } else { - /*--- This function has already been added, so simply increment the number of calls and total time for this function. ---*/ Profile_Map_tp[Profile_Function_tp[i]].push_back(i); - } } @@ -9631,33 +10373,31 @@ void CConfig::SetProfilingCSV() { each function and store the min/max times. ---*/ int map_size = 0; - for (map >::iterator it=Profile_Map_tp.begin(); it!=Profile_Map_tp.end(); ++it) { + for (map >::iterator it = Profile_Map_tp.begin(); it != Profile_Map_tp.end(); ++it) { map_size++; } /*--- Allocate and initialize memory ---*/ double *l_min_red = NULL, *l_max_red = NULL, *l_tot_red = NULL, *l_avg_red = NULL; - int *n_calls_red = NULL; + int* n_calls_red = NULL; double* l_min = new double[map_size]; double* l_max = new double[map_size]; double* l_tot = new double[map_size]; double* l_avg = new double[map_size]; - int* n_calls = new int[map_size]; - for (int i = 0; i < map_size; i++) - { - l_min[i] = 1e10; - l_max[i] = 0.0; - l_tot[i] = 0.0; - l_avg[i] = 0.0; + int* n_calls = new int[map_size]; + for (int i = 0; i < map_size; i++) { + l_min[i] = 1e10; + l_max[i] = 0.0; + l_tot[i] = 0.0; + l_avg[i] = 0.0; n_calls[i] = 0; } /*--- Collect the info for each function from the current rank ---*/ int func_counter = 0; - for (map >::iterator it=Profile_Map_tp.begin(); it!=Profile_Map_tp.end(); ++it) { - + for (map >::iterator it = Profile_Map_tp.begin(); it != Profile_Map_tp.end(); ++it) { for (unsigned int i = 0; i < (it->second).size(); i++) { n_calls[func_counter]++; l_tot[func_counter] += Profile_Time_tp[(it->second)[i]]; @@ -9665,9 +10405,8 @@ void CConfig::SetProfilingCSV() { l_min[func_counter] = Profile_Time_tp[(it->second)[i]]; if (Profile_Time_tp[(it->second)[i]] > l_max[func_counter]) l_max[func_counter] = Profile_Time_tp[(it->second)[i]]; - } - l_avg[func_counter] = l_tot[func_counter]/((double)n_calls[func_counter]); + l_avg[func_counter] = l_tot[func_counter] / ((double)n_calls[func_counter]); func_counter++; } @@ -9678,7 +10417,7 @@ void CConfig::SetProfilingCSV() { l_max_red = new double[map_size]; l_tot_red = new double[map_size]; l_avg_red = new double[map_size]; - n_calls_red = new int[map_size]; + n_calls_red = new int[map_size]; } #ifdef HAVE_MPI @@ -9688,23 +10427,22 @@ void CConfig::SetProfilingCSV() { MPI_Reduce(l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); MPI_Reduce(l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); #else - memcpy(n_calls_red, n_calls, map_size*sizeof(int)); - memcpy(l_tot_red, l_tot, map_size*sizeof(double)); - memcpy(l_avg_red, l_avg, map_size*sizeof(double)); - memcpy(l_min_red, l_min, map_size*sizeof(double)); - memcpy(l_max_red, l_max, map_size*sizeof(double)); + memcpy(n_calls_red, n_calls, map_size * sizeof(int)); + memcpy(l_tot_red, l_tot, map_size * sizeof(double)); + memcpy(l_avg_red, l_avg, map_size * sizeof(double)); + memcpy(l_min_red, l_min, map_size * sizeof(double)); + memcpy(l_max_red, l_max, map_size * sizeof(double)); #endif /*--- The master rank will write the file ---*/ if (rank == MASTER_NODE) { - /*--- Take averages over all ranks on the master ---*/ for (int i = 0; i < map_size; i++) { - l_tot_red[i] = l_tot_red[i]/(double)size; - l_avg_red[i] = l_avg_red[i]/(double)size; - n_calls_red[i] = n_calls_red[i]/size; + l_tot_red[i] = l_tot_red[i] / (double)size; + l_avg_red[i] = l_avg_red[i] / (double)size; + n_calls_red[i] = n_calls_red[i] / size; } /*--- Now write a CSV file with the processed results ---*/ @@ -9715,40 +10453,40 @@ void CConfig::SetProfilingCSV() { /*--- Create the CSV header ---*/ - Profile_File << "\"Function_Name\", \"N_Calls\", \"Avg_Total_Time\", \"Avg_Time\", \"Min_Time\", \"Max_Time\", \"Function_ID\"" << endl; + Profile_File << "\"Function_Name\", \"N_Calls\", \"Avg_Total_Time\", \"Avg_Time\", \"Min_Time\", \"Max_Time\", " + "\"Function_ID\"" + << endl; /*--- Loop through the map and write the results to the file ---*/ func_counter = 0; - for (map >::iterator it=Profile_Map_tp.begin(); it!=Profile_Map_tp.end(); ++it) { - - Profile_File << scientific << it->first << ", " << n_calls_red[func_counter] << ", " << l_tot_red[func_counter] << ", " << l_avg_red[func_counter] << ", " << l_min_red[func_counter] << ", " << l_max_red[func_counter] << ", " << (int)Profile_ID_tp[(it->second)[0]] << endl; + for (map >::iterator it = Profile_Map_tp.begin(); it != Profile_Map_tp.end(); ++it) { + Profile_File << scientific << it->first << ", " << n_calls_red[func_counter] << ", " << l_tot_red[func_counter] + << ", " << l_avg_red[func_counter] << ", " << l_min_red[func_counter] << ", " + << l_max_red[func_counter] << ", " << (int)Profile_ID_tp[(it->second)[0]] << endl; func_counter++; } Profile_File.close(); - } - delete [] l_min; - delete [] l_max; - delete [] l_avg; - delete [] l_tot; - delete [] n_calls; + delete[] l_min; + delete[] l_max; + delete[] l_avg; + delete[] l_tot; + delete[] n_calls; if (rank == MASTER_NODE) { - delete [] l_min_red; - delete [] l_max_red; - delete [] l_avg_red; - delete [] l_tot_red; - delete [] n_calls_red; + delete[] l_min_red; + delete[] l_max_red; + delete[] l_avg_red; + delete[] l_tot_red; + delete[] n_calls_red; } #endif - } -void CConfig::GEMM_Tick(double *val_start_time) const { - +void CConfig::GEMM_Tick(double* val_start_time) const { #ifdef PROFILE #ifdef HAVE_MKL @@ -9758,11 +10496,9 @@ void CConfig::GEMM_Tick(double *val_start_time) const { #endif #endif - } void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) const { - #ifdef PROFILE /* Determine the timing value. The actual function called depends on @@ -9783,8 +10519,7 @@ void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) const { CLong3T MNK(M, N, K); map::iterator MI = GEMM_Profile_MNK.find(MNK); - if(MI == GEMM_Profile_MNK.end()) { - + if (MI == GEMM_Profile_MNK.end()) { /* Entry is not present yet. Create it. */ const int ind = GEMM_Profile_MNK.size(); GEMM_Profile_MNK[MNK] = ind; @@ -9793,24 +10528,20 @@ void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) const { GEMM_Profile_TotTime.push_back(val_elapsed_time); GEMM_Profile_MinTime.push_back(val_elapsed_time); GEMM_Profile_MaxTime.push_back(val_elapsed_time); - } - else { - + } else { /* Entry is already present. Determine its index in the map and update the corresponding vectors. */ const int ind = MI->second; ++GEMM_Profile_NCalls[ind]; GEMM_Profile_TotTime[ind] += val_elapsed_time; - GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], val_elapsed_time); - GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], val_elapsed_time); + GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], val_elapsed_time); + GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], val_elapsed_time); } #endif - } void CConfig::GEMMProfilingCSV() { - #ifdef PROFILE /* Initialize the rank to the master node. */ @@ -9824,11 +10555,9 @@ void CConfig::GEMMProfilingCSV() { SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); /* Check for the master node. */ - if(rank == MASTER_NODE) { - + if (rank == MASTER_NODE) { /* Master node. Loop over the other ranks to receive their data. */ - for(int proc=1; proc recvBufNCalls(nEntries); + vector recvBufNCalls(nEntries); vector recvBufTotTime(nEntries); vector recvBufMinTime(nEntries); vector recvBufMaxTime(nEntries); - vector recvBufMNK(3*nEntries); - - SU2_MPI::Recv(recvBufNCalls.data(), recvBufNCalls.size(), - MPI_LONG, proc, 0, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufTotTime.data(), recvBufTotTime.size(), - MPI_DOUBLE, proc, 1, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufMinTime.data(), recvBufMinTime.size(), - MPI_DOUBLE, proc, 2, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufMaxTime.data(), recvBufMaxTime.size(), - MPI_DOUBLE, proc, 3, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufMNK.data(), recvBufMNK.size(), - MPI_LONG, proc, 4, SU2_MPI::GetComm(), &status); + vector recvBufMNK(3 * nEntries); - /* Loop over the number of entries. */ - for(int i=0; i::iterator MI = GEMM_Profile_MNK.find(MNK); - if(MI == GEMM_Profile_MNK.end()) { - + if (MI == GEMM_Profile_MNK.end()) { /* Entry is not present yet. Create it. */ const int ind = GEMM_Profile_MNK.size(); GEMM_Profile_MNK[MNK] = ind; @@ -9874,58 +10596,47 @@ void CConfig::GEMMProfilingCSV() { GEMM_Profile_TotTime.push_back(recvBufTotTime[i]); GEMM_Profile_MinTime.push_back(recvBufMinTime[i]); GEMM_Profile_MaxTime.push_back(recvBufMaxTime[i]); - } - else { - + } else { /* Entry is already present. Determine its index in the map and update the corresponding vectors. */ const int ind = MI->second; - GEMM_Profile_NCalls[ind] += recvBufNCalls[i]; + GEMM_Profile_NCalls[ind] += recvBufNCalls[i]; GEMM_Profile_TotTime[ind] += recvBufTotTime[i]; - GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], recvBufMinTime[i]); - GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], recvBufMaxTime[i]); + GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], recvBufMinTime[i]); + GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], recvBufMaxTime[i]); } } } - } - else { - + } else { /* Not the master node. Create the send buffer for the MNK data. */ - vector sendBufMNK(3*GEMM_Profile_NCalls.size()); - for(map::iterator MI =GEMM_Profile_MNK.begin(); - MI!=GEMM_Profile_MNK.end(); ++MI) { - - const int ind = 3*MI->second; - sendBufMNK[ind] = MI->first.long0; - sendBufMNK[ind+1] = MI->first.long1; - sendBufMNK[ind+2] = MI->first.long2; + vector sendBufMNK(3 * GEMM_Profile_NCalls.size()); + for (map::iterator MI = GEMM_Profile_MNK.begin(); MI != GEMM_Profile_MNK.end(); ++MI) { + const int ind = 3 * MI->second; + sendBufMNK[ind] = MI->first.long0; + sendBufMNK[ind + 1] = MI->first.long1; + sendBufMNK[ind + 2] = MI->first.long2; } /* Send the data to the master node using blocking sends. */ - SU2_MPI::Send(GEMM_Profile_NCalls.data(), GEMM_Profile_NCalls.size(), - MPI_LONG, MASTER_NODE, 0, SU2_MPI::GetComm()); - SU2_MPI::Send(GEMM_Profile_TotTime.data(), GEMM_Profile_TotTime.size(), - MPI_DOUBLE, MASTER_NODE, 1, SU2_MPI::GetComm()); - SU2_MPI::Send(GEMM_Profile_MinTime.data(), GEMM_Profile_MinTime.size(), - MPI_DOUBLE, MASTER_NODE, 2, SU2_MPI::GetComm()); - SU2_MPI::Send(GEMM_Profile_MaxTime.data(), GEMM_Profile_MaxTime.size(), - MPI_DOUBLE, MASTER_NODE, 3, SU2_MPI::GetComm()); - SU2_MPI::Send(sendBufMNK.data(), sendBufMNK.size(), - MPI_LONG, MASTER_NODE, 4, SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_NCalls.data(), GEMM_Profile_NCalls.size(), MPI_LONG, MASTER_NODE, 0, SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_TotTime.data(), GEMM_Profile_TotTime.size(), MPI_DOUBLE, MASTER_NODE, 1, + SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_MinTime.data(), GEMM_Profile_MinTime.size(), MPI_DOUBLE, MASTER_NODE, 2, + SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_MaxTime.data(), GEMM_Profile_MaxTime.size(), MPI_DOUBLE, MASTER_NODE, 3, + SU2_MPI::GetComm()); + SU2_MPI::Send(sendBufMNK.data(), sendBufMNK.size(), MPI_LONG, MASTER_NODE, 4, SU2_MPI::GetComm()); } #endif /*--- The master rank will write the file ---*/ if (rank == MASTER_NODE) { - /* Store the elements of the map GEMM_Profile_MNK in vectors for post processing reasons. */ const unsigned int nItems = GEMM_Profile_MNK.size(); vector M(nItems), N(nItems), K(nItems); - for(map::iterator MI =GEMM_Profile_MNK.begin(); - MI!=GEMM_Profile_MNK.end(); ++MI) { - + for (map::iterator MI = GEMM_Profile_MNK.begin(); MI != GEMM_Profile_MNK.end(); ++MI) { const int ind = MI->second; M[ind] = MI->first.long0; N[ind] = MI->first.long1; @@ -9937,7 +10648,7 @@ void CConfig::GEMMProfilingCSV() { out this sort. */ vector > sortedTime; - for(unsigned int i=0; i >::reverse_iterator rit =sortedTime.rbegin(); - rit!=sortedTime.rend(); ++rit) { + for (vector >::reverse_iterator rit = sortedTime.rbegin(); rit != sortedTime.rend(); + ++rit) { /* Determine the original index in the profiling vectors. */ const unsigned int ind = rit->second; - const double AvgTime = GEMM_Profile_TotTime[ind]/GEMM_Profile_NCalls[ind]; - const double GFlops = 2.0e-9*M[ind]*N[ind]*K[ind]/AvgTime; + const double AvgTime = GEMM_Profile_TotTime[ind] / GEMM_Profile_NCalls[ind]; + const double GFlops = 2.0e-9 * M[ind] * N[ind] * K[ind] / AvgTime; /* Write the data. */ - Profile_File << scientific << GEMM_Profile_TotTime[ind] << ", " << GEMM_Profile_NCalls[ind] << ", " - << AvgTime << ", " << GEMM_Profile_MinTime[ind] << ", " << GEMM_Profile_MaxTime[ind] << ", " - << M[ind] << ", " << N[ind] << ", " << K[ind] << ", " << GFlops << endl; + Profile_File << scientific << GEMM_Profile_TotTime[ind] << ", " << GEMM_Profile_NCalls[ind] << ", " << AvgTime + << ", " << GEMM_Profile_MinTime[ind] << ", " << GEMM_Profile_MaxTime[ind] << ", " << M[ind] << ", " + << N[ind] << ", " << K[ind] << ", " << GFlops << endl; } /* Close the file. */ @@ -9971,74 +10684,73 @@ void CConfig::GEMMProfilingCSV() { } #endif - } -void CConfig::SetFreeStreamTurboNormal(const su2double* turboNormal){ - +void CConfig::SetFreeStreamTurboNormal(const su2double* turboNormal) { FreeStreamTurboNormal[0] = turboNormal[0]; FreeStreamTurboNormal[1] = turboNormal[1]; FreeStreamTurboNormal[2] = 0.0; - } -void CConfig::SetMultizone(const CConfig *driver_config, const CConfig* const* config_container){ - - for (unsigned short iZone = 0; iZone < nZone; iZone++){ - - if (config_container[iZone]->GetTime_Domain() != GetTime_Domain()){ +void CConfig::SetMultizone(const CConfig* driver_config, const CConfig* const* config_container) { + for (unsigned short iZone = 0; iZone < nZone; iZone++) { + if (config_container[iZone]->GetTime_Domain() != GetTime_Domain()) { SU2_MPI::Error("Option TIME_DOMAIN must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetnTime_Iter() != GetnTime_Iter()){ + if (config_container[iZone]->GetnTime_Iter() != GetnTime_Iter()) { SU2_MPI::Error("Option TIME_ITER must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetnOuter_Iter() != GetnOuter_Iter()){ + if (config_container[iZone]->GetnOuter_Iter() != GetnOuter_Iter()) { SU2_MPI::Error("Option OUTER_ITER must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetTime_Step() != GetTime_Step()){ + if (config_container[iZone]->GetTime_Step() != GetTime_Step()) { SU2_MPI::Error("Option TIME_STEP must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetUnst_CFL() != 0.0){ - SU2_MPI::Error("Option UNST_CFL_NUMBER cannot be used in multizone problems (must be 0)," - " use a fixed TIME_STEP instead.", CURRENT_FUNCTION); + if (config_container[iZone]->GetUnst_CFL() != 0.0) { + SU2_MPI::Error( + "Option UNST_CFL_NUMBER cannot be used in multizone problems (must be 0)," + " use a fixed TIME_STEP instead.", + CURRENT_FUNCTION); } - if (config_container[iZone]->GetMultizone_Problem() != GetMultizone_Problem()){ + if (config_container[iZone]->GetMultizone_Problem() != GetMultizone_Problem()) { SU2_MPI::Error("Option MULTIZONE must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetMultizone_Mesh() != GetMultizone_Mesh()){ + if (config_container[iZone]->GetMultizone_Mesh() != GetMultizone_Mesh()) { SU2_MPI::Error("Option MULTIZONE_MESH must be the same in all zones.", CURRENT_FUNCTION); } - if(config_container[iZone]->GetWnd_Cauchy_Crit()){ + if (config_container[iZone]->GetWnd_Cauchy_Crit()) { SU2_MPI::Error("Option WINDOW_CAUCHY_CRIT must be deactivated for multizone problems.", CURRENT_FUNCTION); } } - if(driver_config->GetWnd_Cauchy_Crit()){ + if (driver_config->GetWnd_Cauchy_Crit()) { SU2_MPI::Error("Option WINDOW_CAUCHY_CRIT must be deactivated for multizone problems.", CURRENT_FUNCTION); } bool multiblockDriver = false; - for (unsigned short iFiles = 0; iFiles < driver_config->GetnVolumeOutputFiles(); iFiles++){ - if (driver_config->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK){ + for (unsigned short iFiles = 0; iFiles < driver_config->GetnVolumeOutputFiles(); iFiles++) { + if (driver_config->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK) { multiblockDriver = true; } } bool multiblockZone = false; - for (unsigned short iZone = 0; iZone < nZone; iZone++){ + for (unsigned short iZone = 0; iZone < nZone; iZone++) { multiblockZone = false; - for (unsigned short iFiles = 0; iFiles < config_container[iZone]->GetnVolumeOutputFiles(); iFiles++){ - if (config_container[iZone]->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK){ + for (unsigned short iFiles = 0; iFiles < config_container[iZone]->GetnVolumeOutputFiles(); iFiles++) { + if (config_container[iZone]->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK) { multiblockZone = true; } } - if (multiblockZone != multiblockDriver){ - SU2_MPI::Error("To enable PARAVIEW_MULTIBLOCK output, add it to OUTPUT_FILES option in main config and\n" - "remove option from sub-config files.", CURRENT_FUNCTION); + if (multiblockZone != multiblockDriver) { + SU2_MPI::Error( + "To enable PARAVIEW_MULTIBLOCK output, add it to OUTPUT_FILES option in main config and\n" + "remove option from sub-config files.", + CURRENT_FUNCTION); } } /*--- Fix the Time Step for all subdomains, for the case of time-dependent problems ---*/ - if (driver_config->GetTime_Domain()){ + if (driver_config->GetTime_Domain()) { Delta_UnstTime = driver_config->GetTime_Step(); Time_Domain = true; From 9f93d6bcfcff902e8a0494997188571165426e25 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Wed, 9 Aug 2023 22:48:18 +0200 Subject: [PATCH 026/139] remove direct_diff, auto_diff --- Common/include/CConfig.hpp | 1 - Common/src/CConfig.cpp | 17 ----------------- config_template.cfg | 6 ------ 3 files changed, 24 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index cb4e14ee96a..f045de02c01 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -262,7 +262,6 @@ class CConfig { *Marker_Load_Dir, /*!< \brief Load markers defined in cartesian coordinates. */ *Marker_Disp_Dir, /*!< \brief Load markers defined in cartesian coordinates. */ *Marker_Load_Sine, /*!< \brief Sine-wave loaded markers defined in cartesian coordinates. */ - *Marker_FlowLoad, /*!< \brief Flow Load markers. */ *Marker_Internal, /*!< \brief Internal flow markers. */ *Marker_All_TagBound; /*!< \brief Global index for markers using grid information. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 1ee3a4548f2..9213083c98b 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1920,8 +1920,6 @@ void CConfig::SetConfig_Options() { /*!\brief RAMP_AND_RELEASE\n DESCRIPTION: release the load after applying the ramp*/ addBoolOption("RAMP_AND_RELEASE_LOAD", RampAndRelease, false); - /* DESCRIPTION: Flow load boundary marker(s) */ - // addStringDoubleListOption("MARKER_FLOWLOAD", nMarker_FlowLoad, Marker_FlowLoad, FlowLoad_Value); /* DESCRIPTION: Damping factor for engine inlet condition */ addDoubleOption("DAMP_ENGINE_INFLOW", Damp_Engine_Inflow, 0.95); /* DESCRIPTION: Damping factor for engine exhaust condition */ @@ -3063,12 +3061,6 @@ void CConfig::SetConfig_Options() { /*--- Options for the automatic differentiation methods ---*/ /*!\par CONFIG_CATEGORY: Automatic Differentation options\ingroup Config*/ - /* DESCRIPTION: Direct differentiation mode (forward) */ - addEnumOption("DIRECT_DIFF", DirectDiff, DirectDiff_Var_Map, NO_DERIVATIVE); - - /* DESCRIPTION: Automatic differentiation mode (reverse) */ - addBoolOption("AUTO_DIFF", AD_Mode, NO); - /* DESCRIPTION: Preaccumulation in the AD mode. */ addBoolOption("PREACC", AD_Preaccumulation, YES); @@ -8007,15 +7999,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { BoundaryTable.PrintFooter(); } - // if (nMarker_FlowLoad != 0) { - // BoundaryTable << "Flow load boundary"; - // for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) { - // BoundaryTable << Marker_FlowLoad[iMarker_FlowLoad]; - // if (iMarker_FlowLoad < nMarker_FlowLoad-1) BoundaryTable << " "; - // } - // BoundaryTable.PrintFooter(); - // } - if (nMarker_Internal != 0) { BoundaryTable << "Internal boundary"; for (iMarker_Internal = 0; iMarker_Internal < nMarker_Internal; iMarker_Internal++) { diff --git a/config_template.cfg b/config_template.cfg index 746e901edc2..dde9a3969e6 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1942,12 +1942,6 @@ STRESS_PENALTY_PARAM= (1.0, 10.0) % ---------------- AUTOMATIC DIFFERENTIATION -------------------% % -% Direct differentiation mode (forward) -DIRECT_DIFF= NONE -% -% Automatic differentiation mode (reverse) -AUTO_DIFF= NO -% % Preaccumulation in the AD mode. PREACC= YES From 93e5fdcf096d1385e1316fa000f9b598dcf43daf Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 11 Aug 2023 09:17:55 +0200 Subject: [PATCH 027/139] update cconfig with clang --- Common/include/CConfig.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index f045de02c01..b3379b587cb 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1099,7 +1099,6 @@ class CConfig { distortion[2], /*!< \brief SU2_GEO section locations array for the COption class. */ ea_lim[3], /*!< \brief equivalent area limit array for the COption class. */ grid_fix[6], /*!< \brief fixed grid (non-deforming region) array for the COption class. */ - //htp_axis[2], /*!< \brief HTP axis for the COption class. */ ffd_axis[3], /*!< \brief FFD axis for the COption class. */ inc_crit[3], /*!< \brief incremental criteria array for the COption class. */ extrarelfac[2], /*!< \brief extra relaxation factor for Giles BC in the COption class. */ From 27e9b339a9b32e7d9c5c8fa1efc1a8746e5a7369 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 11 Aug 2023 09:24:50 +0200 Subject: [PATCH 028/139] update cconfig with clang --- Common/src/CConfig.cpp | 6045 ++++++++++++++++++---------------------- 1 file changed, 2675 insertions(+), 3370 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 9213083c98b..1365f1a3cd9 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -50,20 +50,22 @@ vector Profile_Time_tp; /*!< \brief Vector of elapsed time for vector Profile_ID_tp; /*!< \brief Vector of group ID number for profiled functions. */ map > Profile_Map_tp; /*!< \brief Map containing the final results for profiled functions. */ -map GEMM_Profile_MNK; /*!< \brief Map, which maps the GEMM size to the index where - the data for this GEMM is stored in several vectors. */ -vector GEMM_Profile_NCalls; /*!< \brief Vector, which stores the number of calls to this - GEMM size. */ -vector GEMM_Profile_TotTime; /*!< \brief Total time spent for this GEMM size. */ -vector GEMM_Profile_MinTime; /*!< \brief Minimum time spent for this GEMM size. */ -vector GEMM_Profile_MaxTime; /*!< \brief Maximum time spent for this GEMM size. */ +map GEMM_Profile_MNK; /*!< \brief Map, which maps the GEMM size to the index where + the data for this GEMM is stored in several vectors. */ +vector GEMM_Profile_NCalls; /*!< \brief Vector, which stores the number of calls to this + GEMM size. */ +vector GEMM_Profile_TotTime; /*!< \brief Total time spent for this GEMM size. */ +vector GEMM_Profile_MinTime; /*!< \brief Minimum time spent for this GEMM size. */ +vector GEMM_Profile_MaxTime; /*!< \brief Maximum time spent for this GEMM size. */ //#pragma omp threadprivate(Profile_Function_tp, Profile_Time_tp, Profile_ID_tp, Profile_Map_tp) + 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 ---*/ - caseName = PrintingToolbox::split(string(case_filename), '.')[0]; + caseName = PrintingToolbox::split(string(case_filename),'.')[0]; base_config = true; @@ -99,10 +101,13 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software /*--- Configuration file output ---*/ - if ((rank == MASTER_NODE) && verb_high) SetOutput(val_software, iZone); + if ((rank == MASTER_NODE) && verb_high) + SetOutput(val_software, iZone); + } -CConfig::CConfig(istream& case_buffer, SU2_COMPONENT val_software, bool verb_high) { +CConfig::CConfig(istream &case_buffer, SU2_COMPONENT val_software, bool verb_high) { + base_config = true; iZone = 0; @@ -132,11 +137,13 @@ CConfig::CConfig(istream& case_buffer, SU2_COMPONENT val_software, bool verb_hig /*--- Configuration file output ---*/ - if ((rank == MASTER_NODE) && verb_high) SetOutput(val_software, iZone); + if ((rank == MASTER_NODE) && verb_high) + SetOutput(val_software, iZone); + } -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) { +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(); unsigned short val_nDim; @@ -174,15 +181,18 @@ CConfig::CConfig(CConfig* config, char case_filename[MAX_STRING_SIZE], SU2_COMPO /*--- Configuration file output ---*/ - if ((rank == MASTER_NODE) && verb_high) SetOutput(val_software, val_iZone); + if ((rank == MASTER_NODE) && verb_high) + SetOutput(val_software, val_iZone); Multizone_Problem = config->GetMultizone_Problem(); + } CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software) { + /*--- Set the case name to the base config file name without extension ---*/ - caseName = PrintingToolbox::split(string(case_filename), '.')[0]; + caseName = PrintingToolbox::split(string(case_filename),'.')[0]; base_config = true; @@ -214,12 +224,14 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software /*--- Print the header --- */ SetHeader(val_software); + } -CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig* config) { +CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig *config) { + /*--- Set the case name to the base config file name without extension ---*/ - caseName = PrintingToolbox::split(string(case_filename), '.')[0]; + caseName = PrintingToolbox::split(string(case_filename),'.')[0]; base_config = true; @@ -238,13 +250,19 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig* config) { /*--- Update original config file ---*/ if (runtime_file) { - if (all_options.find("TIME_ITER") == all_options.end()) config->SetnTime_Iter(nTimeIter); + if (all_options.find("TIME_ITER") == all_options.end()) + config->SetnTime_Iter(nTimeIter); } } -SU2_MPI::Comm CConfig::GetMPICommunicator() const { return SU2_Communicator; } +SU2_MPI::Comm CConfig::GetMPICommunicator() const { + + return SU2_Communicator; + +} + +void CConfig::Init(){ -void CConfig::Init() { /*--- Store MPI rank and size ---*/ rank = SU2_MPI::GetRank(); @@ -257,11 +275,16 @@ void CConfig::Init() { /*--- Reading config options ---*/ SetConfig_Options(); + } -void CConfig::SetMPICommunicator(SU2_MPI::Comm Communicator) { SU2_Communicator = Communicator; } +void CConfig::SetMPICommunicator(SU2_MPI::Comm Communicator) { + + SU2_Communicator = Communicator; -void CConfig::addDoubleOption(const string& name, su2double& option_field, su2double default_value) { +} + +void CConfig::addDoubleOption(const string& name, su2double & option_field, su2double default_value) { // Check if the key is already in the map. If this fails, it is coder error // and not user error, so throw. assert(option_map.find(name) == option_map.end()); @@ -277,201 +300,198 @@ void CConfig::addDoubleOption(const string& name, su2double& option_field, su2do // Create an association between the option name ("CFL") and the parser generated above. // During configuration, the parsing script will get the option name, and use this map // to find how to parse that option. - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addStringOption(const string& name, string& option_field, string default_value) { +void CConfig::addStringOption(const string& name, string & option_field, string default_value) { + assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionString(name, option_field, std::move(default_value)); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addIntegerOption(const string& name, int& option_field, int default_value) { +void CConfig::addIntegerOption(const string& name, int & option_field, int default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionInt(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addUnsignedLongOption(const string& name, unsigned long& option_field, unsigned long default_value) { +void CConfig::addUnsignedLongOption(const string& name, unsigned long & option_field, unsigned long default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionULong(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addUnsignedShortOption(const string& name, unsigned short& option_field, unsigned short default_value) { +void CConfig::addUnsignedShortOption(const string& name, unsigned short & option_field, unsigned short default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionUShort(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addLongOption(const string& name, long& option_field, long default_value) { +void CConfig::addLongOption(const string& name, long & option_field, long default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionLong(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addBoolOption(const string& name, bool& option_field, bool default_value) { +void CConfig::addBoolOption(const string& name, bool & option_field, bool default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionBool(name, option_field, default_value); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } // 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, TField& option_field, const map& enum_map, - Tenum default_value) { +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); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } // input_size is the number of options read in from the config file template -void CConfig::addEnumListOption(const string name, unsigned short& input_size, TField*& option_field, - const map& enum_map) { +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); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionEnumList(name, enum_map, option_field, input_size); + option_map.insert( pair(name, val) ); } void CConfig::addDoubleArrayOption(const string& name, const int size, su2double* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionArray(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } void CConfig::addUShortArrayOption(const string& name, const int size, unsigned short* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionArray(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addDoubleListOption(const string& name, unsigned short& size, su2double*& option_field) { +void CConfig::addDoubleListOption(const string& name, unsigned short & size, su2double * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionDoubleList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addShortListOption(const string& name, unsigned short& size, short*& option_field) { +void CConfig::addShortListOption(const string& name, unsigned short & size, short * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionShortList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addUShortListOption(const string& name, unsigned short& size, unsigned short*& option_field) { +void CConfig::addUShortListOption(const string& name, unsigned short & size, unsigned short * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionUShortList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addULongListOption(const string& name, unsigned short& size, unsigned long*& option_field) { +void CConfig::addULongListOption(const string& name, unsigned short & size, unsigned long * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionULongList(name, size, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addStringListOption(const string& name, unsigned short& num_marker, string*& option_field) { +void CConfig::addStringListOption(const string& name, unsigned short & num_marker, string* & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionStringList(name, num_marker, option_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addConvectOption(const string& name, unsigned short& space_field, CENTERED& centered_field, - UPWIND& upwind_field) { +void CConfig::addConvectOption(const string& name, unsigned short & space_field, CENTERED & centered_field, UPWIND & upwind_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionConvect(name, space_field, centered_field, upwind_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addConvectFEMOption(const string& name, unsigned short& space_field, unsigned short& fem_field) { +void CConfig::addConvectFEMOption(const string& name, unsigned short & space_field, unsigned short & fem_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFEMConvect(name, space_field, fem_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addMathProblemOption(const string& name, bool& ContinuousAdjoint, const bool& ContinuousAdjoint_default, - bool& DiscreteAdjoint, const bool& DiscreteAdjoint_default, bool& Restart_Flow, - const bool& Restart_Flow_default) { +void CConfig::addMathProblemOption(const string& name, bool & ContinuousAdjoint, const bool & ContinuousAdjoint_default, + bool & DiscreteAdjoint, const bool & DiscreteAdjoint_default, + bool & Restart_Flow, const bool & Restart_Flow_default) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionMathProblem(name, ContinuousAdjoint, ContinuousAdjoint_default, DiscreteAdjoint, - DiscreteAdjoint_default, Restart_Flow, Restart_Flow_default); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionMathProblem(name, ContinuousAdjoint, ContinuousAdjoint_default, DiscreteAdjoint, DiscreteAdjoint_default, Restart_Flow, Restart_Flow_default); + option_map.insert(pair(name, val)); } -void CConfig::addDVParamOption(const string& name, unsigned short& nDV_field, su2double**& paramDV, string*& FFDTag, - unsigned short*& design_variable) { +void CConfig::addDVParamOption(const string& name, unsigned short & nDV_field, su2double** & paramDV, string* & FFDTag, + unsigned short* & design_variable) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionDVParam(name, nDV_field, paramDV, FFDTag, design_variable); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addDVValueOption(const string& name, unsigned short*& nDVValue_field, su2double**& valueDV, - unsigned short& nDV_field, su2double**& paramDV, unsigned short*& design_variable) { +void CConfig::addDVValueOption(const string& name, unsigned short* & nDVValue_field, su2double** & valueDV, unsigned short & nDV_field, su2double** & paramDV, + unsigned short* & design_variable) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionDVValue(name, nDVValue_field, valueDV, nDV_field, paramDV, design_variable); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addFFDDefOption(const string& name, unsigned short& nFFD_field, su2double**& coordFFD, string*& FFDTag) { +void CConfig::addFFDDefOption(const string& name, unsigned short & nFFD_field, su2double** & coordFFD, string* & FFDTag) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFFDDef(name, nFFD_field, coordFFD, FFDTag); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addFFDDegreeOption(const string& name, unsigned short& nFFD_field, unsigned short**& degreeFFD) { +void CConfig::addFFDDegreeOption(const string& name, unsigned short & nFFD_field, unsigned short** & degreeFFD) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFFDDegree(name, nFFD_field, degreeFFD); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addStringDoubleListOption(const string& name, unsigned short& list_size, string*& string_field, - su2double*& double_field) { +void CConfig::addStringDoubleListOption(const string& name, unsigned short & list_size, string * & string_field, + su2double* & double_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionStringValuesList(name, list_size, string_field, double_field); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addInletOption(const string& name, unsigned short& nMarker_Inlet, string*& Marker_Inlet, - su2double*& Ttotal, su2double*& Ptotal, su2double**& FlowDir) { +void CConfig::addInletOption(const string& name, unsigned short & nMarker_Inlet, string * & Marker_Inlet, + su2double* & Ttotal, su2double* & Ptotal, su2double** & FlowDir) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionInlet(name, nMarker_Inlet, Marker_Inlet, Ttotal, Ptotal, FlowDir); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addInletSpeciesOption(const string& name, unsigned short& nMarker_Inlet_Species, - string*& Marker_Inlet_Species, su2double**& inlet_species_val, - unsigned short& nSpecies_per_Inlet) { +void CConfig::addInletSpeciesOption(const string& name, unsigned short & nMarker_Inlet_Species, + string * & Marker_Inlet_Species, su2double** & inlet_species_val, + unsigned short & nSpecies_per_Inlet) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionStringValuesList(name, nMarker_Inlet_Species, Marker_Inlet_Species, inlet_species_val, nSpecies_per_Inlet); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } void CConfig::addInletTurbOption(const string& name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb, @@ -484,87 +504,83 @@ void CConfig::addInletTurbOption(const string& name, unsigned short& nMarker_Inl } template -void CConfig::addRiemannOption(const string name, unsigned short& nMarker_Riemann, string*& Marker_Riemann, - unsigned short*& option_field, const map& enum_map, su2double*& var1, - su2double*& var2, su2double**& FlowDir) { +void CConfig::addRiemannOption(const string name, unsigned short & nMarker_Riemann, string * & Marker_Riemann, unsigned short* & option_field, const map & enum_map, + su2double* & var1, su2double* & var2, su2double** & FlowDir) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = - new COptionRiemann(name, nMarker_Riemann, Marker_Riemann, option_field, enum_map, var1, var2, FlowDir); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionRiemann(name, nMarker_Riemann, Marker_Riemann, option_field, enum_map, var1, var2, FlowDir); + option_map.insert(pair(name, val)); } template -void CConfig::addGilesOption(const string name, unsigned short& nMarker_Giles, string*& Marker_Giles, - unsigned short*& option_field, const map& enum_map, su2double*& var1, - su2double*& var2, su2double**& FlowDir, su2double*& relaxfactor1, - su2double*& relaxfactor2) { +void CConfig::addGilesOption(const string name, unsigned short & nMarker_Giles, string * & Marker_Giles, unsigned short* & option_field, const map & enum_map, + su2double* & var1, su2double* & var2, su2double** & FlowDir, su2double* & relaxfactor1, su2double* & relaxfactor2) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionGiles(name, nMarker_Giles, Marker_Giles, option_field, enum_map, var1, var2, - FlowDir, relaxfactor1, relaxfactor2); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionGiles(name, nMarker_Giles, Marker_Giles, option_field, enum_map, var1, var2, FlowDir, relaxfactor1, relaxfactor2); + option_map.insert(pair(name, val)); } -void CConfig::addExhaustOption(const string& name, unsigned short& nMarker_Exhaust, string*& Marker_Exhaust, - su2double*& Ttotal, su2double*& Ptotal) { +void CConfig::addExhaustOption(const string& name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust, + su2double* & Ttotal, su2double* & Ptotal) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionExhaust(name, nMarker_Exhaust, Marker_Exhaust, Ttotal, Ptotal); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addPeriodicOption(const string& name, unsigned short& nMarker_PerBound, string*& Marker_PerBound, - string*& Marker_PerDonor, su2double**& RotCenter, su2double**& RotAngles, - su2double**& Translation) { +void CConfig::addPeriodicOption(const string & name, unsigned short & nMarker_PerBound, + string* & Marker_PerBound, string* & Marker_PerDonor, + su2double** & RotCenter, su2double** & RotAngles, su2double** & Translation) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = - new COptionPeriodic(name, nMarker_PerBound, Marker_PerBound, Marker_PerDonor, RotCenter, RotAngles, Translation); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionPeriodic(name, nMarker_PerBound, Marker_PerBound, Marker_PerDonor, RotCenter, RotAngles, Translation); + option_map.insert(pair(name, val)); } -void CConfig::addTurboPerfOption(const string& name, unsigned short& nMarker_TurboPerf, string*& Marker_TurboBoundIn, - string*& Marker_TurboBoundOut) { +void CConfig::addTurboPerfOption(const string & name, unsigned short & nMarker_TurboPerf, + string* & Marker_TurboBoundIn, string* & Marker_TurboBoundOut) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionTurboPerformance(name, nMarker_TurboPerf, Marker_TurboBoundIn, Marker_TurboBoundOut); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addActDiskOption(const string& name, unsigned short& nMarker_ActDiskInlet, - unsigned short& nMarker_ActDiskOutlet, string*& Marker_ActDiskInlet, - string*& Marker_ActDiskOutlet, su2double**& ActDisk_PressJump, - su2double**& ActDisk_TempJump, su2double**& ActDisk_Omega) { +void CConfig::addActDiskOption(const string & name, unsigned short & nMarker_ActDiskInlet, + unsigned short & nMarker_ActDiskOutlet, string* & Marker_ActDiskInlet, + string* & Marker_ActDiskOutlet, su2double** & ActDisk_PressJump, + su2double** & ActDisk_TempJump, su2double** & ActDisk_Omega) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionActDisk(name, nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } -void CConfig::addWallFunctionOption(const string& name, unsigned short& list_size, string*& string_field, - WALL_FUNCTIONS*& val_Kind_WF, unsigned short**& val_IntInfo_WF, - su2double**& val_DoubleInfo_WF) { +void CConfig::addWallFunctionOption(const string &name, unsigned short &list_size, string* &string_field, + WALL_FUNCTIONS* &val_Kind_WF, unsigned short** &val_IntInfo_WF, + su2double** &val_DoubleInfo_WF) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = - new COptionWallFunction(name, list_size, string_field, val_Kind_WF, val_IntInfo_WF, val_DoubleInfo_WF); - option_map.insert(pair(name, val)); + COptionBase* val = new COptionWallFunction(name, list_size, string_field, val_Kind_WF, + val_IntInfo_WF, val_DoubleInfo_WF); + option_map.insert(pair(name, val)); } void CConfig::addPythonOption(const string& name) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionPython(name); - option_map.insert(pair(name, val)); + option_map.insert(pair(name, val)); } unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short val_format) { + int nZone = 1; /* Default value if nothing is specified. */ switch (val_format) { case SU2: { + /*--- Local variables for reading the SU2 file. ---*/ string text_line; ifstream mesh_file; @@ -572,32 +588,35 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short /*--- Check if the mesh file can be opened for reading. ---*/ mesh_file.open(val_mesh_filename.c_str(), ios::in); if (mesh_file.fail()) - SU2_MPI::Error(string("There is no geometry file called ") + val_mesh_filename, CURRENT_FUNCTION); + SU2_MPI::Error(string("There is no geometry file called ") + val_mesh_filename, + CURRENT_FUNCTION); /*--- Read the SU2 mesh file until the zone data is reached or when it can be decided that it is not present. ---*/ - while (getline(mesh_file, text_line)) { + while( getline (mesh_file, text_line) ) { + /*--- Search for the "NZONE" keyword to see if there are multiple Zones ---*/ - if (text_line.find("NZONE=", 0) != string::npos) { - text_line.erase(0, 6); - nZone = atoi(text_line.c_str()); + if(text_line.find ("NZONE=",0) != string::npos) { + text_line.erase (0,6); nZone = atoi(text_line.c_str()); break; } /*--- If one of the keywords IZONE, NELEM or NPOIN, NMARK is encountered, it can be assumed that the NZONE keyword is not present and the loop can be terminated. ---*/ - if (text_line.find("IZONE=", 0) != string::npos) break; - if (text_line.find("NELEM=", 0) != string::npos) break; - if (text_line.find("NPOIN=", 0) != string::npos) break; - if (text_line.find("NMARK=", 0) != string::npos) break; + if(text_line.find ("IZONE=",0) != string::npos) break; + if(text_line.find ("NELEM=",0) != string::npos) break; + if(text_line.find ("NPOIN=",0) != string::npos) break; + if(text_line.find ("NMARK=",0) != string::npos) break; } mesh_file.close(); break; + } case CGNS_GRID: { + #ifdef HAVE_CGNS /*--- Local variables which are needed when calling the CGNS mid-level API. ---*/ @@ -608,9 +627,10 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short /*--- Check whether the supplied file is truly a CGNS file. ---*/ - if (cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK) { - SU2_MPI::Error(val_mesh_filename + string(" was not found or is not a properly formatted CGNS file.\n") + - string("Note that SU2 expects unstructured CGNS files in ADF data format."), + if ( cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK ) { + SU2_MPI::Error(val_mesh_filename + + string(" was not found or is not a properly formatted CGNS file.\n") + + string("Note that SU2 expects unstructured CGNS files in ADF data format."), CURRENT_FUNCTION); } @@ -629,30 +649,34 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short error if there is because this reader can currently only handle one database. ---*/ - if (nbases > 1) { - SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database.", CURRENT_FUNCTION); + if ( nbases > 1 ) { + SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database." , + CURRENT_FUNCTION); } /*--- Read the databases. Note that the indexing starts at 1. ---*/ - for (int i = 1; i <= nbases; i++) { + for ( int i = 1; i <= nbases; i++ ) { + if (cg_base_read(fn, i, basename, &cell_dim, &phys_dim)) cg_error_exit(); /*--- Get the number of zones for this base. ---*/ if (cg_nzones(fn, i, &nzones)) cg_error_exit(); + } /*--- Close the CGNS file. ---*/ - if (cg_close(fn)) cg_error_exit(); + if ( cg_close(fn) ) cg_error_exit(); /*--- Set the number of zones as read from the CGNS file ---*/ nZone = nzones; #else - SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + string(" To use CGNS, build SU2 accordingly."), + SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + + string(" To use CGNS, build SU2 accordingly."), CURRENT_FUNCTION); #endif @@ -668,14 +692,17 @@ unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short } } - return (unsigned short)nZone; + return (unsigned short) nZone; + } unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short val_format) { + short nDim = -1; switch (val_format) { case SU2: { + /*--- Local variables for reading the SU2 file. ---*/ string text_line; ifstream mesh_file; @@ -683,43 +710,41 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short /*--- Open grid file ---*/ mesh_file.open(val_mesh_filename.c_str(), ios::in); if (mesh_file.fail()) { - SU2_MPI::Error(string("The SU2 mesh file named ") + val_mesh_filename + string(" was not found."), - CURRENT_FUNCTION); + SU2_MPI::Error(string("The SU2 mesh file named ") + val_mesh_filename + string(" was not found."), CURRENT_FUNCTION); } /*--- Read the SU2 mesh file until the dimension data is reached or when it can be decided that it is not present. ---*/ - while (getline(mesh_file, text_line)) { + while( getline (mesh_file, text_line) ) { + /*--- Search for the "NDIME" keyword to determine the number of dimensions. ---*/ - if (text_line.find("NDIME=", 0) != string::npos) { - text_line.erase(0, 6); - nDim = atoi(text_line.c_str()); + if(text_line.find ("NDIME=",0) != string::npos) { + text_line.erase (0,6); nDim = atoi(text_line.c_str()); break; } /*--- If one of the keywords NELEM or NPOIN, NMARK is encountered, it can be assumed that the NZONE keyword is not present and the loop can be terminated. ---*/ - if (text_line.find("NELEM=", 0) != string::npos) break; - if (text_line.find("NPOIN=", 0) != string::npos) break; - if (text_line.find("NMARK=", 0) != string::npos) break; + if(text_line.find ("NELEM=",0) != string::npos) break; + if(text_line.find ("NPOIN=",0) != string::npos) break; + if(text_line.find ("NMARK=",0) != string::npos) break; } mesh_file.close(); /*--- Throw an error if the dimension was not found. ---*/ if (nDim == -1) { - SU2_MPI::Error( - val_mesh_filename + - string(" is not an SU2 mesh file or has the wrong format \n ('NDIME=' not found). Please check."), - CURRENT_FUNCTION); + SU2_MPI::Error(val_mesh_filename + string(" is not an SU2 mesh file or has the wrong format \n ('NDIME=' not found). Please check."), + CURRENT_FUNCTION); } break; } case CGNS_GRID: { + #ifdef HAVE_CGNS /*--- Local variables which are needed when calling the CGNS mid-level API. ---*/ @@ -728,9 +753,10 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short char basename[CGNS_STRING_SIZE]; /*--- Check whether the supplied file is truly a CGNS file. ---*/ - if (cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK) { - SU2_MPI::Error(val_mesh_filename + string(" was not found or is not a properly formatted CGNS file.\n") + - string("Note that SU2 expects unstructured CGNS files in ADF data format."), + if ( cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK ) { + SU2_MPI::Error(val_mesh_filename + + string(" was not found or is not a properly formatted CGNS file.\n") + + string("Note that SU2 expects unstructured CGNS files in ADF data format."), CURRENT_FUNCTION); } @@ -746,8 +772,9 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short /*--- Check if there is more than one database. Throw an error if there is because this reader can currently only handle one database. ---*/ - if (nbases > 1) - SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database.", CURRENT_FUNCTION); + if ( nbases > 1 ) + SU2_MPI::Error("CGNS reader currently incapable of handling more than 1 database." , + CURRENT_FUNCTION); /*--- Read the database. Note that the indexing starts at 1. Afterwards close the file again. ---*/ @@ -758,7 +785,8 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short nDim = cell_dim; #else - SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + string(" To use CGNS, build SU2 accordingly."), + SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + + string(" To use CGNS, build SU2 accordingly."), CURRENT_FUNCTION); #endif @@ -777,326 +805,192 @@ unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short /*--- After reading the mesh, assert that the dimension is equal to 2 or 3. ---*/ assert((nDim == 2) || (nDim == 3)); - return (unsigned short)nDim; + return (unsigned short) nDim; } void CConfig::SetPointersNull() { - Marker_CfgFile_GeoEval = nullptr; - Marker_All_GeoEval = nullptr; - Marker_CfgFile_Monitoring = nullptr; - Marker_All_Monitoring = nullptr; - Marker_CfgFile_Designing = nullptr; - Marker_All_Designing = nullptr; - Marker_CfgFile_Plotting = nullptr; - Marker_All_Plotting = nullptr; - Marker_CfgFile_Analyze = nullptr; - Marker_All_Analyze = nullptr; - Marker_CfgFile_DV = nullptr; - Marker_All_DV = nullptr; - Marker_CfgFile_Moving = nullptr; - Marker_All_Moving = nullptr; - Marker_CfgFile_PerBound = nullptr; - Marker_All_PerBound = nullptr; - Marker_PerBound = nullptr; - Marker_CfgFile_Turbomachinery = nullptr; - Marker_All_Turbomachinery = nullptr; - Marker_CfgFile_TurbomachineryFlag = nullptr; - Marker_All_TurbomachineryFlag = nullptr; - Marker_CfgFile_MixingPlaneInterface = nullptr; - Marker_All_MixingPlaneInterface = nullptr; + + Marker_CfgFile_GeoEval = nullptr; Marker_All_GeoEval = nullptr; + Marker_CfgFile_Monitoring = nullptr; Marker_All_Monitoring = nullptr; + Marker_CfgFile_Designing = nullptr; Marker_All_Designing = nullptr; + Marker_CfgFile_Plotting = nullptr; Marker_All_Plotting = nullptr; + Marker_CfgFile_Analyze = nullptr; Marker_All_Analyze = nullptr; + Marker_CfgFile_DV = nullptr; Marker_All_DV = nullptr; + Marker_CfgFile_Moving = nullptr; Marker_All_Moving = nullptr; + Marker_CfgFile_PerBound = nullptr; Marker_All_PerBound = nullptr; Marker_PerBound = nullptr; + Marker_CfgFile_Turbomachinery = nullptr; Marker_All_Turbomachinery = nullptr; + Marker_CfgFile_TurbomachineryFlag = nullptr; Marker_All_TurbomachineryFlag = nullptr; + Marker_CfgFile_MixingPlaneInterface = nullptr; Marker_All_MixingPlaneInterface = nullptr; Marker_CfgFile_ZoneInterface = nullptr; - Marker_CfgFile_Deform_Mesh = nullptr; - Marker_All_Deform_Mesh = nullptr; - Marker_CfgFile_Deform_Mesh_Sym_Plane = nullptr; - Marker_All_Deform_Mesh_Sym_Plane = nullptr; - Marker_CfgFile_Fluid_Load = nullptr; - Marker_All_Fluid_Load = nullptr; - Marker_CfgFile_SobolevBC = nullptr; - Marker_All_SobolevBC = nullptr; - - Marker_CfgFile_Turbomachinery = nullptr; - Marker_All_Turbomachinery = nullptr; - Marker_CfgFile_TurbomachineryFlag = nullptr; - Marker_All_TurbomachineryFlag = nullptr; - Marker_CfgFile_MixingPlaneInterface = nullptr; - Marker_All_MixingPlaneInterface = nullptr; - - Marker_CfgFile_PyCustom = nullptr; - Marker_All_PyCustom = nullptr; - - Marker_DV = nullptr; - Marker_Moving = nullptr; - Marker_Monitoring = nullptr; - Marker_Designing = nullptr; - Marker_GeoEval = nullptr; - Marker_Plotting = nullptr; - Marker_Analyze = nullptr; - Marker_PyCustom = nullptr; - Marker_WallFunctions = nullptr; - Marker_CfgFile_KindBC = nullptr; - Marker_All_KindBC = nullptr; - Marker_SobolevBC = nullptr; - Marker_StrongBC = nullptr; - - Kind_WallFunctions = nullptr; - IntInfo_WallFunctions = nullptr; + Marker_CfgFile_Deform_Mesh = nullptr; Marker_All_Deform_Mesh = nullptr; + Marker_CfgFile_Deform_Mesh_Sym_Plane = nullptr; Marker_All_Deform_Mesh_Sym_Plane = nullptr; + Marker_CfgFile_Fluid_Load = nullptr; Marker_All_Fluid_Load = nullptr; + Marker_CfgFile_SobolevBC = nullptr; Marker_All_SobolevBC = nullptr; + + Marker_CfgFile_Turbomachinery = nullptr; Marker_All_Turbomachinery = nullptr; + Marker_CfgFile_TurbomachineryFlag = nullptr; Marker_All_TurbomachineryFlag = nullptr; + Marker_CfgFile_MixingPlaneInterface = nullptr; Marker_All_MixingPlaneInterface = nullptr; + + Marker_CfgFile_PyCustom = nullptr; Marker_All_PyCustom = nullptr; + + Marker_DV = nullptr; Marker_Moving = nullptr; Marker_Monitoring = nullptr; + Marker_Designing = nullptr; Marker_GeoEval = nullptr; Marker_Plotting = nullptr; + Marker_Analyze = nullptr; Marker_PyCustom = nullptr; Marker_WallFunctions = nullptr; + Marker_CfgFile_KindBC = nullptr; Marker_All_KindBC = nullptr; Marker_SobolevBC = nullptr; + Marker_StrongBC = nullptr; + + Kind_WallFunctions = nullptr; + IntInfo_WallFunctions = nullptr; DoubleInfo_WallFunctions = nullptr; Config_Filenames = nullptr; /*--- Marker Pointers ---*/ - Marker_Euler = nullptr; - Marker_FarField = nullptr; - Marker_Custom = nullptr; - Marker_SymWall = nullptr; - Marker_PerBound = nullptr; - Marker_PerDonor = nullptr; - Marker_NearFieldBound = nullptr; - Marker_Inlet_Turb = nullptr; - Marker_Deform_Mesh = nullptr; - Marker_Deform_Mesh_Sym_Plane = nullptr; - Marker_Fluid_Load = nullptr; - Marker_Inlet = nullptr; - Marker_Outlet = nullptr; - Marker_Inlet_Species = nullptr; - Marker_Supersonic_Inlet = nullptr; - Marker_Supersonic_Outlet = nullptr; - Marker_Smoluchowski_Maxwell = nullptr; - Marker_Isothermal = nullptr; - Marker_HeatFlux = nullptr; - Marker_EngineInflow = nullptr; - Marker_Load = nullptr; - Marker_Disp_Dir = nullptr; - Marker_RoughWall = nullptr; - Marker_EngineExhaust = nullptr; - Marker_Displacement = nullptr; - Marker_Load = nullptr; - Marker_Load_Dir = nullptr; - Marker_Clamped = nullptr; - Marker_Internal = nullptr; - Marker_All_TagBound = nullptr; - Marker_CfgFile_TagBound = nullptr; - Marker_All_KindBC = nullptr; - Marker_CfgFile_KindBC = nullptr; - Marker_All_SendRecv = nullptr; - Marker_All_PerBound = nullptr; - Marker_ZoneInterface = nullptr; - Marker_All_ZoneInterface = nullptr; - Marker_Riemann = nullptr; - Marker_Fluid_InterfaceBound = nullptr; - Marker_CHTInterface = nullptr; - Marker_Damper = nullptr; - Marker_Emissivity = nullptr; - Marker_HeatTransfer = nullptr; - - /*--- Boundary Condition settings ---*/ - - Isothermal_Temperature = nullptr; - HeatTransfer_Coeff = nullptr; - HeatTransfer_WallTemp = nullptr; - Heat_Flux = nullptr; - Displ_Value = nullptr; - Load_Value = nullptr; - Damper_Constant = nullptr; - Wall_Emissivity = nullptr; - Roughness_Height = nullptr; + Marker_Euler = nullptr; Marker_FarField = nullptr; Marker_Custom = nullptr; + Marker_SymWall = nullptr; Marker_PerBound = nullptr; + Marker_PerDonor = nullptr; Marker_NearFieldBound = nullptr; Marker_Inlet_Turb = nullptr; + Marker_Deform_Mesh = nullptr; Marker_Deform_Mesh_Sym_Plane= nullptr; Marker_Fluid_Load = nullptr; + Marker_Inlet = nullptr; Marker_Outlet = nullptr; Marker_Inlet_Species = nullptr; + Marker_Supersonic_Inlet = nullptr; Marker_Supersonic_Outlet = nullptr; Marker_Smoluchowski_Maxwell= nullptr; + Marker_Isothermal = nullptr; Marker_HeatFlux = nullptr; Marker_EngineInflow = nullptr; + Marker_Load = nullptr; Marker_Disp_Dir = nullptr; Marker_RoughWall = nullptr; + Marker_EngineExhaust = nullptr; Marker_Displacement = nullptr; Marker_Load = nullptr; + Marker_Load_Dir = nullptr; Marker_Clamped = nullptr; + Marker_Internal = nullptr; + Marker_All_TagBound = nullptr; Marker_CfgFile_TagBound = nullptr; Marker_All_KindBC = nullptr; + Marker_CfgFile_KindBC = nullptr; Marker_All_SendRecv = nullptr; Marker_All_PerBound = nullptr; + Marker_ZoneInterface = nullptr; Marker_All_ZoneInterface = nullptr; Marker_Riemann = nullptr; + Marker_Fluid_InterfaceBound = nullptr; Marker_CHTInterface = nullptr; Marker_Damper = nullptr; + Marker_Emissivity = nullptr; Marker_HeatTransfer = nullptr; + + /*--- Boundary Condition settings ---*/ + + Isothermal_Temperature = nullptr; HeatTransfer_Coeff = nullptr; HeatTransfer_WallTemp = nullptr; + Heat_Flux = nullptr; Displ_Value = nullptr; Load_Value = nullptr; + Damper_Constant = nullptr; Wall_Emissivity = nullptr; + Roughness_Height = nullptr; /*--- Inlet Outlet Boundary Condition settings ---*/ - Inlet_Ttotal = nullptr; - Inlet_Ptotal = nullptr; - Inlet_FlowDir = nullptr; - Inlet_Temperature = nullptr; - Inlet_Pressure = nullptr; - Inlet_Velocity = nullptr; - Outlet_Pressure = nullptr; - Inlet_SpeciesVal = nullptr; - Inlet_TurbVal = nullptr; + Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr; + Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr; + Inlet_Velocity = nullptr; + Outlet_Pressure = nullptr; Inlet_SpeciesVal = nullptr; Inlet_TurbVal = nullptr; /*--- Engine Boundary Condition settings ---*/ - Inflow_Pressure = nullptr; - Inflow_MassFlow = nullptr; - Inflow_ReverseMassFlow = nullptr; - Inflow_TotalPressure = nullptr; - Inflow_Temperature = nullptr; - Inflow_TotalTemperature = nullptr; - Inflow_RamDrag = nullptr; - Inflow_Force = nullptr; - Inflow_Power = nullptr; - Inflow_Mach = nullptr; - - Exhaust_Pressure = nullptr; - Exhaust_Temperature = nullptr; - Exhaust_MassFlow = nullptr; - Exhaust_TotalPressure = nullptr; - Exhaust_TotalTemperature = nullptr; - Exhaust_GrossThrust = nullptr; - Exhaust_Force = nullptr; - Exhaust_Power = nullptr; - Exhaust_Temperature_Target = nullptr; - Exhaust_Pressure_Target = nullptr; + Inflow_Pressure = nullptr; Inflow_MassFlow = nullptr; Inflow_ReverseMassFlow = nullptr; + Inflow_TotalPressure = nullptr; Inflow_Temperature = nullptr; Inflow_TotalTemperature = nullptr; + Inflow_RamDrag = nullptr; Inflow_Force = nullptr; Inflow_Power = nullptr; + Inflow_Mach = nullptr; - Engine_Mach = nullptr; - Engine_Force = nullptr; - Engine_Power = nullptr; - Engine_NetThrust = nullptr; - Engine_GrossThrust = nullptr; - Engine_Area = nullptr; - EngineInflow_Target = nullptr; - - Exhaust_Temperature_Target = nullptr; - Exhaust_Temperature = nullptr; - Exhaust_Pressure = nullptr; + Exhaust_Pressure = nullptr; Exhaust_Temperature = nullptr; Exhaust_MassFlow = nullptr; + Exhaust_TotalPressure = nullptr; Exhaust_TotalTemperature = nullptr; + Exhaust_GrossThrust = nullptr; Exhaust_Force = nullptr; + Exhaust_Power = nullptr; Exhaust_Temperature_Target = nullptr; Exhaust_Pressure_Target = nullptr; - Inlet_Ttotal = nullptr; - Inlet_Ptotal = nullptr; - Inlet_FlowDir = nullptr; - Inlet_Temperature = nullptr; - Inlet_Pressure = nullptr; - Inlet_Velocity = nullptr; - Inflow_Mach = nullptr; - Inflow_Pressure = nullptr; - Outlet_Pressure = nullptr; - Isothermal_Temperature = nullptr; - - ElasticityMod = nullptr; - PoissonRatio = nullptr; - MaterialDensity = nullptr; - - Load_Dir = nullptr; - Load_Dir_Value = nullptr; - Load_Dir_Multiplier = nullptr; - Disp_Dir = nullptr; - Disp_Dir_Value = nullptr; - Disp_Dir_Multiplier = nullptr; - Electric_Field_Mod = nullptr; - Electric_Field_Dir = nullptr; - RefNode_Displacement = nullptr; + + Engine_Mach = nullptr; Engine_Force = nullptr; + Engine_Power = nullptr; Engine_NetThrust = nullptr; Engine_GrossThrust = nullptr; + Engine_Area = nullptr; EngineInflow_Target = nullptr; + + Exhaust_Temperature_Target = nullptr; Exhaust_Temperature = nullptr; Exhaust_Pressure = nullptr; + Exhaust_Pressure_Target = nullptr; Inlet_Ttotal = nullptr; Inlet_Ptotal = nullptr; + Inlet_FlowDir = nullptr; Inlet_Temperature = nullptr; Inlet_Pressure = nullptr; + Inlet_Velocity = nullptr; Inflow_Mach = nullptr; Inflow_Pressure = nullptr; + Outlet_Pressure = nullptr; Isothermal_Temperature = nullptr; + + ElasticityMod = nullptr; PoissonRatio = nullptr; MaterialDensity = nullptr; + + Load_Dir = nullptr; Load_Dir_Value = nullptr; Load_Dir_Multiplier = nullptr; + Disp_Dir = nullptr; Disp_Dir_Value = nullptr; Disp_Dir_Multiplier = nullptr; + Electric_Field_Mod = nullptr; Electric_Field_Dir = nullptr; RefNode_Displacement = nullptr; Electric_Constant = nullptr; /*--- Actuator Disk Boundary Condition settings ---*/ - ActDiskInlet_Pressure = nullptr; - ActDiskInlet_TotalPressure = nullptr; - ActDiskInlet_Temperature = nullptr; - ActDiskInlet_TotalTemperature = nullptr; - ActDiskInlet_MassFlow = nullptr; - ActDiskInlet_RamDrag = nullptr; - ActDiskInlet_Force = nullptr; - ActDiskInlet_Power = nullptr; - - ActDiskOutlet_Pressure = nullptr; - ActDiskOutlet_TotalPressure = nullptr; - ActDiskOutlet_GrossThrust = nullptr; - ActDiskOutlet_Force = nullptr; - ActDiskOutlet_Power = nullptr; - ActDiskOutlet_Temperature = nullptr; - ActDiskOutlet_TotalTemperature = nullptr; - ActDiskOutlet_MassFlow = nullptr; - - ActDisk_DeltaPress = nullptr; - ActDisk_DeltaTemp = nullptr; - ActDisk_TotalPressRatio = nullptr; - ActDisk_TotalTempRatio = nullptr; - ActDisk_StaticPressRatio = nullptr; - ActDisk_StaticTempRatio = nullptr; - ActDisk_NetThrust = nullptr; - ActDisk_GrossThrust = nullptr; - ActDisk_Power = nullptr; - ActDisk_MassFlow = nullptr; - ActDisk_Area = nullptr; - ActDisk_ReverseMassFlow = nullptr; - Surface_MassFlow = nullptr; - Surface_Mach = nullptr; - Surface_Temperature = nullptr; - Surface_Pressure = nullptr; - Surface_Density = nullptr; - Surface_Enthalpy = nullptr; - Surface_NormalVelocity = nullptr; - Surface_TotalTemperature = nullptr; - Surface_TotalPressure = nullptr; - Surface_PressureDrop = nullptr; - Surface_DC60 = nullptr; - Surface_IDC = nullptr; - Surface_Species_Variance = nullptr; - Surface_Species_0 = nullptr; - - Outlet_MassFlow = nullptr; - Outlet_Density = nullptr; - Outlet_Area = nullptr; - - Surface_Uniformity = nullptr; - Surface_SecondaryStrength = nullptr; - Surface_SecondOverUniform = nullptr; + ActDiskInlet_Pressure = nullptr; ActDiskInlet_TotalPressure = nullptr; ActDiskInlet_Temperature = nullptr; + ActDiskInlet_TotalTemperature = nullptr; ActDiskInlet_MassFlow = nullptr; ActDiskInlet_RamDrag = nullptr; + ActDiskInlet_Force = nullptr; ActDiskInlet_Power = nullptr; + + ActDiskOutlet_Pressure = nullptr; + ActDiskOutlet_TotalPressure = nullptr; ActDiskOutlet_GrossThrust = nullptr; ActDiskOutlet_Force = nullptr; + ActDiskOutlet_Power = nullptr; ActDiskOutlet_Temperature = nullptr; ActDiskOutlet_TotalTemperature = nullptr; + ActDiskOutlet_MassFlow = nullptr; + + ActDisk_DeltaPress = nullptr; ActDisk_DeltaTemp = nullptr; + ActDisk_TotalPressRatio = nullptr; ActDisk_TotalTempRatio = nullptr; ActDisk_StaticPressRatio = nullptr; + ActDisk_StaticTempRatio = nullptr; ActDisk_NetThrust = nullptr; ActDisk_GrossThrust = nullptr; + ActDisk_Power = nullptr; ActDisk_MassFlow = nullptr; ActDisk_Area = nullptr; + ActDisk_ReverseMassFlow = nullptr; Surface_MassFlow = nullptr; Surface_Mach = nullptr; + Surface_Temperature = nullptr; Surface_Pressure = nullptr; Surface_Density = nullptr; Surface_Enthalpy = nullptr; + Surface_NormalVelocity = nullptr; Surface_TotalTemperature = nullptr; Surface_TotalPressure = nullptr; Surface_PressureDrop = nullptr; + Surface_DC60 = nullptr; Surface_IDC = nullptr; + Surface_Species_Variance = nullptr; Surface_Species_0 = nullptr; + + Outlet_MassFlow = nullptr; Outlet_Density = nullptr; Outlet_Area = nullptr; + + Surface_Uniformity = nullptr; Surface_SecondaryStrength = nullptr; Surface_SecondOverUniform = nullptr; Surface_MomentumDistortion = nullptr; - Surface_IDC_Mach = nullptr; - Surface_IDR = nullptr; - ActDisk_Mach = nullptr; - ActDisk_Force = nullptr; - ActDisk_BCThrust = nullptr; - ActDisk_BCThrust_Old = nullptr; + Surface_IDC_Mach = nullptr; Surface_IDR = nullptr; ActDisk_Mach = nullptr; + ActDisk_Force = nullptr; ActDisk_BCThrust = nullptr; ActDisk_BCThrust_Old = nullptr; /*--- Miscellaneous/unsorted ---*/ - Aeroelastic_plunge = nullptr; - Aeroelastic_pitch = nullptr; + Aeroelastic_plunge = nullptr; + Aeroelastic_pitch = nullptr; - CFL_AdaptParam = nullptr; - CFL = nullptr; - PlaneTag = nullptr; - ParamDV = nullptr; - DV_Value = nullptr; - Design_Variable = nullptr; + CFL_AdaptParam = nullptr; + CFL = nullptr; + PlaneTag = nullptr; + ParamDV = nullptr; + DV_Value = nullptr; + Design_Variable = nullptr; - TimeDOFsADER_DG = nullptr; - TimeIntegrationADER_DG = nullptr; + TimeDOFsADER_DG = nullptr; + TimeIntegrationADER_DG = nullptr; WeightsIntegrationADER_DG = nullptr; - RK_Alpha_Step = nullptr; - MG_CorrecSmooth = nullptr; - MG_PreSmooth = nullptr; - MG_PostSmooth = nullptr; - Int_Coeffs = nullptr; + RK_Alpha_Step = nullptr; + MG_CorrecSmooth = nullptr; + MG_PreSmooth = nullptr; + MG_PostSmooth = nullptr; + Int_Coeffs = nullptr; Kind_Inc_Inlet = nullptr; Kind_Inc_Outlet = nullptr; - Kind_ObjFunc = nullptr; + Kind_ObjFunc = nullptr; Weight_ObjFunc = nullptr; /*--- Species solver pointers. ---*/ - Species_Init = nullptr; - Species_Clipping_Min = nullptr; - Species_Clipping_Max = nullptr; + Species_Init = nullptr; + Species_Clipping_Min = nullptr; + Species_Clipping_Max = nullptr; /*--- Moving mesh pointers ---*/ nKind_SurfaceMovement = 0; Kind_SurfaceMovement = nullptr; - LocationStations = nullptr; - MarkerMotion_Origin = nullptr; - MarkerTranslation_Rate = nullptr; - MarkerRotation_Rate = nullptr; - MarkerPitching_Omega = nullptr; - MarkerPitching_Ampl = nullptr; - MarkerPitching_Phase = nullptr; - MarkerPlunging_Omega = nullptr; - MarkerPlunging_Ampl = nullptr; - RefOriginMoment_X = nullptr; - RefOriginMoment_Y = nullptr; - RefOriginMoment_Z = nullptr; - MoveMotion_Origin = nullptr; + LocationStations = nullptr; + MarkerMotion_Origin = nullptr; + MarkerTranslation_Rate = nullptr; + MarkerRotation_Rate = nullptr; + MarkerPitching_Omega = nullptr; + MarkerPitching_Ampl = nullptr; + MarkerPitching_Phase = nullptr; + MarkerPlunging_Omega = nullptr; + MarkerPlunging_Ampl = nullptr; + RefOriginMoment_X = nullptr; RefOriginMoment_Y = nullptr; RefOriginMoment_Z = nullptr; + MoveMotion_Origin = nullptr; /*--- Periodic BC pointers. ---*/ - Periodic_Translation = nullptr; - Periodic_RotAngles = nullptr; - Periodic_RotCenter = nullptr; + Periodic_Translation= nullptr; Periodic_RotAngles = nullptr; Periodic_RotCenter = nullptr; /* Harmonic Balance Frequency pointer */ @@ -1104,35 +998,35 @@ void CConfig::SetPointersNull() { /*--- Initialize some default arrays to NULL. ---*/ - Riemann_FlowDir = nullptr; - Giles_FlowDir = nullptr; - CoordFFDBox = nullptr; - DegreeFFDBox = nullptr; - FFDTag = nullptr; - nDV_Value = nullptr; - TagFFDBox = nullptr; - - Kind_Data_Riemann = nullptr; - Riemann_Var1 = nullptr; - Riemann_Var2 = nullptr; - Kind_Data_Giles = nullptr; - Giles_Var1 = nullptr; - Giles_Var2 = nullptr; - RelaxFactorAverage = nullptr; - RelaxFactorFourier = nullptr; - nSpan_iZones = nullptr; - Kind_TurboMachinery = nullptr; - - Marker_MixingPlaneInterface = nullptr; - Marker_TurboBoundIn = nullptr; - Marker_TurboBoundOut = nullptr; - Marker_Giles = nullptr; - Marker_Shroud = nullptr; - - nBlades = nullptr; - FreeStreamTurboNormal = nullptr; - - top_optim_kernels = nullptr; + Riemann_FlowDir = nullptr; + Giles_FlowDir = nullptr; + CoordFFDBox = nullptr; + DegreeFFDBox = nullptr; + FFDTag = nullptr; + nDV_Value = nullptr; + TagFFDBox = nullptr; + + Kind_Data_Riemann = nullptr; + Riemann_Var1 = nullptr; + Riemann_Var2 = nullptr; + Kind_Data_Giles = nullptr; + Giles_Var1 = nullptr; + Giles_Var2 = nullptr; + RelaxFactorAverage = nullptr; + RelaxFactorFourier = nullptr; + nSpan_iZones = nullptr; + Kind_TurboMachinery = nullptr; + + Marker_MixingPlaneInterface = nullptr; + Marker_TurboBoundIn = nullptr; + Marker_TurboBoundOut = nullptr; + Marker_Giles = nullptr; + Marker_Shroud = nullptr; + + nBlades = nullptr; + FreeStreamTurboNormal = nullptr; + + top_optim_kernels = nullptr; top_optim_kernel_params = nullptr; top_optim_filter_radius = nullptr; @@ -1145,10 +1039,10 @@ void CConfig::SetPointersNull() { /*--- Variable initialization ---*/ - TimeIter = 0; - InnerIter = 0; + TimeIter = 0; + InnerIter = 0; nIntCoeffs = 0; - OuterIter = 0; + OuterIter = 0; AoA_Offset = 0; AoS_Offset = 0; @@ -1171,9 +1065,11 @@ void CConfig::SetPointersNull() { Total_UnstTimeND = 0.0; Kind_TimeNumScheme = EULER_IMPLICIT; + } void CConfig::SetConfig_Options() { + // This config file is parsed by a number of programs to make it easy to write SU2 // wrapper scripts (in python, go, etc.) so please do // the best you can to follow the established format. It's very hard to parse c++ code @@ -1185,13 +1081,11 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Problem Definition \ingroup Config */ /*--- Options related to problem definition and partitioning ---*/ - /*!\brief SOLVER \n DESCRIPTION: Type of solver \n Options: see \link Solver_Map \endlink \n DEFAULT: NONE \ingroup - * Config*/ + /*!\brief SOLVER \n DESCRIPTION: Type of solver \n Options: see \link Solver_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("SOLVER", Kind_Solver, Solver_Map, MAIN_SOLVER::NONE); /*!\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: NONE \ingroup Config*/ + /*!\brief PHYSICAL_PROBLEM \n DESCRIPTION: Physical governing equations \n Options: see \link Solver_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("MULTIZONE_SOLVER", Kind_MZSolver, Multizone_Map, ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL); #ifdef CODI_REVERSE_TYPE const bool discAdjDefault = true; @@ -1199,50 +1093,37 @@ void CConfig::SetConfig_Options() { const bool discAdjDefault = false; #endif /*!\brief MATH_PROBLEM \n DESCRIPTION: Mathematical problem \n Options: DIRECT, ADJOINT \ingroup Config*/ - addMathProblemOption("MATH_PROBLEM", ContinuousAdjoint, false, DiscreteAdjoint, discAdjDefault, Restart_Flow, - discAdjDefault); - /*!\brief KIND_TURB_MODEL \n DESCRIPTION: Specify turbulence model \n Options: see \link Turb_Model_Map \endlink \n - * DEFAULT: NONE \ingroup Config*/ + addMathProblemOption("MATH_PROBLEM", ContinuousAdjoint, false, DiscreteAdjoint, discAdjDefault, Restart_Flow, discAdjDefault); + /*!\brief KIND_TURB_MODEL \n DESCRIPTION: Specify turbulence model \n Options: see \link Turb_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_TURB_MODEL", Kind_Turb_Model, Turb_Model_Map, TURB_MODEL::NONE); - /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SST turbulence model options/corrections. \n Options: see \link - * SST_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SST turbulence model options/corrections. \n Options: see \link SST_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SST_OPTIONS", nSST_Options, SST_Options, SST_Options_Map); - /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link - * SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map); - /*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n - * DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE); - /*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link - * LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("LM_OPTIONS", nLM_Options, LM_Options, LM_Options_Map); /*!\brief HROUGHNESS \n DESCRIPTION: Value of RMS roughness for transition model \n DEFAULT: 1E-6 \ingroup Config*/ addDoubleOption("HROUGHNESS", hRoughness, 1e-6); - /*!\brief KIND_SCALAR_MODEL \n DESCRIPTION: Specify scalar transport model \n Options: see \link Scalar_Model_Map - * \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_SCALAR_MODEL \n DESCRIPTION: Specify scalar transport model \n Options: see \link Scalar_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_SCALAR_MODEL", Kind_Species_Model, Species_Model_Map, SPECIES_MODEL::NONE); - /*!\brief KIND_SGS_MODEL \n DESCRIPTION: Specify subgrid scale model OPTIONS: see \link SGS_Model_Map \endlink \n - * DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_SGS_MODEL \n DESCRIPTION: Specify subgrid scale model OPTIONS: see \link SGS_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_SGS_MODEL", Kind_SGS_Model, SGS_Model_Map, TURB_SGS_MODEL::NONE); - /*!\brief KIND_FEM_DG_SHOCK \n DESCRIPTION: Specify shock capturing method for DG OPTIONS: see \link - * ShockCapturingDG_Map \endlink \n DEFAULT: NONE \ingroup Config*/ + /*!\brief KIND_FEM_DG_SHOCK \n DESCRIPTION: Specify shock capturing method for DG OPTIONS: see \link ShockCapturingDG_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_FEM_DG_SHOCK", Kind_FEM_Shock_Capturing_DG, ShockCapturingDG_Map, FEM_SHOCK_CAPTURING_DG::NONE); - /*!\brief KIND_VERIFICATION_SOLUTION \n DESCRIPTION: Specify the verification solution OPTIONS: see \link - * Verification_Solution_Map \endlink \n DEFAULT: NO_VERIFICATION_SOLUTION \ingroup Config*/ - addEnumOption("KIND_VERIFICATION_SOLUTION", Kind_Verification_Solution, Verification_Solution_Map, - VERIFICATION_SOLUTION::NONE); + /*!\brief KIND_VERIFICATION_SOLUTION \n DESCRIPTION: Specify the verification solution OPTIONS: see \link Verification_Solution_Map \endlink \n DEFAULT: NO_VERIFICATION_SOLUTION \ingroup Config*/ + addEnumOption("KIND_VERIFICATION_SOLUTION", Kind_Verification_Solution, Verification_Solution_Map, VERIFICATION_SOLUTION::NONE); - /*!\brief KIND_MATRIX_COLORING \n DESCRIPTION: Specify the method for matrix coloring for Jacobian computations - * OPTIONS: see \link MatrixColoring_Map \endlink \n DEFAULT GREEDY_COLORING \ingroup Config*/ + /*!\brief KIND_MATRIX_COLORING \n DESCRIPTION: Specify the method for matrix coloring for Jacobian computations OPTIONS: see \link MatrixColoring_Map \endlink \n DEFAULT GREEDY_COLORING \ingroup Config*/ addEnumOption("KIND_MATRIX_COLORING", Kind_Matrix_Coloring, MatrixColoring_Map, GREEDY_COLORING); - /*!\brief WEAKLY_COUPLED_HEAT_EQUATION \n DESCRIPTION: Enable heat equation for incompressible flows. \ingroup - * Config*/ + /*!\brief WEAKLY_COUPLED_HEAT_EQUATION \n DESCRIPTION: Enable heat equation for incompressible flows. \ingroup Config*/ addBoolOption("WEAKLY_COUPLED_HEAT_EQUATION", Weakly_Coupled_Heat, NO); /*\brief AXISYMMETRIC \n DESCRIPTION: Axisymmetric simulation \n DEFAULT: false \ingroup Config */ @@ -1253,61 +1134,46 @@ void CConfig::SetConfig_Options() { addBoolOption("VORTICITY_CONFINEMENT", VorticityConfinement, false); /* DESCRIPTION: Apply a body force as a source term (NO, YES) */ addBoolOption("BODY_FORCE", Body_Force, false); - body_force[0] = 0.0; - body_force[1] = 0.0; - body_force[2] = 0.0; + body_force[0] = 0.0; body_force[1] = 0.0; body_force[2] = 0.0; /* DESCRIPTION: Vector of body force values (BodyForce_X, BodyForce_Y, BodyForce_Z) */ 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, - ENUM_STREAMWISE_PERIODIC::NONE); + /* 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, 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 */ + /* 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 */ addDoubleOption("STREAMWISE_PERIODIC_OUTLET_HEAT", Streamwise_Periodic_OutletHeat, 0.0); - /* DESCRIPTION: Delta pressure [Pa] on which basis body force will be computed, serves as initial value if MASSFLOW is - * chosen. \n DEFAULT: 1.0 \ingroup Config */ + /* DESCRIPTION: Delta pressure [Pa] on which basis body force will be computed, serves as initial value if MASSFLOW is chosen. \n DEFAULT: 1.0 \ingroup Config */ addDoubleOption("STREAMWISE_PERIODIC_PRESSURE_DROP", Streamwise_Periodic_PressureDrop, 1.0); - /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. \n DEFAULT: 0.0 \ingroup Config */ + /* DESCRIPTION: Target Massflow [kg/s], Delta P will be adapted until m_dot is met. \n DEFAULT: 0.0 \ingroup Config */ addDoubleOption("STREAMWISE_PERIODIC_MASSFLOW", Streamwise_Periodic_TargetMassFlow, 0.0); - /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config - */ + /*!\brief RESTART_SOL \n DESCRIPTION: Restart solution from native solution file \n Options: NO, YES \ingroup Config */ addBoolOption("RESTART_SOL", Restart, false); /*!\brief BINARY_RESTART \n DESCRIPTION: Read binary SU2 native restart files. \n Options: YES, NO \ingroup Config */ addBoolOption("READ_BINARY_RESTART", Read_Binary_Restart, true); - /*!\brief WRT_RESTART_OVERWRITE \n DESCRIPTION: overwrite restart files or append iteration number. \n Options: YES, - * NO \ingroup Config */ + /*!\brief WRT_RESTART_OVERWRITE \n DESCRIPTION: overwrite restart files or append iteration number. \n Options: YES, NO \ingroup Config */ addBoolOption("WRT_RESTART_OVERWRITE", Wrt_Restart_Overwrite, true); - /*!\brief WRT_SURFACE_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: - * YES, NO \ingroup Config */ + /*!\brief WRT_SURFACE_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: YES, NO \ingroup Config */ addBoolOption("WRT_SURFACE_OVERWRITE", Wrt_Surface_Overwrite, true); - /*!\brief WRT_VOLUME_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: - * YES, NO \ingroup Config */ + /*!\brief WRT_VOLUME_OVERWRITE \n DESCRIPTION: overwrite visualisation files or append iteration number. \n Options: YES, NO \ingroup Config */ addBoolOption("WRT_VOLUME_OVERWRITE", Wrt_Volume_Overwrite, true); - /*!\brief SYSTEM_MEASUREMENTS \n DESCRIPTION: System of measurements \n OPTIONS: see \link Measurements_Map \endlink - * \n DEFAULT: SI \ingroup Config*/ + /*!\brief SYSTEM_MEASUREMENTS \n DESCRIPTION: System of measurements \n OPTIONS: see \link Measurements_Map \endlink \n DEFAULT: SI \ingroup Config*/ addEnumOption("SYSTEM_MEASUREMENTS", SystemMeasurements, Measurements_Map, SI); /*!\par CONFIG_CATEGORY: FluidModel \ingroup Config*/ - /*!\brief FLUID_MODEL \n DESCRIPTION: Fluid model \n OPTIONS: See \link FluidModel_Map \endlink \n DEFAULT: - * STANDARD_AIR \ingroup Config*/ + /*!\brief FLUID_MODEL \n DESCRIPTION: Fluid model \n OPTIONS: See \link FluidModel_Map \endlink \n DEFAULT: STANDARD_AIR \ingroup Config*/ addEnumOption("FLUID_MODEL", Kind_FluidModel, FluidModel_Map, STANDARD_AIR); - /*!\brief FLUID_NAME \n DESCRIPTION: Fluid name \n OPTIONS: see coolprop homepage \n DEFAULT: nitrogen \ingroup - * Config*/ + /*!\brief FLUID_NAME \n DESCRIPTION: Fluid name \n OPTIONS: see coolprop homepage \n DEFAULT: nitrogen \ingroup Config*/ addStringOption("FLUID_NAME", FluidName, string("nitrogen")); /*!\par CONFIG_CATEGORY: Data-driven fluid model parameters \ingroup Config*/ - /*!\brief INTERPOLATION_METHOD \n DESCRIPTION: Interpolation method used to determine the thermodynamic state of the - * fluid. \n OPTIONS: See \link DataDrivenMethod_Map \endlink DEFAULT: MLP \ingroup Config*/ - addEnumOption("INTERPOLATION_METHOD", Kind_DataDriven_Method, DataDrivenMethod_Map, ENUM_DATADRIVEN_METHOD::LUT); + /*!\brief INTERPOLATION_METHOD \n DESCRIPTION: Interpolation method used to determine the thermodynamic state of the fluid. \n OPTIONS: See \link DataDrivenMethod_Map \endlink DEFAULT: MLP \ingroup Config*/ + addEnumOption("INTERPOLATION_METHOD",Kind_DataDriven_Method, DataDrivenMethod_Map, ENUM_DATADRIVEN_METHOD::LUT); /*!\brief FILENAME_INTERPOLATOR \n DESCRIPTION: Input file for the interpolation method. \n \ingroup Config*/ addStringListOption("FILENAMES_INTERPOLATOR", n_Datadriven_files, DataDriven_Method_FileNames); - /*!\brief DATADRIVEN_NEWTON_RELAXATION \n DESCRIPTION: Relaxation factor for Newton solvers in data-driven fluid - * model. \n \ingroup Config*/ + /*!\brief DATADRIVEN_NEWTON_RELAXATION \n DESCRIPTION: Relaxation factor for Newton solvers in data-driven fluid model. \n \ingroup Config*/ addDoubleOption("DATADRIVEN_NEWTON_RELAXATION", DataDriven_Relaxation_Factor, 0.05); /*!\brief CONFINEMENT_PARAM \n DESCRIPTION: Input Confinement Parameter for Vorticity Confinement*/ @@ -1316,23 +1182,17 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Freestream Conditions \ingroup Config*/ /*--- Options related to freestream specification ---*/ - /*!\brief GAS_CONSTANT \n DESCRIPTION: Specific gas constant (287.058 J/kg*K (air), only for compressible flows) - * \ingroup Config*/ + /*!\brief GAS_CONSTANT \n DESCRIPTION: Specific gas constant (287.058 J/kg*K (air), only for compressible flows) \ingroup Config*/ addDoubleOption("GAS_CONSTANT", Gas_Constant, 287.058); - /*!\brief GAMMA_VALUE \n DESCRIPTION: Ratio of specific heats (1.4 (air), only for compressible flows) \ingroup - * Config*/ + /*!\brief GAMMA_VALUE \n DESCRIPTION: Ratio of specific heats (1.4 (air), only for compressible flows) \ingroup Config*/ addDoubleOption("GAMMA_VALUE", Gamma, 1.4); - /*!\brief THERMODYNAMIC_PRESSURE \n DESCRIPTION: Thermodynamics(operating) Pressure (101325 Pa), only for - * incompressible flows) \ingroup Config*/ + /*!\brief THERMODYNAMIC_PRESSURE \n DESCRIPTION: Thermodynamics(operating) Pressure (101325 Pa), only for incompressible flows) \ingroup Config*/ addDoubleOption("THERMODYNAMIC_PRESSURE", Pressure_Thermodynamic, 101325.0); - /*!\brief CP_VALUE \n DESCRIPTION: Specific heat at constant pressure, Cp (1004.703 J/kg*K (air), constant density - * incompressible fluids only) \ingroup Config*/ + /*!\brief CP_VALUE \n DESCRIPTION: Specific heat at constant pressure, Cp (1004.703 J/kg*K (air), constant density incompressible fluids only) \ingroup Config*/ addDoubleListOption("SPECIFIC_HEAT_CP", nSpecific_Heat_Cp, Specific_Heat_Cp); - /*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for - * Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/ + /*!\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/ addDoubleOption("THERMAL_EXPANSION_COEFF", Thermal_Expansion_Coeff, 0.00347); - /*!\brief MOLECULAR_WEIGHT \n DESCRIPTION: Molecular weight for an incompressible ideal gas (28.96 g/mol (air) - * default) \ingroup Config*/ + /*!\brief MOLECULAR_WEIGHT \n DESCRIPTION: Molecular weight for an incompressible ideal gas (28.96 g/mol (air) default) \ingroup Config*/ addDoubleListOption("MOLECULAR_WEIGHT", nMolecular_Weight, Molecular_Weight); ///* DESCRIPTION: Specify if Mutation++ library is used */ @@ -1345,8 +1205,7 @@ void CConfig::SetConfig_Options() { addDoubleListOption("GAS_COMPOSITION", nSpecies, Gas_Composition); /* DESCRIPTION: Specify mass fraction of each species for NEMO inlet*/ addDoubleListOption("INLET_GAS_COMPOSITION", nSpecies_inlet, Inlet_MassFrac); - /*!\brief INLET_TEMPERATURE_VE \n DESCRIPTION: NEMO inlet temperature_ve (K), if left 0 K, set to Ttr value \ingroup - * Config*/ + /*!\brief INLET_TEMPERATURE_VE \n DESCRIPTION: NEMO inlet temperature_ve (K), if left 0 K, set to Ttr value \ingroup Config*/ addDoubleOption("INLET_TEMPERATURE_VE", Inlet_Temperature_ve, 0.0); /* DESCRIPTION: Specify if mixture is frozen */ addBoolOption("FROZEN_MIXTURE", frozen, false); @@ -1362,8 +1221,7 @@ void CConfig::SetConfig_Options() { addDoubleListOption("SUPERCATALYTIC_WALL_COMPOSITION", nSpecies_Cat_Wall, Supercatalytic_Wall_Composition); /* DESCRIPTION: Specfify catalytic efficiency of wall if using gamma model */ addDoubleOption("CATALYTIC_EFFICIENCY", CatalyticEfficiency, 1.0); - /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients - * \ingroup Config*/ + /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/ /*--- Options related to VAN der WAALS MODEL and PENG ROBINSON ---*/ @@ -1376,11 +1234,10 @@ void CConfig::SetConfig_Options() { /*--- Options related to VAN der WAALS MODEL and PENG ROBINSON ---*/ /* DESCRIPTION: Critical Density, default value for MDM */ - addDoubleOption("ACENTRIC_FACTOR", Acentric_Factor, 0.035); + addDoubleOption("ACENTRIC_FACTOR", Acentric_Factor, 0.035); - /*--- Options related to Viscosity Model ---*/ - /*!\brief VISCOSITY_MODEL \n DESCRIPTION: model of the viscosity \n OPTIONS: See \link ViscosityModel_Map \endlink \n - * DEFAULT: SUTHERLAND \ingroup Config*/ + /*--- Options related to Viscosity Model ---*/ + /*!\brief VISCOSITY_MODEL \n DESCRIPTION: model of the viscosity \n OPTIONS: See \link ViscosityModel_Map \endlink \n DEFAULT: SUTHERLAND \ingroup Config*/ addEnumOption("VISCOSITY_MODEL", Kind_ViscosityModel, ViscosityModel_Map, VISCOSITYMODEL::SUTHERLAND); /*--- Options related to Constant Viscosity Model ---*/ @@ -1398,24 +1255,20 @@ void CConfig::SetConfig_Options() { addDoubleListOption("SUTHERLAND_CONSTANT", nMu_S, Mu_S); /*--- Options related to Viscosity Model ---*/ - /*!\brief MIXINGVISCOSITY_MODEL \n DESCRIPTION: Mixing model of the viscosity \n OPTIONS: See \link ViscosityModel_Map - * \endlink \n DEFAULT: DAVIDSON \ingroup Config*/ - addEnumOption("MIXING_VISCOSITY_MODEL", Kind_MixingViscosityModel, MixingViscosityModel_Map, - MIXINGVISCOSITYMODEL::DAVIDSON); + /*!\brief MIXINGVISCOSITY_MODEL \n DESCRIPTION: Mixing model of the viscosity \n OPTIONS: See \link ViscosityModel_Map \endlink \n DEFAULT: DAVIDSON \ingroup Config*/ + addEnumOption("MIXING_VISCOSITY_MODEL", Kind_MixingViscosityModel, MixingViscosityModel_Map, MIXINGVISCOSITYMODEL::DAVIDSON); /*--- Options related to Thermal Conductivity Model ---*/ - addEnumOption("CONDUCTIVITY_MODEL", Kind_ConductivityModel, ConductivityModel_Map, - CONDUCTIVITYMODEL::CONSTANT_PRANDTL); + addEnumOption("CONDUCTIVITY_MODEL", Kind_ConductivityModel, ConductivityModel_Map, CONDUCTIVITYMODEL::CONSTANT_PRANDTL); /* DESCRIPTION: Definition of the turbulent thermal conductivity model (CONSTANT_PRANDTL_TURB (default), NONE). */ - addEnumOption("TURBULENT_CONDUCTIVITY_MODEL", Kind_ConductivityModel_Turb, TurbConductivityModel_Map, - CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL); + addEnumOption("TURBULENT_CONDUCTIVITY_MODEL", Kind_ConductivityModel_Turb, TurbConductivityModel_Map, CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL); - /*--- Options related to Constant Thermal Conductivity Model ---*/ + /*--- Options related to Constant Thermal Conductivity Model ---*/ - /* DESCRIPTION: default value for AIR */ - addDoubleListOption("THERMAL_CONDUCTIVITY_CONSTANT", nThermal_Conductivity_Constant, Thermal_Conductivity_Constant); + /* DESCRIPTION: default value for AIR */ + addDoubleListOption("THERMAL_CONDUCTIVITY_CONSTANT", nThermal_Conductivity_Constant , Thermal_Conductivity_Constant); /*--- Options related to temperature polynomial coefficients for fluid models. ---*/ @@ -1426,31 +1279,24 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Definition of the temperature polynomial coefficients for specific heat Cp. */ addDoubleArrayOption("KT_POLYCOEFFS", N_POLY_COEFFS, kt_polycoeffs.data()); - /*!\brief REYNOLDS_NUMBER \n DESCRIPTION: Reynolds number (non-dimensional, based on the free-stream values). Needed - * for viscous solvers. For incompressible solvers the Reynolds length will always be 1.0 \n DEFAULT: 0.0 \ingroup - * Config */ + /*!\brief REYNOLDS_NUMBER \n DESCRIPTION: Reynolds number (non-dimensional, based on the free-stream values). Needed for viscous solvers. For incompressible solvers the Reynolds length will always be 1.0 \n DEFAULT: 0.0 \ingroup Config */ addDoubleOption("REYNOLDS_NUMBER", Reynolds, 0.0); - /*!\brief REYNOLDS_LENGTH \n DESCRIPTION: Reynolds length (1 m by default). Used for compressible solver: - * incompressible solver will use 1.0. \ingroup Config */ + /*!\brief REYNOLDS_LENGTH \n DESCRIPTION: Reynolds length (1 m by default). Used for compressible solver: incompressible solver will use 1.0. \ingroup Config */ addDoubleOption("REYNOLDS_LENGTH", Length_Reynolds, 1.0); - /*!\brief PRANDTL_LAM \n DESCRIPTION: Laminar Prandtl number (0.72 (air), only for compressible flows) \n DEFAULT: - * 0.72 \ingroup Config*/ - addDoubleListOption("PRANDTL_LAM", nPrandtl_Lam, Prandtl_Lam); - /*!\brief PRANDTL_TURB \n DESCRIPTION: Turbulent Prandtl number (0.9 (air), only for compressible flows) \n DEFAULT - * 0.90 \ingroup Config*/ - addDoubleListOption("PRANDTL_TURB", nPrandtl_Turb, Prandtl_Turb); + /*!\brief PRANDTL_LAM \n DESCRIPTION: Laminar Prandtl number (0.72 (air), only for compressible flows) \n DEFAULT: 0.72 \ingroup Config*/ + addDoubleListOption("PRANDTL_LAM", nPrandtl_Lam , Prandtl_Lam); + /*!\brief PRANDTL_TURB \n DESCRIPTION: Turbulent Prandtl number (0.9 (air), only for compressible flows) \n DEFAULT 0.90 \ingroup Config*/ + addDoubleListOption("PRANDTL_TURB", nPrandtl_Turb , Prandtl_Turb); /*--- Options related to wall models. ---*/ - /*!\brief WALLMODEL_KAPPA \n DESCRIPTION: von Karman constant used for the wall model \n DEFAULT 0.41 \ingroup - * Config*/ + /*!\brief WALLMODEL_KAPPA \n DESCRIPTION: von Karman constant used for the wall model \n DEFAULT 0.41 \ingroup Config*/ addDoubleOption("WALLMODEL_KAPPA", wallModel_Kappa, 0.41); /*!\brief WALLMODEL_MAXITER \n DESCRIPTION: Max iterations used for the wall model \n DEFAULT 200 \ingroup Config*/ addUnsignedShortOption("WALLMODEL_MAXITER", wallModel_MaxIter, 200); /*!\brief WALLMODEL_RELFAC \n DESCRIPTION: Relaxation factor used for the wall model \n DEFAULT 0.5 \ingroup Config*/ addDoubleOption("WALLMODEL_RELFAC", wallModel_RelFac, 0.5); - /*!\brief WALLMODEL_MINYPLUS \n DESCRIPTION: lower limit for Y+ used for the wall model \n DEFAULT 5.0 \ingroup - * Config*/ + /*!\brief WALLMODEL_MINYPLUS \n DESCRIPTION: lower limit for Y+ used for the wall model \n DEFAULT 5.0 \ingroup Config*/ addDoubleOption("WALLMODEL_MINYPLUS", wallModel_MinYplus, 5.0); /*!\brief WALLMODEL_B \n DESCRIPTION: constant B used for the wall model \n DEFAULT 5.5 \ingroup Config*/ addDoubleOption("WALLMODEL_B", wallModel_B, 5.5); @@ -1459,70 +1305,55 @@ void CConfig::SetConfig_Options() { addDoubleOption("BULK_MODULUS", Bulk_Modulus, 1.42E5); /* DESCRIPTION: Epsilon^2 multipier in Beta calculation for incompressible preconditioner. */ addDoubleOption("BETA_FACTOR", Beta_Factor, 4.1); - /*!\brief MACH_NUMBER \n DESCRIPTION: Mach number (non-dimensional, based on the free-stream values). 0.0 by default - * \ingroup Config*/ + /*!\brief MACH_NUMBER \n DESCRIPTION: Mach number (non-dimensional, based on the free-stream values). 0.0 by default \ingroup Config*/ addDoubleOption("MACH_NUMBER", Mach, 0.0); - /*!\brief INIT_OPTION \n DESCRIPTION: Init option to choose between Reynolds or thermodynamics quantities for - * initializing the solution \n OPTIONS: see \link InitOption_Map \endlink \n DEFAULT REYNOLDS \ingroup Config*/ + /*!\brief INIT_OPTION \n DESCRIPTION: Init option to choose between Reynolds or thermodynamics quantities for initializing the solution \n OPTIONS: see \link InitOption_Map \endlink \n DEFAULT REYNOLDS \ingroup Config*/ addEnumOption("INIT_OPTION", Kind_InitOption, InitOption_Map, REYNOLDS); /* DESCRIPTION: Free-stream option to choose between density and temperature for initializing the solution */ addEnumOption("FREESTREAM_OPTION", Kind_FreeStreamOption, FreeStreamOption_Map, FREESTREAM_OPTION::TEMPERATURE_FS); /*!\brief FREESTREAM_PRESSURE\n DESCRIPTION: Free-stream pressure (101325.0 N/m^2 by default) \ingroup Config*/ addDoubleOption("FREESTREAM_PRESSURE", Pressure_FreeStream, 101325.0); - /*!\brief FREESTREAM_DENSITY\n DESCRIPTION: Free-stream density (1.2886 Kg/m^3 (air), 998.2 Kg/m^3 (water)) \n DEFAULT - * -1.0 (calculated from others) \ingroup Config*/ + /*!\brief FREESTREAM_DENSITY\n DESCRIPTION: Free-stream density (1.2886 Kg/m^3 (air), 998.2 Kg/m^3 (water)) \n DEFAULT -1.0 (calculated from others) \ingroup Config*/ addDoubleOption("FREESTREAM_DENSITY", Density_FreeStream, -1.0); /*!\brief FREESTREAM_TEMPERATURE\n DESCRIPTION: Free-stream temperature (288.15 K by default) \ingroup Config*/ addDoubleOption("FREESTREAM_TEMPERATURE", Temperature_FreeStream, 288.15); - /*!\brief FREESTREAM_TEMPERATURE_VE\n DESCRIPTION: Free-stream vibrational-electronic temperature (288.15 K by - * default) \ingroup Config*/ + /*!\brief FREESTREAM_TEMPERATURE_VE\n DESCRIPTION: Free-stream vibrational-electronic temperature (288.15 K by default) \ingroup Config*/ addDoubleOption("FREESTREAM_TEMPERATURE_VE", Temperature_ve_FreeStream, 288.15); + /*--- 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, INC_DENSITYMODEL::CONSTANT); - /*!\brief ENERGY_EQUATION \n DESCRIPTION: Solve the energy equation in the incompressible flow solver. \ingroup - * Config*/ + /*!\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*/ addDoubleOption("INC_DENSITY_REF", Inc_Density_Ref, 1.0); - /*!\brief INC_VELOCITY_REF \n DESCRIPTION: Reference velocity for incompressible flows (1.0 by default) \ingroup - * Config*/ + /*!\brief INC_VELOCITY_REF \n DESCRIPTION: Reference velocity for incompressible flows (1.0 by default) \ingroup Config*/ addDoubleOption("INC_VELOCITY_REF", Inc_Velocity_Ref, 1.0); - /*!\brief INC_TEMPERATURE_REF \n DESCRIPTION: Reference temperature for incompressible flows with the energy equation - * (1.0 by default) \ingroup Config*/ + /*!\brief INC_TEMPERATURE_REF \n DESCRIPTION: Reference temperature for incompressible flows with the energy equation (1.0 by default) \ingroup Config*/ addDoubleOption("INC_TEMPERATURE_REF", Inc_Temperature_Ref, 1.0); - /*!\brief INC_DENSITY_INIT \n DESCRIPTION: Initial density for incompressible flows (1.2886 kg/m^3 by default) - * \ingroup Config*/ + /*!\brief INC_DENSITY_INIT \n DESCRIPTION: Initial density for incompressible flows (1.2886 kg/m^3 by default) \ingroup Config*/ addDoubleOption("INC_DENSITY_INIT", Inc_Density_Init, 1.2886); - /*!\brief INC_VELOCITY_INIT \n DESCRIPTION: Initial velocity for incompressible flows (1.0,0,0 m/s by default) - * \ingroup Config*/ - vel_init[0] = 1.0; - vel_init[1] = 0.0; - vel_init[2] = 0.0; + /*!\brief INC_VELOCITY_INIT \n DESCRIPTION: Initial velocity for incompressible flows (1.0,0,0 m/s by default) \ingroup Config*/ + vel_init[0] = 1.0; vel_init[1] = 0.0; vel_init[2] = 0.0; addDoubleArrayOption("INC_VELOCITY_INIT", 3, vel_init); - /*!\brief INC_TEMPERATURE_INIT \n DESCRIPTION: Initial temperature for incompressible flows with the energy equation - * (288.15 K by default) \ingroup Config*/ + /*!\brief INC_TEMPERATURE_INIT \n DESCRIPTION: Initial temperature for incompressible flows with the energy equation (288.15 K by default) \ingroup Config*/ addDoubleOption("INC_TEMPERATURE_INIT", Inc_Temperature_Init, 288.15); /*!\brief INC_NONDIM \n DESCRIPTION: Non-dimensionalization scheme for incompressible flows. \ingroup Config*/ addEnumOption("INC_NONDIM", Ref_Inc_NonDim, NonDim_Map, INITIAL_VALUES); - /*!\brief INC_INLET_USENORMAL \n DESCRIPTION: Use the local boundary normal for the flow direction with the - * incompressible pressure inlet. \ingroup Config*/ + /*!\brief INC_INLET_USENORMAL \n DESCRIPTION: Use the local boundary normal for the flow direction with the incompressible pressure inlet. \ingroup Config*/ addBoolOption("INC_INLET_USENORMAL", Inc_Inlet_UseNormal, false); - /*!\brief INC_INLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the velocity at a - * pressure inlet in incompressible flow (0.1 by default). \ingroup Config*/ + /*!\brief INC_INLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the velocity at a pressure inlet in incompressible flow (0.1 by default). \ingroup Config*/ addDoubleOption("INC_INLET_DAMPING", Inc_Inlet_Damping, 0.1); - /*!\brief INC_OUTLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the pressure at a mass - * flow outlet in incompressible flow (0.1 by default). \ingroup Config*/ + /*!\brief INC_OUTLET_DAMPING \n DESCRIPTION: Damping factor applied to the iterative updates to the pressure at a mass flow outlet in incompressible flow (0.1 by default). \ingroup Config*/ addDoubleOption("INC_OUTLET_DAMPING", Inc_Outlet_Damping, 0.1); /*--- Options related to the species solver. ---*/ /*!\brief SPECIES_INIT \n DESCRIPTION: Initial values for scalar transport \ingroup Config*/ addDoubleListOption("SPECIES_INIT", nSpecies_Init, Species_Init); - /*!\brief SPECIES_CLIPPING \n DESCRIPTION: Activate clipping for scalar transport equations \n DEFAULT: false \ingroup - * Config*/ + /*!\brief SPECIES_CLIPPING \n DESCRIPTION: Activate clipping for scalar transport equations \n DEFAULT: false \ingroup Config*/ addBoolOption("SPECIES_CLIPPING", Species_Clipping, false); /*!\brief SPECIES_CLIPPING_MAX \n DESCRIPTION: Maximum values for scalar clipping \ingroup Config*/ addDoubleListOption("SPECIES_CLIPPING_MAX", nSpecies_Clipping_Max, Species_Clipping_Max); @@ -1531,38 +1362,27 @@ void CConfig::SetConfig_Options() { /*!\brief FLAME_INIT \n DESCRIPTION: flame initialization using the flamelet model \ingroup Config*/ /*--- flame offset (x,y,z) ---*/ - flame_init[0] = 0.0; - flame_init[1] = 0.0; - flame_init[2] = 0.0; + flame_init[0] = 0.0; flame_init[1] = 0.0; flame_init[2] = 0.0; /*--- flame normal (nx, ny, nz) ---*/ - flame_init[3] = 1.0; - flame_init[4] = 0.0; - flame_init[5] = 0.0; + flame_init[3] = 1.0; flame_init[4] = 0.0; flame_init[5] = 0.0; /*--- flame thickness (x) and flame burnt thickness (after this thickness, we have unburnt conditions again) ---*/ - flame_init[6] = 0.5e-3; - flame_init[7] = 1.0; - addDoubleArrayOption("FLAME_INIT", 8, flame_init); + flame_init[6] = 0.5e-3; flame_init[7] = 1.0; + addDoubleArrayOption("FLAME_INIT", 8,flame_init); /*--- Options related to mass diffusivity and thereby the species solver. ---*/ /*!\brief DIFFUSIVITY_MODEL\n DESCRIPTION: mass diffusivity model \n DEFAULT constant disffusivity \ingroup Config*/ - addEnumOption("DIFFUSIVITY_MODEL", Kind_Diffusivity_Model, Diffusivity_Model_Map, - DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY); - /*!\brief DIFFUSIVITY_CONSTANT\n DESCRIPTION: mass diffusivity if DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY is chosen \n - * DEFAULT 0.001 (Air) \ingroup Config*/ - addDoubleOption("DIFFUSIVITY_CONSTANT", Diffusivity_Constant, 0.001); - /*!\brief SCHMIDT_LAM \n DESCRIPTION: Laminar Schmidt number of mass diffusion \n DEFAULT 1.0 (~for Gases) \ingroup - * Config*/ + addEnumOption("DIFFUSIVITY_MODEL", Kind_Diffusivity_Model, Diffusivity_Model_Map, DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY); + /*!\brief DIFFUSIVITY_CONSTANT\n DESCRIPTION: mass diffusivity if DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY is chosen \n DEFAULT 0.001 (Air) \ingroup Config*/ + addDoubleOption("DIFFUSIVITY_CONSTANT", Diffusivity_Constant , 0.001); + /*!\brief SCHMIDT_LAM \n DESCRIPTION: Laminar Schmidt number of mass diffusion \n DEFAULT 1.0 (~for Gases) \ingroup Config*/ addDoubleOption("SCHMIDT_NUMBER_LAMINAR", Schmidt_Number_Laminar, 1.0); - /*!\brief SCHMIDT_TURB \n DESCRIPTION: Turbulent Schmidt number of mass diffusion \n DEFAULT 0.70 (more or less - * experimental value) \ingroup Config*/ + /*!\brief SCHMIDT_TURB \n DESCRIPTION: Turbulent Schmidt number of mass diffusion \n DEFAULT 0.70 (more or less experimental value) \ingroup Config*/ addDoubleOption("SCHMIDT_NUMBER_TURBULENT", Schmidt_Number_Turbulent, 0.7); /*!\brief DESCRIPTION: Constant Lewis number for mass diffusion */ addDoubleListOption("CONSTANT_LEWIS_NUMBER", nConstant_Lewis_Number, Constant_Lewis_Number); - vel_inf[0] = 1.0; - vel_inf[1] = 0.0; - vel_inf[2] = 0.0; + vel_inf[0] = 1.0; vel_inf[1] = 0.0; vel_inf[2] = 0.0; /*!\brief FREESTREAM_VELOCITY\n DESCRIPTION: Free-stream velocity (m/s) */ addDoubleArrayOption("FREESTREAM_VELOCITY", 3, vel_inf); /* DESCRIPTION: Free-stream viscosity (1.853E-5 Ns/m^2 (air), 0.798E-3 Ns/m^2 (water)) */ @@ -1608,10 +1428,11 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Number of times Alpha is updated in a fix CL problem. */ addUnsignedLongOption("UPDATE_BCTHRUST", Update_BCThrust, 5); + /*!\par CONFIG_CATEGORY: Reference Conditions \ingroup Config*/ /*--- Options related to reference values for nondimensionalization ---*/ - Length_Ref = 1.0; //<---- NOTE: this should be given an option or set as a const + Length_Ref = 1.0; //<---- NOTE: this should be given an option or set as a const /*!\brief REF_ORIGIN_MOMENT_X\n DESCRIPTION: X Reference origin for moment computation \ingroup Config*/ addDoubleListOption("REF_ORIGIN_MOMENT_X", nRefOriginMoment_X, RefOriginMoment_X); @@ -1619,13 +1440,11 @@ void CConfig::SetConfig_Options() { addDoubleListOption("REF_ORIGIN_MOMENT_Y", nRefOriginMoment_Y, RefOriginMoment_Y); /*!\brief REF_ORIGIN_MOMENT_Z\n DESCRIPTION: Z Reference origin for moment computation \ingroup Config*/ addDoubleListOption("REF_ORIGIN_MOMENT_Z", nRefOriginMoment_Z, RefOriginMoment_Z); - /*!\brief REF_AREA\n DESCRIPTION: Reference area for force coefficients (0 implies automatic calculation) \ingroup - * Config*/ + /*!\brief REF_AREA\n DESCRIPTION: Reference area for force coefficients (0 implies automatic calculation) \ingroup Config*/ addDoubleOption("REF_AREA", RefArea, 1.0); /*!\brief SEMI_SPAN\n DESCRIPTION: Wing semi-span (0 implies automatic calculation) \ingroup Config*/ addDoubleOption("SEMI_SPAN", SemiSpan, 0.0); - /*!\brief REF_LENGTH\n DESCRIPTION: Reference length for pitching, rolling, and yawing non-dimensional moment \ingroup - * Config*/ + /*!\brief REF_LENGTH\n DESCRIPTION: Reference length for pitching, rolling, and yawing non-dimensional moment \ingroup Config*/ addDoubleOption("REF_LENGTH", RefLength, 1.0); /*!\brief REF_SHARP_EDGES\n DESCRIPTION: Reference coefficient for detecting sharp edges \ingroup Config*/ addDoubleOption("REF_SHARP_EDGES", RefSharpEdges, 3.0); @@ -1640,22 +1459,18 @@ void CConfig::SetConfig_Options() { /*--- Options related to various boundary markers ---*/ /*!\brief HTP_AXIS\n DESCRIPTION: Location of the HTP axis*/ - // htp_axis[0] = 0.0; htp_axis[1] = 0.0; - // addDoubleArrayOption("HTP_AXIS", 2, htp_axis); + //htp_axis[0] = 0.0; htp_axis[1] = 0.0; + //addDoubleArrayOption("HTP_AXIS", 2, htp_axis); /*!\brief MARKER_PLOTTING\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/ addStringListOption("MARKER_PLOTTING", nMarker_Plotting, Marker_Plotting); - /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients - * \ingroup Config*/ + /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/ addStringListOption("MARKER_MONITORING", nMarker_Monitoring, Marker_Monitoring); - /*!\brief MARKER_CONTROL_VOLUME\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup - * Config*/ + /*!\brief MARKER_CONTROL_VOLUME\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/ addStringListOption("MARKER_ANALYZE", nMarker_Analyze, Marker_Analyze); - /*!\brief MARKER_DESIGNING\n DESCRIPTION: Marker(s) of the surface where objective function (design problem) will be - * evaluated \ingroup Config*/ + /*!\brief MARKER_DESIGNING\n DESCRIPTION: Marker(s) of the surface where objective function (design problem) will be evaluated \ingroup Config*/ addStringListOption("MARKER_DESIGNING", nMarker_Designing, Marker_Designing); - /*!\brief GEO_MARKER\n DESCRIPTION: Marker(s) of the surface where evaluate the geometrical functions \ingroup - * Config*/ + /*!\brief GEO_MARKER\n DESCRIPTION: Marker(s) of the surface where evaluate the geometrical functions \ingroup Config*/ addStringListOption("GEO_MARKER", nMarker_GeoEval, Marker_GeoEval); /*!\brief MARKER_EULER\n DESCRIPTION: Euler wall boundary marker(s) \ingroup Config*/ addStringListOption("MARKER_EULER", nMarker_Euler, Marker_Euler); @@ -1685,41 +1500,37 @@ void CConfig::SetConfig_Options() { Format: ( periodic marker, donor marker, rotation_center_x, rotation_center_y, rotation_center_z, rotation_angle_x-axis, rotation_angle_y-axis, rotation_angle_z-axis, translation_x, translation_y, translation_z, ... ) */ - addPeriodicOption("MARKER_PERIODIC", nMarker_PerBound, Marker_PerBound, Marker_PerDonor, Periodic_RotCenter, - Periodic_RotAngles, Periodic_Translation); + addPeriodicOption("MARKER_PERIODIC", nMarker_PerBound, Marker_PerBound, Marker_PerDonor, + Periodic_RotCenter, Periodic_RotAngles, Periodic_Translation); /*!\brief MARKER_PYTHON_CUSTOM\n DESCRIPTION: Python customizable marker(s) \ingroup Config*/ addStringListOption("MARKER_PYTHON_CUSTOM", nMarker_PyCustom, Marker_PyCustom); /*!\brief MARKER_WALL_FUNCTIONS\n DESCRIPTION: Viscous wall markers for which wall functions must be applied. Format: (Wall function marker, wall function type, ...) \ingroup Config*/ - addWallFunctionOption("MARKER_WALL_FUNCTIONS", nMarker_WallFunctions, Marker_WallFunctions, Kind_WallFunctions, - IntInfo_WallFunctions, DoubleInfo_WallFunctions); + addWallFunctionOption("MARKER_WALL_FUNCTIONS", nMarker_WallFunctions, Marker_WallFunctions, + Kind_WallFunctions, IntInfo_WallFunctions, DoubleInfo_WallFunctions); /*!\brief MARKER_STRONG_BC\n DESCRIPTION: Markers where a strong BC must be applied.*/ addStringListOption("MARKER_SPECIES_STRONG_BC", nMarker_StrongBC, Marker_StrongBC); - /*!\brief ACTDISK_TYPE \n DESCRIPTION: Actuator Disk boundary type \n OPTIONS: see \link ActDisk_Map \endlink \n - * Default: VARIABLES_JUMP \ingroup Config*/ + /*!\brief ACTDISK_TYPE \n DESCRIPTION: Actuator Disk boundary type \n OPTIONS: see \link ActDisk_Map \endlink \n Default: VARIABLES_JUMP \ingroup Config*/ addEnumOption("ACTDISK_TYPE", Kind_ActDisk, ActDisk_Map, VARIABLES_JUMP); /*!\brief MARKER_ACTDISK\n DESCRIPTION: \ingroup Config*/ - addActDiskOption("MARKER_ACTDISK", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, - Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); + addActDiskOption("MARKER_ACTDISK", + nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, + ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); - /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: - * actdiskinput.dat \ingroup Config*/ + /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/ 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*/ + /*!\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, 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*/ + /*!\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*/ + /*!\brief INLET_FILENAME \n DESCRIPTION: Input file for a specified inlet profile (w/ extension) \n DEFAULT: inlet.dat \ingroup Config*/ addStringOption("INLET_FILENAME", Inlet_Filename, string("inlet.dat")); /*!\brief INLET_MATCHING_TOLERANCE * \n DESCRIPTION: If a file is provided to specify the inlet profile, @@ -1736,29 +1547,22 @@ void CConfig::SetConfig_Options() { addInletOption("MARKER_INLET", nMarker_Inlet, Marker_Inlet, Inlet_Ttotal, Inlet_Ptotal, Inlet_FlowDir); /*!\brief MARKER_INLET_SPECIES \n DESCRIPTION: Inlet Species boundary marker(s) with the following format Inlet Species: (inlet_marker, Species1, Species2, ..., SpeciesN-1, inlet_marker2, Species1, Species2, ...) */ - addInletSpeciesOption("MARKER_INLET_SPECIES", nMarker_Inlet_Species, Marker_Inlet_Species, Inlet_SpeciesVal, - nSpecies_per_Inlet); + addInletSpeciesOption("MARKER_INLET_SPECIES",nMarker_Inlet_Species, Marker_Inlet_Species, Inlet_SpeciesVal, nSpecies_per_Inlet); /*!\brief MARKER_INLET_TURBULENT \n DESCRIPTION: Inlet Turbulence boundary marker(s) with the following format Inlet Turbulent: (inlet_marker, TurbulentIntensity1, ViscosityRatio1, inlet_marker2, TurbulentIntensity2, ViscosityRatio2, ...) */ addInletTurbOption("MARKER_INLET_TURBULENT", nMarker_Inlet_Turb, Marker_Inlet_Turb, Inlet_TurbVal, nTurb_Properties); /*!\brief MARKER_RIEMANN \n DESCRIPTION: Riemann boundary marker(s) with the following formats, a unit vector. - * \n OPTIONS: See \link Riemann_Map \endlink. The variables indicated by the option and the flow direction unit - * vector must be specified. \ingroup Config*/ - addRiemannOption("MARKER_RIEMANN", nMarker_Riemann, Marker_Riemann, Kind_Data_Riemann, Riemann_Map, Riemann_Var1, - Riemann_Var2, Riemann_FlowDir); + * \n OPTIONS: See \link Riemann_Map \endlink. The variables indicated by the option and the flow direction unit vector must be specified. \ingroup Config*/ + addRiemannOption("MARKER_RIEMANN", nMarker_Riemann, Marker_Riemann, Kind_Data_Riemann, Riemann_Map, Riemann_Var1, Riemann_Var2, Riemann_FlowDir); /*!\brief MARKER_GILES \n DESCRIPTION: Giles boundary marker(s) with the following formats, a unit vector. */ - /* \n OPTIONS: See \link Giles_Map \endlink. The variables indicated by the option and the flow direction unit vector - * must be specified. \ingroup Config*/ - addGilesOption("MARKER_GILES", nMarker_Giles, Marker_Giles, Kind_Data_Giles, Giles_Map, Giles_Var1, Giles_Var2, - Giles_FlowDir, RelaxFactorAverage, RelaxFactorFourier); + /* \n OPTIONS: See \link Giles_Map \endlink. The variables indicated by the option and the flow direction unit vector must be specified. \ingroup Config*/ + addGilesOption("MARKER_GILES", nMarker_Giles, Marker_Giles, Kind_Data_Giles, Giles_Map, Giles_Var1, Giles_Var2, Giles_FlowDir, RelaxFactorAverage, RelaxFactorFourier); /*!\brief SPATIAL_FOURIER \n DESCRIPTION: Option to compute the spatial fourier trasformation for the Giles BC. */ addBoolOption("SPATIAL_FOURIER", SpatialFourier, false); - /*!\brief GILES_EXTRA_RELAXFACTOR \n DESCRIPTION: the 1st coeff the value of the under relaxation factor to apply to - * the shroud and hub, the 2nd coefficient is the the percentage of span-wise height influenced by this extra under - * relaxation factor.*/ - extrarelfac[0] = 0.1; - extrarelfac[1] = 0.1; + /*!\brief GILES_EXTRA_RELAXFACTOR \n DESCRIPTION: the 1st coeff the value of the under relaxation factor to apply to the shroud and hub, + * the 2nd coefficient is the the percentage of span-wise height influenced by this extra under relaxation factor.*/ + extrarelfac[0] = 0.1; extrarelfac[1] = 0.1; addDoubleArrayOption("GILES_EXTRA_RELAXFACTOR", 2, extrarelfac); /*!\brief AVERAGE_PROCESS_TYPE \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ @@ -1766,68 +1570,54 @@ void CConfig::SetConfig_Options() { /*!\brief AVERAGE_PROCESS_KIND \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ addEnumOption("AVERAGE_PROCESS_KIND", Kind_AverageProcess, AverageProcess_Map, AREA); - /*!\brief PERFORMANCE_AVERAGE_PROCESS_KIND \n DESCRIPTION: types of mixing process for averaging quantities at the - boundaries for performance computation. \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE - \ingroup Config*/ + /*!\brief PERFORMANCE_AVERAGE_PROCESS_KIND \n DESCRIPTION: types of mixing process for averaging quantities at the boundaries for performance computation. + \n OPTIONS: see \link MixingProcess_Map \endlink \n DEFAULT: AREA_AVERAGE \ingroup Config*/ addEnumOption("PERFORMANCE_AVERAGE_PROCESS_KIND", Kind_PerformanceAverageProcess, AverageProcess_Map, AREA); - mixedout_coeff[0] = 1.0; - mixedout_coeff[1] = 1.0E-05; - mixedout_coeff[2] = 15.0; + mixedout_coeff[0] = 1.0; mixedout_coeff[1] = 1.0E-05; mixedout_coeff[2] = 15.0; /*!\brief MIXEDOUT_COEFF \n DESCRIPTION: the 1st coeff is an under relaxation factor for the Newton method, * the 2nd coefficient is the tolerance for the Newton method, 3rd coefficient is the maximum number of * iteration for the Newton Method.*/ addDoubleArrayOption("MIXEDOUT_COEFF", 3, mixedout_coeff); /*!\brief RAMP_ROTATING_FRAME\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/ addBoolOption("RAMP_ROTATING_FRAME", RampRotatingFrame, false); - rampRotFrame_coeff[0] = 0; - rampRotFrame_coeff[1] = 1.0; - rampRotFrame_coeff[2] = 1000.0; - /*!\brief RAMP_ROTATING_FRAME_COEFF \n DESCRIPTION: the 1st coeff is the staring velocity, + rampRotFrame_coeff[0] = 0; rampRotFrame_coeff[1] = 1.0; rampRotFrame_coeff[2] = 1000.0; + /*!\brief RAMP_ROTATING_FRAME_COEFF \n DESCRIPTION: the 1st coeff is the staring velocity, * the 2nd coeff is the number of iterations for the update, 3rd is the number of iteration */ addDoubleArrayOption("RAMP_ROTATING_FRAME_COEFF", 3, rampRotFrame_coeff); /* DESCRIPTION: AVERAGE_MACH_LIMIT is a limit value for average procedure based on the mass flux. */ addDoubleOption("AVERAGE_MACH_LIMIT", AverageMachLimit, 0.03); /*!\brief RAMP_OUTLET_PRESSURE\n DESCRIPTION: option to ramp up or down the rotating frame velocity value*/ addBoolOption("RAMP_OUTLET_PRESSURE", RampOutletPressure, false); - rampOutPres_coeff[0] = 100000.0; - rampOutPres_coeff[1] = 1.0; - rampOutPres_coeff[2] = 1000.0; + rampOutPres_coeff[0] = 100000.0; rampOutPres_coeff[1] = 1.0; rampOutPres_coeff[2] = 1000.0; /*!\brief RAMP_OUTLET_PRESSURE_COEFF \n DESCRIPTION: the 1st coeff is the staring outlet pressure, - * the 2nd coeff is the number of iterations for the update, 3rd is the number of total iteration till reaching the - * final outlet pressure value */ + * the 2nd coeff is the number of iterations for the update, 3rd is the number of total iteration till reaching the final outlet pressure value */ addDoubleArrayOption("RAMP_OUTLET_PRESSURE_COEFF", 3, rampOutPres_coeff); - /*!\brief MARKER_MIXINGPLANE \n DESCRIPTION: Identify the boundaries in which the mixing plane is applied. \ingroup - * Config*/ + /*!\brief MARKER_MIXINGPLANE \n DESCRIPTION: Identify the boundaries in which the mixing plane is applied. \ingroup Config*/ addStringListOption("MARKER_MIXINGPLANE_INTERFACE", nMarker_MixingPlaneInterface, Marker_MixingPlaneInterface); /*!\brief TURBULENT_MIXINGPLANE \n DESCRIPTION: Activate mixing plane also for turbulent quantities \ingroup Config*/ addBoolOption("TURBULENT_MIXINGPLANE", turbMixingPlane, false); - /*!\brief MARKER_TURBOMACHINERY \n DESCRIPTION: Identify the inflow and outflow boundaries in which the turbomachinery - * settings are applied. \ingroup Config*/ + /*!\brief MARKER_TURBOMACHINERY \n DESCRIPTION: Identify the inflow and outflow boundaries in which the turbomachinery settings are applied. \ingroup Config*/ addTurboPerfOption("MARKER_TURBOMACHINERY", nMarker_Turbomachinery, Marker_TurboBoundIn, Marker_TurboBoundOut); - /*!\brief NUM_SPANWISE_SECTIONS \n DESCRIPTION: Integer number of spanwise sections to compute 3D turbo BC and - * Performance for turbomachinery */ + /*!\brief NUM_SPANWISE_SECTIONS \n DESCRIPTION: Integer number of spanwise sections to compute 3D turbo BC and Performance for turbomachinery */ addUnsignedShortOption("NUM_SPANWISE_SECTIONS", nSpanWiseSections_User, 1); /*!\brief SPANWISE_KIND \n DESCRIPTION: type of algorithm to identify the span-wise sections at the turbo boundaries. \n OPTIONS: see \link SpanWise_Map \endlink \n Default: AUTOMATIC */ addEnumOption("SPANWISE_KIND", Kind_SpanWise, SpanWise_Map, AUTOMATIC); /*!\brief TURBOMACHINERY_KIND \n DESCRIPTION: types of turbomachinery architecture. \n OPTIONS: see \link TurboMachinery_Map \endlink \n Default: AXIAL */ - addEnumListOption("TURBOMACHINERY_KIND", nTurboMachineryKind, Kind_TurboMachinery, TurboMachinery_Map); + addEnumListOption("TURBOMACHINERY_KIND",nTurboMachineryKind, Kind_TurboMachinery, TurboMachinery_Map); /*!\brief MARKER_SHROUD \n DESCRIPTION: markers in which velocity is forced to 0.0. * \n Format: (shroud1, shroud2, ...)*/ addStringListOption("MARKER_SHROUD", nMarker_Shroud, Marker_Shroud); /*!\brief MARKER_SUPERSONIC_INLET \n DESCRIPTION: Supersonic inlet boundary marker(s) - * \n Format: (inlet marker, temperature, static pressure, velocity_x, velocity_y, velocity_z, ... ), i.e. - * primitive variables specified. \ingroup Config*/ - addInletOption("MARKER_SUPERSONIC_INLET", nMarker_Supersonic_Inlet, Marker_Supersonic_Inlet, Inlet_Temperature, - Inlet_Pressure, Inlet_Velocity); + * \n Format: (inlet marker, temperature, static pressure, velocity_x, velocity_y, velocity_z, ... ), i.e. primitive variables specified. \ingroup Config*/ + addInletOption("MARKER_SUPERSONIC_INLET", nMarker_Supersonic_Inlet, Marker_Supersonic_Inlet, Inlet_Temperature, Inlet_Pressure, Inlet_Velocity); /*!\brief MARKER_SUPERSONIC_OUTLET \n DESCRIPTION: Supersonic outlet boundary marker(s) \ingroup Config*/ addStringListOption("MARKER_SUPERSONIC_OUTLET", nMarker_Supersonic_Outlet, Marker_Supersonic_Outlet); /*!\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 outlet types for incompressible flows. List length must match number - * of inlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET. \ingroup Config*/ + /*!\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 */ @@ -1835,18 +1625,14 @@ void CConfig::SetConfig_Options() { /*!\brief MARKER_HEATFLUX \n DESCRIPTION: Specified heat flux wall boundary marker(s) Format: ( Heat flux marker, wall heat flux (static), ... ) \ingroup Config*/ addStringDoubleListOption("MARKER_HEATFLUX", nMarker_HeatFlux, Marker_HeatFlux, Heat_Flux); - /*!\brief INTEGRATED_HEATFLUX \n DESCRIPTION: Prescribe Heatflux in [W] instead of [W/m^2] \ingroup Config \default - * false */ + /*!\brief INTEGRATED_HEATFLUX \n DESCRIPTION: Prescribe Heatflux in [W] instead of [W/m^2] \ingroup Config \default false */ addBoolOption("INTEGRATED_HEATFLUX", Integrated_HeatFlux, false); /*!\brief MARKER_HEATTRANSFER DESCRIPTION: Heat flux with specified heat transfer coefficient boundary marker(s)\n * Format: ( Heat transfer marker, heat transfer coefficient, wall temperature (static), ... ) \ingroup Config */ - addExhaustOption("MARKER_HEATTRANSFER", nMarker_HeatTransfer, Marker_HeatTransfer, HeatTransfer_Coeff, - HeatTransfer_WallTemp); - /*!\brief Smoluchowski/Maxwell wall boundary marker(s) \n DESCRIPTION: Slip velocity and temperature jump wall - boundary marker(s) Format: ( Heat flux marker, wall temperature (static), momentum accomodation coefficient, thermal - accomodation coefficient ... ) \ingroup Config*/ - addStringDoubleListOption("MARKER_SMOLUCHOWSKI_MAXWELL", nMarker_Smoluchowski_Maxwell, Marker_Smoluchowski_Maxwell, - Isothermal_Temperature); // Missing TMAC and TAC + addExhaustOption("MARKER_HEATTRANSFER", nMarker_HeatTransfer, Marker_HeatTransfer, HeatTransfer_Coeff, HeatTransfer_WallTemp); + /*!\brief Smoluchowski/Maxwell wall boundary marker(s) \n DESCRIPTION: Slip velocity and temperature jump wall boundary marker(s) + Format: ( Heat flux marker, wall temperature (static), momentum accomodation coefficient, thermal accomodation coefficient ... ) \ingroup Config*/ + addStringDoubleListOption("MARKER_SMOLUCHOWSKI_MAXWELL", nMarker_Smoluchowski_Maxwell, Marker_Smoluchowski_Maxwell, Isothermal_Temperature); //Missing TMAC and TAC /*!\brief WALL_ROUGHNESS \n DESCRIPTION: Specified roughness heights at wall boundary marker(s) Format: ( Wall marker, roughness_height (static), ... ) \ingroup Config*/ addStringDoubleListOption("WALL_ROUGHNESS", nRough_Wall, Marker_RoughWall, Roughness_Height); @@ -1866,30 +1652,18 @@ void CConfig::SetConfig_Options() { // /* DESCRIPTION: Actuator disk double surface */ // addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); /* DESCRIPTION: Definition of the distortion rack (radial number of proves / circumferential density (degree) */ - distortion[0] = 5.0; - distortion[1] = 15.0; + distortion[0] = 5.0; distortion[1] = 15.0; addDoubleArrayOption("DISTORTION_RACK", 2, distortion); /* DESCRIPTION: Values of the box to impose a subsonic nacellle (mach, Pressure, Temperature) */ - eng_val[0] = 0.0; - eng_val[1] = 0.0; - eng_val[2] = 0.0; - eng_val[3] = 0.0; - eng_val[4] = 0.0; + eng_val[0]=0.0; eng_val[1]=0.0; eng_val[2]=0.0; eng_val[3]=0.0; eng_val[4]=0.0; addDoubleArrayOption("SUBSONIC_ENGINE_VALUES", 5, eng_val); - /* DESCRIPTION: Coordinates of the box to impose a subsonic nacellle cylinder (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax, - * Radius) */ - eng_cyl[0] = 0.0; - eng_cyl[1] = 0.0; - eng_cyl[2] = 0.0; - eng_cyl[3] = 1E15; - eng_cyl[4] = 1E15; - eng_cyl[5] = 1E15; - eng_cyl[6] = 1E15; + /* DESCRIPTION: Coordinates of the box to impose a subsonic nacellle cylinder (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax, Radius) */ + eng_cyl[0] = 0.0; eng_cyl[1] = 0.0; eng_cyl[2] = 0.0; + eng_cyl[3] = 1E15; eng_cyl[4] = 1E15; eng_cyl[5] = 1E15; eng_cyl[6] = 1E15; addDoubleArrayOption("SUBSONIC_ENGINE_CYL", 7, eng_cyl); /* DESCRIPTION: Engine exhaust boundary marker(s) Format: (nacelle exhaust marker, total nozzle temp, total nozzle pressure, ... )*/ - addExhaustOption("MARKER_ENGINE_EXHAUST", nMarker_EngineExhaust, Marker_EngineExhaust, Exhaust_Temperature_Target, - Exhaust_Pressure_Target); + addExhaustOption("MARKER_ENGINE_EXHAUST", nMarker_EngineExhaust, Marker_EngineExhaust, Exhaust_Temperature_Target, Exhaust_Pressure_Target); /* DESCRIPTION: Clamped boundary marker(s) */ addStringListOption("MARKER_CLAMPED", nMarker_Clamped, Marker_Clamped); /* DESCRIPTION: Displacement boundary marker(s) */ @@ -1903,29 +1677,25 @@ void CConfig::SetConfig_Options() { addInletOption("MARKER_LOAD", nMarker_Load_Dir, Marker_Load_Dir, Load_Dir_Value, Load_Dir_Multiplier, Load_Dir); /* DESCRIPTION: Load boundary marker(s) Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), i.e. primitive variables specified. */ - addInletOption("MARKER_DISPLACEMENT", nMarker_Disp_Dir, Marker_Disp_Dir, Disp_Dir_Value, Disp_Dir_Multiplier, - Disp_Dir); + addInletOption("MARKER_DISPLACEMENT", nMarker_Disp_Dir, Marker_Disp_Dir, Disp_Dir_Value, Disp_Dir_Multiplier, Disp_Dir); /* DESCRIPTION: Sine load boundary marker(s) Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), i.e. primitive variables specified. */ - // addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, - // Load_Sine_Dir); + //addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, Load_Sine_Dir); /*!\brief SINE_LOAD\n DESCRIPTION: option to apply the load as a sine*/ addBoolOption("SINE_LOAD", Sine_Load, false); - sineload_coeff[0] = 0.0; - sineload_coeff[1] = 0.0; - sineload_coeff[2] = 0.0; - /*!\brief SINE_LOAD_COEFF \n DESCRIPTION: the 1st coeff is the amplitude, the 2nd is the frequency, 3rd is the phase - * in radians */ + sineload_coeff[0] = 0.0; sineload_coeff[1] = 0.0; sineload_coeff[2] = 0.0; + /*!\brief SINE_LOAD_COEFF \n DESCRIPTION: the 1st coeff is the amplitude, the 2nd is the frequency, 3rd is the phase in radians */ addDoubleArrayOption("SINE_LOAD_COEFF", 3, sineload_coeff); /*!\brief RAMP_AND_RELEASE\n DESCRIPTION: release the load after applying the ramp*/ addBoolOption("RAMP_AND_RELEASE_LOAD", RampAndRelease, false); + /* DESCRIPTION: Flow load boundary marker(s) */ + //addStringDoubleListOption("MARKER_FLOWLOAD", nMarker_FlowLoad, Marker_FlowLoad, FlowLoad_Value); /* DESCRIPTION: Damping factor for engine inlet condition */ addDoubleOption("DAMP_ENGINE_INFLOW", Damp_Engine_Inflow, 0.95); /* DESCRIPTION: Damping factor for engine exhaust condition */ addDoubleOption("DAMP_ENGINE_EXHAUST", Damp_Engine_Exhaust, 0.95); - /*!\brief ENGINE_INFLOW_TYPE \n DESCRIPTION: Inlet boundary type \n OPTIONS: see \link Engine_Inflow_Map \endlink \n - * Default: FAN_FACE_MACH \ingroup Config*/ + /*!\brief ENGINE_INFLOW_TYPE \n DESCRIPTION: Inlet boundary type \n OPTIONS: see \link Engine_Inflow_Map \endlink \n Default: FAN_FACE_MACH \ingroup Config*/ addEnumOption("ENGINE_INFLOW_TYPE", Kind_Engine_Inflow, Engine_Inflow_Map, FAN_FACE_MACH); /* DESCRIPTION: Evaluate a problem with engines */ addBoolOption("ENGINE", Engine, false); @@ -1939,8 +1709,7 @@ void CConfig::SetConfig_Options() { addBoolOption("NEWTON_KRYLOV", NewtonKrylov, false); /* DESCRIPTION: Integer parameters {startup iters, precond iters, initial tolerance relaxation}. */ addUShortArrayOption("NEWTON_KRYLOV_IPARAM", NK_IntParam.size(), NK_IntParam.data()); - /* DESCRIPTION: Double parameters {startup residual drop, precond tolerance, full tolerance residual drop, findiff - * step}. */ + /* DESCRIPTION: Double parameters {startup residual drop, precond tolerance, full tolerance residual drop, findiff step}. */ addDoubleArrayOption("NEWTON_KRYLOV_DPARAM", NK_DblParam.size(), NK_DblParam.data()); /* DESCRIPTION: Number of samples for quasi-Newton methods. */ @@ -1960,14 +1729,10 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Activate The adaptive CFL number. */ addBoolOption("CFL_ADAPT", CFL_Adapt, false); /* !\brief CFL_ADAPT_PARAM - * DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max), acceptable - * linear residual ) Factor down generally <1.0, factor up generally > 1.0 to cause the CFL to increase when the - * under-relaxation parameter is 1.0 and to decrease when the under-relaxation parameter is less than 0.1. Factor is - * multiplicative. \ingroup Config*/ - default_cfl_adapt[0] = 1.0; - default_cfl_adapt[1] = 1.0; - default_cfl_adapt[2] = 10.0; - default_cfl_adapt[3] = 100.0; + * DESCRIPTION: Parameters of the adaptive CFL number (factor down, factor up, CFL limit (min and max), acceptable linear residual ) + * Factor down generally <1.0, factor up generally > 1.0 to cause the CFL to increase when the under-relaxation parameter is 1.0 + * and to decrease when the under-relaxation parameter is less than 0.1. Factor is multiplicative. \ingroup Config*/ + default_cfl_adapt[0] = 1.0; default_cfl_adapt[1] = 1.0; default_cfl_adapt[2] = 10.0; default_cfl_adapt[3] = 100.0; default_cfl_adapt[4] = 0.001; addDoubleListOption("CFL_ADAPT_PARAM", nCFL_AdaptParam, CFL_AdaptParam); /* DESCRIPTION: Reduction factor of the CFL coefficient in the adjoint problem */ @@ -1976,8 +1741,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("CFL_REDUCTION_TURB", CFLRedCoeff_Turb, 1.0); /* DESCRIPTION: Reduction factor of the CFL coefficient in the turbulent adjoint problem */ addDoubleOption("CFL_REDUCTION_ADJTURB", CFLRedCoeff_AdjTurb, 1.0); - /*!\brief CFL_REDUCTION_SPECIES \n DESCRIPTION: Reduction factor of the CFL coefficient in the species problem \n - * DEFAULT: 1.0 */ + /*!\brief CFL_REDUCTION_SPECIES \n DESCRIPTION: Reduction factor of the CFL coefficient in the species problem \n DEFAULT: 1.0 */ addDoubleOption("CFL_REDUCTION_SPECIES", CFLRedCoeff_Species, 1.0); /* DESCRIPTION: External iteration offset due to restart */ addUnsignedLongOption("EXT_ITER_OFFSET", ExtIter_OffSet, 0); @@ -1999,7 +1763,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Starting direct solver iteration for the unsteady adjoint */ addLongOption("UNST_ADJOINT_ITER", Unst_AdjointIter, 0); /* DESCRIPTION: Number of iterations to average the objective */ - addLongOption("ITER_AVERAGE_OBJ", Iter_Avg_Objective, 0); + addLongOption("ITER_AVERAGE_OBJ", Iter_Avg_Objective , 0); /* DESCRIPTION: Time discretization */ addEnumOption("TIME_DISCRE_FLOW", Kind_TimeIntScheme_Flow, Time_Int_Map, EULER_IMPLICIT); /* DESCRIPTION: Time discretization */ @@ -2027,12 +1791,10 @@ void CConfig::SetConfig_Options() { /*--- Options related to the linear solvers ---*/ /*!\brief LINEAR_SOLVER - * \n DESCRIPTION: Linear solver for the implicit, mesh deformation, or discrete adjoint systems \n OPTIONS: see - * \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ + * \n DESCRIPTION: Linear solver for the implicit, mesh deformation, or discrete adjoint systems \n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ addEnumOption("LINEAR_SOLVER", Kind_Linear_Solver, Linear_Solver_Map, FGMRES); /*!\brief LINEAR_SOLVER_PREC - * \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink - * \n DEFAULT: LU_SGS \ingroup Config*/ + * \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink \n DEFAULT: LU_SGS \ingroup Config*/ addEnumOption("LINEAR_SOLVER_PREC", Kind_Linear_Solver_Prec, Linear_Solver_Prec_Map, ILU); /* DESCRIPTION: Minimum error threshold for the linear solver for the implicit formulation */ addDoubleOption("LINEAR_SOLVER_ERROR", Linear_Solver_Error, 1E-6); @@ -2073,39 +1835,31 @@ void CConfig::SetConfig_Options() { /*!\brief CONV_FIELD\n DESCRIPTION: Output field to monitor \n Default: depends on solver \ingroup Config*/ addStringListOption("CONV_FIELD", nConvField, ConvField); - /*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 - * \ingroup Config*/ + /*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 \ingroup Config*/ addDoubleOption("CONV_RESIDUAL_MINVAL", MinLogResidual, -14.0); - /*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup - * Config*/ + /*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup Config*/ addUnsignedLongOption("CONV_STARTITER", StartConv_Iter, 5); /*!\brief CONV_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ addUnsignedShortOption("CONV_CAUCHY_ELEMS", Cauchy_Elems, 100); /*!\brief CONV_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-10 \ingroup Config*/ addDoubleOption("CONV_CAUCHY_EPS", Cauchy_Eps, 1E-10); - /*!\brief CONV_WINDOW_STARTITER\n DESCRIPTION: Iteration number after START_ITER_WND to begin convergence - * monitoring\n DEFAULT: 15 \ingroup Config*/ + /*!\brief CONV_WINDOW_STARTITER\n DESCRIPTION: Iteration number after START_ITER_WND to begin convergence monitoring\n DEFAULT: 15 \ingroup Config*/ addUnsignedLongOption("CONV_WINDOW_STARTITER", Wnd_StartConv_Iter, 15); - /*!\brief CONV_WINDOW_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-3 \ingroup - * Config*/ + /*!\brief CONV_WINDOW_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-3 \ingroup Config*/ addDoubleOption("CONV_WINDOW_CAUCHY_EPS", Wnd_Cauchy_Eps, 1E-3); - /*!\brief CONV_WINDOW_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup - * Config*/ + /*!\brief CONV_WINDOW_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ addUnsignedShortOption("CONV_WINDOW_CAUCHY_ELEMS", Wnd_Cauchy_Elems, 100); - /*!\brief WINDOW_CAUCHY_CRIT \n DESCRIPTION: Determines, if the cauchy convergence criterion should be used for - * windowed time averaged objective functions*/ - addBoolOption("WINDOW_CAUCHY_CRIT", Wnd_Cauchy_Crit, false); + /*!\brief WINDOW_CAUCHY_CRIT \n DESCRIPTION: Determines, if the cauchy convergence criterion should be used for windowed time averaged objective functions*/ + addBoolOption("WINDOW_CAUCHY_CRIT",Wnd_Cauchy_Crit, false); /*!\brief CONV_WINDOW_FIELD - * \n DESCRIPTION: Output fields for the Cauchy criterium for the TIME iteration. The criterium is applied to the - * windowed time average of the chosen funcion. */ - addStringListOption("CONV_WINDOW_FIELD", nWndConvField, WndConvField); + * \n DESCRIPTION: Output fields for the Cauchy criterium for the TIME iteration. The criterium is applied to the windowed time average of the chosen funcion. */ + addStringListOption("CONV_WINDOW_FIELD",nWndConvField, WndConvField); /*!\par CONFIG_CATEGORY: Multi-grid \ingroup Config*/ /*!\brief MGLEVEL\n DESCRIPTION: Multi-grid Levels. DEFAULT: 0 \ingroup Config*/ addUnsignedShortOption("MGLEVEL", nMGLevels, 0); - /*!\brief MGCYCLE\n DESCRIPTION: Multi-grid cycle. OPTIONS: See \link MG_Cycle_Map \endlink. Defualt V_CYCLE \ingroup - * Config*/ + /*!\brief MGCYCLE\n DESCRIPTION: Multi-grid cycle. OPTIONS: See \link MG_Cycle_Map \endlink. Defualt V_CYCLE \ingroup Config*/ addEnumOption("MGCYCLE", MGCycle, MG_Cycle_Map, V_CYCLE); /*!\brief MG_PRE_SMOOTH\n DESCRIPTION: Multi-grid pre-smoothing level \ingroup Config*/ addUShortListOption("MG_PRE_SMOOTH", nMG_PreSmooth, MG_PreSmooth); @@ -2113,96 +1867,74 @@ void CConfig::SetConfig_Options() { addUShortListOption("MG_POST_SMOOTH", nMG_PostSmooth, MG_PostSmooth); /*!\brief MG_CORRECTION_SMOOTH\n DESCRIPTION: Jacobi implicit smoothing of the correction \ingroup Config*/ addUShortListOption("MG_CORRECTION_SMOOTH", nMG_CorrecSmooth, MG_CorrecSmooth); - /*!\brief MG_DAMP_RESTRICTION\n DESCRIPTION: Damping factor for the residual restriction. DEFAULT: 0.75 \ingroup - * Config*/ + /*!\brief MG_DAMP_RESTRICTION\n DESCRIPTION: Damping factor for the residual restriction. DEFAULT: 0.75 \ingroup Config*/ addDoubleOption("MG_DAMP_RESTRICTION", Damp_Res_Restric, 0.75); - /*!\brief MG_DAMP_PROLONGATION\n DESCRIPTION: Damping factor for the correction prolongation. DEFAULT 0.75 \ingroup - * Config*/ + /*!\brief MG_DAMP_PROLONGATION\n DESCRIPTION: Damping factor for the correction prolongation. DEFAULT 0.75 \ingroup Config*/ addDoubleOption("MG_DAMP_PROLONGATION", Damp_Correc_Prolong, 0.75); /*!\par CONFIG_CATEGORY: Spatial Discretization \ingroup Config*/ /*--- Options related to the spatial discretization ---*/ /*!\brief NUM_METHOD_GRAD - * \n DESCRIPTION: Numerical method for spatial gradients \n OPTIONS: See \link Gradient_Map \endlink. \n DEFAULT: - * WEIGHTED_LEAST_SQUARES. \ingroup Config*/ + * \n DESCRIPTION: Numerical method for spatial gradients \n OPTIONS: See \link Gradient_Map \endlink. \n DEFAULT: WEIGHTED_LEAST_SQUARES. \ingroup Config*/ addEnumOption("NUM_METHOD_GRAD", Kind_Gradient_Method, Gradient_Map, WEIGHTED_LEAST_SQUARES); /*!\brief NUM_METHOD_GRAD - * \n DESCRIPTION: Numerical method for spatial gradients used only for upwind reconstruction \n OPTIONS: See \link - * Gradient_Map \endlink. \n DEFAULT: NO_GRADIENT. \ingroup Config*/ + * \n DESCRIPTION: Numerical method for spatial gradients used only for upwind reconstruction \n OPTIONS: See \link Gradient_Map \endlink. \n DEFAULT: NO_GRADIENT. \ingroup Config*/ addEnumOption("NUM_METHOD_GRAD_RECON", Kind_Gradient_Method_Recon, Gradient_Map, NO_GRADIENT); /*!\brief VENKAT_LIMITER_COEFF - * \n DESCRIPTION: Coefficient for the limiter. DEFAULT value 0.5. Larger values decrease the extent of limiting, - * values approaching zero cause lower-order approximation to the solution. \ingroup Config */ + * \n DESCRIPTION: Coefficient for the limiter. DEFAULT value 0.5. Larger values decrease the extent of limiting, values approaching zero cause lower-order approximation to the solution. \ingroup Config */ addDoubleOption("VENKAT_LIMITER_COEFF", Venkat_LimiterCoeff, 0.05); /*!\brief ADJ_SHARP_LIMITER_COEFF - * \n DESCRIPTION: Coefficient for detecting the limit of the sharp edges. DEFAULT value 3.0. Use with sharp edges - * limiter. \ingroup Config*/ + * \n DESCRIPTION: Coefficient for detecting the limit of the sharp edges. DEFAULT value 3.0. Use with sharp edges limiter. \ingroup Config*/ addDoubleOption("ADJ_SHARP_LIMITER_COEFF", AdjSharp_LimiterCoeff, 3.0); /*!\brief LIMITER_ITER - * \n DESCRIPTION: Freeze the value of the limiter after a number of iterations. DEFAULT value 999999. \ingroup - * Config*/ + * \n DESCRIPTION: Freeze the value of the limiter after a number of iterations. DEFAULT value 999999. \ingroup Config*/ addUnsignedLongOption("LIMITER_ITER", LimiterIter, 999999); /*!\brief CONV_NUM_METHOD_FLOW - * \n DESCRIPTION: Convective numerical method \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map - * \endlink. \ingroup Config*/ + * \n DESCRIPTION: Convective numerical method \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_FLOW", Kind_ConvNumScheme_Flow, Kind_Centered_Flow, Kind_Upwind_Flow); /*!\brief NUM_METHOD_FEM_FLOW - * \n DESCRIPTION: Numerical method \n OPTIONS: See \link FEM_Map \endlink , \link Centered_Map \endlink. \ingroup - * Config*/ + * \n DESCRIPTION: Numerical method \n OPTIONS: See \link FEM_Map \endlink , \link Centered_Map \endlink. \ingroup Config*/ addConvectFEMOption("NUM_METHOD_FEM_FLOW", Kind_ConvNumScheme_FEM_Flow, Kind_FEM_Flow); /*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_FLOW", MUSCL_Flow, true); /*!\brief SLOPE_LIMITER_FLOW - * DESCRIPTION: Slope limiter for the direct solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT - * VENKATAKRISHNAN \ingroup Config*/ + * DESCRIPTION: Slope limiter for the direct solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ addEnumOption("SLOPE_LIMITER_FLOW", Kind_SlopeLimit_Flow, Limiter_Map, LIMITER::VENKATAKRISHNAN); - jst_coeff[0] = 0.5; - jst_coeff[1] = 0.02; - /*!\brief JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the JST method - * \ingroup Config*/ + jst_coeff[0] = 0.5; jst_coeff[1] = 0.02; + /*!\brief JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the JST method \ingroup Config*/ addDoubleArrayOption("JST_SENSOR_COEFF", 2, jst_coeff); - /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs - * method. \ingroup Config*/ + /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("LAX_SENSOR_COEFF", Kappa_1st_Flow, 0.15); - /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) - * \ingroup Config*/ + /*!\brief USE_ACCURATE_FLUX_JACOBIANS \n DESCRIPTION: Use numerically computed Jacobians for AUSM+up(2) and SLAU(2) \ingroup Config*/ addBoolOption("USE_ACCURATE_FLUX_JACOBIANS", Use_Accurate_Jacobians, false); - /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the - * global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ + /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Improve the numerical properties (diagonal dominance) of the global Jacobian matrix, 3 to 4 is "optimum" (central schemes) \ingroup Config*/ addDoubleOption("CENTRAL_JACOBIAN_FIX_FACTOR", Cent_Jac_Fix_Factor, 4.0); - /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Control numerical properties of the global Jacobian matrix using - * a multiplication factor for incompressible central schemes \ingroup Config*/ + /*!\brief CENTRAL_JACOBIAN_FIX_FACTOR \n DESCRIPTION: Control numerical properties of the global Jacobian matrix using a multiplication factor for incompressible central schemes \ingroup Config*/ addDoubleOption("CENTRAL_INC_JACOBIAN_FIX_FACTOR", Cent_Inc_Jac_Fix_Factor, 1.0); /*!\brief CONV_NUM_METHOD_ADJFLOW * \n DESCRIPTION: Convective numerical method for the adjoint solver. - * \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. Note: not all methods are guaranteed to - * be implemented for the adjoint solver. \ingroup Config */ + * \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. Note: not all methods are guaranteed to be implemented for the adjoint solver. \ingroup Config */ addConvectOption("CONV_NUM_METHOD_ADJFLOW", Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, Kind_Upwind_AdjFlow); /*!\brief MUSCL_ADJFLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_ADJFLOW", MUSCL_AdjFlow, true); /*!\brief SLOPE_LIMITER_ADJFLOW - * DESCRIPTION: Slope limiter for the adjoint solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT - * VENKATAKRISHNAN \ingroup Config*/ + * DESCRIPTION: Slope limiter for the adjoint solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ addEnumOption("SLOPE_LIMITER_ADJFLOW", Kind_SlopeLimit_AdjFlow, Limiter_Map, LIMITER::VENKATAKRISHNAN); - jst_adj_coeff[0] = 0.5; - jst_adj_coeff[1] = 0.02; - /*!\brief ADJ_JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the adjoint - * JST method. \ingroup Config*/ + jst_adj_coeff[0] = 0.5; jst_adj_coeff[1] = 0.02; + /*!\brief ADJ_JST_SENSOR_COEFF \n DESCRIPTION: 2nd and 4th order artificial dissipation coefficients for the adjoint JST method. \ingroup Config*/ addDoubleArrayOption("ADJ_JST_SENSOR_COEFF", 2, jst_adj_coeff); - /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the adjoint - * Lax-Friedrichs method. \ingroup Config*/ + /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the adjoint Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("ADJ_LAX_SENSOR_COEFF", Kappa_1st_AdjFlow, 0.15); /*!\brief MUSCL_TURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_TURB", MUSCL_Turb, false); /*!\brief SLOPE_LIMITER_TURB - * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup - * Config*/ + * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ addEnumOption("SLOPE_LIMITER_TURB", Kind_SlopeLimit_Turb, Limiter_Map, LIMITER::VENKATAKRISHNAN); /*!\brief CONV_NUM_METHOD_TURB * \n DESCRIPTION: Convective numerical method \ingroup Config*/ @@ -2211,25 +1943,21 @@ void CConfig::SetConfig_Options() { /*!\brief MUSCL_ADJTURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_ADJTURB", MUSCL_AdjTurb, false); /*!\brief SLOPE_LIMITER_ADJTURB - * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup - * Config */ + * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ addEnumOption("SLOPE_LIMITER_ADJTURB", Kind_SlopeLimit_AdjTurb, Limiter_Map, LIMITER::VENKATAKRISHNAN); - /*!\brief CONV_NUM_METHOD_ADJTURB\n DESCRIPTION: Convective numerical method for the adjoint/turbulent problem - * \ingroup Config*/ + /*!\brief CONV_NUM_METHOD_ADJTURB\n DESCRIPTION: Convective numerical method for the adjoint/turbulent problem \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_ADJTURB", Kind_ConvNumScheme_AdjTurb, Kind_Centered_AdjTurb, Kind_Upwind_AdjTurb); /*!\brief MUSCL_SPECIES \n DESCRIPTION: Check if the MUSCL scheme should be used \n DEFAULT false \ingroup Config*/ addBoolOption("MUSCL_SPECIES", MUSCL_Species, false); - /*!\brief SLOPE_LIMITER_SPECIES \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT - * NONE \ingroup Config*/ + /*!\brief SLOPE_LIMITER_SPECIES \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE \ingroup Config*/ addEnumOption("SLOPE_LIMITER_SPECIES", Kind_SlopeLimit_Species, Limiter_Map, LIMITER::NONE); /*!\brief CONV_NUM_METHOD_SPECIES \n DESCRIPTION: Convective numerical method for species transport \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_SPECIES", Kind_ConvNumScheme_Species, Kind_Centered_Species, Kind_Upwind_Species); /*!\brief MUSCL_HEAT \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_HEAT", MUSCL_Heat, false); - /*!\brief SLOPE_LIMITER_HEAT \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE - * \ingroup Config*/ + /*!\brief SLOPE_LIMITER_HEAT \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE \ingroup Config*/ addEnumOption("SLOPE_LIMITER_HEAT", Kind_SlopeLimit_Heat, Limiter_Map, LIMITER::NONE); /*!\brief CONV_NUM_METHOD_HEAT \n DESCRIPTION: Convective numerical method */ addConvectOption("CONV_NUM_METHOD_HEAT", Kind_ConvNumScheme_Heat, Kind_Centered_Heat, Kind_Upwind_Heat); @@ -2242,11 +1970,9 @@ void CConfig::SetConfig_Options() { /*!\brief MG_ADJFLOW\n DESCRIPTION: Multigrid with the adjoint problem. \n Defualt: YES \ingroup Config*/ addBoolOption("MG_ADJFLOW", MG_AdjointFlow, true); - /*!\brief OBJECTIVE_WEIGHT \n DESCRIPTION: Adjoint problem boundary condition weights. Applies scaling factor to - * objective(s) \ingroup Config*/ + /*!\brief OBJECTIVE_WEIGHT \n DESCRIPTION: Adjoint problem boundary condition weights. Applies scaling factor to objective(s) \ingroup Config*/ addDoubleListOption("OBJECTIVE_WEIGHT", nObjW, Weight_ObjFunc); - /*!\brief OBJECTIVE_FUNCTION \n DESCRIPTION: Adjoint problem boundary condition \n OPTIONS: see \link Objective_Map - * \endlink \n DEFAULT: DRAG_COEFFICIENT \ingroup Config*/ + /*!\brief OBJECTIVE_FUNCTION \n DESCRIPTION: Adjoint problem boundary condition \n OPTIONS: see \link Objective_Map \endlink \n DEFAULT: DRAG_COEFFICIENT \ingroup Config*/ addEnumListOption("OBJECTIVE_FUNCTION", nObj, Kind_ObjFunc, Objective_Map); /*!\brief CUSTOM_OBJFUNC \n DESCRIPTION: User-provided definition of a custom objective function. \ingroup Config*/ @@ -2263,8 +1989,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: parameter for the definition of a complex objective function */ addDoubleOption("DCMZ_DCL_VALUE", dCMz_dCL, 0.0); - geo_loc[0] = 0.0; - geo_loc[1] = 1.0; + geo_loc[0] = 0.0; geo_loc[1] = 1.0; /* DESCRIPTION: Definition of the airfoil section */ addDoubleArrayOption("GEO_BOUNDS", 2, geo_loc); /* DESCRIPTION: Identify the body to slice */ @@ -2275,11 +2000,8 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("GEO_NUMBER_STATIONS", nWingStations, 25); /* DESCRIPTION: Definition of the airfoil sections */ addDoubleListOption("GEO_LOCATION_STATIONS", nLocationStations, LocationStations); - nacelle_location[0] = 0.0; - nacelle_location[1] = 0.0; - nacelle_location[2] = 0.0; - nacelle_location[3] = 0.0; - nacelle_location[4] = 0.0; + nacelle_location[0] = 0.0; nacelle_location[1] = 0.0; nacelle_location[2] = 0.0; + nacelle_location[3] = 0.0; nacelle_location[4] = 0.0; /* DESCRIPTION: Definition of the nacelle location (higlite coordinates, tilt angle, toe angle) */ addDoubleArrayOption("GEO_NACELLE_LOCATION", 5, nacelle_location); /* DESCRIPTION: Output sectional forces for specified markers. */ @@ -2299,29 +2021,28 @@ void CConfig::SetConfig_Options() { addBoolOption("FROZEN_LIMITER_DISC", Frozen_Limiter_Disc, false); /* DESCRIPTION: Use an inconsistent (primal/dual) discrete adjoint formulation */ addBoolOption("INCONSISTENT_DISC", Inconsistent_Disc, false); - /* DESCRIPTION: */ + /* DESCRIPTION: */ addDoubleOption("FIX_AZIMUTHAL_LINE", FixAzimuthalLine, 90.0); /*!\brief SENS_REMOVE_SHARP - * \n DESCRIPTION: Remove sharp edges from the sensitivity evaluation \n Format: SENS_REMOVE_SHARP = YES \n DEFAULT: - * NO \ingroup Config*/ + * \n DESCRIPTION: Remove sharp edges from the sensitivity evaluation \n Format: SENS_REMOVE_SHARP = YES \n DEFAULT: NO \ingroup Config*/ addBoolOption("SENS_REMOVE_SHARP", Sens_Remove_Sharp, false); /* DESCRIPTION: Automatically reorient elements that seem flipped */ - addBoolOption("REORIENT_ELEMENTS", ReorientElements, true); + addBoolOption("REORIENT_ELEMENTS",ReorientElements, true); /*!\par CONFIG_CATEGORY: Sobolev Gradient Solver Parameters \ingroup Config */ /*--- Options related to the Sobolev smoothing solver ---*/ /* DESCRIPTION: Switch to activate gradient smoothing */ - addBoolOption("SMOOTH_GRADIENT", SmoothGradient, false); + addBoolOption("SMOOTH_GRADIENT",SmoothGradient, false); /* DESCRIPTION: Epsilon of the identity term in the Laplace Beltrami Operator */ - addDoubleOption("SMOOTHING_EPSILON1", SmoothingEps1, 1.0); + addDoubleOption("SMOOTHING_EPSILON1",SmoothingEps1, 1.0); /* DESCRIPTION: Epsilon of the Laplace term in the Laplace Beltrami Operator */ - addDoubleOption("SMOOTHING_EPSILON2", SmoothingEps2, 1.0); + addDoubleOption("SMOOTHING_EPSILON2",SmoothingEps2, 1.0); /* DESCRIPTION: Switch to calculate for each dimension separately */ addBoolOption("SEPARATE_DIMENSIONS", SmoothSepDim, false); /* DESCRIPTION: Switch to activate working on the design surfaces only */ - addBoolOption("SMOOTH_ON_SURFACE", SmoothOnSurface, false); + addBoolOption("SMOOTH_ON_SURFACE",SmoothOnSurface, false); /* DESCRIPTION: Switch to activate zero Dirichlet boundary for surface mode */ addBoolOption("DIRICHLET_SURFACE_BOUNDARY", SmoothDirichletSurfaceBound, false); /* DESCRIPTION: Switch to activate the debbuging modus */ @@ -2330,11 +2051,9 @@ void CConfig::SetConfig_Options() { * \n DESCRIPTION: Output filename for the Sobolev Hessian approximation. \ingroup Config*/ addStringOption("HESS_OBJFUNC_FILENAME", ObjFunc_Hess_FileName, string("of_hess.dat")); - /* DESCRIPTION: Linear solver for the gradient smoothing\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: - * FGMRES \ingroup Config*/ + /* DESCRIPTION: Linear solver for the gradient smoothing\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ addEnumOption("GRAD_LINEAR_SOLVER", Kind_Grad_Linear_Solver, Linear_Solver_Map, FGMRES); - /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink - * \n DEFAULT: ILU \ingroup Config*/ + /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink \n DEFAULT: ILU \ingroup Config*/ addEnumOption("GRAD_LINEAR_SOLVER_PREC", Kind_Grad_Linear_Solver_Prec, Linear_Solver_Prec_Map, ILU); /* DESCRIPTION: Minimum error threshold for the linear solver for the implicit formulation */ addDoubleOption("GRAD_LINEAR_SOLVER_ERROR", Grad_Linear_Solver_Error, 1E-14); @@ -2344,52 +2063,39 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Input/output files and formats \ingroup Config */ /*--- Options related to input/output files and formats ---*/ - /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n - * DEFAULT: TECPLOT \ingroup Config */ + /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link TabOutput_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_OUTPUT::TAB_CSV); - /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY - * output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ + /*!\brief OUTPUT_PRECISION \n DESCRIPTION: Set .precision(value) to specified value for SU2_DOT and HISTORY output. Useful for exact gradient validation. \n DEFAULT: 6 \ingroup Config */ addUnsignedShortOption("OUTPUT_PRECISION", output_precision, 10); /*!\brief ACTDISK_JUMP \n DESCRIPTION: The jump is given by the difference in values or a ratio */ addEnumOption("ACTDISK_JUMP", ActDisk_Jump, Jump_Map, DIFFERENCE); - /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 - * \ingroup Config*/ + /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ addEnumOption("MESH_FORMAT", Mesh_FileFormat, Input_Map, SU2); /* DESCRIPTION: Mesh input file */ addStringOption("MESH_FILENAME", Mesh_FileName, string("mesh.su2")); - /*!\brief MESH_OUT_FILENAME \n DESCRIPTION: Mesh output file name. Used when converting, scaling, or deforming a mesh. - * \n DEFAULT: mesh_out.su2 \ingroup Config*/ + /*!\brief MESH_OUT_FILENAME \n DESCRIPTION: Mesh output file name. Used when converting, scaling, or deforming a mesh. \n DEFAULT: mesh_out.su2 \ingroup Config*/ addStringOption("MESH_OUT_FILENAME", Mesh_Out_FileName, string("mesh_out.su2")); - /* DESCRIPTION: List of the number of grid points in the RECTANGLE or BOX grid in the x,y,z directions. (default: - * (33,33,33) ). */ + /* DESCRIPTION: List of the number of grid points in the RECTANGLE or BOX grid in the x,y,z directions. (default: (33,33,33) ). */ addShortListOption("MESH_BOX_SIZE", nMesh_Box_Size, Mesh_Box_Size); - /* DESCRIPTION: List of the length of the RECTANGLE or BOX grid in the x,y,z directions. (default: (1.0,1.0,1.0) ). */ - mesh_box_length[0] = 1.0; - mesh_box_length[1] = 1.0; - mesh_box_length[2] = 1.0; + /* DESCRIPTION: List of the length of the RECTANGLE or BOX grid in the x,y,z directions. (default: (1.0,1.0,1.0) ). */ + mesh_box_length[0] = 1.0; mesh_box_length[1] = 1.0; mesh_box_length[2] = 1.0; addDoubleArrayOption("MESH_BOX_LENGTH", 3, mesh_box_length); - /* DESCRIPTION: List of the offset from 0.0 of the RECTANGLE or BOX grid in the x,y,z directions. (default: - * (0.0,0.0,0.0) ). */ - mesh_box_offset[0] = 0.0; - mesh_box_offset[1] = 0.0; - mesh_box_offset[2] = 0.0; + /* DESCRIPTION: List of the offset from 0.0 of the RECTANGLE or BOX grid in the x,y,z directions. (default: (0.0,0.0,0.0) ). */ + mesh_box_offset[0] = 0.0; mesh_box_offset[1] = 0.0; mesh_box_offset[2] = 0.0; addDoubleArrayOption("MESH_BOX_OFFSET", 3, mesh_box_offset); /* DESCRIPTION: Determine if the mesh file supports multizone. \n DEFAULT: true (temporarily) */ addBoolOption("MULTIZONE_MESH", Multizone_Mesh, true); - /* DESCRIPTION: Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: false - * (temporarily) */ + /* DESCRIPTION: Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: false (temporarily) */ addBoolOption("MULTIZONE_RESIDUAL", Multizone_Residual, false); - /* !\brief CONTROLLING_VARIABLE_NAMES \n DESCRIPTION: Names of the variables used as inputs for the data regression - * method in flamelet or data-driven fluid models. */ + /* !\brief CONTROLLING_VARIABLE_NAMES \n DESCRIPTION: Names of the variables used as inputs for the data regression method in flamelet or data-driven fluid models. */ addStringListOption("CONTROLLING_VARIABLE_NAMES", n_control_vars, controlling_variable_names); - /* !\brief CONTROLLING_VARIABLE_SOURCE_NAMES \n DESCRIPTION: Names of the variables in the flamelet manifold - * corresponding to the source terms of the controlling variables. */ + /* !\brief CONTROLLING_VARIABLE_SOURCE_NAMES \n DESCRIPTION: Names of the variables in the flamelet manifold corresponding to the source terms of the controlling variables. */ addStringListOption("CONTROLLING_VARIABLE_SOURCE_NAMES", n_control_vars, cv_source_names); /* DESCRIPTION: Names of the passive lookup variables for flamelet LUT */ @@ -2401,21 +2107,17 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Names of the user scalar source terms. */ addStringListOption("USER_SOURCE_NAMES", n_user_sources, user_source_names); - /*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup - * Config*/ + /*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup Config*/ addStringOption("CONV_FILENAME", Conv_FileName, string("history")); /*!\brief BREAKDOWN_FILENAME \n DESCRIPTION: Output file forces breakdown \ingroup Config*/ addStringOption("BREAKDOWN_FILENAME", Breakdown_FileName, string("forces_breakdown.dat")); - /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart flow input file (the file output under the filename set by - * RESTART_FLOW_FILENAME) \n DEFAULT: solution_flow.dat \ingroup Config */ + /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart flow input file (the file output under the filename set by RESTART_FLOW_FILENAME) \n DEFAULT: solution_flow.dat \ingroup Config */ addStringOption("SOLUTION_FILENAME", Solution_FileName, string("solution.dat")); - /*!\brief SOLUTION_ADJ_FILENAME\n DESCRIPTION: Restart adjoint input file. Objective function abbreviation is - * expected. \ingroup Config*/ + /*!\brief SOLUTION_ADJ_FILENAME\n DESCRIPTION: Restart adjoint input file. Objective function abbreviation is expected. \ingroup Config*/ addStringOption("SOLUTION_ADJ_FILENAME", Solution_AdjFileName, string("solution_adj.dat")); /*!\brief RESTART_FLOW_FILENAME \n DESCRIPTION: Output file restart flow \ingroup Config*/ addStringOption("RESTART_FILENAME", Restart_FileName, string("restart.dat")); - /*!\brief RESTART_ADJ_FILENAME \n DESCRIPTION: Output file restart adjoint. Objective function abbreviation will be - * appended. \ingroup Config*/ + /*!\brief RESTART_ADJ_FILENAME \n DESCRIPTION: Output file restart adjoint. Objective function abbreviation will be appended. \ingroup Config*/ addStringOption("RESTART_ADJ_FILENAME", Restart_AdjFileName, string("restart_adj.dat")); /*!\brief VOLUME_FLOW_FILENAME \n DESCRIPTION: Output file flow (w/o extension) variables \ingroup Config */ addStringOption("VOLUME_FILENAME", Volume_FileName, string("vol_solution")); @@ -2459,7 +2161,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Type of mesh motion */ addEnumOption("GRID_MOVEMENT", Kind_GridMovement, GridMovement_Map, NO_MOVEMENT); /* DESCRIPTION: Type of surface motion */ - addEnumListOption("SURFACE_MOVEMENT", nKind_SurfaceMovement, Kind_SurfaceMovement, SurfaceMovement_Map); + addEnumListOption("SURFACE_MOVEMENT",nKind_SurfaceMovement, Kind_SurfaceMovement, SurfaceMovement_Map); /* DESCRIPTION: Marker(s) of moving surfaces (MOVING_WALL or DEFORMING grid motion). */ addStringListOption("MARKER_MOVING", nMarker_Moving, Marker_Moving); /* DESCRIPTION: Marker(s) of gradient problem boundaries. */ @@ -2516,8 +2218,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("AIRFOIL_MASS_RATIO", AirfoilMassRatio, 60); /* DESCRIPTION: Distance in semichords by which the center of gravity lies behind the elastic axis. */ addDoubleOption("CG_LOCATION", CG_Location, 1.8); - /* DESCRIPTION: The radius of gyration squared (expressed in semichords) of the typical section about the elastic - * axis. */ + /* DESCRIPTION: The radius of gyration squared (expressed in semichords) of the typical section about the elastic axis. */ addDoubleOption("RADIUS_GYRATION_SQUARED", RadiusGyrationSquared, 3.48); /* DESCRIPTION: Solve the aeroelastic equations every given number of internal iterations. */ addUnsignedShortOption("AEROELASTIC_ITER", AeroelasticIter, 3); @@ -2565,9 +2266,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Evaluate equivalent area on the Near-Field */ addBoolOption("EQUIV_AREA", EquivArea, false); - ea_lim[0] = 0.0; - ea_lim[1] = 1.0; - ea_lim[2] = 1.0; + ea_lim[0] = 0.0; ea_lim[1] = 1.0; ea_lim[2] = 1.0; /* DESCRIPTION: Integration limits of the equivalent area ( xmin, xmax, Dist_NearField ) */ addDoubleArrayOption("EA_INT_LIMIT", 3, ea_lim); /* DESCRIPTION: Equivalent area scaling factor */ @@ -2606,23 +2305,16 @@ void CConfig::SetConfig_Options() { addDVValueOption("DV_VALUE", nDV_Value, DV_Value, nDV, ParamDV, Design_Variable); /* DESCRIPTION: Provide a file of surface positions from an external parameterization. */ addStringOption("DV_FILENAME", DV_Filename, string("surface_positions.dat")); - /* DESCRIPTION: File of sensitivities as an unordered ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each - * volume grid point. */ + /* DESCRIPTION: File of sensitivities as an unordered ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each volume grid point. */ addStringOption("DV_UNORDERED_SENS_FILENAME", DV_Unordered_Sens_Filename, string("unordered_sensitivity.dat")); - /* DESCRIPTION: File of sensitivities as an ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each surface grid - * point. */ + /* DESCRIPTION: File of sensitivities as an ASCII file with rows of x, y, z, dJ/dx, dJ/dy, dJ/dz for each surface grid point. */ addStringOption("DV_SENS_FILENAME", DV_Sens_Filename, string("surface_sensitivity.dat")); - /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link Output_Map \endlink \n - * DEFAULT: TECPLOT \ingroup Config */ + /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link Output_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ addEnumOption("DV_SENSITIVITY_FORMAT", Sensitivity_FileFormat, Sensitivity_Map, SU2_NATIVE); /* DESCRIPTION: Hold the grid fixed in a region */ addBoolOption("HOLD_GRID_FIXED", Hold_GridFixed, false); - grid_fix[0] = -1E15; - grid_fix[1] = -1E15; - grid_fix[2] = -1E15; - grid_fix[3] = 1E15; - grid_fix[4] = 1E15; - grid_fix[5] = 1E15; + grid_fix[0] = -1E15; grid_fix[1] = -1E15; grid_fix[2] = -1E15; + grid_fix[3] = 1E15; grid_fix[4] = 1E15; grid_fix[5] = 1E15; /* DESCRIPTION: Coordinates of the box where the grid will be deformed (Xmin, Ymin, Zmin, Xmax, Ymax, Zmax) */ addDoubleArrayOption("HOLD_GRID_FIXED_COORD", 6, grid_fix); @@ -2638,8 +2330,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("DEFORM_COEFF", Deform_Coeff, 1E6); /* DESCRIPTION: Deform limit in m or inches */ addDoubleOption("DEFORM_LIMIT", Deform_Limit, 1E6); - /* DESCRIPTION: Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, WALL_DISTANCE, - * CONSTANT_STIFFNESS) */ + /* DESCRIPTION: Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, WALL_DISTANCE, CONSTANT_STIFFNESS) */ addEnumOption("DEFORM_STIFFNESS_TYPE", Deform_StiffnessType, Deform_Stiffness_Map, SOLID_WALL_DISTANCE); /* DESCRIPTION: Young's modulus for constant stiffness FEA method of grid deformation */ addDoubleOption("DEFORM_ELASTICITY_MODULUS", Deform_ElasticityMod, 2E11); @@ -2647,11 +2338,9 @@ void CConfig::SetConfig_Options() { addDoubleOption("DEFORM_POISSONS_RATIO", Deform_PoissonRatio, 0.3); /* DESCRIPTION: Size of the layer of highest stiffness for wall distance-based mesh stiffness */ addDoubleOption("DEFORM_STIFF_LAYER_SIZE", Deform_StiffLayerSize, 0.0); - /* DESCRIPTION: Linear solver for the mesh deformation\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: - * FGMRES \ingroup Config*/ + /* DESCRIPTION: Linear solver for the mesh deformation\n OPTIONS: see \link Linear_Solver_Map \endlink \n DEFAULT: FGMRES \ingroup Config*/ addEnumOption("DEFORM_LINEAR_SOLVER", Kind_Deform_Linear_Solver, Linear_Solver_Map, FGMRES); - /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink - * \n DEFAULT: LU_SGS \ingroup Config*/ + /* \n DESCRIPTION: Preconditioner for the Krylov linear solvers \n OPTIONS: see \link Linear_Solver_Prec_Map \endlink \n DEFAULT: LU_SGS \ingroup Config*/ addEnumOption("DEFORM_LINEAR_SOLVER_PREC", Kind_Deform_Linear_Solver_Prec, Linear_Solver_Prec_Map, ILU); /* DESCRIPTION: Minimum error threshold for the linear solver for the implicit formulation */ addDoubleOption("DEFORM_LINEAR_SOLVER_ERROR", Deform_Linear_Solver_Error, 1E-14); @@ -2692,11 +2381,9 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: FEA solver \ingroup Config*/ /*--- Options related to the FEA solver ---*/ - /*!\brief FEA_FILENAME \n DESCRIPTION: Filename to input for element-based properties \n Default: - * default_element_properties.dat \ingroup Config */ + /*!\brief FEA_FILENAME \n DESCRIPTION: Filename to input for element-based properties \n Default: default_element_properties.dat \ingroup Config */ addStringOption("FEA_FILENAME", FEA_FileName, string("default_element_properties.dat")); - /* DESCRIPTION: Determine if advanced features are used from the element-based FEA analysis (NO, YES = experimental) - */ + /* DESCRIPTION: Determine if advanced features are used from the element-based FEA analysis (NO, YES = experimental) */ addBoolOption("FEA_ADVANCED_MODE", FEAAdvancedMode, false); /* DESCRIPTION: Modulus of elasticity */ @@ -2711,7 +2398,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("KNOWLES_N", Knowles_N, 1.0); /* DESCRIPTION: Include DE effects - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("DE_EFFECTS", DE_Effects, false); /*!\brief ELECTRIC_FIELD_CONST \n DESCRIPTION: Value of the Dielectric Elastomer constant */ addDoubleListOption("ELECTRIC_FIELD_CONST", nElectric_Constant, Electric_Constant); @@ -2721,22 +2408,18 @@ void CConfig::SetConfig_Options() { addDoubleListOption("ELECTRIC_FIELD_DIR", nDim_Electric_Field, Electric_Field_Dir); /*!\brief DESIGN_VARIABLE_FEA - * \n DESCRIPTION: Design variable for FEA problems \n OPTIONS: See \link DVFEA_Map \endlink \n DEFAULT - * VENKATAKRISHNAN \ingroup Config */ + * \n DESCRIPTION: Design variable for FEA problems \n OPTIONS: See \link DVFEA_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ addEnumOption("DESIGN_VARIABLE_FEA", Kind_DV_FEA, DVFEA_Map, NODV_FEA); /* DESCRIPTION: Consider a reference solution for the structure (optimization applications) - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("REFERENCE_GEOMETRY", RefGeom, false); /*!\brief REFERENCE_GEOMETRY_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_GEOMETRY_PENALTY", RefGeom_Penalty, 1E6); - /*!\brief REFERENCE_GEOMETRY_FILENAME \n DESCRIPTION: Reference geometry filename \n Default: reference_geometry.dat - * \ingroup Config */ + /*!\brief REFERENCE_GEOMETRY_FILENAME \n DESCRIPTION: Reference geometry filename \n Default: reference_geometry.dat \ingroup Config */ addStringOption("REFERENCE_GEOMETRY_FILENAME", RefGeom_FEMFileName, string("reference_geometry.dat")); - /*!\brief REFERENCE_GEOMETRY_FORMAT \n DESCRIPTION: Format of the reference geometry file \n OPTIONS: see \link - * Input_Ref_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ + /*!\brief REFERENCE_GEOMETRY_FORMAT \n DESCRIPTION: Format of the reference geometry file \n OPTIONS: see \link Input_Ref_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ addEnumOption("REFERENCE_GEOMETRY_FORMAT", RefGeom_FileFormat, Input_Ref_Map, SU2_REF); - /*!\brief REFERENCE_GEOMETRY_SURFACE\n DESCRIPTION: If true consider only the surfaces where loads are applied. - * \ingroup Config*/ + /*!\brief REFERENCE_GEOMETRY_SURFACE\n DESCRIPTION: If true consider only the surfaces where loads are applied. \ingroup Config*/ addBoolOption("REFERENCE_GEOMETRY_SURFACE", RefGeomSurf, false); /*!\brief REFERENCE_NODE\n DESCRIPTION: Reference node for the structure (optimization applications) */ @@ -2746,27 +2429,23 @@ void CConfig::SetConfig_Options() { /*!\brief REFERENCE_NODE_PENALTY\n DESCRIPTION: Penalty weight value for the objective function \ingroup Config*/ addDoubleOption("REFERENCE_NODE_PENALTY", RefNode_Penalty, 1E3); - /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup - * Config*/ + /*!\brief TOTAL_DV_PENALTY\n DESCRIPTION: Penalty weight value to maintain the total sum of DV constant \ingroup Config*/ addDoubleOption("TOTAL_DV_PENALTY", DV_Penalty, 0); - /*!\brief STRESS_PENALTY_PARAM\n DESCRIPTION: Maximum allowed stress and KS exponent for structural optimization - * \ingroup Config*/ + /*!\brief STRESS_PENALTY_PARAM\n DESCRIPTION: Maximum allowed stress and KS exponent for structural optimization \ingroup Config*/ addDoubleArrayOption("STRESS_PENALTY_PARAM", 2, StressPenaltyParam.data()); /*!\brief REGIME_TYPE \n DESCRIPTION: Geometric condition \n OPTIONS: see \link Struct_Map \endlink \ingroup Config*/ addEnumOption("GEOMETRIC_CONDITIONS", Kind_Struct_Solver, Struct_Map, STRUCT_DEFORMATION::SMALL); /*!\brief REGIME_TYPE \n DESCRIPTION: Material model \n OPTIONS: see \link Material_Map \endlink \ingroup Config*/ addEnumOption("MATERIAL_MODEL", Kind_Material, Material_Map, STRUCT_MODEL::LINEAR_ELASTIC); - /*!\brief REGIME_TYPE \n DESCRIPTION: Compressibility of the material \n OPTIONS: see \link MatComp_Map \endlink - * \ingroup Config*/ + /*!\brief REGIME_TYPE \n DESCRIPTION: Compressibility of the material \n OPTIONS: see \link MatComp_Map \endlink \ingroup Config*/ addEnumOption("MATERIAL_COMPRESSIBILITY", Kind_Material_Compress, MatComp_Map, STRUCT_COMPRESS::COMPRESSIBLE); /* DESCRIPTION: Consider a prestretch in the structural domain - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("PRESTRETCH", Prestretch, false); - /*!\brief PRESTRETCH_FILENAME \n DESCRIPTION: Filename to input for prestretching membranes \n Default: - * prestretch_file.dat \ingroup Config */ + /*!\brief PRESTRETCH_FILENAME \n DESCRIPTION: Filename to input for prestretching membranes \n Default: prestretch_file.dat \ingroup Config */ addStringOption("PRESTRETCH_FILENAME", Prestretch_FEMFileName, string("prestretch_file.dat")); /* DESCRIPTION: Iterative method for non-linear structural analysis */ @@ -2774,10 +2453,10 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Formulation for bidimensional elasticity solver */ addEnumOption("FORMULATION_ELASTICITY_2D", Kind_2DElasForm, ElasForm_2D, STRUCT_2DFORM::PLANE_STRAIN); /* DESCRIPTION: Apply dead loads - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("DEAD_LOAD", DeadLoad, false); /* DESCRIPTION: Temporary: pseudo static analysis (no density in dynamic analysis) - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("PSEUDO_STATIC", PseudoStatic, false); /* DESCRIPTION: Parameter alpha for Newmark scheme (s) */ addDoubleOption("NEWMARK_BETA", Newmark_beta, 0.25); @@ -2798,9 +2477,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Maximum number of increments of the */ addUnsignedLongOption("NUMBER_INCREMENTS", IncLoad_Nincrements, 10); - inc_crit[0] = 0.0; - inc_crit[1] = 0.0; - inc_crit[2] = 0.0; + inc_crit[0] = 0.0; inc_crit[1] = 0.0; inc_crit[2] = 0.0; /* DESCRIPTION: Definition of the UTOL RTOL ETOL*/ addDoubleArrayOption("INCREMENTAL_CRITERIA", 3, inc_crit); @@ -2818,8 +2495,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, - ENUM_PROJECTION_FUNCTION::NONE); + 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 */ @@ -2865,6 +2541,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Determines if the forces breakdown is written out */ addBoolOption("WRT_FORCES_BREAKDOWN", Wrt_ForcesBreakdown, false); + /*!\par KIND_INTERPOLATION \n * DESCRIPTION: Type of interpolation to use for multi-zone problems. \n OPTIONS: see \link Interpolator_Map \endlink * Sets Kind_Interpolation \ingroup Config @@ -2877,14 +2554,13 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("NUM_NEAREST_NEIGHBORS", NumNearestNeighbors, 1); /*!\par KIND_INTERPOLATION \n - * DESCRIPTION: Type of radial basis function to use for radial basis function interpolation. \n OPTIONS: see \link - * RadialBasis_Map \endlink Sets Kind_RadialBasis \ingroup Config + * DESCRIPTION: Type of radial basis function to use for radial basis function interpolation. \n OPTIONS: see \link RadialBasis_Map \endlink + * Sets Kind_RadialBasis \ingroup Config */ - addEnumOption("KIND_RADIAL_BASIS_FUNCTION", Kind_RadialBasisFunction, RadialBasisFunction_Map, - RADIAL_BASIS::WENDLAND_C2); + addEnumOption("KIND_RADIAL_BASIS_FUNCTION", Kind_RadialBasisFunction, RadialBasisFunction_Map, RADIAL_BASIS::WENDLAND_C2); /* DESCRIPTION: Use polynomial term in radial basis function interpolation. - * Options: NO, YES \ingroup Config */ + * Options: NO, YES \ingroup Config */ addBoolOption("RADIAL_BASIS_FUNCTION_POLYNOMIAL_TERM", RadialBasisFunction_PolynomialOption, true); /* DESCRIPTION: Radius for radial basis function. */ @@ -2893,19 +2569,17 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Tolerance to prune small coefficients from the RBF interpolation matrix. */ addDoubleOption("RADIAL_BASIS_FUNCTION_PRUNE_TOLERANCE", RadialBasisFunction_PruneTol, 1e-6); - /*!\par INLETINTERPOLATION \n - * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link - * Inlet_SpanwiseInterpolation_Map \endlink Sets Kind_InletInterpolation \ingroup Config + /*!\par INLETINTERPOLATION \n + * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link Inlet_SpanwiseInterpolation_Map \endlink + * Sets Kind_InletInterpolation \ingroup Config */ - addEnumOption("INLET_INTERPOLATION_FUNCTION", Kind_InletInterpolationFunction, Inlet_SpanwiseInterpolation_Map, - INLET_SPANWISE_INTERP::NONE); + addEnumOption("INLET_INTERPOLATION_FUNCTION",Kind_InletInterpolationFunction, Inlet_SpanwiseInterpolation_Map, INLET_SPANWISE_INTERP::NONE); - /*!\par INLETINTERPOLATION \n - * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link - * Inlet_SpanwiseInterpolation_Map \endlink Sets Kind_InletInterpolation \ingroup Config + /*!\par INLETINTERPOLATION \n + * DESCRIPTION: Type of spanwise interpolation to use for the inlet face. \n OPTIONS: see \link Inlet_SpanwiseInterpolation_Map \endlink + * Sets Kind_InletInterpolation \ingroup Config */ - addEnumOption("INLET_INTERPOLATION_DATA_TYPE", Kind_Inlet_InterpolationType, Inlet_SpanwiseInterpolationType_Map, - INLET_INTERP_TYPE::VR_VTHETA); + addEnumOption("INLET_INTERPOLATION_DATA_TYPE", Kind_Inlet_InterpolationType, Inlet_SpanwiseInterpolationType_Map, INLET_INTERP_TYPE::VR_VTHETA); addBoolOption("PRINT_INLET_INTERPOLATED_DATA", PrintInlet_InterpolatedData, false); @@ -2943,14 +2617,10 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Rotation of the volumetric heat source respect to Z axis */ addDoubleOption("HEAT_SOURCE_ROTATION_Z", Heat_Source_Rot_Z, 0.0); /* DESCRIPTION: Position of heat source center (Heat_Source_Center_X, Heat_Source_Center_Y, Heat_Source_Center_Z) */ - hs_center[0] = 0.0; - hs_center[1] = 0.0; - hs_center[2] = 0.0; + hs_center[0] = 0.0; hs_center[1] = 0.0; hs_center[2] = 0.0; addDoubleArrayOption("HEAT_SOURCE_CENTER", 3, hs_center); /* DESCRIPTION: Vector of heat source radii (Heat_Source_Axes_A, Heat_Source_Axes_B, Heat_Source_Axes_C) */ - hs_axes[0] = 1.0; - hs_axes[1] = 1.0; - hs_axes[2] = 1.0; + hs_axes[0] = 1.0; hs_axes[1] = 1.0; hs_axes[2] = 1.0; addDoubleArrayOption("HEAT_SOURCE_AXES", 3, hs_axes); /*!\brief MARKER_EMISSIVITY DESCRIPTION: Wall emissivity of the marker for radiation purposes \n @@ -2965,8 +2635,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, - CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX); + addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX); /*!\par CONFIG_CATEGORY: Visualize Control Volumes \ingroup Config*/ /*--- options related to visualizing control volumes ---*/ @@ -3011,9 +2680,7 @@ void CConfig::SetConfig_Options() { addEnumOption("FFD_COORD_SYSTEM", FFD_CoordSystem, CoordSystem_Map, CARTESIAN); /* DESCRIPTION: Axis information for the spherical and cylindrical coord system */ - ffd_axis[0] = 0.0; - ffd_axis[1] = 0.0; - ffd_axis[2] = 0.0; + ffd_axis[0] = 0.0; ffd_axis[1] = 0.0; ffd_axis[2] =0.0; addDoubleArrayOption("FFD_AXIS", 3, ffd_axis); /* DESCRIPTION: Number of total iterations in the FFD point inversion */ @@ -3050,17 +2717,21 @@ void CConfig::SetConfig_Options() { addEnumOption("FFD_CONTINUITY", FFD_Continuity, Continuity_Map, DERIVATIVE_2ND); /* DESCRIPTION: Kind of blending for the FFD definition */ - addEnumOption("FFD_BLENDING", FFD_Blending, Blending_Map, BEZIER); + addEnumOption("FFD_BLENDING", FFD_Blending, Blending_Map, BEZIER ); /* DESCRIPTION: Order of the BSplines for BSpline Blending function */ - ffd_coeff[0] = 2; - ffd_coeff[1] = 2; - ffd_coeff[2] = 2; + ffd_coeff[0] = 2; ffd_coeff[1] = 2; ffd_coeff[2] = 2; addDoubleArrayOption("FFD_BSPLINE_ORDER", 3, ffd_coeff); /*--- Options for the automatic differentiation methods ---*/ /*!\par CONFIG_CATEGORY: Automatic Differentation options\ingroup Config*/ + /* DESCRIPTION: Direct differentiation mode (forward) */ + addEnumOption("DIRECT_DIFF", DirectDiff, DirectDiff_Var_Map, NO_DERIVATIVE); + + /* DESCRIPTION: Automatic differentiation mode (reverse) */ + addBoolOption("AUTO_DIFF", AD_Mode, NO); + /* DESCRIPTION: Preaccumulation in the AD mode. */ addBoolOption("PREACC", AD_Preaccumulation, YES); @@ -3254,9 +2925,11 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("ROM_SAVE_FREQ", rom_save_freq, 1); /* END_CONFIG_OPTIONS */ + } void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) { + ifstream case_file; /*--- Read the configuration file ---*/ @@ -3270,29 +2943,32 @@ void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) { SetConfig_Parsing(case_file); case_file.close(); + } -void CConfig::SetConfig_Parsing(istream& config_buffer) { +void CConfig::SetConfig_Parsing(istream& config_buffer){ + string text_line, option_name; vector option_value; string errorString; - const int max_err_count = 30; // Maximum number of errors to print before stopping - int err_count = 0; // How many errors have we found in the config file + const int max_err_count = 30; // Maximum number of errors to print before stopping + int err_count = 0; // How many errors have we found in the config file int line_count = 1; map included_options; /*--- Parse the configuration file and set the options ---*/ - while (getline(config_buffer, text_line)) { + while (getline (config_buffer, text_line)) { + if (err_count >= max_err_count) { errorString.append("Too many errors, stopping parse."); break; } - PrintingToolbox::trim(text_line); + PrintingToolbox::trim(text_line); /*--- Check if there is a line continuation character at the * end of the current line or somewhere in between (the rest is ignored then). @@ -3300,78 +2976,74 @@ void CConfig::SetConfig_Parsing(istream& config_buffer) { * If there is a statement after a cont. char * throw an error. ---*/ - if (!text_line.empty() && (text_line.front() != '%')) { - while (text_line.back() == '\\' || (PrintingToolbox::split(text_line, '\\').size() > 1)) { - string tmp; - getline(config_buffer, tmp); - line_count++; - if (tmp.find_first_of('=') != string::npos) { - errorString.append("Line " + to_string(line_count) + ": Statement found after continuation character.\n"); - } - PrintingToolbox::trim(tmp); - if (tmp.front() != '%') { - text_line = PrintingToolbox::split(text_line, '\\')[0]; - text_line += " " + tmp; - } - } - } + if (!text_line.empty() && (text_line.front() != '%')){ + while (text_line.back() == '\\' || + (PrintingToolbox::split(text_line, '\\').size() > 1)){ + string tmp; + getline (config_buffer, tmp); + line_count++; + if (tmp.find_first_of('=') != string::npos){ + errorString.append("Line " + to_string(line_count) + ": Statement found after continuation character.\n"); + } + PrintingToolbox::trim(tmp); + if (tmp.front() != '%'){ + text_line = PrintingToolbox::split(text_line, '\\')[0]; + text_line += " " + tmp; + } + } + } if (TokenizeString(text_line, option_name, option_value)) { /*--- See if it's a python option ---*/ if (option_map.find(option_name) == option_map.end()) { - string newString; - newString.append("Line " + to_string(line_count) + " " + option_name); - newString.append(": invalid option name"); - newString.append(". Check current SU2 options in config_template.cfg."); - newString.append("\n"); - if (!option_name.compare("SINGLEZONE_DRIVER")) - newString.append("Option SINGLEZONE_DRIVER is deprecated, it does not have a replacement.\n\n"); - else if (!option_name.compare("DYN_TIMESTEP")) - newString.append("DYN_TIMESTEP is deprecated. Use TIME_STEP instead.\n\n"); - else if (!option_name.compare("DYN_TIME")) - newString.append("DYN_TIME is deprecated. Use MAX_TIME instead.\n\n"); - else if (!option_name.compare("DYNAMIC_ANALYSIS")) - newString.append("DYNAMIC_ANALYSIS is deprecated. Use TIME_DOMAIN instead.\n\n"); - else if (!option_name.compare("SPECIES_USE_STRONG_BC")) - newString.append( - "SPECIES_USE_STRONG_BC is deprecated. Use MARKER_SPECIES_STRONG_BC= (marker1, ...) instead.\n\n"); - else { - /*--- Find the most likely candidate for the unrecognized option, based on the length - of start and end character sequences shared by candidates and the option. ---*/ - auto countMatchChars = [&option_name](const string& candidate) { - const size_t sz1 = option_name.size(), sz2 = candidate.size(); - size_t nMatch = 0; - for (size_t i = 0; i < min(sz1, sz2); ++i) { - if (option_name[i] == candidate[i]) - nMatch++; - else - break; - } - for (size_t i = 0; i < min(sz1, sz2); ++i) { - if (option_name[sz1 - 1 - i] == candidate[sz2 - 1 - i]) - nMatch++; - else - break; - } - return nMatch; - }; - string match; - size_t maxScore = 0; - for (auto& candidate : option_map) { - auto score = countMatchChars(candidate.first); - if (score > maxScore) { - maxScore = score; - match = candidate.first; + string newString; + newString.append("Line " + to_string(line_count) + " " + option_name); + newString.append(": invalid option name"); + newString.append(". Check current SU2 options in config_template.cfg."); + newString.append("\n"); + if (!option_name.compare("SINGLEZONE_DRIVER")) + newString.append("Option SINGLEZONE_DRIVER is deprecated, it does not have a replacement.\n\n"); + else if (!option_name.compare("DYN_TIMESTEP")) + newString.append("DYN_TIMESTEP is deprecated. Use TIME_STEP instead.\n\n"); + else if (!option_name.compare("DYN_TIME")) + newString.append("DYN_TIME is deprecated. Use MAX_TIME instead.\n\n"); + else if (!option_name.compare("DYNAMIC_ANALYSIS")) + newString.append("DYNAMIC_ANALYSIS is deprecated. Use TIME_DOMAIN instead.\n\n"); + else if (!option_name.compare("SPECIES_USE_STRONG_BC")) + newString.append("SPECIES_USE_STRONG_BC is deprecated. Use MARKER_SPECIES_STRONG_BC= (marker1, ...) instead.\n\n"); + else { + /*--- Find the most likely candidate for the unrecognized option, based on the length + of start and end character sequences shared by candidates and the option. ---*/ + auto countMatchChars = [&option_name](const string& candidate) { + const size_t sz1 = option_name.size(), sz2 = candidate.size(); + size_t nMatch = 0; + for (size_t i=0; i maxScore) { + maxScore = score; + match = candidate.first; + } } + newString.append("Did you mean "); + newString.append(match); + newString.append("?\n"); } - newString.append("Did you mean "); - newString.append(match); - newString.append("?\n"); - } - errorString.append(newString); - err_count++; - line_count++; + errorString.append(newString); + err_count++; + line_count++; continue; } @@ -3379,7 +3051,7 @@ void CConfig::SetConfig_Parsing(istream& config_buffer) { if (included_options.find(option_name) != included_options.end()) { string newString; - newString.append("Line " + to_string(line_count) + " " + option_name); + newString.append("Line " + to_string(line_count) + " " + option_name); newString.append(": option appears twice"); newString.append("\n"); errorString.append(newString); @@ -3400,27 +3072,18 @@ void CConfig::SetConfig_Parsing(istream& config_buffer) { /*--- valid option, but deprecated value ---*/ if (!option_name.compare("KIND_TURB_MODEL")) { if (option_value[0] == "SST_SUST") - errorString.append( - "Option KIND_TURB_MODEL=SST_SUST is deprecated. Use KIND_TURB_MODEL=SST, SST_OPTIONS=SUSTAINING " - "instead.\n"); + errorString.append("Option KIND_TURB_MODEL=SST_SUST is deprecated. Use KIND_TURB_MODEL=SST, SST_OPTIONS=SUSTAINING instead.\n"); else if (option_value[0] == "SA_NEG") - errorString.append( - "Option KIND_TURB_MODEL=SA_NEG is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=NEGATIVE instead.\n"); + errorString.append("Option KIND_TURB_MODEL=SA_NEG is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=NEGATIVE instead.\n"); else if (option_value[0] == "SA_E") - errorString.append( - "Option KIND_TURB_MODEL=SA_E is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS instead.\n"); + errorString.append("Option KIND_TURB_MODEL=SA_E is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS instead.\n"); else if (option_value[0] == "SA_COMP") - errorString.append( - "Option KIND_TURB_MODEL=SA_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=COMPRESSIBILITY " - "instead.\n"); + errorString.append("Option KIND_TURB_MODEL=SA_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=COMPRESSIBILITY instead.\n"); else if (option_value[0] == "SA_E_COMP") - errorString.append( - "Option KIND_TURB_MODEL=SA_E_COMP is deprecated. Use KIND_TURB_MODEL=SA, " - "SA_OPTIONS=EDWARDS,COMPRESSIBILITY instead.\n"); + errorString.append("Option KIND_TURB_MODEL=SA_E_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS,COMPRESSIBILITY instead.\n"); } else if (!option_name.compare("KIND_TRANS_MODEL")) { if (option_value[0] == "BC") - errorString.append( - "Option KIND_TRANS_MODEL=BC is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=BCM instead.\n"); + errorString.append("Option KIND_TRANS_MODEL=BC is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=BCM instead.\n"); } errorString.append(out); errorString.append("\n"); @@ -3437,25 +3100,28 @@ void CConfig::SetConfig_Parsing(istream& config_buffer) { } } -void CConfig::SetDefaultFromConfig(CConfig* config) { - map noInheritance = {{"SCREEN_OUTPUT", true}, {"HISTORY_OUTPUT", true}}; +void CConfig::SetDefaultFromConfig(CConfig *config){ + + map noInheritance = {{"SCREEN_OUTPUT", true},{"HISTORY_OUTPUT", true}}; map::iterator iter = all_options.begin(), curr_iter; - while (iter != all_options.end()) { + while (iter != all_options.end()){ curr_iter = iter++; - if (!config->option_map[curr_iter->first]->GetValue().empty() && !noInheritance[curr_iter->first]) { + if (!config->option_map[curr_iter->first]->GetValue().empty() && !noInheritance[curr_iter->first]){ option_map[curr_iter->first]->SetValue(config->option_map[curr_iter->first]->GetValue()); all_options.erase(curr_iter); } } } -void CConfig::SetDefault() { +void CConfig::SetDefault(){ + /*--- Set the default values for all of the options that weren't set ---*/ for (auto iter = all_options.begin(); iter != all_options.end(); ++iter) { - if (option_map[iter->first]->GetValue().empty()) option_map[iter->first]->SetDefault(); + if (option_map[iter->first]->GetValue().empty()) + option_map[iter->first]->SetDefault(); } } @@ -3468,27 +3134,28 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { case_file.open(case_filename, ios::in); - if (case_file.fail()) { - return false; - } + if (case_file.fail()) { return false; } string errorString; - int err_count = 0; // How many errors have we found in the config file - const int max_err_count = 30; // Maximum number of errors to print before stopping + int err_count = 0; // How many errors have we found in the config file + const int max_err_count = 30; // Maximum number of errors to print before stopping map included_options; /*--- Parse the configuration file and set the options ---*/ - while (getline(case_file, text_line)) { + while (getline (case_file, text_line)) { + if (err_count >= max_err_count) { errorString.append("Too many errors, stopping parse."); break; } if (TokenizeString(text_line, option_name, option_value)) { + if (option_map.find(option_name) == option_map.end()) { + /*--- See if it's a python option ---*/ string newString; @@ -3525,6 +3192,7 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { errorString.append("\n"); err_count++; } + } } @@ -3543,9 +3211,11 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { case_file.close(); return true; + } -void CConfig::SetHeader(SU2_COMPONENT val_software) const { +void CConfig::SetHeader(SU2_COMPONENT val_software) const{ + if ((iZone == 0) && (rank == MASTER_NODE)) { cout << "\n"; cout << "-------------------------------------------------------------------------\n"; @@ -3553,21 +3223,11 @@ void CConfig::SetHeader(SU2_COMPONENT val_software) const { cout << "| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |\n"; cout << "| \\__ \\ |_| |/ / |\n"; switch (val_software) { - case SU2_COMPONENT::SU2_CFD: - cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n"; - break; - case SU2_COMPONENT::SU2_DEF: - cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |\n"; - break; - case SU2_COMPONENT::SU2_DOT: - cout << "| |___/\\___//___| Suite (Gradient Projection Code) |\n"; - break; - case SU2_COMPONENT::SU2_GEO: - cout << "| |___/\\___//___| Suite (Geometry Definition Code) |\n"; - break; - case SU2_COMPONENT::SU2_SOL: - cout << "| |___/\\___//___| Suite (Solution Exporting Code) |\n"; - break; + case SU2_COMPONENT::SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n"; break; + case SU2_COMPONENT::SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |\n"; break; + case SU2_COMPONENT::SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |\n"; break; + case SU2_COMPONENT::SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |\n"; break; + case SU2_COMPONENT::SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |\n"; break; } cout << "| |\n"; cout << "-------------------------------------------------------------------------\n"; @@ -3592,80 +3252,90 @@ void CConfig::SetHeader(SU2_COMPONENT val_software) const { cout << "| License along with SU2. If not, see . |\n"; cout << "-------------------------------------------------------------------------" << endl; } + } -void CConfig::SetnZone() { +void CConfig::SetnZone(){ + /*--- Just as a clarification --- */ - if (Multizone_Problem == NO && Kind_Solver != MAIN_SOLVER::MULTIPHYSICS) { + if (Multizone_Problem == NO && Kind_Solver != MAIN_SOLVER::MULTIPHYSICS){ nZone = 1; } - if (Kind_Solver == MAIN_SOLVER::MULTIPHYSICS) { + if (Kind_Solver == MAIN_SOLVER::MULTIPHYSICS){ Multizone_Problem = YES; - if (nConfig_Files == 0) { + if (nConfig_Files == 0){ SU2_MPI::Error("CONFIG_LIST must be provided if PHYSICAL_PROBLEM=MULTIPHYSICS", CURRENT_FUNCTION); } } - if (Multizone_Problem == YES) { + if (Multizone_Problem == YES){ + /*--- Some basic multizone checks ---*/ - if (nMarker_ZoneInterface % 2 != 0) { + if (nMarker_ZoneInterface % 2 != 0){ SU2_MPI::Error("Number of markers in MARKER_ZONE_INTERFACE must be a multiple of 2", CURRENT_FUNCTION); } - if (Multizone_Mesh) { + if (Multizone_Mesh){ + /*--- Get the number of zones from the mesh file --- */ nZone = GetnZone(Mesh_FileName, Mesh_FileFormat); /*--- If config list is set, make sure number matches number of zones in mesh file --- */ - if (nConfig_Files != 0 && (nZone != nConfig_Files)) { + if (nConfig_Files != 0 && (nZone != nConfig_Files)){ SU2_MPI::Error("Number of CONFIG_LIST must match number of zones in mesh file.", CURRENT_FUNCTION); } } else { + /*--- Number of zones is determined from the number of config files provided --- */ - if (nConfig_Files == 0) { - SU2_MPI::Error( - "If MULTIZONE_MESH is set to YES, you must provide a list of config files using CONFIG_LIST option", - CURRENT_FUNCTION); + if (nConfig_Files == 0){ + SU2_MPI::Error("If MULTIZONE_MESH is set to YES, you must provide a list of config files using CONFIG_LIST option", CURRENT_FUNCTION); } nZone = nConfig_Files; + } /*--- Check if subconfig files exist --- */ - if (nConfig_Files != 0) { - for (unsigned short iConfig = 0; iConfig < nConfig_Files; iConfig++) { + if (nConfig_Files != 0){ + for (unsigned short iConfig = 0; iConfig < nConfig_Files; iConfig++){ ifstream f(Config_Filenames[iConfig].c_str()); - if (!f.good()) { - SU2_MPI::Error("Config file " + Config_Filenames[iConfig] + " defined in CONFIG_FILES does not exist", - CURRENT_FUNCTION); + if (!f.good()){ + SU2_MPI::Error("Config file " + Config_Filenames[iConfig] + " defined in CONFIG_FILES does not exist", CURRENT_FUNCTION); } } } + } + } 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) || (Kind_FluidModel == IDEAL_GAS) || (Kind_FluidModel == INC_IDEAL_GAS) || - (Kind_FluidModel == FLUID_MIXTURE) || (Kind_FluidModel == FLUID_FLAMELET) || - (Kind_FluidModel == INC_IDEAL_GAS_POLY) || (Kind_FluidModel == CONSTANT_DENSITY)); - bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) || (Kind_FluidModel == SU2_NONEQ)); + bool ideal_gas = ((Kind_FluidModel == STANDARD_AIR) || + (Kind_FluidModel == IDEAL_GAS) || + (Kind_FluidModel == INC_IDEAL_GAS) || + (Kind_FluidModel == FLUID_MIXTURE) || + (Kind_FluidModel == FLUID_FLAMELET) || + (Kind_FluidModel == INC_IDEAL_GAS_POLY) || + (Kind_FluidModel == CONSTANT_DENSITY)); + bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) || + (Kind_FluidModel == SU2_NONEQ)); bool standard_air = ((Kind_FluidModel == STANDARD_AIR)); bool nemo = GetNEMOProblem(); - if (nZone > 1) { + if (nZone > 1){ Multizone_Problem = YES; } /*--- Set the default output files ---*/ - if (!OptionIsSet("OUTPUT_FILES")) { + if (!OptionIsSet("OUTPUT_FILES")){ nVolumeOutputFiles = 3; VolumeOutputFiles = new OUTPUT_TYPE[nVolumeOutputFiles]; VolumeOutputFiles[0] = OUTPUT_TYPE::RESTART_BINARY; @@ -3674,38 +3344,35 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } /*--- Set the default output frequencies ---*/ - if (!OptionIsSet("OUTPUT_WRT_FREQ")) { + if (!OptionIsSet("OUTPUT_WRT_FREQ")){ nVolumeOutputFrequencies = nVolumeOutputFiles; - VolumeOutputFrequencies = new unsigned long[nVolumeOutputFrequencies]; + VolumeOutputFrequencies = new unsigned long [nVolumeOutputFrequencies]; /*--- Using default frequency of 250 for all files when steady, and 1 for unsteady. ---*/ - for (auto iVolumeFreq = 0; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++) { + for (auto iVolumeFreq = 0; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++){ VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : 250; } } else if (nVolumeOutputFrequencies < nVolumeOutputFiles) { /*--- If there are fewer frequencies than files, repeat the last frequency. - * This is useful to define 1 frequency for the restart file and 1 frequency for all the visualization files. - * ---*/ + * This is useful to define 1 frequency for the restart file and 1 frequency for all the visualization files. ---*/ auto* newFrequencies = new unsigned long[nVolumeOutputFiles]; for (unsigned short i = 0; i < nVolumeOutputFrequencies; ++i) { newFrequencies[i] = VolumeOutputFrequencies[i]; } for (auto i = nVolumeOutputFrequencies; i < nVolumeOutputFiles; ++i) { - newFrequencies[i] = newFrequencies[i - 1]; + newFrequencies[i] = newFrequencies[i-1]; } - delete[] VolumeOutputFrequencies; + delete [] VolumeOutputFrequencies; VolumeOutputFrequencies = newFrequencies; nVolumeOutputFrequencies = nVolumeOutputFiles; } /*--- Check if SU2 was build with TecIO support, as that is required for Tecplot Binary output. ---*/ #ifndef HAVE_TECIO - for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++) { + for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++){ if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::TECPLOT_BINARY || VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::SURFACE_TECPLOT_BINARY) { - SU2_MPI::Error( - string("Tecplot binary file requested in option OUTPUT_FILES but SU2 was built without TecIO support.\n"), - CURRENT_FUNCTION); + SU2_MPI::Error(string("Tecplot binary file requested in option OUTPUT_FILES but SU2 was built without TecIO support.\n"), CURRENT_FUNCTION); } } #endif @@ -3715,8 +3382,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++) { if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::CGNS || VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::SURFACE_CGNS) { - SU2_MPI::Error(string("CGNS file requested in option OUTPUT_FILES but SU2 was built without CGNS support.\n"), - CURRENT_FUNCTION); + SU2_MPI::Error(string("CGNS file requested in option OUTPUT_FILES but SU2 was built without CGNS support.\n"),CURRENT_FUNCTION); } } #endif @@ -3728,12 +3394,10 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- STL_BINARY output not implemented yet, but already a value in option_structure.hpp---*/ for (unsigned short iVolumeFile = 0; iVolumeFile < nVolumeOutputFiles; iVolumeFile++) { - if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY) { - SU2_MPI::Error(string("OUTPUT_FILES: 'STL_BINARY' output not implemented. Use 'STL' for ASCII output.\n"), - CURRENT_FUNCTION); + if (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY){ + SU2_MPI::Error(string("OUTPUT_FILES: 'STL_BINARY' output not implemented. Use 'STL' for ASCII output.\n"), CURRENT_FUNCTION); } - if (val_nDim == 2 && (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_ASCII || - VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY)) { + if (val_nDim == 2 && (VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_ASCII || VolumeOutputFiles[iVolumeFile] == OUTPUT_TYPE::STL_BINARY)) { SU2_MPI::Error(string("OUTPUT_FILES: 'STL(_BINARY)' output only reasonable for 3D cases.\n"), CURRENT_FUNCTION); } } @@ -3741,7 +3405,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check if MESH_QUALITY is requested in VOLUME_OUTPUT and set the config boolean accordingly. ---*/ Wrt_MeshQuality = false; for (unsigned short iField = 0; iField < nVolumeOutput; iField++) { - if (VolumeOutput[iField].find("MESH_QUALITY") != string::npos) { + if(VolumeOutput[iField].find("MESH_QUALITY") != string::npos) { Wrt_MeshQuality = true; } } @@ -3749,21 +3413,21 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check if MULTIGRID is requested in VOLUME_OUTPUT and set the config boolean accordingly. ---*/ Wrt_MultiGrid = false; for (unsigned short iField = 0; iField < nVolumeOutput; iField++) { - if (VolumeOutput[iField].find("MULTIGRID") != string::npos) { + if(VolumeOutput[iField].find("MULTIGRID") != string::npos) { Wrt_MultiGrid = true; } } - if (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE) { + if (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE){ SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= NAVIER_STOKES", CURRENT_FUNCTION); } - if (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE) { + if (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE){ SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= INC_NAVIER_STOKES", CURRENT_FUNCTION); } - if (Kind_Solver == MAIN_SOLVER::RANS && Kind_Turb_Model == TURB_MODEL::NONE) { + if (Kind_Solver == MAIN_SOLVER::RANS && Kind_Turb_Model == TURB_MODEL::NONE){ SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= RANS", CURRENT_FUNCTION); } - if (Kind_Solver == MAIN_SOLVER::INC_RANS && Kind_Turb_Model == TURB_MODEL::NONE) { + if (Kind_Solver == MAIN_SOLVER::INC_RANS && Kind_Turb_Model == TURB_MODEL::NONE){ SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= INC_RANS", CURRENT_FUNCTION); } @@ -3775,7 +3439,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } /*--- Check if turbulence model can be used for AXISYMMETRIC case---*/ - if (Axisymmetric && Kind_Turb_Model != TURB_MODEL::NONE && Kind_Turb_Model != TURB_MODEL::SST) { + if (Axisymmetric && Kind_Turb_Model != TURB_MODEL::NONE && Kind_Turb_Model != TURB_MODEL::SST){ SU2_MPI::Error("Axisymmetry is currently only supported for KIND_TURB_MODEL chosen as SST", CURRENT_FUNCTION); } @@ -3795,23 +3459,21 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Wall_Functions = false; if (nMarker_WallFunctions > 0) { for (iMarker = 0; iMarker < nMarker_WallFunctions; iMarker++) { - if (Kind_WallFunctions[iMarker] != WALL_FUNCTIONS::NONE) Wall_Functions = true; + if (Kind_WallFunctions[iMarker] != WALL_FUNCTIONS::NONE) + Wall_Functions = true; if ((Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::ADAPTIVE_FUNCTION) || (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::SCALABLE_FUNCTION) || (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::NONEQUILIBRIUM_MODEL)) - SU2_MPI::Error(string("For RANS problems, use NONE, STANDARD_WALL_FUNCTION or EQUILIBRIUM_WALL_MODEL.\n"), - CURRENT_FUNCTION); + SU2_MPI::Error(string("For RANS problems, use NONE, STANDARD_WALL_FUNCTION or EQUILIBRIUM_WALL_MODEL.\n"), CURRENT_FUNCTION); if (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::STANDARD_FUNCTION) { if ((Kind_Solver != MAIN_SOLVER::RANS) && (Kind_Solver != MAIN_SOLVER::INC_RANS)) - SU2_MPI::Error(string("Wall model STANDARD_FUNCTION only available for RANS or INC_RANS.\n"), - CURRENT_FUNCTION); + SU2_MPI::Error(string("Wall model STANDARD_FUNCTION only available for RANS or INC_RANS.\n"), CURRENT_FUNCTION); if (nRough_Wall != 0) - SU2_MPI::Error( - string("Wall model STANDARD_FUNCTION and WALL_ROUGHNESS migh not be compatible. Checking required!\n"), - CURRENT_FUNCTION); + SU2_MPI::Error(string("Wall model STANDARD_FUNCTION and WALL_ROUGHNESS migh not be compatible. Checking required!\n"), CURRENT_FUNCTION); } + } } @@ -3819,8 +3481,10 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i solver. This is typically unused (often internal flows). Also fixed CL mode for incompressible flows is not implemented ---*/ - if (Kind_Solver == MAIN_SOLVER::INC_EULER || Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || + if (Kind_Solver == MAIN_SOLVER::INC_EULER || + Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::INC_RANS) { + /*--- Compute x-velocity with a safegaurd for 0.0. ---*/ su2double Vx = 1e-10; @@ -3832,10 +3496,10 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i su2double alpha = 0.0, beta = 0.0; if (val_nDim == 2) { - alpha = atan(vel_init[1] / Vx) * 180.0 / PI_NUMBER; + alpha = atan(vel_init[1]/Vx)*180.0/PI_NUMBER; } else { - alpha = atan(vel_init[2] / Vx) * 180.0 / PI_NUMBER; - beta = atan(vel_init[1] / Vx) * 180.0 / PI_NUMBER; + alpha = atan(vel_init[2]/Vx)*180.0/PI_NUMBER; + beta = atan(vel_init[1]/Vx)*180.0/PI_NUMBER; } /*--- Set alpha and beta in the config class. ---*/ @@ -3849,8 +3513,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Inc CHT simulation, but energy equation of fluid is inactive. ---*/ if (Multizone_Problem && (nMarker_CHTInterface > 0) && !Energy_Equation) - SU2_MPI::Error(string("You probably want to set INC_ENERGY_EQUATION= YES for the fluid solver. \n"), - CURRENT_FUNCTION); + SU2_MPI::Error(string("You probably want to set INC_ENERGY_EQUATION= YES for the fluid solver. \n"), CURRENT_FUNCTION); } /*--- By default, in 2D we should use TWOD_AIRFOIL (independenly from the input file) ---*/ @@ -3897,8 +3560,9 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Set the default for thrust in ActDisk ---*/ - if ((Kind_ActDisk == NET_THRUST) || (Kind_ActDisk == BC_THRUST) || (Kind_ActDisk == DRAG_MINUS_THRUST) || - (Kind_ActDisk == MASSFLOW) || (Kind_ActDisk == POWER)) + if ((Kind_ActDisk == NET_THRUST) || (Kind_ActDisk == BC_THRUST) + || (Kind_ActDisk == DRAG_MINUS_THRUST) || (Kind_ActDisk == MASSFLOW) + || (Kind_ActDisk == POWER)) ActDisk_Jump = RATIO; /*--- Error-catching and automatic array adjustments for objective, marker, and weights arrays --- */ @@ -3910,60 +3574,60 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Kind_ObjFunc[0] = DRAG_COEFFICIENT; Weight_ObjFunc = new su2double[1]; Weight_ObjFunc[0] = 1.0; - nObj = 1; - nObjW = 1; + nObj=1; + nObjW=1; } /*--- Maker sure that arrays are the same length ---*/ - if (nObj > 0) { - if (nMarker_Monitoring != nObj && Marker_Monitoring != nullptr) { - if (nMarker_Monitoring == 1) { - /*-- If only one marker was listed with multiple objectives, set that marker as the marker for each objective - * ---*/ + if (nObj>0) { + if (nMarker_Monitoring!=nObj && Marker_Monitoring!= nullptr) { + if (nMarker_Monitoring==1) { + /*-- If only one marker was listed with multiple objectives, set that marker as the marker for each objective ---*/ nMarker_Monitoring = nObj; string marker = Marker_Monitoring[0]; delete[] Marker_Monitoring; Marker_Monitoring = new string[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) Marker_Monitoring[iMarker] = marker; - } else if (nObj == 1) { + for (iMarker=0; iMarker 1) { - SU2_MPI::Error( - "When using more than one OBJECTIVE_FUNCTION, MARKER_MONITORING must be the same length or length 1.\n" - "For multiple surfaces per objective, either use one objective or list the objective multiple times.\n" - "For multiple objectives per marker either use one marker or list the marker multiple times.\n" - "Similar rules apply for multi-objective optimization using OPT_OBJECTIVE rather than OBJECTIVE_FUNCTION.", - CURRENT_FUNCTION); + } + else if(nObj>1) { + SU2_MPI::Error("When using more than one OBJECTIVE_FUNCTION, MARKER_MONITORING must be the same length or length 1.\n" + "For multiple surfaces per objective, either use one objective or list the objective multiple times.\n" + "For multiple objectives per marker either use one marker or list the marker multiple times.\n" + "Similar rules apply for multi-objective optimization using OPT_OBJECTIVE rather than OBJECTIVE_FUNCTION.", + CURRENT_FUNCTION); } } } /*-- Correct for case where Weight_ObjFunc has not been provided or has length < kind_objfunc---*/ - if (nObjW < nObj) { - if (Weight_ObjFunc != nullptr && nObjW > 1) { - SU2_MPI::Error( - "The option OBJECTIVE_WEIGHT must either have the same length as OBJECTIVE_FUNCTION,\n" - "be lenght 1, or be deleted from the config file (equal weights will be applied).", - CURRENT_FUNCTION); + if (nObjW1) { + SU2_MPI::Error("The option OBJECTIVE_WEIGHT must either have the same length as OBJECTIVE_FUNCTION,\n" + "be lenght 1, or be deleted from the config file (equal weights will be applied).", CURRENT_FUNCTION); } Weight_ObjFunc = new su2double[nObj]; - for (unsigned short iObj = 0; iObj < nObj; iObj++) Weight_ObjFunc[iObj] = 1.0; + for (unsigned short iObj=0; iObj 1) { unsigned short Obj_0 = Kind_ObjFunc[0]; - for (unsigned short iObj = 1; iObj < nObj; iObj++) { - switch (Kind_ObjFunc[iObj]) { + for (unsigned short iObj=1; iObj 0) { + if (nObj > 0){ if (Kind_ObjFunc[0] == CUSTOM_OBJFUNC && CustomObjFunc.empty() && !Multizone_Problem) { - SU2_MPI::Error( - "The expression for the custom objective function was not set.\n" - "For example, CUSTOM_OBJFUNC= LIFT/DRAG", - CURRENT_FUNCTION); + SU2_MPI::Error("The expression for the custom objective function was not set.\n" + "For example, CUSTOM_OBJFUNC= LIFT/DRAG", CURRENT_FUNCTION); } } /*--- Check for unsteady problem ---*/ - 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); + 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); } - if (Time_Domain) { + if (Time_Domain){ Delta_UnstTime = Time_Step; - if (TimeMarching == TIME_MARCHING::TIME_STEPPING) { - InnerIter = 1; - } + if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ InnerIter = 1; } /*--- Set History write freq for inner and outer iteration to zero by default, so only time iterations write. ---*/ - if (!OptionIsSet("HISTORY_WRT_FREQ_INNER")) { - HistoryWrtFreq[2] = 0; - } - if (!OptionIsSet("HISTORY_WRT_FREQ_OUTER")) { - HistoryWrtFreq[1] = 0; - } + if (!OptionIsSet("HISTORY_WRT_FREQ_INNER")) { HistoryWrtFreq[2] = 0; } + if (!OptionIsSet("HISTORY_WRT_FREQ_OUTER")) { HistoryWrtFreq[1] = 0; } if (Restart == NO) { Restart_Iter = 0; } else { - if (nTimeIter <= Restart_Iter) SU2_MPI::Error("TIME_ITER must be larger than RESTART_ITER.", CURRENT_FUNCTION); + if(nTimeIter <= Restart_Iter) SU2_MPI::Error("TIME_ITER must be larger than RESTART_ITER.", CURRENT_FUNCTION); } - /*--- WINDOW_START_ITER must be larger than or equal to: RESTART_ITER. Otherwise, the running average is wrong. - * ---*/ + /*--- WINDOW_START_ITER must be larger than or equal to: RESTART_ITER. Otherwise, the running average is wrong. ---*/ if (OptionIsSet("WINDOW_START_ITER")) { if (StartWindowIteration < Restart_Iter) { SU2_MPI::Error("WINDOW_START_ITER must be larger than or equal to: RESTART_ITER!", CURRENT_FUNCTION); } } else { /*--- Enforced default behavior: start of the window is the first new iteration. ---*/ - if (rank == MASTER_NODE) - cout << "WARNING: Setting WINDOW_START_ITER = RESTART_ITER for meaningful running average.\n"; + if (rank == MASTER_NODE) cout << "WARNING: Setting WINDOW_START_ITER = RESTART_ITER for meaningful running average.\n"; StartWindowIteration = Restart_Iter; } - if (Time_Step <= 0.0 && Unst_CFL == 0.0) { - SU2_MPI::Error("Invalid value for TIME_STEP.", CURRENT_FUNCTION); - } + if (Time_Step <= 0.0 && Unst_CFL == 0.0){ SU2_MPI::Error("Invalid value for TIME_STEP.", CURRENT_FUNCTION); } } else { nTimeIter = 1; Time_Step = 0; /*--- Entry 0 corresponds to unsteady simulation so for steady simulation are just set to 1. ---*/ - ScreenWrtFreq[0] = 1; + ScreenWrtFreq[0] = 1; HistoryWrtFreq[0] = 1; - if (TimeMarching != TIME_MARCHING::HARMONIC_BALANCE) { - TimeMarching = TIME_MARCHING::STEADY; - } + if (TimeMarching != TIME_MARCHING::HARMONIC_BALANCE) { TimeMarching = TIME_MARCHING::STEADY; } } - if (Time_Domain && !GetWrt_Restart_Overwrite()) { - SU2_MPI::Error( - "Appending iterations to the filename (WRT_RESTART_OVERWRITE=NO) is incompatible with transient problems.", - CURRENT_FUNCTION); + if (Time_Domain && !GetWrt_Restart_Overwrite()){ + SU2_MPI::Error("Appending iterations to the filename (WRT_RESTART_OVERWRITE=NO) is incompatible with transient problems.", CURRENT_FUNCTION); } - if (Time_Domain && !GetWrt_Surface_Overwrite()) { - SU2_MPI::Error( - "Appending iterations to the filename (WRT_SURFACE_OVERWRITE=NO) is incompatible with transient problems.", - CURRENT_FUNCTION); + if (Time_Domain && !GetWrt_Surface_Overwrite()){ + SU2_MPI::Error("Appending iterations to the filename (WRT_SURFACE_OVERWRITE=NO) is incompatible with transient problems.", CURRENT_FUNCTION); } - if (Time_Domain && !GetWrt_Volume_Overwrite()) { - SU2_MPI::Error( - "Appending iterations to the filename (WRT_VOLUME_OVERWRITE=NO) is incompatible with transient problems.", - CURRENT_FUNCTION); + if (Time_Domain && !GetWrt_Volume_Overwrite()){ + SU2_MPI::Error("Appending iterations to the filename (WRT_VOLUME_OVERWRITE=NO) is incompatible with transient problems.", CURRENT_FUNCTION); } + /*--- Ensure that Discard_InFiles is false, owerwise the gradient could be wrong ---*/ - if ((ContinuousAdjoint || DiscreteAdjoint) && Fixed_CL_Mode && !Eval_dOF_dCX) Discard_InFiles = false; + if ((ContinuousAdjoint || DiscreteAdjoint) && Fixed_CL_Mode && !Eval_dOF_dCX) + Discard_InFiles = false; /*--- Deactivate the multigrid in the adjoint problem ---*/ - if ((ContinuousAdjoint && !MG_AdjointFlow) || (TimeMarching == TIME_MARCHING::TIME_STEPPING)) { - nMGLevels = 0; - } - - if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::RANS || Kind_Solver == MAIN_SOLVER::NEMO_EULER || - Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::FEM_EULER || - Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::FEM_RANS || - Kind_Solver == MAIN_SOLVER::FEM_LES) { + if ((ContinuousAdjoint && !MG_AdjointFlow) || + (TimeMarching == TIME_MARCHING::TIME_STEPPING)) { nMGLevels = 0; } + + if (Kind_Solver == MAIN_SOLVER::EULER || + Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::RANS || + Kind_Solver == MAIN_SOLVER::NEMO_EULER || + Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::FEM_EULER || + Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::FEM_RANS || + Kind_Solver == MAIN_SOLVER::FEM_LES){ Kind_Regime = ENUM_REGIME::COMPRESSIBLE; - } else if (Kind_Solver == MAIN_SOLVER::INC_EULER || Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::INC_RANS) { + } else if (Kind_Solver == MAIN_SOLVER::INC_EULER || + Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::INC_RANS){ Kind_Regime = ENUM_REGIME::INCOMPRESSIBLE; - } else { + } else { Kind_Regime = ENUM_REGIME::NO_FLOW; } - if ((rank == MASTER_NODE) && ContinuousAdjoint && (Ref_NonDim == DIMENSIONAL) && - (Kind_SU2 == SU2_COMPONENT::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; } /*--- Initialize non-physical points/reconstructions to zero ---*/ - Nonphys_Points = 0; + Nonphys_Points = 0; Nonphys_Reconstr = 0; /*--- Set the number of external iterations to 1 for the steady state problem ---*/ if (Kind_Solver == MAIN_SOLVER::FEM_ELASTICITY) { nMGLevels = 0; - if (Kind_Struct_Solver == STRUCT_DEFORMATION::SMALL) { + if (Kind_Struct_Solver == STRUCT_DEFORMATION::SMALL){ MinLogResidual = log10(Linear_Solver_Error); } } @@ -4140,9 +3785,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check for unsupported features. ---*/ - if ((Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && - Kind_Solver != MAIN_SOLVER::RANS) && - (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE)) { + if ((Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS) && (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE)){ SU2_MPI::Error("Harmonic Balance not yet implemented for the incompressible solver.", CURRENT_FUNCTION); } @@ -4155,7 +3798,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } - /*--- Set default values for various fluid properties. ---*/ +/*--- Set default values for various fluid properties. ---*/ const su2double Molecular_Weight_Default = 28.96; const su2double Mu_Constant_Default = (SystemMeasurements == SI) ? 1.716E-5 : (1.716E-5 / 47.88025898); @@ -4163,8 +3806,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i const su2double Mu_Temperature_Ref_Default = (SystemMeasurements == SI) ? 273.15 : (273.15 * 1.8); const su2double Mu_S_Default = (SystemMeasurements == SI) ? 110.4 : (110.4 * 1.8); const su2double Specific_Heat_Cp_Default = 1004.703; - const su2double Thermal_Conductivity_Constant_Default = - (SystemMeasurements == SI) ? 2.57E-2 : (2.57E-2 * 0.577789317); + const su2double Thermal_Conductivity_Constant_Default = (SystemMeasurements == SI) ? 2.57E-2 : (2.57E-2 * 0.577789317); const su2double Prandtl_Lam_Default = 0.72; const su2double Prandtl_Turb_Default = 0.9; const su2double Lewis_Number_Default = 1.0; @@ -4191,218 +3833,210 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SetDefaultIfEmpty(Prandtl_Turb, nPrandtl_Turb, Prandtl_Turb_Default); SetDefaultIfEmpty(Constant_Lewis_Number, nConstant_Lewis_Number, Lewis_Number_Default); - Variable_Density = - ((Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) || (Kind_DensityModel == INC_DENSITYMODEL::FLAMELET)); + Variable_Density = ((Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) || (Kind_DensityModel == INC_DENSITYMODEL::FLAMELET)); /*--- Check whether inputs for FLUID_MIXTURE are correctly specified. ---*/ - if (Kind_FluidModel == FLUID_MIXTURE) { - /*--- Check whether the number of entries of each specified fluid property equals the number of transported scalar - equations solved + 1. nMolecular_Weight and nSpecific_Heat_Cp are used because it is required for the fluid mixing - models. - * Cp is required in case of MIXTURE_FLUID_MODEL because the energy equation needs to be active.--- */ - if (nMolecular_Weight != nSpecies_Init + 1 || nSpecific_Heat_Cp != nSpecies_Init + 1) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for MOLECULAR_WEIGHT and SPECIFIC_HEAT_CP,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } - /*--- Check whether the density model used is correct, in the case of FLUID_MIXTURE the density model must be - VARIABLE. Otherwise, if the density model is CONSTANT, the scalars will not have influence the mixture density - and it will remain constant through the complete domain. --- */ - if (Kind_DensityModel != INC_DENSITYMODEL::VARIABLE) { - SU2_MPI::Error("The use of FLUID_MIXTURE requires the INC_DENSITY_MODEL option to be VARIABLE", CURRENT_FUNCTION); - } - - switch (Kind_ViscosityModel) { - case VISCOSITYMODEL::CONSTANT: - if (nMu_Constant != nSpecies_Init + 1) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for MU_CONSTANT,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } - break; - case VISCOSITYMODEL::SUTHERLAND: - if ((nMu_Ref != nSpecies_Init + 1) || (nMu_Temperature_Ref != nSpecies_Init + 1) || - (nMu_S != nSpecies_Init + 1)) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for MU_REF, MU_T_REF and " - "SUTHERLAND_CONSTANT,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); - } - break; - default: - if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Fluid mixture: viscosity model not available.", CURRENT_FUNCTION); - break; - } + if (Kind_FluidModel == FLUID_MIXTURE) { + /*--- Check whether the number of entries of each specified fluid property equals the number of transported scalar + equations solved + 1. nMolecular_Weight and nSpecific_Heat_Cp are used because it is required for the fluid mixing models. + * Cp is required in case of MIXTURE_FLUID_MODEL because the energy equation needs to be active.--- */ + if (nMolecular_Weight != nSpecies_Init + 1 || nSpecific_Heat_Cp != nSpecies_Init + 1) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for MOLECULAR_WEIGHT and SPECIFIC_HEAT_CP,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } + /*--- Check whether the density model used is correct, in the case of FLUID_MIXTURE the density model must be + VARIABLE. Otherwise, if the density model is CONSTANT, the scalars will not have influence the mixture density + and it will remain constant through the complete domain. --- */ + if (Kind_DensityModel != INC_DENSITYMODEL::VARIABLE) { + SU2_MPI::Error("The use of FLUID_MIXTURE requires the INC_DENSITY_MODEL option to be VARIABLE", + CURRENT_FUNCTION); + } - switch (Kind_ConductivityModel) { - case CONDUCTIVITYMODEL::CONSTANT: - if ((Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) && - (Kind_Turb_Model != TURB_MODEL::NONE)) { - if ((nThermal_Conductivity_Constant != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { + switch (Kind_ViscosityModel) { + case VISCOSITYMODEL::CONSTANT: + if (nMu_Constant != nSpecies_Init + 1) { SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT and " - "PRANDTL_TURB,\n" + "The use of FLUID_MIXTURE requires the number of entries for MU_CONSTANT,\n" "to be equal to the number of entries of SPECIES_INIT + 1", CURRENT_FUNCTION); } - } else { - if (nThermal_Conductivity_Constant != nSpecies_Init + 1) { + break; + case VISCOSITYMODEL::SUTHERLAND: + if ((nMu_Ref != nSpecies_Init + 1) || (nMu_Temperature_Ref != nSpecies_Init + 1) || + (nMu_S != nSpecies_Init + 1)) { SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT,\n" + "The use of FLUID_MIXTURE requires the number of entries for MU_REF, MU_T_REF and " + "SUTHERLAND_CONSTANT,\n" "to be equal to the number of entries of SPECIES_INIT + 1", CURRENT_FUNCTION); } - } - break; - case CONDUCTIVITYMODEL::CONSTANT_PRANDTL: - if (Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) { - if ((nPrandtl_Lam != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM and PRANDTL_TURB,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); + break; + default: + if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Fluid mixture: viscosity model not available.", CURRENT_FUNCTION); + break; + } + + switch (Kind_ConductivityModel) { + case CONDUCTIVITYMODEL::CONSTANT: + if ((Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) && + (Kind_Turb_Model != TURB_MODEL::NONE)) { + if ((nThermal_Conductivity_Constant != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT and " + "PRANDTL_TURB,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } + } else { + if (nThermal_Conductivity_Constant != nSpecies_Init + 1) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for THERMAL_CONDUCTIVITY_CONSTANT,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } } - } else { - if (nPrandtl_Lam != nSpecies_Init + 1) { - SU2_MPI::Error( - "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM,\n" - "to be equal to the number of entries of SPECIES_INIT + 1", - CURRENT_FUNCTION); + break; + case CONDUCTIVITYMODEL::CONSTANT_PRANDTL: + if (Kind_ConductivityModel_Turb == CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL) { + if ((nPrandtl_Lam != nSpecies_Init + 1) || (nPrandtl_Turb != nSpecies_Init + 1)) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM and PRANDTL_TURB,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } + } else { + if (nPrandtl_Lam != nSpecies_Init + 1) { + SU2_MPI::Error( + "The use of FLUID_MIXTURE requires the number of entries for PRANDTL_LAM,\n" + "to be equal to the number of entries of SPECIES_INIT + 1", + CURRENT_FUNCTION); + } } - } - break; - default: - if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Conductivity model not available.", CURRENT_FUNCTION); - break; + break; + default: + if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Conductivity model not available.", CURRENT_FUNCTION); + break; + } } - } - if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { - if (Kind_FluidModel != FLUID_FLAMELET) { - SU2_MPI::Error("The use of SCALAR_MODEL= FLAMELET requires the FLUID_MODEL option to be FLUID_FLAMELET", - CURRENT_FUNCTION); - } - if (!Variable_Density) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the INC_DENSITY_MODEL option to be VARIABLE or FLAMELET", - CURRENT_FUNCTION); - } + if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { - if (Kind_ConductivityModel != CONDUCTIVITYMODEL::FLAMELET) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the CONDUCTIVITY_MODEL option to be FLAMELET", - CURRENT_FUNCTION); - } + if (Kind_FluidModel != FLUID_FLAMELET) { + SU2_MPI::Error("The use of SCALAR_MODEL= FLAMELET requires the FLUID_MODEL option to be FLUID_FLAMELET", + CURRENT_FUNCTION); + } - if (Kind_Diffusivity_Model != DIFFUSIVITYMODEL::FLAMELET) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the DIFFUSIVITY_MODEL option to be FLAMELET", - CURRENT_FUNCTION); - } + if (!Variable_Density) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the INC_DENSITY_MODEL option to be VARIABLE or FLAMELET", + CURRENT_FUNCTION); + } - if (Kind_ViscosityModel != VISCOSITYMODEL::FLAMELET) { - SU2_MPI::Error("The use of FLUID_FLAMELET requires the VISCOSITY_MODEL option to be FLAMELET", CURRENT_FUNCTION); - } + if (Kind_ConductivityModel != CONDUCTIVITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the CONDUCTIVITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } - if (Weakly_Coupled_Heat) { - SU2_MPI::Error("The use of FLUID_FLAMELET is incompatible with WEAKLY_COUPLED_HEAT in the same zone.", - CURRENT_FUNCTION); - } - } + if (Kind_Diffusivity_Model != DIFFUSIVITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the DIFFUSIVITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } - /*--- Check for Measurement System ---*/ + if (Kind_ViscosityModel != VISCOSITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the VISCOSITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } - if (SystemMeasurements == US && !standard_air) { - SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION); - } + if (Weakly_Coupled_Heat) { + SU2_MPI::Error("The use of FLUID_FLAMELET is incompatible with WEAKLY_COUPLED_HEAT in the same zone.", + CURRENT_FUNCTION); + } + } - /* --- Check for NEMO compatibility issues ---*/ - if (Kind_FluidModel == SU2_NONEQ && - (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND && - Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS)) { - SU2_MPI::Error( - "Transport model not available for NEMO solver using SU2TCLIB. Please use the WILKE, SUTHERLAND or GUPTAYOS " - "transport model instead.", - CURRENT_FUNCTION); - } + /*--- Check for Measurement System ---*/ - if (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) { - if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) { - SU2_MPI::Error("Only Gupta-Yos transport model available for ionized flows using SU2TCLIB.", CURRENT_FUNCTION); + if (SystemMeasurements == US && !standard_air) { + SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION); } - } - if (Kind_FluidModel == MUTATIONPP && - (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) { - SU2_MPI::Error( - "Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE or CHAPMANN_ENSKOG " - "transport model instead..", - CURRENT_FUNCTION); - } + /* --- Check for NEMO compatibility issues ---*/ + if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) ) { + SU2_MPI::Error("Transport model not available for NEMO solver using SU2TCLIB. Please use the WILKE, SUTHERLAND or GUPTAYOS transport model instead.", CURRENT_FUNCTION); + } - if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && nWall_Catalytic != 0) { - SU2_MPI::Error("Catalytic wall recombination is not yet available for ionized flows in SU2_NEMO.", - CURRENT_FUNCTION); - } + if (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) { + if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) { + SU2_MPI::Error("Only Gupta-Yos transport model available for ionized flows using SU2TCLIB.", CURRENT_FUNCTION); + } + } - if (!ideal_gas && !nemo) { - if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) { - SU2_MPI::Error( - "Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", - CURRENT_FUNCTION); + if (Kind_FluidModel == MUTATIONPP && + (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) { + SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE or CHAPMANN_ENSKOG transport model instead..", + CURRENT_FUNCTION); } - } - if (GetBoolTurbomachinery()) { - nBlades = new su2double[nZone]; - FreeStreamTurboNormal = new su2double[3]; - } + if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && nWall_Catalytic != 0) { + SU2_MPI::Error("Catalytic wall recombination is not yet available for ionized flows in SU2_NEMO.", CURRENT_FUNCTION); + } - /*--- Check if Giles are used with turbo markers ---*/ + if (!ideal_gas && !nemo) { + if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) { + SU2_MPI::Error("Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", CURRENT_FUNCTION); + } + } - if (nMarker_Giles > 0 && !GetBoolTurbomachinery()) { - SU2_MPI::Error("Giles Boundary conditions can only be used with turbomachinery markers", CURRENT_FUNCTION); - } + if (GetBoolTurbomachinery()) { + nBlades = new su2double[nZone]; + FreeStreamTurboNormal = new su2double[3]; + } - /*--- Check for Boundary condition available for NICFD ---*/ + /*--- Check if Giles are used with turbo markers ---*/ - if ((!ideal_gas) && (!noneq_gas)) { - if (nMarker_Inlet != 0) { - SU2_MPI::Error( - "Riemann Boundary conditions or Giles must be used for inlet and outlet with Not Ideal Compressible " - "Fluids ", - CURRENT_FUNCTION); - } - if (nMarker_Outlet != 0) { - SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", - CURRENT_FUNCTION); + if (nMarker_Giles > 0 && !GetBoolTurbomachinery()) { + SU2_MPI::Error("Giles Boundary conditions can only be used with turbomachinery markers", CURRENT_FUNCTION); } - if (nMarker_FarField != 0) { - SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", - CURRENT_FUNCTION); - } - } + /*--- Check for Boundary condition available for NICFD ---*/ - /*--- Check for Boundary condition available for NICF ---*/ + if ((!ideal_gas) && (!noneq_gas)) { + if (nMarker_Inlet != 0) { + SU2_MPI::Error( + "Riemann Boundary conditions or Giles must be used for inlet and outlet with Not Ideal Compressible " + "Fluids ", + CURRENT_FUNCTION); + } + if (nMarker_Outlet != 0) { + SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", + CURRENT_FUNCTION); + } - if (ideal_gas && (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && - Kind_Solver != MAIN_SOLVER::INC_RANS)) { - if (SystemMeasurements == US && standard_air) { - if (Kind_ViscosityModel != VISCOSITYMODEL::SUTHERLAND) { - SU2_MPI::Error("Only SUTHERLAND viscosity model can be used with US Measurement", CURRENT_FUNCTION); + if (nMarker_FarField != 0) { + SU2_MPI::Error("Riemann Boundary conditions or Giles must be used outlet with Not Ideal Compressible Fluids ", + CURRENT_FUNCTION); } } - if (Kind_ConductivityModel != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) { - SU2_MPI::Error("Only CONSTANT_PRANDTL thermal conductivity model can be used with STANDARD_AIR and IDEAL_GAS", - CURRENT_FUNCTION); + + /*--- Check for Boundary condition available for NICF ---*/ + + if (ideal_gas && (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::INC_RANS)) { + if (SystemMeasurements == US && standard_air) { + if (Kind_ViscosityModel != VISCOSITYMODEL::SUTHERLAND) { + SU2_MPI::Error("Only SUTHERLAND viscosity model can be used with US Measurement", CURRENT_FUNCTION); + } + } + if (Kind_ConductivityModel != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) { + SU2_MPI::Error("Only CONSTANT_PRANDTL thermal conductivity model can be used with STANDARD_AIR and IDEAL_GAS", + CURRENT_FUNCTION); + } } - } - /*--- Check for Boundary condition option agreement ---*/ - if (Kind_InitOption == REYNOLDS) { - if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::RANS) && Reynolds <= 0) { + /*--- Check for Boundary condition option agreement ---*/ + if (Kind_InitOption == REYNOLDS){ + if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::RANS) && Reynolds <=0){ SU2_MPI::Error("Reynolds number required for NAVIER_STOKES and RANS !!", CURRENT_FUNCTION); } } @@ -4411,44 +4045,45 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SU2_MPI::Error("Number of SURFACE_MOVEMENT must match number of MARKER_MOVING", CURRENT_FUNCTION); } - if (TimeMarching == TIME_MARCHING::TIME_STEPPING) { - nIter = 1; - nInnerIter = 1; + if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ + nIter = 1; + nInnerIter = 1; } - if (!Multizone_Problem) { - ScreenWrtFreq[1] = 0; + if (!Multizone_Problem){ + ScreenWrtFreq[1] = 0; HistoryWrtFreq[1] = 0; - if (!Time_Domain) { + if (!Time_Domain){ /*--- If not running multizone or unsteady, INNER_ITER and ITER are interchangeable, * but precedence will be given to INNER_ITER if both options are present. ---*/ - if (!OptionIsSet("INNER_ITER")) { + if (!OptionIsSet("INNER_ITER")){ nInnerIter = nIter; } } } - if ((Multizone_Problem || Time_Domain) && OptionIsSet("ITER")) { - SU2_MPI::Error( - "ITER must not be used when running multizone and/or unsteady problems.\n" - "Use TIME_ITER, OUTER_ITER or INNER_ITER to specify number of time iterations,\n" - "outer iterations or inner iterations, respectively.", - CURRENT_FUNCTION); + + if ((Multizone_Problem || Time_Domain) && OptionIsSet("ITER")){ + SU2_MPI::Error("ITER must not be used when running multizone and/or unsteady problems.\n" + "Use TIME_ITER, OUTER_ITER or INNER_ITER to specify number of time iterations,\n" + "outer iterations or inner iterations, respectively.", CURRENT_FUNCTION); } /*--- If we're solving a purely steady problem with no prescribed grid movement (both rotating frame and moving walls can be steady), make sure that there is no grid motion ---*/ - if (GetGrid_Movement()) { + if (GetGrid_Movement()){ 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) && - (Kind_GridMovement != NONE)) { + (TimeMarching == TIME_MARCHING::STEADY && !Time_Domain)){ + + if((Kind_GridMovement != ROTATING_FRAME) && + (Kind_GridMovement != STEADY_TRANSLATION) && + (Kind_GridMovement != NONE)){ SU2_MPI::Error("Unsupported kind of grid movement for steady state problems.", CURRENT_FUNCTION); } - for (iMarker = 0; iMarker < nMarker_Moving; iMarker++) { - if (Kind_SurfaceMovement[iMarker] != MOVING_WALL) { + for (iMarker = 0; iMarker < nMarker_Moving; iMarker++){ + if (Kind_SurfaceMovement[iMarker] != MOVING_WALL){ SU2_MPI::Error("Unsupported kind of surface movement for steady state problems.", CURRENT_FUNCTION); } } @@ -4464,7 +4099,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- If it is not specified, set the mesh motion mach number equal to the freestream value. ---*/ - if (GetDynamic_Grid() && Mach_Motion == 0.0) Mach_Motion = Mach; + if (GetDynamic_Grid() && Mach_Motion == 0.0) + Mach_Motion = Mach; /*--- Set the boolean flag if we are in a rotating frame (source term). ---*/ @@ -4474,88 +4110,72 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i config file, set them equal to zero for safety. Also check to make sure that for each option, a value has been declared for each moving marker. ---*/ - if (nMarker_Moving > 0) { - if (nMarkerMotion_Origin == 0) { - nMarkerMotion_Origin = 3 * nMarker_Moving; - MarkerMotion_Origin = new su2double[nMarkerMotion_Origin](); + if (nMarker_Moving > 0){ + if (nMarkerMotion_Origin == 0){ + nMarkerMotion_Origin = 3*nMarker_Moving; + MarkerMotion_Origin = new su2double[nMarkerMotion_Origin] (); } - if (nMarkerMotion_Origin / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_MOTION_ORIGIN must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerMotion_Origin/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_MOTION_ORIGIN must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMarkerTranslation == 0) { - nMarkerTranslation = 3 * nMarker_Moving; - MarkerTranslation_Rate = new su2double[nMarkerTranslation](); + if (nMarkerTranslation == 0){ + nMarkerTranslation = 3*nMarker_Moving; + MarkerTranslation_Rate = new su2double[nMarkerTranslation] (); } - if (nMarkerTranslation / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_TRANSLATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerTranslation/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_TRANSLATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMarkerRotation_Rate == 0) { - nMarkerRotation_Rate = 3 * nMarker_Moving; - MarkerRotation_Rate = new su2double[nMarkerRotation_Rate](); + if (nMarkerRotation_Rate == 0){ + nMarkerRotation_Rate = 3*nMarker_Moving; + MarkerRotation_Rate = new su2double[nMarkerRotation_Rate] (); } - if (nMarkerRotation_Rate / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_ROTATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerRotation_Rate/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_ROTATION_RATE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMarkerPlunging_Ampl == 0) { - nMarkerPlunging_Ampl = 3 * nMarker_Moving; - MarkerPlunging_Ampl = new su2double[nMarkerPlunging_Ampl](); + if (nMarkerPlunging_Ampl == 0){ + nMarkerPlunging_Ampl = 3*nMarker_Moving; + MarkerPlunging_Ampl = new su2double[nMarkerPlunging_Ampl] (); } - if (nMarkerPlunging_Ampl / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_PLUNGING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerPlunging_Ampl/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_PLUNGING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMarkerPlunging_Omega == 0) { - nMarkerPlunging_Omega = 3 * nMarker_Moving; - MarkerPlunging_Omega = new su2double[nMarkerPlunging_Omega](); + if (nMarkerPlunging_Omega == 0){ + nMarkerPlunging_Omega = 3*nMarker_Moving; + MarkerPlunging_Omega = new su2double[nMarkerPlunging_Omega] (); } - if (nMarkerPlunging_Omega / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_PLUNGING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerPlunging_Omega/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_PLUNGING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMarkerPitching_Ampl == 0) { - nMarkerPitching_Ampl = 3 * nMarker_Moving; - MarkerPitching_Ampl = new su2double[nMarkerPitching_Ampl](); + if (nMarkerPitching_Ampl == 0){ + nMarkerPitching_Ampl = 3*nMarker_Moving; + MarkerPitching_Ampl = new su2double[nMarkerPitching_Ampl] (); } - if (nMarkerPitching_Ampl / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_PITCHING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerPitching_Ampl/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_PITCHING_AMPL must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMarkerPitching_Omega == 0) { - nMarkerPitching_Omega = 3 * nMarker_Moving; - MarkerPitching_Omega = new su2double[nMarkerPitching_Omega](); + if (nMarkerPitching_Omega == 0){ + nMarkerPitching_Omega = 3*nMarker_Moving; + MarkerPitching_Omega = new su2double[nMarkerPitching_Omega] (); } - if (nMarkerPitching_Omega / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_PITCHING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerPitching_Omega/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_PITCHING_OMEGA must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMarkerPitching_Phase == 0) { - nMarkerPitching_Phase = 3 * nMarker_Moving; - MarkerPitching_Phase = new su2double[nMarkerPitching_Phase](); + if (nMarkerPitching_Phase == 0){ + nMarkerPitching_Phase = 3*nMarker_Moving; + MarkerPitching_Phase = new su2double[nMarkerPitching_Phase] (); } - if (nMarkerPitching_Phase / 3 != nMarker_Moving) { - SU2_MPI::Error( - "Number of SURFACE_PITCHING_PHASE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", - CURRENT_FUNCTION); + if (nMarkerPitching_Phase/3 != nMarker_Moving){ + SU2_MPI::Error("Number of SURFACE_PITCHING_PHASE must be three times the number of MARKER_MOVING, (x,y,z) per marker.", CURRENT_FUNCTION); } - if (nMoveMotion_Origin == 0) { + if (nMoveMotion_Origin == 0){ nMoveMotion_Origin = nMarker_Moving; MoveMotion_Origin = new unsigned short[nMoveMotion_Origin]; - for (iMarker = 0; iMarker < nMarker_Moving; iMarker++) { + for (iMarker = 0; iMarker < nMarker_Moving; iMarker++){ MoveMotion_Origin[iMarker] = NO; } } - if (nMoveMotion_Origin != nMarker_Moving) { + if (nMoveMotion_Origin != nMarker_Moving){ SU2_MPI::Error("Number of MOVE_MOTION_ORIGIN must match number of MARKER_MOVING.", CURRENT_FUNCTION); } } @@ -4564,61 +4184,61 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE) { HarmonicBalance_Period = GetHarmonicBalance_Period(); - if (HarmonicBalance_Period < 0) { + if (HarmonicBalance_Period < 0) { SU2_MPI::Error("Not a valid value for time period!!", CURRENT_FUNCTION); } /* Initialize the Harmonic balance Frequency pointer */ if (Omega_HB == nullptr) { Omega_HB = new su2double[nOmega_HB]; - for (unsigned short iZone = 0; iZone < nOmega_HB; iZone++) Omega_HB[iZone] = 0.0; - } else { + for (unsigned short iZone = 0; iZone < nOmega_HB; iZone++ ) + Omega_HB[iZone] = 0.0; + } else { if (nOmega_HB != nTimeInstances) { - SU2_MPI::Error("Length of omega_HB must match the number TIME_INSTANCES!!", CURRENT_FUNCTION); + SU2_MPI::Error("Length of omega_HB must match the number TIME_INSTANCES!!" , CURRENT_FUNCTION); } } } /*--- Force number of span-wise section to 1 if 2D case ---*/ - if (val_nDim == 2) { - nSpanWiseSections_User = 1; - Kind_SpanWise = EQUISPACED; + if(val_nDim ==2){ + nSpanWiseSections_User=1; + Kind_SpanWise= EQUISPACED; } /*--- Set number of TurboPerformance markers ---*/ - if (nMarker_Turbomachinery > 0) { - if (nMarker_Turbomachinery > 1) { - nMarker_TurboPerformance = nMarker_Turbomachinery + SU2_TYPE::Int(nMarker_Turbomachinery / 2) + 1; - } else { + if(nMarker_Turbomachinery > 0){ + if(nMarker_Turbomachinery > 1){ + nMarker_TurboPerformance = nMarker_Turbomachinery + SU2_TYPE::Int(nMarker_Turbomachinery/2) + 1; + }else{ nMarker_TurboPerformance = nMarker_Turbomachinery; } } else { nMarker_TurboPerformance = 0; - nSpanWiseSections = 1; + nSpanWiseSections =1; } /*--- Set number of TurboPerformance markers ---*/ - if (nMarker_Turbomachinery != 0) { + if(nMarker_Turbomachinery != 0){ nSpan_iZones = new unsigned short[nZone]; } /*--- Set number of TurboPerformance markers ---*/ - if (GetGrid_Movement() && RampRotatingFrame && !DiscreteAdjoint) { + if(GetGrid_Movement() && RampRotatingFrame && !DiscreteAdjoint){ FinalRotation_Rate_Z = Rotation_Rate[2]; - if (abs(FinalRotation_Rate_Z) > 0.0) { + if(abs(FinalRotation_Rate_Z) > 0.0){ Rotation_Rate[2] = rampRotFrame_coeff[0]; } } - if (RampOutletPressure && !DiscreteAdjoint) { - for (iMarker = 0; iMarker < nMarker_Giles; iMarker++) { - if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || - Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM) { + if(RampOutletPressure && !DiscreteAdjoint){ + for (iMarker = 0; iMarker < nMarker_Giles; iMarker++){ + if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM ){ FinalOutletPressure = Giles_Var1[iMarker]; Giles_Var1[iMarker] = rampOutPres_coeff[0]; } } - for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++) { - if (Kind_Data_Riemann[iMarker] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker] == RADIAL_EQUILIBRIUM) { + for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++){ + if (Kind_Data_Riemann[iMarker] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker] == RADIAL_EQUILIBRIUM){ FinalOutletPressure = Riemann_Var1[iMarker]; Riemann_Var1[iMarker] = rampOutPres_coeff[0]; } @@ -4626,12 +4246,12 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } /*--- Check on extra Relaxation factor for Giles---*/ - if (extrarelfac[1] > 0.5) { + if(extrarelfac[1] > 0.5){ extrarelfac[1] = 0.5; } - /*--- Use the various rigid-motion input frequencies to determine the period to be used with harmonic balance cases. - There are THREE types of motion to consider, namely: rotation, pitching, and plunging. - The largest period of motion is the one to be used for harmonic balance calculations. ---*/ + /*--- Use the various rigid-motion input frequencies to determine the period to be used with harmonic balance cases. + There are THREE types of motion to consider, namely: rotation, pitching, and plunging. + The largest period of motion is the one to be used for harmonic balance calculations. ---*/ /*if (Unsteady_Simulation == HARMONIC_BALANCE) { if (!(GetGrid_Movement())) { @@ -4646,21 +4266,27 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i //--- rotation: ---// - su2double Omega_mag_rot = - sqrt(pow(Rotation_Rate_X[ZONE_0],2)+pow(Rotation_Rate_Y[ZONE_0],2)+pow(Rotation_Rate_Z[ZONE_0],2)); if (Omega_mag_rot - > 0) periods[0] = 2*PI_NUMBER/Omega_mag_rot; else periods[0] = 0.0; + su2double Omega_mag_rot = sqrt(pow(Rotation_Rate_X[ZONE_0],2)+pow(Rotation_Rate_Y[ZONE_0],2)+pow(Rotation_Rate_Z[ZONE_0],2)); + if (Omega_mag_rot > 0) + periods[0] = 2*PI_NUMBER/Omega_mag_rot; + else + periods[0] = 0.0; //--- pitching: ---// - su2double Omega_mag_pitch = - sqrt(pow(Pitching_Omega_X[ZONE_0],2)+pow(Pitching_Omega_Y[ZONE_0],2)+pow(Pitching_Omega_Z[ZONE_0],2)); if - (Omega_mag_pitch > 0) periods[1] = 2*PI_NUMBER/Omega_mag_pitch; else periods[1] = 0.0; + su2double Omega_mag_pitch = sqrt(pow(Pitching_Omega_X[ZONE_0],2)+pow(Pitching_Omega_Y[ZONE_0],2)+pow(Pitching_Omega_Z[ZONE_0],2)); + if (Omega_mag_pitch > 0) + periods[1] = 2*PI_NUMBER/Omega_mag_pitch; + else + periods[1] = 0.0; //--- plunging: ---// - su2double Omega_mag_plunge = - sqrt(pow(Plunging_Omega_X[ZONE_0],2)+pow(Plunging_Omega_Y[ZONE_0],2)+pow(Plunging_Omega_Z[ZONE_0],2)); if - (Omega_mag_plunge > 0) periods[2] = 2*PI_NUMBER/Omega_mag_plunge; else periods[2] = 0.0; + su2double Omega_mag_plunge = sqrt(pow(Plunging_Omega_X[ZONE_0],2)+pow(Plunging_Omega_Y[ZONE_0],2)+pow(Plunging_Omega_Z[ZONE_0],2)); + if (Omega_mag_plunge > 0) + periods[2] = 2*PI_NUMBER/Omega_mag_plunge; + else + periods[2] = 0.0; //--- determine which period is largest ---// @@ -4676,76 +4302,85 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i }*/ + /*--- In case the moment origin coordinates have not been declared in the config file, set them equal to zero for safety. Also check to make sure that for each marker, a value has been declared for the moment origin. Unless only one value was specified, then set this value for all the markers being monitored. ---*/ - if ((nRefOriginMoment_X != nRefOriginMoment_Y) || (nRefOriginMoment_X != nRefOriginMoment_Z)) { - SU2_MPI::Error( - "ERROR: Length of REF_ORIGIN_MOMENT_X, REF_ORIGIN_MOMENT_Y and REF_ORIGIN_MOMENT_Z must be the same!!", - CURRENT_FUNCTION); + + if ((nRefOriginMoment_X != nRefOriginMoment_Y) || (nRefOriginMoment_X != nRefOriginMoment_Z) ) { + SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_X, REF_ORIGIN_MOMENT_Y and REF_ORIGIN_MOMENT_Z must be the same!!", CURRENT_FUNCTION); } if (RefOriginMoment_X == nullptr) { RefOriginMoment_X = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_X[iMarker] = 0.0; + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) + RefOriginMoment_X[iMarker] = 0.0; } else { if (nRefOriginMoment_X == 1) { + su2double aux_RefOriginMoment_X = RefOriginMoment_X[0]; - delete[] RefOriginMoment_X; + delete [] RefOriginMoment_X; RefOriginMoment_X = new su2double[nMarker_Monitoring]; nRefOriginMoment_X = nMarker_Monitoring; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_X[iMarker] = aux_RefOriginMoment_X; - } else if (nRefOriginMoment_X != nMarker_Monitoring) { - SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_X must match number of Monitoring Markers!!", - CURRENT_FUNCTION); + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) + RefOriginMoment_X[iMarker] = aux_RefOriginMoment_X; + } + else if (nRefOriginMoment_X != nMarker_Monitoring) { + SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_X must match number of Monitoring Markers!!", CURRENT_FUNCTION); } } if (RefOriginMoment_Y == nullptr) { RefOriginMoment_Y = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Y[iMarker] = 0.0; + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) + RefOriginMoment_Y[iMarker] = 0.0; } else { if (nRefOriginMoment_Y == 1) { + su2double aux_RefOriginMoment_Y = RefOriginMoment_Y[0]; - delete[] RefOriginMoment_Y; + delete [] RefOriginMoment_Y; RefOriginMoment_Y = new su2double[nMarker_Monitoring]; nRefOriginMoment_Y = nMarker_Monitoring; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Y[iMarker] = aux_RefOriginMoment_Y; - } else if (nRefOriginMoment_Y != nMarker_Monitoring) { - SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Y must match number of Monitoring Markers!!", - CURRENT_FUNCTION); + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) + RefOriginMoment_Y[iMarker] = aux_RefOriginMoment_Y; + } + else if (nRefOriginMoment_Y != nMarker_Monitoring) { + SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Y must match number of Monitoring Markers!!", CURRENT_FUNCTION); } } if (RefOriginMoment_Z == nullptr) { RefOriginMoment_Z = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Z[iMarker] = 0.0; + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) + RefOriginMoment_Z[iMarker] = 0.0; } else { if (nRefOriginMoment_Z == 1) { + su2double aux_RefOriginMoment_Z = RefOriginMoment_Z[0]; - delete[] RefOriginMoment_Z; + delete [] RefOriginMoment_Z; RefOriginMoment_Z = new su2double[nMarker_Monitoring]; nRefOriginMoment_Z = nMarker_Monitoring; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) RefOriginMoment_Z[iMarker] = aux_RefOriginMoment_Z; - } else if (nRefOriginMoment_Z != nMarker_Monitoring) { - SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Z must match number of Monitoring Markers!!", - CURRENT_FUNCTION); + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) + RefOriginMoment_Z[iMarker] = aux_RefOriginMoment_Z; + } + else if (nRefOriginMoment_Z != nMarker_Monitoring) { + SU2_MPI::Error("ERROR: Length of REF_ORIGIN_MOMENT_Z must match number of Monitoring Markers!!", CURRENT_FUNCTION); } } /*--- Set the boolean flag if we are carrying out an aeroelastic simulation. ---*/ - Aeroelastic_Simulation = - GetGrid_Movement() && (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION)); + Aeroelastic_Simulation = GetGrid_Movement() && (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION)); /*--- Initializing the size for the solutions of the Aeroelastic problem. ---*/ + if (GetGrid_Movement() && Aeroelastic_Simulation) { Aeroelastic_np1.resize(nMarker_Monitoring); Aeroelastic_n.resize(nMarker_Monitoring); @@ -4754,11 +4389,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Aeroelastic_np1[iMarker].resize(2); Aeroelastic_n[iMarker].resize(2); Aeroelastic_n1[iMarker].resize(2); - for (int i = 0; i < 2; i++) { + for (int i =0; i<2; i++) { Aeroelastic_np1[iMarker][i].resize(2); Aeroelastic_n[iMarker][i].resize(2); Aeroelastic_n1[iMarker][i].resize(2); - for (int j = 0; j < 2; j++) { + for (int j=0; j<2; j++) { Aeroelastic_np1[iMarker][i][j] = 0.0; Aeroelastic_n[iMarker][i][j] = 0.0; Aeroelastic_n1[iMarker][i][j] = 0.0; @@ -4772,7 +4407,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (GetGrid_Movement() && Aeroelastic_Simulation) { Aeroelastic_pitch = new su2double[nMarker_Monitoring]; Aeroelastic_plunge = new su2double[nMarker_Monitoring]; - for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) { + for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++ ) { Aeroelastic_pitch[iMarker] = 0.0; Aeroelastic_plunge[iMarker] = 0.0; } @@ -4781,14 +4416,18 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i FinestMesh = MESH_0; if (MGCycle == FULLMG_CYCLE) FinestMesh = nMGLevels; - if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) && (Kind_Turb_Model != TURB_MODEL::NONE)) + if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) && + (Kind_Turb_Model != TURB_MODEL::NONE)) Kind_Solver = MAIN_SOLVER::RANS; - if ((Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) && (Kind_Turb_Model != TURB_MODEL::NONE)) + if ((Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) && + (Kind_Turb_Model != TURB_MODEL::NONE)) Kind_Solver = MAIN_SOLVER::INC_RANS; - if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::INC_EULER || - Kind_Solver == MAIN_SOLVER::NEMO_EULER || Kind_Solver == MAIN_SOLVER::FEM_EULER) + if (Kind_Solver == MAIN_SOLVER::EULER || + Kind_Solver == MAIN_SOLVER::INC_EULER || + Kind_Solver == MAIN_SOLVER::NEMO_EULER || + Kind_Solver == MAIN_SOLVER::FEM_EULER) Kind_Turb_Model = TURB_MODEL::NONE; Kappa_2nd_Flow = jst_coeff[0]; @@ -4799,89 +4438,113 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Make the MG_PreSmooth, MG_PostSmooth, and MG_CorrecSmooth arrays consistent with nMGLevels ---*/ - auto* tmp_smooth = new unsigned short[nMGLevels + 1]; + auto * tmp_smooth = new unsigned short[nMGLevels+1]; + + if ((nMG_PreSmooth != nMGLevels+1) && (nMG_PreSmooth != 0)) { + if (nMG_PreSmooth > nMGLevels+1) { - if ((nMG_PreSmooth != nMGLevels + 1) && (nMG_PreSmooth != 0)) { - if (nMG_PreSmooth > nMGLevels + 1) { /*--- Truncate by removing unnecessary elements at the end ---*/ - for (unsigned int i = 0; i <= nMGLevels; i++) tmp_smooth[i] = MG_PreSmooth[i]; - delete[] MG_PreSmooth; - MG_PreSmooth = nullptr; - } else { + for (unsigned int i = 0; i <= nMGLevels; i++) + tmp_smooth[i] = MG_PreSmooth[i]; + delete [] MG_PreSmooth; + MG_PreSmooth=nullptr; + } + else { + /*--- Add additional elements equal to last element ---*/ - for (unsigned int i = 0; i < nMG_PreSmooth; i++) tmp_smooth[i] = MG_PreSmooth[i]; - for (unsigned int i = nMG_PreSmooth; i <= nMGLevels; i++) tmp_smooth[i] = MG_PreSmooth[nMG_PreSmooth - 1]; - delete[] MG_PreSmooth; - MG_PreSmooth = nullptr; + for (unsigned int i = 0; i < nMG_PreSmooth; i++) + tmp_smooth[i] = MG_PreSmooth[i]; + for (unsigned int i = nMG_PreSmooth; i <= nMGLevels; i++) + tmp_smooth[i] = MG_PreSmooth[nMG_PreSmooth-1]; + delete [] MG_PreSmooth; + MG_PreSmooth=nullptr; } - nMG_PreSmooth = nMGLevels + 1; + nMG_PreSmooth = nMGLevels+1; MG_PreSmooth = new unsigned short[nMG_PreSmooth]; - for (unsigned int i = 0; i < nMG_PreSmooth; i++) MG_PreSmooth[i] = tmp_smooth[i]; + for (unsigned int i = 0; i < nMG_PreSmooth; i++) + MG_PreSmooth[i] = tmp_smooth[i]; } if ((nMGLevels != 0) && (nMG_PreSmooth == 0)) { - delete[] MG_PreSmooth; - nMG_PreSmooth = nMGLevels + 1; + delete [] MG_PreSmooth; + nMG_PreSmooth = nMGLevels+1; MG_PreSmooth = new unsigned short[nMG_PreSmooth]; - for (unsigned int i = 0; i < nMG_PreSmooth; i++) MG_PreSmooth[i] = i + 1; + for (unsigned int i = 0; i < nMG_PreSmooth; i++) + MG_PreSmooth[i] = i+1; } - if ((nMG_PostSmooth != nMGLevels + 1) && (nMG_PostSmooth != 0)) { - if (nMG_PostSmooth > nMGLevels + 1) { + if ((nMG_PostSmooth != nMGLevels+1) && (nMG_PostSmooth != 0)) { + if (nMG_PostSmooth > nMGLevels+1) { + /*--- Truncate by removing unnecessary elements at the end ---*/ - for (unsigned int i = 0; i <= nMGLevels; i++) tmp_smooth[i] = MG_PostSmooth[i]; - delete[] MG_PostSmooth; - MG_PostSmooth = nullptr; - } else { + for (unsigned int i = 0; i <= nMGLevels; i++) + tmp_smooth[i] = MG_PostSmooth[i]; + delete [] MG_PostSmooth; + MG_PostSmooth=nullptr; + } + else { + /*--- Add additional elements equal to last element ---*/ - for (unsigned int i = 0; i < nMG_PostSmooth; i++) tmp_smooth[i] = MG_PostSmooth[i]; - for (unsigned int i = nMG_PostSmooth; i <= nMGLevels; i++) tmp_smooth[i] = MG_PostSmooth[nMG_PostSmooth - 1]; - delete[] MG_PostSmooth; - MG_PostSmooth = nullptr; + for (unsigned int i = 0; i < nMG_PostSmooth; i++) + tmp_smooth[i] = MG_PostSmooth[i]; + for (unsigned int i = nMG_PostSmooth; i <= nMGLevels; i++) + tmp_smooth[i] = MG_PostSmooth[nMG_PostSmooth-1]; + delete [] MG_PostSmooth; + MG_PostSmooth=nullptr; } - nMG_PostSmooth = nMGLevels + 1; + nMG_PostSmooth = nMGLevels+1; MG_PostSmooth = new unsigned short[nMG_PostSmooth]; - for (unsigned int i = 0; i < nMG_PostSmooth; i++) MG_PostSmooth[i] = tmp_smooth[i]; + for (unsigned int i = 0; i < nMG_PostSmooth; i++) + MG_PostSmooth[i] = tmp_smooth[i]; + } if ((nMGLevels != 0) && (nMG_PostSmooth == 0)) { - delete[] MG_PostSmooth; - nMG_PostSmooth = nMGLevels + 1; + delete [] MG_PostSmooth; + nMG_PostSmooth = nMGLevels+1; MG_PostSmooth = new unsigned short[nMG_PostSmooth]; - for (unsigned int i = 0; i < nMG_PostSmooth; i++) MG_PostSmooth[i] = 0; + for (unsigned int i = 0; i < nMG_PostSmooth; i++) + MG_PostSmooth[i] = 0; } - if ((nMG_CorrecSmooth != nMGLevels + 1) && (nMG_CorrecSmooth != 0)) { - if (nMG_CorrecSmooth > nMGLevels + 1) { + if ((nMG_CorrecSmooth != nMGLevels+1) && (nMG_CorrecSmooth != 0)) { + if (nMG_CorrecSmooth > nMGLevels+1) { + /*--- Truncate by removing unnecessary elements at the end ---*/ - for (unsigned int i = 0; i <= nMGLevels; i++) tmp_smooth[i] = MG_CorrecSmooth[i]; - delete[] MG_CorrecSmooth; + for (unsigned int i = 0; i <= nMGLevels; i++) + tmp_smooth[i] = MG_CorrecSmooth[i]; + delete [] MG_CorrecSmooth; MG_CorrecSmooth = nullptr; - } else { + } + else { + /*--- Add additional elements equal to last element ---*/ - for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) tmp_smooth[i] = MG_CorrecSmooth[i]; + for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) + tmp_smooth[i] = MG_CorrecSmooth[i]; for (unsigned int i = nMG_CorrecSmooth; i <= nMGLevels; i++) - tmp_smooth[i] = MG_CorrecSmooth[nMG_CorrecSmooth - 1]; - delete[] MG_CorrecSmooth; + tmp_smooth[i] = MG_CorrecSmooth[nMG_CorrecSmooth-1]; + delete [] MG_CorrecSmooth; MG_CorrecSmooth = nullptr; } - nMG_CorrecSmooth = nMGLevels + 1; + nMG_CorrecSmooth = nMGLevels+1; MG_CorrecSmooth = new unsigned short[nMG_CorrecSmooth]; - for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) MG_CorrecSmooth[i] = tmp_smooth[i]; + for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) + MG_CorrecSmooth[i] = tmp_smooth[i]; } if ((nMGLevels != 0) && (nMG_CorrecSmooth == 0)) { - delete[] MG_CorrecSmooth; - nMG_CorrecSmooth = nMGLevels + 1; + delete [] MG_CorrecSmooth; + nMG_CorrecSmooth = nMGLevels+1; MG_CorrecSmooth = new unsigned short[nMG_CorrecSmooth]; - for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) MG_CorrecSmooth[i] = 0; + for (unsigned int i = 0; i < nMG_CorrecSmooth; i++) + MG_CorrecSmooth[i] = 0; } /*--- Override MG Smooth parameters ---*/ @@ -4901,29 +4564,27 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Kind_Solver == MAIN_SOLVER::RANS) Kind_Solver = MAIN_SOLVER::ADJ_RANS; } - nCFL = nMGLevels + 1; + nCFL = nMGLevels+1; CFL = new su2double[nCFL]; CFL[0] = CFLFineGrid; /*--- Handle optional CFL adapt parameter values ---*/ if (nCFL_AdaptParam < default_cfl_adapt.size()) { - auto newParam = new su2double[default_cfl_adapt.size()]; + auto newParam = new su2double [default_cfl_adapt.size()]; for (iCFL = 0; iCFL < default_cfl_adapt.size(); ++iCFL) { - if (iCFL < nCFL_AdaptParam) - newParam[iCFL] = CFL_AdaptParam[iCFL]; - else - newParam[iCFL] = default_cfl_adapt[iCFL]; + if (iCFL < nCFL_AdaptParam) newParam[iCFL] = CFL_AdaptParam[iCFL]; + else newParam[iCFL] = default_cfl_adapt[iCFL]; } swap(newParam, CFL_AdaptParam); - delete[] newParam; + delete [] newParam; nCFL_AdaptParam = default_cfl_adapt.size(); } /*--- Evaluate when the Cl should be evaluated ---*/ - Iter_Fixed_CM = SU2_TYPE::Int(nInnerIter / (su2double(Update_iH) + 1)); - Iter_Fixed_NetThrust = SU2_TYPE::Int(nInnerIter / (su2double(Update_BCThrust) + 1)); + Iter_Fixed_CM = SU2_TYPE::Int(nInnerIter / (su2double(Update_iH)+1)); + Iter_Fixed_NetThrust = SU2_TYPE::Int(nInnerIter / (su2double(Update_BCThrust)+1)); /*--- Setting relaxation factor and CFL for the adjoint runs ---*/ @@ -4931,8 +4592,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i CFL[0] = CFL[0] * CFLRedCoeff_AdjFlow; CFL_AdaptParam[2] *= CFLRedCoeff_AdjFlow; CFL_AdaptParam[3] *= CFLRedCoeff_AdjFlow; - Iter_Fixed_CM = SU2_TYPE::Int(su2double(Iter_Fixed_CM) / CFLRedCoeff_AdjFlow); - Iter_Fixed_NetThrust = SU2_TYPE::Int(su2double(Iter_Fixed_NetThrust) / CFLRedCoeff_AdjFlow); + Iter_Fixed_CM = SU2_TYPE::Int(su2double (Iter_Fixed_CM) / CFLRedCoeff_AdjFlow); + Iter_Fixed_NetThrust = SU2_TYPE::Int(su2double (Iter_Fixed_NetThrust) / CFLRedCoeff_AdjFlow); } if ((DiscreteAdjoint) && (Inconsistent_Disc)) { @@ -4946,46 +4607,40 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Update_AoA_Iter_Limit == 0 && Fixed_CL_Mode) { SU2_MPI::Error("ERROR: Please specify non-zero UPDATE_AOA_ITER_LIMIT.", CURRENT_FUNCTION); } - if (Iter_Fixed_CM == 0) { - Iter_Fixed_CM = nInnerIter + 1; - Update_iH = 0; - } - if (Iter_Fixed_NetThrust == 0) { - Iter_Fixed_NetThrust = nInnerIter + 1; - Update_BCThrust = 0; - } + if (Iter_Fixed_CM == 0) { Iter_Fixed_CM = nInnerIter+1; Update_iH = 0; } + if (Iter_Fixed_NetThrust == 0) { Iter_Fixed_NetThrust = nInnerIter+1; Update_BCThrust = 0; } - for (iCFL = 1; iCFL < nCFL; iCFL++) CFL[iCFL] = CFL[iCFL - 1]; + for (iCFL = 1; iCFL < nCFL; iCFL++) + CFL[iCFL] = CFL[iCFL-1]; if (nRKStep == 0) { nRKStep = 1; - RK_Alpha_Step = new su2double[1]; - RK_Alpha_Step[0] = 1.0; + RK_Alpha_Step = new su2double[1]; RK_Alpha_Step[0] = 1.0; } /* Check if the byte alignment of the matrix multiplications is a multiple of 64. */ - if (byteAlignmentMatMul % 64) { + if( byteAlignmentMatMul%64 ) { SU2_MPI::Error("ALIGNED_BYTES_MATMUL must be a multiple of 64.", CURRENT_FUNCTION); } /* Determine the value of sizeMatMulPadding, which is the matrix size in the vectorization direction when padding is applied to have optimal performance in the matrix multiplications. */ - sizeMatMulPadding = byteAlignmentMatMul / sizeof(passivedouble); + sizeMatMulPadding = byteAlignmentMatMul/sizeof(passivedouble); /* Correct the number of time levels for time accurate local time stepping, if needed. */ - if (nLevels_TimeAccurateLTS == 0) nLevels_TimeAccurateLTS = 1; - if (nLevels_TimeAccurateLTS > 15) nLevels_TimeAccurateLTS = 15; + if (nLevels_TimeAccurateLTS == 0) nLevels_TimeAccurateLTS = 1; + if (nLevels_TimeAccurateLTS > 15) nLevels_TimeAccurateLTS = 15; /* Check that no time accurate local time stepping is specified for time integration schemes other than ADER. */ if (Kind_TimeIntScheme_FEM_Flow != ADER_DG && nLevels_TimeAccurateLTS != 1) { - if (rank == MASTER_NODE) { - cout << endl - << "WARNING: " << nLevels_TimeAccurateLTS << " levels specified for time accurate local time stepping." - << endl + + if (rank==MASTER_NODE) { + cout << endl << "WARNING: " + << nLevels_TimeAccurateLTS << " levels specified for time accurate local time stepping." << endl << "Time accurate local time stepping is only possible for ADER, hence this option is not used." << endl << endl; } @@ -4994,13 +4649,15 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } if (Kind_TimeIntScheme_FEM_Flow == ADER_DG) { + 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. */ if (nLevels_TimeAccurateLTS != 1) { - if (Unst_CFL == 0.0) - SU2_MPI::Error("ERROR: Unsteady CFL not specified for time accurate local time stepping.", CURRENT_FUNCTION); + if(Unst_CFL == 0.0) + SU2_MPI::Error("ERROR: Unsteady CFL not specified for time accurate local time stepping.", + CURRENT_FUNCTION); } /* Determine the location of the ADER time DOFs, which are the Gauss-Legendre @@ -5010,86 +4667,75 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i GaussJacobi.GetQuadraturePoints(0.0, 0.0, -1.0, 1.0, GLPoints, GLWeights); TimeDOFsADER_DG = new su2double[nTimeDOFsADER_DG]; - for (unsigned short i = 0; i < nTimeDOFsADER_DG; ++i) TimeDOFsADER_DG[i] = GLPoints[i]; + for(unsigned short i=0; i 1) { + else if (top_optim_nKernelParams==1 && top_optim_nKernel>1) { su2double tmp = top_optim_kernel_params[0]; - delete[] top_optim_kernel_params; + delete [] top_optim_kernel_params; top_optim_nKernelParams = top_optim_nKernel; - top_optim_kernel_params = new su2double[top_optim_nKernel]; - for (unsigned short i = 0; i < top_optim_nKernel; ++i) top_optim_kernel_params[i] = tmp; + top_optim_kernel_params = new su2double [top_optim_nKernel]; + for (unsigned short i=0; i 1) { + else if (top_optim_nRadius==1 && top_optim_nKernel>1) { su2double tmp = top_optim_filter_radius[0]; - delete[] top_optim_filter_radius; + delete [] top_optim_filter_radius; top_optim_nRadius = top_optim_nKernel; - top_optim_filter_radius = new su2double[top_optim_nKernel]; - for (unsigned short i = 0; i < top_optim_nKernel; ++i) top_optim_filter_radius[i] = tmp; + top_optim_filter_radius = new su2double [top_optim_nKernel]; + for (unsigned short i=0; i 1) { - SU2_MPI::Error( - "SURFACE_SPECIES_0 and SURFACE_SPECIES_VARIANCE currently can only handle one entry to MARKER_ANALYZE.", - CURRENT_FUNCTION); + SU2_MPI::Error("SURFACE_SPECIES_0 and SURFACE_SPECIES_VARIANCE currently can only handle one entry to MARKER_ANALYZE.", CURRENT_FUNCTION); } } - if (Kind_TimeIntScheme_Species != EULER_IMPLICIT && Kind_TimeIntScheme_Species != EULER_EXPLICIT) { - SU2_MPI::Error( - "Only TIME_DISCRE_TURB = EULER_IMPLICIT, EULER_EXPLICIT have been implemented in the scalar solver.", - CURRENT_FUNCTION); + if(Kind_TimeIntScheme_Species != EULER_IMPLICIT && + Kind_TimeIntScheme_Species != EULER_EXPLICIT){ + SU2_MPI::Error("Only TIME_DISCRE_TURB = EULER_IMPLICIT, EULER_EXPLICIT have been implemented in the scalar solver.", CURRENT_FUNCTION); } /*--- If Species clipping is on, make sure bounds are given by the user. ---*/ if (Species_Clipping) if (!(OptionIsSet("SPECIES_CLIPPING_MIN") && OptionIsSet("SPECIES_CLIPPING_MAX"))) - SU2_MPI::Error( - "SPECIES_CLIPPING= YES requires the options SPECIES_CLIPPING_MIN/MAX to set the clipping values.", - CURRENT_FUNCTION); + SU2_MPI::Error("SPECIES_CLIPPING= YES requires the options SPECIES_CLIPPING_MIN/MAX to set the clipping values.", CURRENT_FUNCTION); /*--- Make sure a Diffusivity has been set for Constant Diffusivity. ---*/ - if (Kind_Diffusivity_Model == DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY && !(OptionIsSet("DIFFUSIVITY_CONSTANT"))) - SU2_MPI::Error("A DIFFUSIVITY_CONSTANT= has to be set with DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY.", - CURRENT_FUNCTION); + if (Kind_Diffusivity_Model == DIFFUSIVITYMODEL::CONSTANT_DIFFUSIVITY && + !(OptionIsSet("DIFFUSIVITY_CONSTANT"))) + SU2_MPI::Error("A DIFFUSIVITY_CONSTANT= has to be set with DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY.", CURRENT_FUNCTION); /*--- Check whether the number of entries of the constant Lewis number equals the number of transported scalar equations solved. nConstant_Lewis_Number is used because it is required for the diffusivity fluid mixing @@ -5841,7 +5439,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i nSpecies_options.push_back(nSpecies_Init); if (Species_Clipping) nSpecies_options.insert(nSpecies_options.end(), {nSpecies_Clipping_Min, nSpecies_Clipping_Max}); - if (nMarker_Inlet_Species > 0) nSpecies_options.push_back(nSpecies_per_Inlet); + if (nMarker_Inlet_Species > 0) + nSpecies_options.push_back(nSpecies_per_Inlet); // Add more options for size check here. /*--- nSpecies_Init is the master, but it simply checks for consistency. ---*/ @@ -5852,8 +5451,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Once consistency is checked set the var that is used throughout the code. ---*/ nSpecies = nSpecies_Init; - /*--- Check whether some variables (or their sums) are in physical bounds. [0,1] for species related quantities. - * ---*/ + /*--- Check whether some variables (or their sums) are in physical bounds. [0,1] for species related quantities. ---*/ /*--- Note, only for species transport, not for flamelet model ---*/ if (Kind_Species_Model == SPECIES_MODEL::SPECIES_TRANSPORT) { su2double Species_Init_Sum = 0.0; @@ -5873,15 +5471,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } - } // species transport checks + } // species transport checks /*--- Define some variables for flamelet model. ---*/ if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { /*--- The controlling variables are progress variable, total enthalpy, and optionally mixture fraction ---*/ - // n_control_vars = nSpecies - n_user_scalars; + //n_control_vars = nSpecies - n_user_scalars; if (n_control_vars != (nSpecies - n_user_scalars)) - SU2_MPI::Error("Number of initial species incompatbile with number of controlling variables and user scalars.", - CURRENT_FUNCTION); + SU2_MPI::Error("Number of initial species incompatbile with number of controlling variables and user scalars.", CURRENT_FUNCTION); /*--- We can have additional user defined transported scalars ---*/ n_scalars = n_control_vars + n_user_scalars; } @@ -5892,32 +5489,40 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } void CConfig::SetMarkers(SU2_COMPONENT val_software) { - unsigned short iMarker_All, iMarker_CfgFile, iMarker_Euler, iMarker_Custom, iMarker_FarField, iMarker_SymWall, - iMarker_PerBound, iMarker_NearFieldBound, iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, - iMarker_Giles, iMarker_Outlet, iMarker_Smoluchowski_Maxwell, iMarker_Isothermal, iMarker_HeatFlux, - iMarker_HeatTansfer, iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Damper, iMarker_Displacement, - iMarker_Load, iMarker_Internal, iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, - iMarker_Analyze, iMarker_DV, iMarker_Moving, iMarker_SobolevBC, iMarker_PyCustom, iMarker_Supersonic_Inlet, - iMarker_Supersonic_Outlet, iMarker_Clamped, iMarker_ZoneInterface, iMarker_CHTInterface, iMarker_Load_Dir, - iMarker_Disp_Dir, iMarker_Fluid_Load, iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, iMarker_ActDiskInlet, - iMarker_ActDiskOutlet, iMarker_Turbomachinery, iMarker_MixingPlaneInterface; + + unsigned short iMarker_All, iMarker_CfgFile, iMarker_Euler, iMarker_Custom, + iMarker_FarField, iMarker_SymWall, iMarker_PerBound, + iMarker_NearFieldBound, iMarker_Fluid_InterfaceBound, + iMarker_Inlet, iMarker_Riemann, iMarker_Giles, iMarker_Outlet, + iMarker_Smoluchowski_Maxwell, + iMarker_Isothermal,iMarker_HeatFlux,iMarker_HeatTansfer, + iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Damper, + iMarker_Displacement, iMarker_Load, iMarker_Internal, + iMarker_Monitoring, iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, + iMarker_DV, iMarker_Moving, iMarker_SobolevBC, iMarker_PyCustom, iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, + iMarker_Clamped, iMarker_ZoneInterface, iMarker_CHTInterface, iMarker_Load_Dir, iMarker_Disp_Dir, + iMarker_Fluid_Load, iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, + iMarker_ActDiskInlet, iMarker_ActDiskOutlet, + iMarker_Turbomachinery, iMarker_MixingPlaneInterface; int size = SINGLE_NODE; SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); /*--- Compute the total number of markers in the config file ---*/ - nMarker_CfgFile = nMarker_Euler + nMarker_FarField + nMarker_SymWall + nMarker_PerBound + nMarker_NearFieldBound + - nMarker_Fluid_InterfaceBound + nMarker_CHTInterface + nMarker_Inlet + nMarker_Riemann + - nMarker_Smoluchowski_Maxwell + nMarker_Giles + nMarker_Outlet + nMarker_Isothermal + - nMarker_HeatFlux + nMarker_HeatTransfer + nMarker_EngineInflow + nMarker_EngineExhaust + - nMarker_Internal + nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + - nMarker_Load + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + nMarker_Clamped + - nMarker_Load_Dir + nMarker_Disp_Dir + nMarker_ActDiskInlet + nMarker_ActDiskOutlet + - nMarker_ZoneInterface; + nMarker_CfgFile = nMarker_Euler + nMarker_FarField + nMarker_SymWall + + nMarker_PerBound + nMarker_NearFieldBound + nMarker_Fluid_InterfaceBound + + nMarker_CHTInterface + nMarker_Inlet + nMarker_Riemann + nMarker_Smoluchowski_Maxwell + + nMarker_Giles + nMarker_Outlet + nMarker_Isothermal + + nMarker_HeatFlux + nMarker_HeatTransfer + + nMarker_EngineInflow + nMarker_EngineExhaust + nMarker_Internal + + nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + nMarker_Load + + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + + nMarker_Clamped + nMarker_Load_Dir + nMarker_Disp_Dir + + nMarker_ActDiskInlet + nMarker_ActDiskOutlet + nMarker_ZoneInterface; /*--- Add the possible send/receive domains ---*/ - nMarker_Max = nMarker_CfgFile + OVERHEAD * size; + nMarker_Max = nMarker_CfgFile + OVERHEAD*size; /*--- Basic dimensionalization of the markers (worst scenario) ---*/ @@ -5925,33 +5530,26 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Allocate the memory (markers in each domain) ---*/ - Marker_All_TagBound = new string[nMarker_All]; // Store the tag that correspond with each marker. - Marker_All_SendRecv = new short[nMarker_All](); // +#domain (send), -#domain (receive). - Marker_All_KindBC = new unsigned short[nMarker_All](); // Store the kind of boundary condition. - Marker_All_Monitoring = new unsigned short[nMarker_All](); // Store whether the boundary should be monitored. - Marker_All_Designing = new unsigned short[nMarker_All](); // Store whether the boundary should be designed. - Marker_All_Plotting = new unsigned short[nMarker_All](); // Store whether the boundary should be plotted. - Marker_All_Analyze = new unsigned short[nMarker_All](); // Store whether the boundary should be plotted. - Marker_All_ZoneInterface = new unsigned short[nMarker_All](); // Store whether the boundary is in the FSI interface. - Marker_All_GeoEval = new unsigned short[nMarker_All](); // Store whether the boundary should be geometry evaluation. - Marker_All_DV = - new unsigned short[nMarker_All](); // Store whether the boundary should be affected by design variables. - Marker_All_Moving = new unsigned short[nMarker_All](); // Store whether the boundary should be in motion. - Marker_All_Deform_Mesh = new unsigned short[nMarker_All](); // Store whether the boundary is deformable. - Marker_All_Deform_Mesh_Sym_Plane = - new unsigned short[nMarker_All](); // Store wheter the boundary will follow the deformation - Marker_All_Fluid_Load = - new unsigned short[nMarker_All](); // Store whether the boundary computes/applies fluid loads. - Marker_All_PyCustom = new unsigned short[nMarker_All](); // Store whether the boundary is Python customizable. - Marker_All_PerBound = new short[nMarker_All](); // Store whether the boundary belongs to a periodic boundary. - Marker_All_Turbomachinery = - new unsigned short[nMarker_All](); // Store whether the boundary is in needed for Turbomachinery computations. - Marker_All_TurbomachineryFlag = - new unsigned short[nMarker_All](); // Store whether the boundary has a flag for Turbomachinery computations. - Marker_All_MixingPlaneInterface = - new unsigned short[nMarker_All](); // Store whether the boundary has a in the MixingPlane interface. - Marker_All_SobolevBC = - new unsigned short[nMarker_All](); // Store wether the boundary should apply to the gradient smoothing. + Marker_All_TagBound = new string[nMarker_All]; // Store the tag that correspond with each marker. + Marker_All_SendRecv = new short[nMarker_All] (); // +#domain (send), -#domain (receive). + Marker_All_KindBC = new unsigned short[nMarker_All] (); // Store the kind of boundary condition. + Marker_All_Monitoring = new unsigned short[nMarker_All] (); // Store whether the boundary should be monitored. + Marker_All_Designing = new unsigned short[nMarker_All] (); // Store whether the boundary should be designed. + Marker_All_Plotting = new unsigned short[nMarker_All] (); // Store whether the boundary should be plotted. + Marker_All_Analyze = new unsigned short[nMarker_All] (); // Store whether the boundary should be plotted. + Marker_All_ZoneInterface = new unsigned short[nMarker_All] (); // Store whether the boundary is in the FSI interface. + Marker_All_GeoEval = new unsigned short[nMarker_All] (); // Store whether the boundary should be geometry evaluation. + Marker_All_DV = new unsigned short[nMarker_All] (); // Store whether the boundary should be affected by design variables. + Marker_All_Moving = new unsigned short[nMarker_All] (); // Store whether the boundary should be in motion. + Marker_All_Deform_Mesh = new unsigned short[nMarker_All] (); // Store whether the boundary is deformable. + Marker_All_Deform_Mesh_Sym_Plane = new unsigned short[nMarker_All] (); //Store wheter the boundary will follow the deformation + Marker_All_Fluid_Load = new unsigned short[nMarker_All] (); // Store whether the boundary computes/applies fluid loads. + Marker_All_PyCustom = new unsigned short[nMarker_All] (); // Store whether the boundary is Python customizable. + Marker_All_PerBound = new short[nMarker_All] (); // Store whether the boundary belongs to a periodic boundary. + Marker_All_Turbomachinery = new unsigned short[nMarker_All] (); // Store whether the boundary is in needed for Turbomachinery computations. + Marker_All_TurbomachineryFlag = new unsigned short[nMarker_All] (); // Store whether the boundary has a flag for Turbomachinery computations. + Marker_All_MixingPlaneInterface = new unsigned short[nMarker_All] (); // Store whether the boundary has a in the MixingPlane interface. + Marker_All_SobolevBC = new unsigned short[nMarker_All] (); // Store wether the boundary should apply to the gradient smoothing. for (iMarker_All = 0; iMarker_All < nMarker_All; iMarker_All++) { Marker_All_TagBound[iMarker_All] = "SEND_RECEIVE"; @@ -5959,25 +5557,25 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Allocate the memory (markers in the config file) ---*/ - Marker_CfgFile_TagBound = new string[nMarker_CfgFile]; - Marker_CfgFile_KindBC = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Monitoring = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Designing = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Plotting = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Analyze = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_GeoEval = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_ZoneInterface = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_DV = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Moving = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Deform_Mesh = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Deform_Mesh_Sym_Plane = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Fluid_Load = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_PerBound = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_Turbomachinery = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_TurbomachineryFlag = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_MixingPlaneInterface = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_PyCustom = new unsigned short[nMarker_CfgFile](); - Marker_CfgFile_SobolevBC = new unsigned short[nMarker_CfgFile](); + Marker_CfgFile_TagBound = new string[nMarker_CfgFile]; + Marker_CfgFile_KindBC = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Monitoring = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Designing = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Plotting = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Analyze = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_GeoEval = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_ZoneInterface = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_DV = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Moving = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Deform_Mesh = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Deform_Mesh_Sym_Plane= new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Fluid_Load = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_PerBound = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_Turbomachinery = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_TurbomachineryFlag = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_MixingPlaneInterface = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_PyCustom = new unsigned short[nMarker_CfgFile] (); + Marker_CfgFile_SobolevBC = new unsigned short[nMarker_CfgFile] (); for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = "SEND_RECEIVE"; @@ -5985,26 +5583,26 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Allocate memory to store surface information (Analyze BC) ---*/ - Surface_MassFlow = new su2double[nMarker_Analyze](); - Surface_Mach = new su2double[nMarker_Analyze](); - Surface_Temperature = new su2double[nMarker_Analyze](); - Surface_Pressure = new su2double[nMarker_Analyze](); - Surface_Density = new su2double[nMarker_Analyze](); - Surface_Enthalpy = new su2double[nMarker_Analyze](); - Surface_NormalVelocity = new su2double[nMarker_Analyze](); - Surface_Uniformity = new su2double[nMarker_Analyze](); - Surface_SecondaryStrength = new su2double[nMarker_Analyze](); - Surface_SecondOverUniform = new su2double[nMarker_Analyze](); - Surface_MomentumDistortion = new su2double[nMarker_Analyze](); - Surface_TotalTemperature = new su2double[nMarker_Analyze](); - Surface_TotalPressure = new su2double[nMarker_Analyze](); - Surface_PressureDrop = new su2double[nMarker_Analyze](); - Surface_Species_0 = new su2double[nMarker_Analyze](); - Surface_Species_Variance = new su2double[nMarker_Analyze](); - Surface_DC60 = new su2double[nMarker_Analyze](); - Surface_IDC = new su2double[nMarker_Analyze](); - Surface_IDC_Mach = new su2double[nMarker_Analyze](); - Surface_IDR = new su2double[nMarker_Analyze](); + Surface_MassFlow = new su2double[nMarker_Analyze] (); + Surface_Mach = new su2double[nMarker_Analyze] (); + Surface_Temperature = new su2double[nMarker_Analyze] (); + Surface_Pressure = new su2double[nMarker_Analyze] (); + Surface_Density = new su2double[nMarker_Analyze] (); + Surface_Enthalpy = new su2double[nMarker_Analyze] (); + Surface_NormalVelocity = new su2double[nMarker_Analyze] (); + Surface_Uniformity = new su2double[nMarker_Analyze] (); + Surface_SecondaryStrength = new su2double[nMarker_Analyze] (); + Surface_SecondOverUniform = new su2double[nMarker_Analyze] (); + Surface_MomentumDistortion = new su2double[nMarker_Analyze] (); + Surface_TotalTemperature = new su2double[nMarker_Analyze] (); + Surface_TotalPressure = new su2double[nMarker_Analyze] (); + Surface_PressureDrop = new su2double[nMarker_Analyze] (); + Surface_Species_0 = new su2double[nMarker_Analyze] (); + Surface_Species_Variance = new su2double[nMarker_Analyze] (); + Surface_DC60 = new su2double[nMarker_Analyze] (); + Surface_IDC = new su2double[nMarker_Analyze] (); + Surface_IDC_Mach = new su2double[nMarker_Analyze] (); + Surface_IDR = new su2double[nMarker_Analyze] (); /*--- Populate the marker information in the config file (all domains) ---*/ @@ -6034,31 +5632,31 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - ActDisk_DeltaPress = new su2double[nMarker_ActDiskInlet](); - ActDisk_DeltaTemp = new su2double[nMarker_ActDiskInlet](); - ActDisk_TotalPressRatio = new su2double[nMarker_ActDiskInlet](); - ActDisk_TotalTempRatio = new su2double[nMarker_ActDiskInlet](); - ActDisk_StaticPressRatio = new su2double[nMarker_ActDiskInlet](); - ActDisk_StaticTempRatio = new su2double[nMarker_ActDiskInlet](); - ActDisk_Power = new su2double[nMarker_ActDiskInlet](); - ActDisk_MassFlow = new su2double[nMarker_ActDiskInlet](); - ActDisk_Mach = new su2double[nMarker_ActDiskInlet](); - ActDisk_Force = new su2double[nMarker_ActDiskInlet](); - ActDisk_NetThrust = new su2double[nMarker_ActDiskInlet](); - ActDisk_BCThrust = new su2double[nMarker_ActDiskInlet](); - ActDisk_BCThrust_Old = new su2double[nMarker_ActDiskInlet](); - ActDisk_GrossThrust = new su2double[nMarker_ActDiskInlet](); - ActDisk_Area = new su2double[nMarker_ActDiskInlet](); - ActDisk_ReverseMassFlow = new su2double[nMarker_ActDiskInlet](); - - ActDiskInlet_MassFlow = new su2double[nMarker_ActDiskInlet](); - ActDiskInlet_Temperature = new su2double[nMarker_ActDiskInlet](); - ActDiskInlet_TotalTemperature = new su2double[nMarker_ActDiskInlet](); - ActDiskInlet_Pressure = new su2double[nMarker_ActDiskInlet](); - ActDiskInlet_TotalPressure = new su2double[nMarker_ActDiskInlet](); - ActDiskInlet_RamDrag = new su2double[nMarker_ActDiskInlet](); - ActDiskInlet_Force = new su2double[nMarker_ActDiskInlet](); - ActDiskInlet_Power = new su2double[nMarker_ActDiskInlet](); + ActDisk_DeltaPress = new su2double[nMarker_ActDiskInlet] (); + ActDisk_DeltaTemp = new su2double[nMarker_ActDiskInlet] (); + ActDisk_TotalPressRatio = new su2double[nMarker_ActDiskInlet] (); + ActDisk_TotalTempRatio = new su2double[nMarker_ActDiskInlet] (); + ActDisk_StaticPressRatio = new su2double[nMarker_ActDiskInlet] (); + ActDisk_StaticTempRatio = new su2double[nMarker_ActDiskInlet] (); + ActDisk_Power = new su2double[nMarker_ActDiskInlet] (); + ActDisk_MassFlow = new su2double[nMarker_ActDiskInlet] (); + ActDisk_Mach = new su2double[nMarker_ActDiskInlet] (); + ActDisk_Force = new su2double[nMarker_ActDiskInlet] (); + ActDisk_NetThrust = new su2double[nMarker_ActDiskInlet] (); + ActDisk_BCThrust = new su2double[nMarker_ActDiskInlet] (); + ActDisk_BCThrust_Old = new su2double[nMarker_ActDiskInlet] (); + ActDisk_GrossThrust = new su2double[nMarker_ActDiskInlet] (); + ActDisk_Area = new su2double[nMarker_ActDiskInlet] (); + ActDisk_ReverseMassFlow = new su2double[nMarker_ActDiskInlet] (); + + ActDiskInlet_MassFlow = new su2double[nMarker_ActDiskInlet] (); + ActDiskInlet_Temperature = new su2double[nMarker_ActDiskInlet] (); + ActDiskInlet_TotalTemperature = new su2double[nMarker_ActDiskInlet] (); + ActDiskInlet_Pressure = new su2double[nMarker_ActDiskInlet] (); + ActDiskInlet_TotalPressure = new su2double[nMarker_ActDiskInlet] (); + ActDiskInlet_RamDrag = new su2double[nMarker_ActDiskInlet] (); + ActDiskInlet_Force = new su2double[nMarker_ActDiskInlet] (); + ActDiskInlet_Power = new su2double[nMarker_ActDiskInlet] (); for (iMarker_ActDiskInlet = 0; iMarker_ActDiskInlet < nMarker_ActDiskInlet; iMarker_ActDiskInlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_ActDiskInlet[iMarker_ActDiskInlet]; @@ -6066,14 +5664,14 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - ActDiskOutlet_MassFlow = new su2double[nMarker_ActDiskOutlet](); - ActDiskOutlet_Temperature = new su2double[nMarker_ActDiskOutlet](); - ActDiskOutlet_TotalTemperature = new su2double[nMarker_ActDiskOutlet](); - ActDiskOutlet_Pressure = new su2double[nMarker_ActDiskOutlet](); - ActDiskOutlet_TotalPressure = new su2double[nMarker_ActDiskOutlet](); - ActDiskOutlet_GrossThrust = new su2double[nMarker_ActDiskOutlet](); - ActDiskOutlet_Force = new su2double[nMarker_ActDiskOutlet](); - ActDiskOutlet_Power = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_MassFlow = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_Temperature = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_TotalTemperature = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_Pressure = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_TotalPressure = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_GrossThrust = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_Force = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_Power = new su2double[nMarker_ActDiskOutlet] (); for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_ActDiskOutlet[iMarker_ActDiskOutlet]; @@ -6081,9 +5679,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - Outlet_MassFlow = new su2double[nMarker_Outlet](); - Outlet_Density = new su2double[nMarker_Outlet](); - Outlet_Area = new su2double[nMarker_Outlet](); + Outlet_MassFlow = new su2double[nMarker_Outlet] (); + Outlet_Density = new su2double[nMarker_Outlet] (); + Outlet_Area = new su2double[nMarker_Outlet] (); for (iMarker_NearFieldBound = 0; iMarker_NearFieldBound < nMarker_NearFieldBound; iMarker_NearFieldBound++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_NearFieldBound[iMarker_NearFieldBound]; @@ -6091,8 +5689,7 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - for (iMarker_Fluid_InterfaceBound = 0; iMarker_Fluid_InterfaceBound < nMarker_Fluid_InterfaceBound; - iMarker_Fluid_InterfaceBound++) { + for (iMarker_Fluid_InterfaceBound = 0; iMarker_Fluid_InterfaceBound < nMarker_Fluid_InterfaceBound; iMarker_Fluid_InterfaceBound++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Fluid_InterfaceBound[iMarker_Fluid_InterfaceBound]; Marker_CfgFile_KindBC[iMarker_CfgFile] = FLUID_INTERFACE; iMarker_CfgFile++; @@ -6122,23 +5719,23 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - Engine_Power = new su2double[nMarker_EngineInflow](); - Engine_Mach = new su2double[nMarker_EngineInflow](); - Engine_Force = new su2double[nMarker_EngineInflow](); - Engine_NetThrust = new su2double[nMarker_EngineInflow](); - Engine_GrossThrust = new su2double[nMarker_EngineInflow](); - Engine_Area = new su2double[nMarker_EngineInflow](); - - Inflow_Mach = new su2double[nMarker_EngineInflow](); - Inflow_Pressure = new su2double[nMarker_EngineInflow](); - Inflow_MassFlow = new su2double[nMarker_EngineInflow](); - Inflow_ReverseMassFlow = new su2double[nMarker_EngineInflow](); - Inflow_TotalPressure = new su2double[nMarker_EngineInflow](); - Inflow_Temperature = new su2double[nMarker_EngineInflow](); - Inflow_TotalTemperature = new su2double[nMarker_EngineInflow](); - Inflow_RamDrag = new su2double[nMarker_EngineInflow](); - Inflow_Force = new su2double[nMarker_EngineInflow](); - Inflow_Power = new su2double[nMarker_EngineInflow](); + Engine_Power = new su2double[nMarker_EngineInflow] (); + Engine_Mach = new su2double[nMarker_EngineInflow] (); + Engine_Force = new su2double[nMarker_EngineInflow] (); + Engine_NetThrust = new su2double[nMarker_EngineInflow] (); + Engine_GrossThrust = new su2double[nMarker_EngineInflow] (); + Engine_Area = new su2double[nMarker_EngineInflow] (); + + Inflow_Mach = new su2double[nMarker_EngineInflow] (); + Inflow_Pressure = new su2double[nMarker_EngineInflow] (); + Inflow_MassFlow = new su2double[nMarker_EngineInflow] (); + Inflow_ReverseMassFlow = new su2double[nMarker_EngineInflow] (); + Inflow_TotalPressure = new su2double[nMarker_EngineInflow] (); + Inflow_Temperature = new su2double[nMarker_EngineInflow] (); + Inflow_TotalTemperature = new su2double[nMarker_EngineInflow] (); + Inflow_RamDrag = new su2double[nMarker_EngineInflow] (); + Inflow_Force = new su2double[nMarker_EngineInflow] (); + Inflow_Power = new su2double[nMarker_EngineInflow] (); for (iMarker_EngineInflow = 0; iMarker_EngineInflow < nMarker_EngineInflow; iMarker_EngineInflow++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_EngineInflow[iMarker_EngineInflow]; @@ -6146,14 +5743,14 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - Exhaust_Pressure = new su2double[nMarker_EngineExhaust](); - Exhaust_Temperature = new su2double[nMarker_EngineExhaust](); - Exhaust_MassFlow = new su2double[nMarker_EngineExhaust](); - Exhaust_TotalPressure = new su2double[nMarker_EngineExhaust](); - Exhaust_TotalTemperature = new su2double[nMarker_EngineExhaust](); - Exhaust_GrossThrust = new su2double[nMarker_EngineExhaust](); - Exhaust_Force = new su2double[nMarker_EngineExhaust](); - Exhaust_Power = new su2double[nMarker_EngineExhaust](); + Exhaust_Pressure = new su2double[nMarker_EngineExhaust] (); + Exhaust_Temperature = new su2double[nMarker_EngineExhaust] (); + Exhaust_MassFlow = new su2double[nMarker_EngineExhaust] (); + Exhaust_TotalPressure = new su2double[nMarker_EngineExhaust] (); + Exhaust_TotalTemperature = new su2double[nMarker_EngineExhaust] (); + Exhaust_GrossThrust = new su2double[nMarker_EngineExhaust] (); + Exhaust_Force = new su2double[nMarker_EngineExhaust] (); + Exhaust_Power = new su2double[nMarker_EngineExhaust] (); for (iMarker_EngineExhaust = 0; iMarker_EngineExhaust < nMarker_EngineExhaust; iMarker_EngineExhaust++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_EngineExhaust[iMarker_EngineExhaust]; @@ -6167,8 +5764,7 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - for (iMarker_Supersonic_Outlet = 0; iMarker_Supersonic_Outlet < nMarker_Supersonic_Outlet; - iMarker_Supersonic_Outlet++) { + for (iMarker_Supersonic_Outlet = 0; iMarker_Supersonic_Outlet < nMarker_Supersonic_Outlet; iMarker_Supersonic_Outlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Supersonic_Outlet[iMarker_Supersonic_Outlet]; Marker_CfgFile_KindBC[iMarker_CfgFile] = SUPERSONIC_OUTLET; iMarker_CfgFile++; @@ -6198,8 +5794,7 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { iMarker_CfgFile++; } - for (iMarker_Smoluchowski_Maxwell = 0; iMarker_Smoluchowski_Maxwell < nMarker_Smoluchowski_Maxwell; - iMarker_Smoluchowski_Maxwell++) { + for (iMarker_Smoluchowski_Maxwell = 0; iMarker_Smoluchowski_Maxwell < nMarker_Smoluchowski_Maxwell; iMarker_Smoluchowski_Maxwell++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_Smoluchowski_Maxwell[iMarker_Smoluchowski_Maxwell]; Marker_CfgFile_KindBC[iMarker_CfgFile] = SMOLUCHOWSKI_MAXWELL; iMarker_CfgFile++; @@ -6305,17 +5900,17 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Identification of Turbomachinery markers and flag them---*/ for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { - unsigned short indexMarker = 0; + unsigned short indexMarker=0; Marker_CfgFile_Turbomachinery[iMarker_CfgFile] = NO; Marker_CfgFile_TurbomachineryFlag[iMarker_CfgFile] = NO; - for (iMarker_Turbomachinery = 0; iMarker_Turbomachinery < nMarker_Turbomachinery; iMarker_Turbomachinery++) { - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundIn[iMarker_Turbomachinery]) { - indexMarker = (iMarker_Turbomachinery + 1); + for (iMarker_Turbomachinery = 0; iMarker_Turbomachinery < nMarker_Turbomachinery; iMarker_Turbomachinery++){ + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundIn[iMarker_Turbomachinery]){ + indexMarker=(iMarker_Turbomachinery+1); Marker_CfgFile_Turbomachinery[iMarker_CfgFile] = indexMarker; Marker_CfgFile_TurbomachineryFlag[iMarker_CfgFile] = INFLOW; } - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundOut[iMarker_Turbomachinery]) { - indexMarker = (iMarker_Turbomachinery + 1); + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_TurboBoundOut[iMarker_Turbomachinery]){ + indexMarker=(iMarker_Turbomachinery+1); Marker_CfgFile_Turbomachinery[iMarker_CfgFile] = indexMarker; Marker_CfgFile_TurbomachineryFlag[iMarker_CfgFile] = OUTFLOW; } @@ -6325,19 +5920,19 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { /*--- Identification of MixingPlane interface markers ---*/ for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { - unsigned short indexMarker = 0; + unsigned short indexMarker=0; Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile] = NO; - for (iMarker_MixingPlaneInterface = 0; iMarker_MixingPlaneInterface < nMarker_MixingPlaneInterface; - iMarker_MixingPlaneInterface++) + for (iMarker_MixingPlaneInterface = 0; iMarker_MixingPlaneInterface < nMarker_MixingPlaneInterface; iMarker_MixingPlaneInterface++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_MixingPlaneInterface[iMarker_MixingPlaneInterface]) - indexMarker = (int)(iMarker_MixingPlaneInterface / 2 + 1); + indexMarker=(int)(iMarker_MixingPlaneInterface/2+1); Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile] = indexMarker; } for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_DV[iMarker_CfgFile] = NO; for (iMarker_DV = 0; iMarker_DV < nMarker_DV; iMarker_DV++) - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_DV[iMarker_DV]) Marker_CfgFile_DV[iMarker_CfgFile] = YES; + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_DV[iMarker_DV]) + Marker_CfgFile_DV[iMarker_CfgFile] = YES; } /*--- Add an extra check for DV_MARKER to make sure that any given marker @@ -6352,18 +5947,15 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { } } - if (!found) { - if (nZone == 1) - SU2_MPI::Error("DV_MARKER contains marker names that do not exist in the lists of BCs in the config file.", - CURRENT_FUNCTION); + if(!found) { + if (nZone==1) + SU2_MPI::Error("DV_MARKER contains marker names that do not exist in the lists of BCs in the config file.", CURRENT_FUNCTION); // In case of multiple zones, the markers might appear only in zonal config and not in the Master. // A loop over all zones would need to be included which is not straight forward as this can only be // checked once all zonal configs are read. else if (rank == MASTER_NODE) - cout << "Warning: DV_MARKER contains marker names that do not exist in the lists of BCs of the master config " - "file.\n" - "Make sure the marker names exist in the zonal config files" - << endl; + cout << "Warning: DV_MARKER contains marker names that do not exist in the lists of BCs of the master config file.\n" + "Make sure the marker names exist in the zonal config files" << endl; } } @@ -6383,8 +5975,7 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_Deform_Mesh_Sym_Plane[iMarker_CfgFile] = NO; - for (iMarker_Deform_Mesh_Sym_Plane = 0; iMarker_Deform_Mesh_Sym_Plane < nMarker_Deform_Mesh_Sym_Plane; - iMarker_Deform_Mesh_Sym_Plane++) + for (iMarker_Deform_Mesh_Sym_Plane = 0; iMarker_Deform_Mesh_Sym_Plane < nMarker_Deform_Mesh_Sym_Plane; iMarker_Deform_Mesh_Sym_Plane++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_Deform_Mesh_Sym_Plane[iMarker_Deform_Mesh_Sym_Plane]) Marker_CfgFile_Deform_Mesh_Sym_Plane[iMarker_CfgFile] = YES; } @@ -6396,9 +5987,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { Marker_CfgFile_Fluid_Load[iMarker_CfgFile] = YES; } - for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { + for (iMarker_CfgFile=0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { Marker_CfgFile_PyCustom[iMarker_CfgFile] = NO; - for (iMarker_PyCustom = 0; iMarker_PyCustom < nMarker_PyCustom; iMarker_PyCustom++) + for(iMarker_PyCustom=0; iMarker_PyCustom < nMarker_PyCustom; iMarker_PyCustom++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_PyCustom[iMarker_PyCustom]) Marker_CfgFile_PyCustom[iMarker_CfgFile] = YES; } @@ -6409,61 +6000,58 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_SobolevBC[iMarker_SobolevBC]) Marker_CfgFile_SobolevBC[iMarker_CfgFile] = YES; } + } 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, iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, iMarker_Deform_Mesh, - iMarker_Deform_Mesh_Sym_Plane, iMarker_Fluid_Load, iMarker_Smoluchowski_Maxwell, iWall_Catalytic, iMarker_Giles, - iMarker_Outlet, iMarker_Isothermal, iMarker_HeatFlux, iMarker_HeatTransfer, iMarker_EngineInflow, - iMarker_EngineExhaust, iMarker_Displacement, iMarker_Damper, iMarker_Load, iMarker_Internal, iMarker_Monitoring, - iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iDV_Value, - iMarker_ZoneInterface, iMarker_PyCustom, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Clamped, iMarker_Moving, - iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, iMarker_ActDiskInlet, iMarker_Emissivity, iMarker_StrongBC, - iMarker_ActDiskOutlet, iMarker_MixingPlaneInterface, iMarker_SobolevBC; + + unsigned short iMarker_Euler, iMarker_Custom, iMarker_FarField, + iMarker_SymWall, iMarker_PerBound, iMarker_NearFieldBound, + iMarker_Fluid_InterfaceBound, iMarker_Inlet, iMarker_Riemann, + iMarker_Deform_Mesh, iMarker_Deform_Mesh_Sym_Plane, iMarker_Fluid_Load, + iMarker_Smoluchowski_Maxwell, iWall_Catalytic, + iMarker_Giles, iMarker_Outlet, iMarker_Isothermal, iMarker_HeatFlux, iMarker_HeatTransfer, + iMarker_EngineInflow, iMarker_EngineExhaust, iMarker_Displacement, iMarker_Damper, + iMarker_Load, iMarker_Internal, iMarker_Monitoring, + iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iDV_Value, + iMarker_ZoneInterface, iMarker_PyCustom, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Clamped, + iMarker_Moving, iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, iMarker_ActDiskInlet, + iMarker_Emissivity, iMarker_StrongBC, + iMarker_ActDiskOutlet, iMarker_MixingPlaneInterface, + iMarker_SobolevBC; bool fea = ((Kind_Solver == MAIN_SOLVER::FEM_ELASTICITY) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM)); - cout << endl << "----------------- Physical Case Definition ( Zone " << iZone << " ) -------------------" << endl; + cout << endl <<"----------------- Physical Case Definition ( Zone " << iZone << " ) -------------------" << endl; if (val_software == SU2_COMPONENT::SU2_CFD) { - if (FSI_Problem) cout << "Fluid-Structure Interaction." << endl; + if (FSI_Problem) + cout << "Fluid-Structure Interaction." << endl; if (DiscreteAdjoint) { - cout << "Discrete Adjoint equations using Algorithmic Differentiation\n"; - cout << "based on the physical case: "; + cout <<"Discrete Adjoint equations using Algorithmic Differentiation\n"; + cout <<"based on the physical case: "; } switch (Kind_Solver) { - case MAIN_SOLVER::EULER: - case MAIN_SOLVER::DISC_ADJ_EULER: - case MAIN_SOLVER::INC_EULER: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: - case MAIN_SOLVER::FEM_EULER: - case MAIN_SOLVER::DISC_ADJ_FEM_EULER: + case MAIN_SOLVER::EULER: case MAIN_SOLVER::DISC_ADJ_EULER: + case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_EULER: + case MAIN_SOLVER::FEM_EULER: case MAIN_SOLVER::DISC_ADJ_FEM_EULER: if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible Euler equations." << endl; if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible Euler equations." << endl; break; - case MAIN_SOLVER::NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: - case MAIN_SOLVER::INC_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: - case MAIN_SOLVER::FEM_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_FEM_NS: + case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: + case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: + case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_FEM_NS: 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; + if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible Laminar Navier-Stokes' equations." << endl; break; - case MAIN_SOLVER::RANS: - case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_RANS: - case MAIN_SOLVER::FEM_RANS: - case MAIN_SOLVER::DISC_ADJ_FEM_RANS: + case MAIN_SOLVER::RANS: case MAIN_SOLVER::DISC_ADJ_RANS: + case MAIN_SOLVER::INC_RANS: case MAIN_SOLVER::DISC_ADJ_INC_RANS: + case MAIN_SOLVER::FEM_RANS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: 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 TURB_MODEL::NONE: - break; + case TURB_MODEL::NONE: break; case TURB_MODEL::SA: switch (saParsedOptions.version) { case SA_OPTIONS::NEG: @@ -6486,10 +6074,8 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; case TURB_MODEL::SST: cout << "Menter's k-omega SST"; - if (sstParsedOptions.version == SST_OPTIONS::V1994) - cout << "-1994"; - else - cout << "-2003"; + if (sstParsedOptions.version == SST_OPTIONS::V1994) cout << "-1994"; + else cout << "-2003"; if (sstParsedOptions.modified) cout << "m"; if (sstParsedOptions.sust) cout << " with sustaining terms, and"; @@ -6512,8 +6098,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; } switch (Kind_Trans_Model) { - case TURB_TRANS_MODEL::NONE: - break; + case TURB_TRANS_MODEL::NONE: break; case TURB_TRANS_MODEL::LM: { cout << "Transition model: Langtry and Menter's 4 equation model"; if (lmParsedOptions.LM2015) { @@ -6525,121 +6110,72 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } } if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) { + cout << "Correlation Functions: "; switch (lmParsedOptions.Correlation) { - case TURB_TRANS_CORRELATION::MALAN: - cout << "Malan et al. (2009)" << endl; - break; - case TURB_TRANS_CORRELATION::SULUKSNA: - cout << "Suluksna et al. (2009)" << endl; - break; - case TURB_TRANS_CORRELATION::KRAUSE: - cout << "Krause et al. (2008)" << endl; - break; - case TURB_TRANS_CORRELATION::KRAUSE_HYPER: - cout << "Krause et al. (2008, paper)" << endl; - break; - case TURB_TRANS_CORRELATION::MEDIDA_BAEDER: - cout << "Medida and Baeder (2011)" << endl; - break; - case TURB_TRANS_CORRELATION::MEDIDA: - cout << "Medida PhD (2014)" << endl; - break; - case TURB_TRANS_CORRELATION::MENTER_LANGTRY: - cout << "Menter and Langtry (2009)" << endl; - break; + case TURB_TRANS_CORRELATION::MALAN: cout << "Malan et al. (2009)" << endl; break; + case TURB_TRANS_CORRELATION::SULUKSNA: cout << "Suluksna et al. (2009)" << endl; break; + case TURB_TRANS_CORRELATION::KRAUSE: cout << "Krause et al. (2008)" << endl; break; + case TURB_TRANS_CORRELATION::KRAUSE_HYPER: cout << "Krause et al. (2008, paper)" << endl; break; + case TURB_TRANS_CORRELATION::MEDIDA_BAEDER: cout << "Medida and Baeder (2011)" << endl; break; + case TURB_TRANS_CORRELATION::MEDIDA: cout << "Medida PhD (2014)" << endl; break; + case TURB_TRANS_CORRELATION::MENTER_LANGTRY: cout << "Menter and Langtry (2009)" << endl; break; case TURB_TRANS_CORRELATION::DEFAULT: switch (Kind_Turb_Model) { - case TURB_MODEL::SA: - cout << "Malan et al. (2009)" << endl; - break; - case TURB_MODEL::SST: - cout << "Menter and Langtry (2009)" << endl; - break; - case TURB_MODEL::NONE: - SU2_MPI::Error("No turbulence model has been selected but LM transition model is active.", - CURRENT_FUNCTION); - break; + case TURB_MODEL::SA: cout << "Malan et al. (2009)" << endl; break; + case TURB_MODEL::SST: cout << "Menter and Langtry (2009)" << endl; break; + case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but LM transition model is active.", CURRENT_FUNCTION); break; } break; } } cout << "Hybrid RANS/LES: "; switch (Kind_HybridRANSLES) { - case NO_HYBRIDRANSLES: - cout << "No Hybrid RANS/LES" << endl; - break; - case SA_DES: - cout << "Detached Eddy Simulation (DES97) " << endl; - break; - case SA_DDES: - cout << "Delayed Detached Eddy Simulation (DDES) with Standard SGS" << endl; - break; - case SA_ZDES: - cout << "Delayed Detached Eddy Simulation (DDES) with Vorticity-based SGS" << endl; - break; - case SA_EDDES: - cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; - break; + case NO_HYBRIDRANSLES: cout << "No Hybrid RANS/LES" << endl; break; + case SA_DES: cout << "Detached Eddy Simulation (DES97) " << endl; break; + case SA_DDES: cout << "Delayed Detached Eddy Simulation (DDES) with Standard SGS" << endl; break; + case SA_ZDES: cout << "Delayed Detached Eddy Simulation (DDES) with Vorticity-based SGS" << endl; break; + case SA_EDDES: cout << "Delayed Detached Eddy Simulation (DDES) with Shear-layer Adapted SGS" << endl; break; } break; case MAIN_SOLVER::NEMO_EULER: - if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) - cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl; - if (Kind_FluidModel == SU2_NONEQ) { + 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 != "AIR-7") && (GasModel != "ARGON")) - SU2_MPI::Error( - "The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or " - "ARGON.", - CURRENT_FUNCTION); + SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION); } break; case MAIN_SOLVER::NEMO_NAVIER_STOKES: - if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) - cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl; - if (Kind_FluidModel == SU2_NONEQ) { + 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 != "AIR-7") && (GasModel != "ARGON")) - SU2_MPI::Error( - "The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or " - "ARGON.", - CURRENT_FUNCTION); + SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION); } break; case MAIN_SOLVER::FEM_LES: - if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible 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 << "LES Subgrid Scale model: "; switch (Kind_SGS_Model) { - case TURB_SGS_MODEL::IMPLICIT_LES: - cout << "Implicit LES" << endl; - break; - case TURB_SGS_MODEL::SMAGORINSKY: - cout << "Smagorinsky " << endl; - break; - case TURB_SGS_MODEL::WALE: - cout << "WALE" << endl; - break; - case TURB_SGS_MODEL::VREMAN: - cout << "VREMAN" << endl; - break; + case TURB_SGS_MODEL::IMPLICIT_LES: cout << "Implicit LES" << endl; break; + case TURB_SGS_MODEL::SMAGORINSKY: cout << "Smagorinsky " << endl; break; + case TURB_SGS_MODEL::WALE: cout << "WALE" << endl; break; + case TURB_SGS_MODEL::VREMAN: cout << "VREMAN" << endl; break; default: SU2_MPI::Error("Subgrid Scale model not specified.", CURRENT_FUNCTION); + } break; - case MAIN_SOLVER::FEM_ELASTICITY: - case MAIN_SOLVER::DISC_ADJ_FEM: + case MAIN_SOLVER::FEM_ELASTICITY: case MAIN_SOLVER::DISC_ADJ_FEM: if (Kind_Struct_Solver == STRUCT_DEFORMATION::SMALL) cout << "Geometrically linear elasticity solver." << endl; - if (Kind_Struct_Solver == STRUCT_DEFORMATION::LARGE) - cout << "Geometrically non-linear elasticity solver." << endl; + if (Kind_Struct_Solver == STRUCT_DEFORMATION::LARGE) cout << "Geometrically non-linear elasticity solver." << endl; if (Kind_Material == STRUCT_MODEL::LINEAR_ELASTIC) cout << "Linear elastic material." << endl; if (Kind_Material == STRUCT_MODEL::NEO_HOOKEAN) { if (Kind_Material_Compress == STRUCT_COMPRESS::COMPRESSIBLE) cout << "Compressible Neo-Hookean material model." << endl; } break; - case MAIN_SOLVER::ADJ_EULER: - cout << "Continuous Euler adjoint equations." << endl; - break; + case MAIN_SOLVER::ADJ_EULER: cout << "Continuous Euler adjoint equations." << endl; break; case MAIN_SOLVER::ADJ_NAVIER_STOKES: if (Frozen_Visc_Cont) cout << "Continuous Navier-Stokes adjoint equations with frozen (laminar) viscosity." << endl; @@ -6652,8 +6188,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { else cout << "Continuous RANS adjoint equations." << endl; break; - case MAIN_SOLVER::HEAT_EQUATION: - case MAIN_SOLVER::DISC_ADJ_HEAT: + case MAIN_SOLVER::HEAT_EQUATION: case MAIN_SOLVER::DISC_ADJ_HEAT: cout << "Heat solver" << endl; break; case MAIN_SOLVER::MULTIPHYSICS: @@ -6661,138 +6196,100 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; default: SU2_MPI::Error("No valid solver was chosen", CURRENT_FUNCTION); + } if ((Kind_Regime == ENUM_REGIME::COMPRESSIBLE) && (Kind_Solver != MAIN_SOLVER::FEM_ELASTICITY)) { - cout << "Mach number: " << Mach << "." << endl; - cout << "Angle of attack (AoA): " << AoA << " deg, and angle of sideslip (AoS): " << AoS << " deg." << endl; + cout << "Mach number: " << Mach <<"."<< endl; + cout << "Angle of attack (AoA): " << AoA <<" deg, and angle of sideslip (AoS): " << AoS <<" deg."<< endl; if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES)) - cout << "Reynolds number: " << Reynolds << ". Reference length " << Length_Reynolds << "." << endl; + cout << "Reynolds number: " << Reynolds <<". Reference length " << Length_Reynolds << "." << endl; if (Fixed_CL_Mode) { cout << "Fixed CL mode, target value: " << Target_CL << "." << endl; } } if (EquivArea) { - cout << "The equivalent area is going to be evaluated on the near-field." << endl; - cout << "The lower integration limit is " << ea_lim[0] << ", and the upper is " << ea_lim[1] << "." << endl; - cout << "The near-field is situated at " << ea_lim[2] << "." << endl; + cout <<"The equivalent area is going to be evaluated on the near-field."<< endl; + cout <<"The lower integration limit is "< 1) || (nRefOriginMoment_Y > 1) || (nRefOriginMoment_Z > 1)) { cout << "Surface(s) where the force coefficients are evaluated and \n"; cout << "their reference origin for moment computation: \n"; for (iMarker_Monitoring = 0; iMarker_Monitoring < nMarker_Monitoring; iMarker_Monitoring++) { - cout << " - " << Marker_Monitoring[iMarker_Monitoring] << " (" << RefOriginMoment_X[iMarker_Monitoring] - << ", " << RefOriginMoment_Y[iMarker_Monitoring] << ", " << RefOriginMoment_Z[iMarker_Monitoring] - << ")"; - if (iMarker_Monitoring < nMarker_Monitoring - 1) - cout << ".\n"; + cout << " - " << Marker_Monitoring[iMarker_Monitoring] << " (" << RefOriginMoment_X[iMarker_Monitoring] <<", "< value <-> param):" << endl; + + + if ((Design_Variable[iDV] != NO_DEFORMATION) && + (Design_Variable[iDV] != FFD_SETTING) && + (Design_Variable[iDV] != SCALE_GRID) && + (Design_Variable[iDV] != TRANSLATE_GRID) && + (Design_Variable[iDV] != ROTATE_GRID) && + (Design_Variable[iDV] != SURFACE_FILE)) { + + if (iDV == 0) + cout << "Design variables definition (markers <-> value <-> param):" << endl; switch (Design_Variable[iDV]) { - case FFD_CONTROL_POINT_2D: - cout << "FFD 2D (control point) <-> "; - break; - case FFD_CAMBER_2D: - cout << "FFD 2D (camber) <-> "; - break; - case FFD_THICKNESS_2D: - cout << "FFD 2D (thickness) <-> "; - break; - case HICKS_HENNE: - cout << "Hicks Henne <-> "; - break; - case SURFACE_BUMP: - cout << "Surface bump <-> "; - break; - case ANGLE_OF_ATTACK: - cout << "Angle of attack <-> "; - break; - case CST: - cout << "Kulfan parameter number (CST) <-> "; - break; - case TRANSLATION: - cout << "Translation design variable."; - break; - case SCALE: - cout << "Scale design variable."; - break; - case NACA_4DIGITS: - cout << "NACA four digits <-> "; - break; - case PARABOLIC: - cout << "Parabolic <-> "; - break; - case AIRFOIL: - cout << "Airfoil <-> "; - break; - case ROTATION: - cout << "Rotation <-> "; - break; - case FFD_CONTROL_POINT: - cout << "FFD (control point) <-> "; - break; - case FFD_NACELLE: - cout << "FFD (nacelle) <-> "; - break; - case FFD_GULL: - cout << "FFD (gull) <-> "; - break; - case FFD_TWIST: - cout << "FFD (twist) <-> "; - break; - case FFD_ROTATION: - cout << "FFD (rotation) <-> "; - break; - case FFD_CONTROL_SURFACE: - cout << "FFD (control surface) <-> "; - break; - case FFD_CAMBER: - cout << "FFD (camber) <-> "; - break; - case FFD_THICKNESS: - cout << "FFD (thickness) -> "; - break; - case FFD_ANGLE_OF_ATTACK: - cout << "FFD (angle of attack) <-> "; - break; + case FFD_CONTROL_POINT_2D: cout << "FFD 2D (control point) <-> "; break; + case FFD_CAMBER_2D: cout << "FFD 2D (camber) <-> "; break; + case FFD_THICKNESS_2D: cout << "FFD 2D (thickness) <-> "; break; + case HICKS_HENNE: cout << "Hicks Henne <-> " ; break; + case SURFACE_BUMP: cout << "Surface bump <-> " ; break; + case ANGLE_OF_ATTACK: cout << "Angle of attack <-> " ; break; + case CST: cout << "Kulfan parameter number (CST) <-> " ; break; + case TRANSLATION: cout << "Translation design variable."; break; + case SCALE: cout << "Scale design variable."; break; + case NACA_4DIGITS: cout << "NACA four digits <-> "; break; + case PARABOLIC: cout << "Parabolic <-> "; break; + case AIRFOIL: cout << "Airfoil <-> "; break; + case ROTATION: cout << "Rotation <-> "; break; + case FFD_CONTROL_POINT: cout << "FFD (control point) <-> "; break; + case FFD_NACELLE: cout << "FFD (nacelle) <-> "; break; + case FFD_GULL: cout << "FFD (gull) <-> "; break; + case FFD_TWIST: cout << "FFD (twist) <-> "; break; + case FFD_ROTATION: cout << "FFD (rotation) <-> "; break; + case FFD_CONTROL_SURFACE: cout << "FFD (control surface) <-> "; break; + case FFD_CAMBER: cout << "FFD (camber) <-> "; break; + case FFD_THICKNESS: cout << "FFD (thickness) -> "; break; + case FFD_ANGLE_OF_ATTACK: cout << "FFD (angle of attack) <-> "; break; } for (iMarker_DV = 0; iMarker_DV < nMarker_DV; iMarker_DV++) { cout << Marker_DV[iMarker_DV]; - if (iMarker_DV < nMarker_DV - 1) - cout << ", "; - else - cout << " <-> "; + if (iMarker_DV < nMarker_DV-1) cout << ", "; + else cout << " <-> "; } for (iDV_Value = 0; iDV_Value < nDV_Value[iDV]; iDV_Value++) { cout << DV_Value[iDV][iDV_Value]; - if (iDV_Value != nDV_Value[iDV] - 1) cout << ", "; + if (iDV_Value != nDV_Value[iDV]-1) cout << ", "; } cout << " <-> "; - if ((Design_Variable[iDV] == NO_DEFORMATION) || (Design_Variable[iDV] == FFD_SETTING) || - (Design_Variable[iDV] == SCALE)) - nParamDV = 0; + if ((Design_Variable[iDV] == NO_DEFORMATION) || + (Design_Variable[iDV] == FFD_SETTING) || + (Design_Variable[iDV] == SCALE) ) nParamDV = 0; if (Design_Variable[iDV] == ANGLE_OF_ATTACK) nParamDV = 1; - if ((Design_Variable[iDV] == FFD_CAMBER_2D) || (Design_Variable[iDV] == FFD_THICKNESS_2D) || - (Design_Variable[iDV] == HICKS_HENNE) || (Design_Variable[iDV] == PARABOLIC) || - (Design_Variable[iDV] == AIRFOIL) || (Design_Variable[iDV] == FFD_GULL) || - (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK)) - nParamDV = 2; - if ((Design_Variable[iDV] == TRANSLATION) || (Design_Variable[iDV] == NACA_4DIGITS) || - (Design_Variable[iDV] == CST) || (Design_Variable[iDV] == SURFACE_BUMP) || - (Design_Variable[iDV] == FFD_CAMBER) || (Design_Variable[iDV] == FFD_THICKNESS)) - nParamDV = 3; + if ((Design_Variable[iDV] == FFD_CAMBER_2D) || + (Design_Variable[iDV] == FFD_THICKNESS_2D) || + (Design_Variable[iDV] == HICKS_HENNE) || + (Design_Variable[iDV] == PARABOLIC) || + (Design_Variable[iDV] == AIRFOIL) || + (Design_Variable[iDV] == FFD_GULL) || + (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK) ) nParamDV = 2; + if ((Design_Variable[iDV] == TRANSLATION) || + (Design_Variable[iDV] == NACA_4DIGITS) || + (Design_Variable[iDV] == CST) || + (Design_Variable[iDV] == SURFACE_BUMP) || + (Design_Variable[iDV] == FFD_CAMBER) || + (Design_Variable[iDV] == FFD_THICKNESS) ) nParamDV = 3; if (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) nParamDV = 5; if (Design_Variable[iDV] == ROTATION) nParamDV = 6; - if ((Design_Variable[iDV] == FFD_CONTROL_POINT) || (Design_Variable[iDV] == FFD_ROTATION) || - (Design_Variable[iDV] == FFD_CONTROL_SURFACE)) - nParamDV = 7; + if ((Design_Variable[iDV] == FFD_CONTROL_POINT) || + (Design_Variable[iDV] == FFD_ROTATION) || + (Design_Variable[iDV] == FFD_CONTROL_SURFACE) ) nParamDV = 7; if (Design_Variable[iDV] == FFD_TWIST) nParamDV = 8; for (unsigned short iParamDV = 0; iParamDV < nParamDV; iParamDV++) { + if (iParamDV == 0) cout << "( "; if ((iParamDV == 0) && - ((Design_Variable[iDV] == NO_DEFORMATION) || (Design_Variable[iDV] == FFD_SETTING) || - (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK) || (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) || - (Design_Variable[iDV] == FFD_CAMBER_2D) || (Design_Variable[iDV] == FFD_THICKNESS_2D) || - (Design_Variable[iDV] == FFD_CONTROL_POINT) || (Design_Variable[iDV] == FFD_NACELLE) || - (Design_Variable[iDV] == FFD_GULL) || (Design_Variable[iDV] == FFD_TWIST) || - (Design_Variable[iDV] == FFD_ROTATION) || (Design_Variable[iDV] == FFD_CONTROL_SURFACE) || - (Design_Variable[iDV] == FFD_CAMBER) || (Design_Variable[iDV] == FFD_THICKNESS))) - cout << FFDTag[iDV]; - else - cout << ParamDV[iDV][iParamDV]; + ((Design_Variable[iDV] == NO_DEFORMATION) || + (Design_Variable[iDV] == FFD_SETTING) || + (Design_Variable[iDV] == FFD_ANGLE_OF_ATTACK) || + (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) || + (Design_Variable[iDV] == FFD_CAMBER_2D) || + (Design_Variable[iDV] == FFD_THICKNESS_2D) || + (Design_Variable[iDV] == FFD_CONTROL_POINT) || + (Design_Variable[iDV] == FFD_NACELLE) || + (Design_Variable[iDV] == FFD_GULL) || + (Design_Variable[iDV] == FFD_TWIST) || + (Design_Variable[iDV] == FFD_ROTATION) || + (Design_Variable[iDV] == FFD_CONTROL_SURFACE) || + (Design_Variable[iDV] == FFD_CAMBER) || + (Design_Variable[iDV] == FFD_THICKNESS))) cout << FFDTag[iDV]; + else cout << ParamDV[iDV][iParamDV]; + + if (iParamDV < nParamDV-1) cout << ", "; + else cout <<" )"<< endl; - if (iParamDV < nParamDV - 1) - cout << ", "; - else - cout << " )" << endl; } } @@ -7071,19 +6523,19 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } else if (Design_Variable[iDV] == FFD_SETTING) { + cout << "Setting the FFD box structure." << endl; cout << "FFD boxes definition (FFD tag <-> degree <-> coord):" << endl; for (unsigned short iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { + cout << TagFFDBox[iFFDBox] << " <-> "; for (unsigned short iDegreeFFD = 0; iDegreeFFD < 3; iDegreeFFD++) { if (iDegreeFFD == 0) cout << "( "; cout << DegreeFFDBox[iFFDBox][iDegreeFFD]; - if (iDegreeFFD < 2) - cout << ", "; - else - cout << " )"; + if (iDegreeFFD < 2) cout << ", "; + else cout <<" )"; } cout << " <-> "; @@ -7091,148 +6543,78 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { for (unsigned short iCoordFFD = 0; iCoordFFD < 24; iCoordFFD++) { if (iCoordFFD == 0) cout << "( "; cout << CoordFFDBox[iFFDBox][iCoordFFD]; - if (iCoordFFD < 23) - cout << ", "; - else - cout << " )" << endl; + if (iCoordFFD < 23) cout << ", "; + else cout <<" )"<< endl; } + } } - else - cout << endl; + else cout << endl; + } } - 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) { + 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) { switch (Kind_ObjFunc[0]) { - case DRAG_COEFFICIENT: - cout << "CD objective function"; - if (Fixed_CL_Mode) { - cout << " using fixed CL mode, dCD/dCL = " << dCD_dCL << "." << endl; - } else { - cout << "." << endl; - } - break; - case LIFT_COEFFICIENT: - cout << "CL objective function." << endl; - break; - case MOMENT_X_COEFFICIENT: - cout << "CMx objective function" << endl; - if (Fixed_CL_Mode) { - cout << " using fixed CL mode, dCMx/dCL = " << dCMx_dCL << "." << endl; - } else { - cout << "." << endl; - } - break; - case MOMENT_Y_COEFFICIENT: - cout << "CMy objective function" << endl; - if (Fixed_CL_Mode) { - cout << " using fixed CL mode, dCMy/dCL = " << dCMy_dCL << "." << endl; - } else { - cout << "." << endl; - } - break; - case MOMENT_Z_COEFFICIENT: - cout << "CMz objective function" << endl; - if (Fixed_CL_Mode) { - cout << " using fixed CL mode, dCMz/dCL = " << dCMz_dCL << "." << endl; - } else { - cout << "." << endl; - } - break; - case INVERSE_DESIGN_PRESSURE: - cout << "Inverse design (Cp) objective function." << endl; - break; - case INVERSE_DESIGN_HEATFLUX: - cout << "Inverse design (Heat Flux) objective function." << endl; + case DRAG_COEFFICIENT: cout << "CD objective function"; + if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCD/dCL = " << dCD_dCL << "." << endl; } + else { cout << "." << endl; } break; - case SIDEFORCE_COEFFICIENT: - cout << "Side force objective function." << endl; + case LIFT_COEFFICIENT: cout << "CL objective function." << endl; break; + case MOMENT_X_COEFFICIENT: cout << "CMx objective function" << endl; + if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCMx/dCL = " << dCMx_dCL << "." << endl; } + else { cout << "." << endl; } break; - case EFFICIENCY: - cout << "CL/CD objective function." << endl; + case MOMENT_Y_COEFFICIENT: cout << "CMy objective function" << endl; + if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCMy/dCL = " << dCMy_dCL << "." << endl; } + else { cout << "." << endl; } break; - case EQUIVALENT_AREA: - cout << "Equivalent area objective function. CD weight: " << WeightCd << "." << endl; - break; - case NEARFIELD_PRESSURE: - cout << "Nearfield pressure objective function. CD weight: " << WeightCd << "." << endl; - break; - case FORCE_X_COEFFICIENT: - cout << "X-force objective function." << endl; - break; - case FORCE_Y_COEFFICIENT: - cout << "Y-force objective function." << endl; - break; - case FORCE_Z_COEFFICIENT: - cout << "Z-force objective function." << endl; - break; - case THRUST_COEFFICIENT: - cout << "Thrust objective function." << endl; - break; - case TORQUE_COEFFICIENT: - cout << "Torque efficiency objective function." << endl; - break; - case TOTAL_HEATFLUX: - cout << "Total heat flux objective function." << endl; - break; - case MAXIMUM_HEATFLUX: - cout << "Maximum heat flux objective function." << endl; - break; - case FIGURE_OF_MERIT: - cout << "Rotor Figure of Merit objective function." << endl; - break; - case BUFFET_SENSOR: - cout << "Buffet sensor objective function." << endl; - break; - case SURFACE_TOTAL_PRESSURE: - cout << "Average total pressure objective function." << endl; - break; - case SURFACE_STATIC_PRESSURE: - cout << "Average static pressure objective function." << endl; - break; - case SURFACE_STATIC_TEMPERATURE: - cout << "Average static temperature objective function." << endl; - break; - case SURFACE_MASSFLOW: - cout << "Mass flow rate objective function." << endl; - break; - case SURFACE_MACH: - cout << "Mach number objective function." << endl; - break; - case CUSTOM_OBJFUNC: - cout << "Custom objective function." << endl; - break; - case REFERENCE_GEOMETRY: - cout << "Target geometry objective function." << endl; - break; - case REFERENCE_NODE: - cout << "Target node displacement objective function." << endl; - break; - case VOLUME_FRACTION: - cout << "Volume fraction objective function." << endl; - break; - case TOPOL_DISCRETENESS: - cout << "Topology discreteness objective function." << endl; - break; - case TOPOL_COMPLIANCE: - cout << "Topology compliance objective function." << endl; - break; - case STRESS_PENALTY: - cout << "Stress penalty objective function." << endl; + case MOMENT_Z_COEFFICIENT: cout << "CMz objective function" << endl; + if (Fixed_CL_Mode) { cout << " using fixed CL mode, dCMz/dCL = " << dCMz_dCL << "." << endl; } + else { cout << "." << endl; } break; + case INVERSE_DESIGN_PRESSURE: cout << "Inverse design (Cp) objective function." << endl; break; + case INVERSE_DESIGN_HEATFLUX: cout << "Inverse design (Heat Flux) objective function." << endl; break; + case SIDEFORCE_COEFFICIENT: cout << "Side force objective function." << endl; break; + case EFFICIENCY: cout << "CL/CD objective function." << endl; break; + case EQUIVALENT_AREA: cout << "Equivalent area objective function. CD weight: " << WeightCd <<"."<< endl; break; + case NEARFIELD_PRESSURE: cout << "Nearfield pressure objective function. CD weight: " << WeightCd <<"."<< endl; break; + case FORCE_X_COEFFICIENT: cout << "X-force objective function." << endl; break; + case FORCE_Y_COEFFICIENT: cout << "Y-force objective function." << endl; break; + case FORCE_Z_COEFFICIENT: cout << "Z-force objective function." << endl; break; + case THRUST_COEFFICIENT: cout << "Thrust objective function." << endl; break; + case TORQUE_COEFFICIENT: cout << "Torque efficiency objective function." << endl; break; + case TOTAL_HEATFLUX: cout << "Total heat flux objective function." << endl; break; + case MAXIMUM_HEATFLUX: cout << "Maximum heat flux objective function." << endl; break; + case FIGURE_OF_MERIT: cout << "Rotor Figure of Merit objective function." << endl; break; + case BUFFET_SENSOR: cout << "Buffet sensor objective function." << endl; break; + case SURFACE_TOTAL_PRESSURE: cout << "Average total pressure objective function." << endl; break; + case SURFACE_STATIC_PRESSURE: cout << "Average static pressure objective function." << endl; break; + case SURFACE_STATIC_TEMPERATURE: cout << "Average static temperature objective function." << endl; break; + case SURFACE_MASSFLOW: cout << "Mass flow rate objective function." << endl; break; + case SURFACE_MACH: cout << "Mach number objective function." << endl; break; + case CUSTOM_OBJFUNC: cout << "Custom objective function." << endl; break; + case REFERENCE_GEOMETRY: cout << "Target geometry objective function." << endl; break; + case REFERENCE_NODE: cout << "Target node displacement objective function." << endl; break; + case VOLUME_FRACTION: cout << "Volume fraction objective function." << endl; break; + case TOPOL_DISCRETENESS: cout << "Topology discreteness objective function." << endl; break; + case TOPOL_COMPLIANCE: cout << "Topology compliance objective function." << endl; break; + case STRESS_PENALTY: cout << "Stress penalty objective function." << endl; break; } - } else { + } + else { cout << "Weighted sum objective function." << endl; } + } if (val_software == SU2_COMPONENT::SU2_CFD) { + auto PrintLimiterInfo = [&](const LIMITER kind_limiter) { cout << "Second order integration in space, with slope limiter.\n"; switch (kind_limiter) { @@ -7267,14 +6649,12 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { case LIMITER::SHARP_EDGES: cout << "Sharp edges slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; cout << "The reference element size is: " << RefElemLength << ".\n"; - cout << "The reference sharp edge distance is: " - << AdjSharp_LimiterCoeff * RefElemLength * Venkat_LimiterCoeff << "." << endl; + cout << "The reference sharp edge distance is: " << AdjSharp_LimiterCoeff*RefElemLength*Venkat_LimiterCoeff << "." << endl; break; case LIMITER::WALL_DISTANCE: cout << "Wall distance slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; cout << "The reference element size is: " << RefElemLength << ".\n"; - cout << "The reference wall distance is: " << AdjSharp_LimiterCoeff * RefElemLength * Venkat_LimiterCoeff - << "." << endl; + cout << "The reference wall distance is: " << AdjSharp_LimiterCoeff*RefElemLength*Venkat_LimiterCoeff << "." << endl; break; default: SU2_MPI::Error("Unknown or invalid limiter type.", CURRENT_FUNCTION); @@ -7282,69 +6662,53 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } }; - cout << endl << "--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; + cout << endl <<"--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; if (SmoothNumGrid) cout << "There are some smoothing iterations on the grid coordinates." << endl; - if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_EULER) || - (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || - (Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { + if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || + (Kind_Solver == MAIN_SOLVER::INC_EULER) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || + (Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) ) { + if (Kind_ConvNumScheme_Flow == SPACE_CENTERED) { if (Kind_Centered_Flow == CENTERED::LAX) { cout << "Lax-Friedrich scheme (1st order in space) for the flow inviscid terms.\n"; cout << "Lax viscous coefficients (1st): " << Kappa_1st_Flow << ".\n"; cout << "First order integration." << endl; - } else { + } + else { cout << "Jameson-Schmidt-Turkel scheme (2nd order in space) for the flow inviscid terms.\n"; cout << "JST viscous coefficients (2nd & 4th): " << Kappa_2nd_Flow << ", " << Kappa_4th_Flow << ".\n"; - cout << "The method includes a grid stretching correction (p = 0.3)." << endl; + cout << "The method includes a grid stretching correction (p = 0.3)."<< endl; } } if (Kind_ConvNumScheme_Flow == SPACE_UPWIND) { - if (Kind_Upwind_Flow == UPWIND::ROE) - cout << "Roe (with entropy fix = " << EntropyFix_Coeff << ") solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::TURKEL) cout << "Roe-Turkel solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::AUSM) cout << "AUSM solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::HLLC) cout << "HLLC solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::SW) cout << "Steger-Warming solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::MSW) - cout << "Modified Steger-Warming solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::L2ROE) cout << "L2ROE Low Mach ROE solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::LMROE) - cout << "Rieper Low Mach ROE solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::SLAU) - cout << "Simple Low-Dissipation AUSM solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::SLAU2) - cout << "Simple Low-Dissipation AUSM 2 solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::FDS) - cout << "Flux difference splitting (FDS) upwind scheme for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP) cout << "AUSM+-up solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP2) cout << "AUSM+-up2 solver for the flow inviscid terms." << endl; - if (Kind_Upwind_Flow == UPWIND::AUSMPLUSM) cout << "AUSM+M solver for the flow inviscid terms." << endl; - - if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER || + if (Kind_Upwind_Flow == UPWIND::ROE) cout << "Roe (with entropy fix = "<< EntropyFix_Coeff <<") solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::TURKEL) cout << "Roe-Turkel solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::AUSM) cout << "AUSM solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::HLLC) cout << "HLLC solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::SW) cout << "Steger-Warming solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::MSW) cout << "Modified Steger-Warming solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::L2ROE) cout << "L2ROE Low Mach ROE solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::LMROE) cout << "Rieper Low Mach ROE solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::SLAU) cout << "Simple Low-Dissipation AUSM solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::SLAU2) cout << "Simple Low-Dissipation AUSM 2 solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::FDS) cout << "Flux difference splitting (FDS) upwind scheme for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP) cout << "AUSM+-up solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::AUSMPLUSUP2) cout << "AUSM+-up2 solver for the flow inviscid terms."<< endl; + if (Kind_Upwind_Flow == UPWIND::AUSMPLUSM) cout << "AUSM+M solver for the flow inviscid terms."<< endl; + + if (Kind_Solver == MAIN_SOLVER::EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER || Kind_Solver == MAIN_SOLVER::NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::RANS || Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) { + Kind_Solver == MAIN_SOLVER::RANS || Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) { switch (Kind_RoeLowDiss) { - case NO_ROELOWDISS: - cout << "Standard Roe without low-dissipation function." << endl; - break; - case NTS: - cout << "Roe with NTS low-dissipation function." << endl; - break; - case FD: - cout << "Roe with DDES's FD low-dissipation function." << endl; - break; - case NTS_DUCROS: - cout << "Roe with NTS low-dissipation function + Ducros shock sensor." << endl; - break; - case FD_DUCROS: - cout << "Roe with DDES's FD low-dissipation function + Ducros shock sensor." << endl; - break; + case NO_ROELOWDISS: cout << "Standard Roe without low-dissipation function."<< endl; break; + case NTS: cout << "Roe with NTS low-dissipation function."<< endl; break; + case FD: cout << "Roe with DDES's FD low-dissipation function."<< endl; break; + case NTS_DUCROS: cout << "Roe with NTS low-dissipation function + Ducros shock sensor."<< endl; break; + case FD_DUCROS: cout << "Roe with DDES's FD low-dissipation function + Ducros shock sensor."<< endl; break; } } @@ -7353,7 +6717,9 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } else { cout << "First order integration in space." << endl; } + } + } if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { @@ -7367,25 +6733,24 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } } - if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { + if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { + if (Kind_ConvNumScheme_AdjFlow == SPACE_CENTERED) { if (Kind_Centered_AdjFlow == CENTERED::JST) { - cout << "Jameson-Schmidt-Turkel scheme for the adjoint inviscid terms." << endl; - cout << "JST viscous coefficients (1st, 2nd, & 4th): " << Kappa_1st_AdjFlow << ", " << Kappa_2nd_AdjFlow - << ", " << Kappa_4th_AdjFlow << "." << endl; - cout << "The method includes a grid stretching correction (p = 0.3)." << endl; + cout << "Jameson-Schmidt-Turkel scheme for the adjoint inviscid terms."<< endl; + cout << "JST viscous coefficients (1st, 2nd, & 4th): " << Kappa_1st_AdjFlow + << ", " << Kappa_2nd_AdjFlow << ", " << Kappa_4th_AdjFlow <<"."<< endl; + cout << "The method includes a grid stretching correction (p = 0.3)."<< endl; cout << "Second order integration." << endl; } if (Kind_Centered_AdjFlow == CENTERED::LAX) { - cout << "Lax-Friedrich scheme for the adjoint inviscid terms." << endl; + cout << "Lax-Friedrich scheme for the adjoint inviscid terms."<< endl; cout << "First order integration." << endl; } } if (Kind_ConvNumScheme_AdjFlow == SPACE_UPWIND) { - if (Kind_Upwind_AdjFlow == UPWIND::ROE) - cout << "Roe (with entropy fix = " << EntropyFix_Coeff << ") solver for the adjoint inviscid terms." << endl; + if (Kind_Upwind_AdjFlow == UPWIND::ROE) cout << "Roe (with entropy fix = "<< EntropyFix_Coeff <<") solver for the adjoint inviscid terms."<< endl; if (MUSCL_AdjFlow) { PrintLimiterInfo(Kind_SlopeLimit_AdjFlow); } else { @@ -7393,14 +6758,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } } - cout << "The reference sharp edge distance is: " << AdjSharp_LimiterCoeff * RefElemLength * Venkat_LimiterCoeff - << ". " << endl; + cout << "The reference sharp edge distance is: " << AdjSharp_LimiterCoeff*RefElemLength*Venkat_LimiterCoeff <<". "<< endl; + } if ((Kind_Solver == MAIN_SOLVER::ADJ_RANS) && (!Frozen_Visc_Cont)) { if (Kind_ConvNumScheme_AdjTurb == SPACE_UPWIND) { - if (Kind_Upwind_Turb == UPWIND::SCALAR_UPWIND) - cout << "Scalar upwind solver for the adjoint turbulence model." << endl; + if (Kind_Upwind_Turb == UPWIND::SCALAR_UPWIND) cout << "Scalar upwind solver for the adjoint turbulence model." << endl; if (MUSCL_AdjTurb) { PrintLimiterInfo(Kind_SlopeLimit_AdjTurb); } else { @@ -7411,85 +6775,62 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || - (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { - cout << "Average of gradients with correction (viscous flow terms)." << endl; + (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { + cout << "Average of gradients with correction (viscous flow terms)." << endl; } if ((Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { cout << "Average of gradients with correction (viscous adjoint terms)." << endl; } - if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || - (Kind_Solver == MAIN_SOLVER::INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS)) { + if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) ) { cout << "Average of gradients with correction (viscous turbulence terms)." << endl; } if ((Kind_Solver == MAIN_SOLVER::ADJ_RANS) && (!Frozen_Visc_Cont)) { - cout << "Average of gradients with correction (2nd order) for computation of adjoint viscous turbulence terms." - << endl; - if (Kind_TimeIntScheme_AdjTurb == EULER_IMPLICIT) - cout << "Euler implicit method for the turbulent adjoint equation." << endl; + cout << "Average of gradients with correction (2nd order) for computation of adjoint viscous turbulence terms." << endl; + if (Kind_TimeIntScheme_AdjTurb == EULER_IMPLICIT) cout << "Euler implicit method for the turbulent adjoint equation." << endl; } - if (Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && - Kind_Solver != MAIN_SOLVER::FEM_RANS && Kind_Solver != MAIN_SOLVER::FEM_LES && - Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_NS && - Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_RANS) { - if (!fea) { + if(Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::FEM_RANS && Kind_Solver != MAIN_SOLVER::FEM_LES && + Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_NS && + Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_RANS) { + if (!fea){ switch (Kind_Gradient_Method_Recon) { - case GREEN_GAUSS: - cout << "Gradient for upwind reconstruction: Green-Gauss." << endl; - break; - case LEAST_SQUARES: - cout << "Gradient for upwind reconstruction: unweighted Least-Squares." << endl; - break; - case WEIGHTED_LEAST_SQUARES: - cout << "Gradient for upwind reconstruction: inverse-distance weighted Least-Squares." << endl; - break; + case GREEN_GAUSS: cout << "Gradient for upwind reconstruction: Green-Gauss." << endl; break; + case LEAST_SQUARES: cout << "Gradient for upwind reconstruction: unweighted Least-Squares." << endl; break; + case WEIGHTED_LEAST_SQUARES: cout << "Gradient for upwind reconstruction: inverse-distance weighted Least-Squares." << endl; break; } switch (Kind_Gradient_Method) { - case GREEN_GAUSS: - cout << "Gradient for viscous and source terms: Green-Gauss." << endl; - break; - case LEAST_SQUARES: - cout << "Gradient for viscous and source terms: unweighted Least-Squares." << endl; - break; - case WEIGHTED_LEAST_SQUARES: - cout << "Gradient for viscous and source terms: inverse-distance weighted Least-Squares." << endl; - break; + case GREEN_GAUSS: cout << "Gradient for viscous and source terms: Green-Gauss." << endl; break; + case LEAST_SQUARES: cout << "Gradient for viscous and source terms: unweighted Least-Squares." << endl; break; + case WEIGHTED_LEAST_SQUARES: cout << "Gradient for viscous and source terms: inverse-distance weighted Least-Squares." << endl; break; } - } else { + } + else{ cout << "Spatial discretization using the Finite Element Method." << endl; } } - if (Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES || - Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS || - Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS) { - if (Kind_FEM_Flow == DG) { + if(Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES || + Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER || Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS || + Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS) { + if(Kind_FEM_Flow == DG) { cout << "Discontinuous Galerkin Finite element solver" << endl; - switch (Riemann_Solver_FEM) { - case UPWIND::ROE: - cout << "Roe (with entropy fix) solver for inviscid fluxes over the faces" << endl; - break; - case UPWIND::LAX_FRIEDRICH: - cout << "Lax-Friedrich solver for inviscid fluxes over the faces" << endl; - break; - case UPWIND::AUSM: - cout << "AUSM solver inviscid fluxes over the faces" << endl; - break; - case UPWIND::HLLC: - cout << "HLLC solver inviscid fluxes over the faces" << endl; - break; - default: - break; + switch( Riemann_Solver_FEM ) { + case UPWIND::ROE: cout << "Roe (with entropy fix) solver for inviscid fluxes over the faces" << endl; break; + case UPWIND::LAX_FRIEDRICH: cout << "Lax-Friedrich solver for inviscid fluxes over the faces" << endl; break; + case UPWIND::AUSM: cout << "AUSM solver inviscid fluxes over the faces" << endl; break; + case UPWIND::HLLC: cout << "HLLC solver inviscid fluxes over the faces" << endl; break; + default: break; } - if (Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER) { + if(Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::DISC_ADJ_FEM_EULER) { cout << "Theta symmetrizing terms interior penalty: " << Theta_Interior_Penalty_DGFEM << endl; } } @@ -7501,58 +6842,50 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "Padded matrix size for optimal performance: " << sizeMatMulPadding << endl; } - cout << endl << "--------------- Time Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; + cout << endl <<"--------------- Time Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; if (!fea) { - switch (TimeMarching) { - 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; + switch (TimeMarching) { + 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 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; + 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; - } + default: + break; + } + } + else { + if (Time_Domain) { + cout << "Dynamic structural analysis."<< endl; + cout << "Time step provided by the user for the dynamic analysis(s): "<< Time_Step << "." << endl; } else { - if (Time_Domain) { - cout << "Dynamic structural analysis." << endl; - cout << "Time step provided by the user for the dynamic analysis(s): " << Time_Step << "." << endl; - } else { - cout << "Static structural analysis." << endl; - } + cout << "Static structural analysis." << endl; } + } - if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_EULER) || - (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || + if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) || + (Kind_Solver == MAIN_SOLVER::INC_EULER) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) || (Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS) || - (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS)) { + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_INC_RANS) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS) || + (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_EULER) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_NS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_FEM_RANS)) { switch (Kind_TimeIntScheme_Flow) { case RUNGE_KUTTA_EXPLICIT: cout << "Runge-Kutta explicit method for the flow equations." << endl; @@ -7569,8 +6902,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { case EULER_IMPLICIT: cout << "Euler implicit method for the flow equations." << endl; if (Kind_FluidModel == MUTATIONPP) - SU2_MPI::Error("Implicit time scheme is not yet implemented with Mutation++. Use EULER_EXPLICIT.", - CURRENT_FUNCTION); + SU2_MPI::Error("Implicit time scheme is not yet implemented with Mutation++. Use EULER_EXPLICIT.", CURRENT_FUNCTION); switch (Kind_Linear_Solver) { case BCGSTAB: case FGMRES: @@ -7580,40 +6912,24 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { else cout << "FGMRES is used for solving the linear system." << endl; switch (Kind_Linear_Solver_Prec) { - case ILU: - cout << "Using a ILU(" << Linear_Solver_ILU_n << ") preconditioning." << endl; - break; - case LINELET: - cout << "Using a linelet preconditioning." << endl; - break; - case LU_SGS: - cout << "Using a LU-SGS preconditioning." << endl; - break; - case JACOBI: - cout << "Using a Jacobi preconditioning." << endl; - break; + case ILU: cout << "Using a ILU("<< Linear_Solver_ILU_n <<") preconditioning."<< endl; break; + case LINELET: cout << "Using a linelet preconditioning."<< endl; break; + case LU_SGS: cout << "Using a LU-SGS preconditioning."<< endl; break; + case JACOBI: cout << "Using a Jacobi preconditioning."<< endl; break; } break; case SMOOTHER: switch (Kind_Linear_Solver_Prec) { - case ILU: - cout << "A ILU(" << Linear_Solver_ILU_n << ")"; - break; - case LINELET: - cout << "A Linelet"; - break; - case LU_SGS: - cout << "A LU-SGS"; - break; - case JACOBI: - cout << "A Jacobi"; - break; + case ILU: cout << "A ILU(" << Linear_Solver_ILU_n << ")"; break; + case LINELET: cout << "A Linelet"; break; + case LU_SGS: cout << "A LU-SGS"; break; + case JACOBI: cout << "A Jacobi"; break; } cout << " method is used for smoothing the linear system." << endl; break; } - cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; - cout << "Max number of linear iterations: " << Linear_Solver_Iter << "." << endl; + cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; + cout << "Max number of linear iterations: "<< Linear_Solver_Iter <<"."<< endl; break; case CLASSICAL_RK4_EXPLICIT: cout << "Classical RK4 explicit method for the flow equations." << endl; @@ -7634,27 +6950,25 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { switch (Kind_Linear_Solver) { case BCGSTAB: cout << "BCGSTAB is used for solving the linear system." << endl; - cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; - cout << "Max number of iterations: " << Linear_Solver_Iter << "." << endl; + cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; + cout << "Max number of iterations: "<< Linear_Solver_Iter <<"."<< endl; break; - case FGMRES: - case RESTARTED_FGMRES: + case FGMRES: case RESTARTED_FGMRES: cout << "FGMRES is used for solving the linear system." << endl; - cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; - cout << "Max number of iterations: " << Linear_Solver_Iter << "." << endl; + cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; + cout << "Max number of iterations: "<< Linear_Solver_Iter <<"."<< endl; break; case CONJUGATE_GRADIENT: cout << "A Conjugate Gradient method is used for solving the linear system." << endl; - cout << "Convergence criteria of the linear solver: " << Linear_Solver_Error << "." << endl; - cout << "Max number of iterations: " << Linear_Solver_Iter << "." << endl; + cout << "Convergence criteria of the linear solver: "<< Linear_Solver_Error <<"."<< endl; + cout << "Max number of iterations: "<< Linear_Solver_Iter <<"."<< endl; break; } break; } } - if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { + if ((Kind_Solver == MAIN_SOLVER::ADJ_EULER) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) { switch (Kind_TimeIntScheme_AdjFlow) { case RUNGE_KUTTA_EXPLICIT: cout << "Runge-Kutta explicit method for the adjoint equations." << endl; @@ -7665,17 +6979,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } cout << endl; break; - case EULER_EXPLICIT: - cout << "Euler explicit method for the adjoint equations." << endl; - break; - case EULER_IMPLICIT: - cout << "Euler implicit method for the adjoint equations." << endl; - break; + case EULER_EXPLICIT: cout << "Euler explicit method for the adjoint equations." << endl; break; + case EULER_IMPLICIT: cout << "Euler implicit method for the adjoint equations." << endl; break; } } - if (Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || - Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES) { + if(Kind_Solver == MAIN_SOLVER::FEM_EULER || Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES || + Kind_Solver == MAIN_SOLVER::FEM_RANS || Kind_Solver == MAIN_SOLVER::FEM_LES) { switch (Kind_TimeIntScheme_FEM_Flow) { case RUNGE_KUTTA_EXPLICIT: cout << "Runge-Kutta explicit method for the flow equations." << endl; @@ -7694,13 +7004,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; case ADER_DG: - if (nLevels_TimeAccurateLTS == 1) + if(nLevels_TimeAccurateLTS == 1) cout << "ADER-DG for the flow equations with global time stepping." << endl; else cout << "ADER-DG for the flow equations with " << nLevels_TimeAccurateLTS << " levels for time accurate local time stepping." << endl; - switch (Kind_ADER_Predictor) { + switch( Kind_ADER_Predictor ) { case ADER_ALIASED_PREDICTOR: cout << "An aliased approach is used in the predictor step. " << endl; break; @@ -7710,19 +7020,19 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } cout << "Number of time DOFs ADER-DG predictor step: " << nTimeDOFsADER_DG << endl; cout << "Location of time DOFs ADER-DG on the interval [-1,1]: "; - for (unsigned short iDOF = 0; iDOF < nTimeDOFsADER_DG; iDOF++) { + for (unsigned short iDOF=0; iDOF& option_value) { +bool CConfig::TokenizeString(string & str, string & option_name, + vector & option_value) { const string delimiters(" (){}:,\t\n\v\f\r"); // check for comments or empty string string::size_type pos, last_pos; pos = str.find_first_of('%'); - if ((str.length() == 0) || (pos == 0)) { + if ( (str.length() == 0) || (pos == 0) ) { // str is empty or a comment line, so no option here return false; } @@ -8288,22 +7596,24 @@ bool CConfig::TokenizeString(string& str, string& option_name, vector& o pos = str.find('='); if (pos == string::npos) { cerr << "Error in TokenizeString(): " - << "line in the configuration file with no \"=\" sign." << endl; + << "line in the configuration file with no \"=\" sign." + << endl; cout << "Look for: " << str << endl; cout << "str.length() = " << str.length() << endl; throw(-1); } name_part = str.substr(0, pos); - value_part = str.substr(pos + 1, string::npos); - // cout << "name_part = |" << name_part << "|" << endl; - // cout << "value_part = |" << value_part << "|" << endl; + value_part = str.substr(pos+1, string::npos); + //cout << "name_part = |" << name_part << "|" << endl; + //cout << "value_part = |" << value_part << "|" << endl; // the first_part should consist of one string with no interior delimiters last_pos = name_part.find_first_not_of(delimiters, 0); pos = name_part.find_first_of(delimiters, last_pos); - if ((name_part.length() == 0) || (last_pos == string::npos)) { + if ( (name_part.length() == 0) || (last_pos == string::npos) ) { cerr << "Error in CConfig::TokenizeString(): " - << "line in the configuration file with no name before the \"=\" sign." << endl; + << "line in the configuration file with no name before the \"=\" sign." + << endl; throw(-1); } if (pos == string::npos) pos = name_part.length(); @@ -8311,13 +7621,14 @@ bool CConfig::TokenizeString(string& str, string& option_name, vector& o last_pos = name_part.find_first_not_of(delimiters, pos); if (last_pos != string::npos) { cerr << "Error in TokenizeString(): " - << "two or more options before an \"=\" sign in the configuration file." << endl; + << "two or more options before an \"=\" sign in the configuration file." + << endl; throw(-1); } StringToUpperCase(option_name); - // cout << "option_name = |" << option_name << "|" << endl; - // cout << "pos = " << pos << ": last_pos = " << last_pos << endl; + //cout << "option_name = |" << option_name << "|" << endl; + //cout << "pos = " << pos << ": last_pos = " << last_pos << endl; // now fill the option value vector option_value.clear(); @@ -8325,7 +7636,7 @@ bool CConfig::TokenizeString(string& str, string& option_name, vector& o // detect a raw string if (value_part[last_pos] == '\'' && value_part.back() == '\'') { - option_value.push_back(value_part.substr(last_pos + 1, value_part.size() - last_pos - 2)); + option_value.push_back(value_part.substr(last_pos+1, value_part.size()-last_pos-2)); return true; } @@ -8340,7 +7651,8 @@ bool CConfig::TokenizeString(string& str, string& option_name, vector& o } if (option_value.empty()) { cerr << "Error in TokenizeString(): " - << "option " << option_name << " in configuration file with no value assigned." << endl; + << "option " << option_name << " in configuration file with no value assigned." + << endl; throw(-1); } @@ -8363,7 +7675,7 @@ bool CConfig::TokenizeString(string& str, string& option_name, vector& o pos = it->find(';'); if (pos != string::npos) { string before_semi = it->substr(0, pos); - string after_semi = it->substr(pos + 1, string::npos); + string after_semi= it->substr(pos+1, string::npos); if (before_semi.empty()) { *it = ";"; it++; @@ -8373,13 +7685,14 @@ bool CConfig::TokenizeString(string& str, string& option_name, vector& o it++; vector to_insert; to_insert.emplace_back(";"); - if (!after_semi.empty()) to_insert.push_back(after_semi); + if (!after_semi.empty()) + to_insert.push_back(after_semi); option_value.insert(it, to_insert.begin(), to_insert.end()); } - it = option_value.begin(); // go back to beginning; not efficient + it = option_value.begin(); // go back to beginning; not efficient continue; - } - it++; + } it++; + } #if 0 cout << "option value(s) = "; @@ -8413,13 +7726,14 @@ bool CConfig::TokenizeString(string& str, string& option_name, vector& o } unsigned short CConfig::GetMarker_CfgFile_TagBound(const string& val_marker) const { + unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) return iMarker_CfgFile; + if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) + return iMarker_CfgFile; } - SU2_MPI::Error(string("The configuration file doesn't have any definition for marker ") + val_marker, - CURRENT_FUNCTION); + SU2_MPI::Error(string("The configuration file doesn't have any definition for marker ") + val_marker, CURRENT_FUNCTION); return 0; } @@ -8534,7 +7848,7 @@ unsigned short CConfig::GetMarker_CfgFile_Fluid_Load(const string& val_marker) c unsigned short CConfig::GetMarker_CfgFile_PyCustom(const string& val_marker) const { unsigned short iMarker_CfgFile; - for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) + for (iMarker_CfgFile=0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_PyCustom[iMarker_CfgFile]; } @@ -8561,64 +7875,70 @@ unsigned short CConfig::GetMarker_CfgFile_SobolevBC(const string& val_marker) co } bool CConfig::GetViscous_Wall(unsigned short iMarker) const { - return (Marker_All_KindBC[iMarker] == HEAT_FLUX || Marker_All_KindBC[iMarker] == ISOTHERMAL || - Marker_All_KindBC[iMarker] == HEAT_TRANSFER || Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL || + + return (Marker_All_KindBC[iMarker] == HEAT_FLUX || + Marker_All_KindBC[iMarker] == ISOTHERMAL || + Marker_All_KindBC[iMarker] == HEAT_TRANSFER || + Marker_All_KindBC[iMarker] == SMOLUCHOWSKI_MAXWELL || Marker_All_KindBC[iMarker] == CHT_WALL_INTERFACE); } bool CConfig::GetCatalytic_Wall(unsigned short iMarker) const { + bool catalytic = false; - for (unsigned short iMarker_Catalytic = 0; iMarker_Catalytic < nWall_Catalytic; iMarker_Catalytic++) { + for (unsigned short iMarker_Catalytic = 0; iMarker_Catalytic < nWall_Catalytic; iMarker_Catalytic++){ string Catalytic_Tag = Wall_Catalytic[iMarker_Catalytic]; - if (Catalytic_Tag == Marker_All_TagBound[iMarker]) { - catalytic = true; - break; - } + if (Catalytic_Tag == Marker_All_TagBound[iMarker]) { catalytic = true; break; } } return catalytic; } bool CConfig::GetSolid_Wall(unsigned short iMarker) const { - return GetViscous_Wall(iMarker) || Marker_All_KindBC[iMarker] == EULER_WALL; + + return GetViscous_Wall(iMarker) || + Marker_All_KindBC[iMarker] == EULER_WALL; } void CConfig::SetSurface_Movement(unsigned short iMarker, unsigned short kind_movement) { + auto* new_surface_movement = new unsigned short[nMarker_Moving + 1]; - auto* new_marker_moving = new string[nMarker_Moving + 1]; + auto* new_marker_moving = new string[nMarker_Moving+1]; - for (unsigned short iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++) { + for (unsigned short iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++){ new_surface_movement[iMarker_Moving] = Kind_SurfaceMovement[iMarker_Moving]; new_marker_moving[iMarker_Moving] = Marker_Moving[iMarker_Moving]; } - if (nKind_SurfaceMovement > 0) { - delete[] Marker_Moving; - delete[] Kind_SurfaceMovement; + if (nKind_SurfaceMovement > 0){ + delete [] Marker_Moving; + delete [] Kind_SurfaceMovement; } Kind_SurfaceMovement = new_surface_movement; - Marker_Moving = new_marker_moving; + Marker_Moving = new_marker_moving; Kind_SurfaceMovement[nMarker_Moving] = kind_movement; Marker_Moving[nMarker_Moving] = Marker_All_TagBound[iMarker]; nMarker_Moving++; nKind_SurfaceMovement++; + } CConfig::~CConfig() { + unsigned long iDV, iMarker; /*--- Delete all of the option objects in the global option map ---*/ - for (auto itr = option_map.begin(); itr != option_map.end(); itr++) { + for(auto itr = option_map.begin(); itr != option_map.end(); itr++) { delete itr->second; } - delete[] TimeDOFsADER_DG; - delete[] TimeIntegrationADER_DG; - delete[] WeightsIntegrationADER_DG; + delete [] TimeDOFsADER_DG; + delete [] TimeIntegrationADER_DG; + delete [] WeightsIntegrationADER_DG; /*--- Free memory for Aeroelastic problems. ---*/ @@ -8688,12 +8008,12 @@ CConfig::~CConfig() { if (DV_Value != nullptr) { for (iDV = 0; iDV < nDV; iDV++) delete[] DV_Value[iDV]; - delete[] DV_Value; + delete [] DV_Value; } if (ParamDV != nullptr) { for (iDV = 0; iDV < nDV; iDV++) delete[] ParamDV[iDV]; - delete[] ParamDV; + delete [] ParamDV; } delete[] Exhaust_Pressure; @@ -8784,13 +8104,15 @@ CConfig::~CConfig() { delete[] Surface_IDR; if (Riemann_FlowDir != nullptr) { - for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++) delete[] Riemann_FlowDir[iMarker]; - delete[] Riemann_FlowDir; + for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++) + delete [] Riemann_FlowDir[iMarker]; + delete [] Riemann_FlowDir; } if (Giles_FlowDir != nullptr) { - for (iMarker = 0; iMarker < nMarker_Giles; iMarker++) delete[] Giles_FlowDir[iMarker]; - delete[] Giles_FlowDir; + for (iMarker = 0; iMarker < nMarker_Giles; iMarker++) + delete [] Giles_FlowDir[iMarker]; + delete [] Giles_FlowDir; } delete[] PlaneTag; @@ -8798,29 +8120,30 @@ CConfig::~CConfig() { /*--- Delete some arrays needed just for initializing options. ---*/ - delete[] FFDTag; - delete[] nDV_Value; + delete [] FFDTag; + delete [] nDV_Value; - delete[] Kind_Data_Riemann; - delete[] Riemann_Var1; - delete[] Riemann_Var2; - delete[] Kind_Data_Giles; - delete[] Giles_Var1; - delete[] Giles_Var2; - delete[] RelaxFactorAverage; - delete[] RelaxFactorFourier; - delete[] nSpan_iZones; + delete [] Kind_Data_Riemann; + delete [] Riemann_Var1; + delete [] Riemann_Var2; + delete [] Kind_Data_Giles; + delete [] Giles_Var1; + delete [] Giles_Var2; + delete [] RelaxFactorAverage; + delete [] RelaxFactorFourier; + delete [] nSpan_iZones; - delete[] Marker_TurboBoundIn; - delete[] Marker_TurboBoundOut; - delete[] Marker_Riemann; - delete[] Marker_Giles; + delete [] Marker_TurboBoundIn; + delete [] Marker_TurboBoundOut; + delete [] Marker_Riemann; + delete [] Marker_Giles; - delete[] nBlades; - delete[] FreeStreamTurboNormal; + delete [] nBlades; + delete [] FreeStreamTurboNormal; } string CConfig::GetFilename(string filename, const string& ext, int timeIter) const { + /*--- Remove any extension --- */ unsigned short lastindex = filename.find_last_of('.'); @@ -8831,21 +8154,22 @@ string CConfig::GetFilename(string filename, const string& ext, int timeIter) co filename = filename + string(ext); /*--- Append the zone number if multizone problems ---*/ - if (Multizone_Problem) filename = GetMultizone_FileName(filename, GetiZone(), ext); + if (Multizone_Problem) + filename = GetMultizone_FileName(filename, GetiZone(), ext); /*--- Append the zone number if multiple instance problems ---*/ - if (GetnTimeInstances() > 1) filename = GetMultiInstance_FileName(filename, GetiInst(), ext); + if (GetnTimeInstances() > 1) + filename = GetMultiInstance_FileName(filename, GetiInst(), ext); /*--- Append the iteration number for unsteady problems ---*/ - if (GetTime_Domain()) { + if (GetTime_Domain()){ filename = GetUnsteady_FileName(filename, timeIter, ext); } return filename; } -string CConfig::GetFilename_Iter(const string& filename_iter, unsigned long curInnerIter, - unsigned long curOuterIter) const { +string CConfig::GetFilename_Iter(const string& filename_iter, unsigned long curInnerIter, unsigned long curOuterIter) const { const auto iter = GetMultizone_Problem() ? curOuterIter : curInnerIter; std::stringstream iter_ss; iter_ss << filename_iter << "_" << std::setw(6) << std::setfill('0') << iter; @@ -8853,6 +8177,7 @@ string CConfig::GetFilename_Iter(const string& filename_iter, unsigned long curI } string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, const string& ext) const { + string UnstExt, UnstFilename = std::move(val_filename); char buffer[50]; @@ -8868,11 +8193,12 @@ string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, const st /*--- Append iteration number for unsteady cases ---*/ if (Time_Domain) { - if ((val_iter >= 0) && (val_iter < 10)) SPRINTF(buffer, "_0000%d", val_iter); - if ((val_iter >= 10) && (val_iter < 100)) SPRINTF(buffer, "_000%d", val_iter); - if ((val_iter >= 100) && (val_iter < 1000)) SPRINTF(buffer, "_00%d", val_iter); - if ((val_iter >= 1000) && (val_iter < 10000)) SPRINTF(buffer, "_0%d", val_iter); - if (val_iter >= 10000) SPRINTF(buffer, "_%d", val_iter); + + if ((val_iter >= 0) && (val_iter < 10)) SPRINTF (buffer, "_0000%d", val_iter); + if ((val_iter >= 10) && (val_iter < 100)) SPRINTF (buffer, "_000%d", val_iter); + if ((val_iter >= 100) && (val_iter < 1000)) SPRINTF (buffer, "_00%d", val_iter); + if ((val_iter >= 1000) && (val_iter < 10000)) SPRINTF (buffer, "_0%d", val_iter); + if (val_iter >= 10000) SPRINTF (buffer, "_%d", val_iter); UnstExt = string(buffer); } UnstExt += ext; @@ -8882,234 +8208,152 @@ string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, const st } string CConfig::GetMultizone_FileName(string val_filename, int val_iZone, const string& ext) const { - string multizone_filename = std::move(val_filename); - char buffer[50]; - unsigned short lastindex = multizone_filename.find_last_of('.'); - multizone_filename = multizone_filename.substr(0, lastindex); + string multizone_filename = std::move(val_filename); + char buffer[50]; - if (Multizone_Problem) { - SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iZone)); - multizone_filename.append(string(buffer)); - } + unsigned short lastindex = multizone_filename.find_last_of('.'); + multizone_filename = multizone_filename.substr(0, lastindex); - multizone_filename += ext; - return multizone_filename; + if (Multizone_Problem) { + SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); + multizone_filename.append(string(buffer)); + } + + multizone_filename += ext; + return multizone_filename; } string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone, const string& ext) const { - string multizone_filename = std::move(val_filename); - char buffer[50]; - unsigned short lastindex = multizone_filename.find_last_of('.'); - multizone_filename = multizone_filename.substr(0, lastindex); - if (Multizone_Problem) { - SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iZone)); - multizone_filename.append(string(buffer)); - } - multizone_filename += ext; - return multizone_filename; + + string multizone_filename = std::move(val_filename); + char buffer[50]; + unsigned short lastindex = multizone_filename.find_last_of('.'); + multizone_filename = multizone_filename.substr(0, lastindex); + if (Multizone_Problem) { + SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); + multizone_filename.append(string(buffer)); + } + multizone_filename += ext; + return multizone_filename; } string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, const string& ext) const { + string multizone_filename = std::move(val_filename); char buffer[50]; unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); - SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iInst)); + SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst)); multizone_filename.append(string(buffer)); multizone_filename += ext; return multizone_filename; } string CConfig::GetMultiInstance_HistoryFileName(string val_filename, int val_iInst) const { + string multizone_filename = std::move(val_filename); char buffer[50]; unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); - SPRINTF(buffer, "_%d", SU2_TYPE::Int(val_iInst)); + SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst)); multizone_filename.append(string(buffer)); return multizone_filename; } string CConfig::GetObjFunc_Extension(string val_filename) const { + string AdjExt, Filename = std::move(val_filename); if (ContinuousAdjoint || DiscreteAdjoint) { + /*--- Remove filename extension (.dat) ---*/ unsigned short lastindex = Filename.find_last_of('.'); Filename = Filename.substr(0, lastindex); - if (nObj == 1) { + if (nObj==1) { switch (Kind_ObjFunc[0]) { - case DRAG_COEFFICIENT: - AdjExt = "_cd"; - break; - case LIFT_COEFFICIENT: - AdjExt = "_cl"; - break; - case SIDEFORCE_COEFFICIENT: - AdjExt = "_csf"; - break; - case INVERSE_DESIGN_PRESSURE: - AdjExt = "_invpress"; - break; - case INVERSE_DESIGN_HEATFLUX: - AdjExt = "_invheat"; - break; - case MOMENT_X_COEFFICIENT: - AdjExt = "_cmx"; - break; - case MOMENT_Y_COEFFICIENT: - AdjExt = "_cmy"; - break; - case MOMENT_Z_COEFFICIENT: - AdjExt = "_cmz"; - break; - case EFFICIENCY: - AdjExt = "_eff"; - break; - case EQUIVALENT_AREA: - AdjExt = "_ea"; - break; - case NEARFIELD_PRESSURE: - AdjExt = "_nfp"; - break; - case FORCE_X_COEFFICIENT: - AdjExt = "_cfx"; - break; - case FORCE_Y_COEFFICIENT: - AdjExt = "_cfy"; - break; - case FORCE_Z_COEFFICIENT: - AdjExt = "_cfz"; - break; - case THRUST_COEFFICIENT: - AdjExt = "_ct"; - break; - case TORQUE_COEFFICIENT: - AdjExt = "_cq"; - break; - case TOTAL_HEATFLUX: - AdjExt = "_totheat"; - break; - case MAXIMUM_HEATFLUX: - AdjExt = "_maxheat"; - break; - case AVG_TEMPERATURE: - AdjExt = "_avtp"; - break; - case FIGURE_OF_MERIT: - AdjExt = "_merit"; - break; - case BUFFET_SENSOR: - AdjExt = "_buffet"; - break; - case SURFACE_TOTAL_PRESSURE: - AdjExt = "_pt"; - break; - case SURFACE_STATIC_PRESSURE: - AdjExt = "_pe"; - break; - case SURFACE_STATIC_TEMPERATURE: - AdjExt = "_T"; - break; - case SURFACE_MASSFLOW: - AdjExt = "_mfr"; - break; - case SURFACE_UNIFORMITY: - AdjExt = "_uniform"; - break; - case SURFACE_SECONDARY: - AdjExt = "_second"; - break; - case SURFACE_MOM_DISTORTION: - AdjExt = "_distort"; - break; - case SURFACE_SECOND_OVER_UNIFORM: - AdjExt = "_sou"; - break; - case SURFACE_PRESSURE_DROP: - AdjExt = "_dp"; - break; - case SURFACE_SPECIES_0: - AdjExt = "_avgspec0"; - break; - case SURFACE_SPECIES_VARIANCE: - AdjExt = "_specvar"; - break; - case SURFACE_MACH: - AdjExt = "_mach"; - break; - case CUSTOM_OBJFUNC: - AdjExt = "_custom"; - break; - case REFERENCE_GEOMETRY: - AdjExt = "_refgeom"; - break; - case REFERENCE_NODE: - AdjExt = "_refnode"; - break; - case VOLUME_FRACTION: - AdjExt = "_volfrac"; - break; - case TOPOL_DISCRETENESS: - AdjExt = "_topdisc"; - break; - case TOPOL_COMPLIANCE: - AdjExt = "_topcomp"; - break; - case STRESS_PENALTY: - AdjExt = "_stress"; - break; + case DRAG_COEFFICIENT: AdjExt = "_cd"; break; + case LIFT_COEFFICIENT: AdjExt = "_cl"; break; + case SIDEFORCE_COEFFICIENT: AdjExt = "_csf"; break; + case INVERSE_DESIGN_PRESSURE: AdjExt = "_invpress"; break; + case INVERSE_DESIGN_HEATFLUX: AdjExt = "_invheat"; break; + case MOMENT_X_COEFFICIENT: AdjExt = "_cmx"; break; + case MOMENT_Y_COEFFICIENT: AdjExt = "_cmy"; break; + case MOMENT_Z_COEFFICIENT: AdjExt = "_cmz"; break; + case EFFICIENCY: AdjExt = "_eff"; break; + case EQUIVALENT_AREA: AdjExt = "_ea"; break; + case NEARFIELD_PRESSURE: AdjExt = "_nfp"; break; + case FORCE_X_COEFFICIENT: AdjExt = "_cfx"; break; + case FORCE_Y_COEFFICIENT: AdjExt = "_cfy"; break; + case FORCE_Z_COEFFICIENT: AdjExt = "_cfz"; break; + case THRUST_COEFFICIENT: AdjExt = "_ct"; break; + case TORQUE_COEFFICIENT: AdjExt = "_cq"; break; + case TOTAL_HEATFLUX: AdjExt = "_totheat"; break; + case MAXIMUM_HEATFLUX: AdjExt = "_maxheat"; break; + case AVG_TEMPERATURE: AdjExt = "_avtp"; break; + case FIGURE_OF_MERIT: AdjExt = "_merit"; break; + case BUFFET_SENSOR: AdjExt = "_buffet"; break; + case SURFACE_TOTAL_PRESSURE: AdjExt = "_pt"; break; + case SURFACE_STATIC_PRESSURE: AdjExt = "_pe"; break; + case SURFACE_STATIC_TEMPERATURE: AdjExt = "_T"; break; + case SURFACE_MASSFLOW: AdjExt = "_mfr"; break; + case SURFACE_UNIFORMITY: AdjExt = "_uniform"; break; + case SURFACE_SECONDARY: AdjExt = "_second"; break; + case SURFACE_MOM_DISTORTION: AdjExt = "_distort"; break; + case SURFACE_SECOND_OVER_UNIFORM: AdjExt = "_sou"; break; + case SURFACE_PRESSURE_DROP: AdjExt = "_dp"; break; + case SURFACE_SPECIES_0: AdjExt = "_avgspec0"; break; + case SURFACE_SPECIES_VARIANCE: AdjExt = "_specvar"; break; + case SURFACE_MACH: AdjExt = "_mach"; break; + case CUSTOM_OBJFUNC: AdjExt = "_custom"; break; + case REFERENCE_GEOMETRY: AdjExt = "_refgeom"; break; + case REFERENCE_NODE: AdjExt = "_refnode"; break; + case VOLUME_FRACTION: AdjExt = "_volfrac"; break; + case TOPOL_DISCRETENESS: AdjExt = "_topdisc"; break; + case TOPOL_COMPLIANCE: AdjExt = "_topcomp"; break; + case STRESS_PENALTY: AdjExt = "_stress"; break; } - } else { + } + else{ AdjExt = "_combo"; } Filename.append(AdjExt); /*--- Lastly, add the .dat extension ---*/ Filename.append(".dat"); + } return Filename; } unsigned short CConfig::GetContainerPosition(unsigned short val_eqsystem) { + switch (val_eqsystem) { - case RUNTIME_FLOW_SYS: - return FLOW_SOL; - case RUNTIME_TURB_SYS: - return TURB_SOL; - case RUNTIME_TRANS_SYS: - return TRANS_SOL; - case RUNTIME_SPECIES_SYS: - return SPECIES_SOL; - case RUNTIME_HEAT_SYS: - return HEAT_SOL; - case RUNTIME_FEA_SYS: - return FEA_SOL; - case RUNTIME_ADJFLOW_SYS: - return ADJFLOW_SOL; - case RUNTIME_ADJTURB_SYS: - return ADJTURB_SOL; - case RUNTIME_ADJSPECIES_SYS: - return ADJSPECIES_SOL; - case RUNTIME_ADJFEA_SYS: - return ADJFEA_SOL; - case RUNTIME_RADIATION_SYS: - return RAD_SOL; - case RUNTIME_MULTIGRID_SYS: - return 0; + case RUNTIME_FLOW_SYS: return FLOW_SOL; + case RUNTIME_TURB_SYS: return TURB_SOL; + case RUNTIME_TRANS_SYS: return TRANS_SOL; + case RUNTIME_SPECIES_SYS: return SPECIES_SOL; + case RUNTIME_HEAT_SYS: return HEAT_SOL; + case RUNTIME_FEA_SYS: return FEA_SOL; + case RUNTIME_ADJFLOW_SYS: return ADJFLOW_SOL; + case RUNTIME_ADJTURB_SYS: return ADJTURB_SOL; + case RUNTIME_ADJSPECIES_SYS:return ADJSPECIES_SOL; + case RUNTIME_ADJFEA_SYS: return ADJFEA_SOL; + case RUNTIME_RADIATION_SYS: return RAD_SOL; + case RUNTIME_MULTIGRID_SYS: return 0; } return 0; } -void CConfig::SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, CENTERED val_kind_centered, - UPWIND val_kind_upwind, LIMITER val_kind_slopelimit, bool val_muscl, +void CConfig::SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, + CENTERED val_kind_centered, UPWIND val_kind_upwind, + LIMITER val_kind_slopelimit, bool val_muscl, unsigned short val_kind_fem) { Kind_ConvNumScheme = val_kind_convnumscheme; Kind_Centered = val_kind_centered; @@ -9117,19 +8361,23 @@ void CConfig::SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, CENTE Kind_FEM = val_kind_fem; Kind_SlopeLimit = val_kind_slopelimit; MUSCL = val_muscl; + } -void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, unsigned short val_system) { +void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, + unsigned short val_system) { + /*--- Set the simulation global time ---*/ - Current_UnstTime = static_cast(TimeIter) * Delta_UnstTime; - Current_UnstTimeND = static_cast(TimeIter) * Delta_UnstTimeND; + Current_UnstTime = static_cast(TimeIter)*Delta_UnstTime; + Current_UnstTimeND = static_cast(TimeIter)*Delta_UnstTimeND; /*--- Set the solver methods ---*/ auto SetFlowParam = [&]() { if (val_system == RUNTIME_FLOW_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Flow, Kind_Centered_Flow, Kind_Upwind_Flow, Kind_SlopeLimit_Flow, + SetKind_ConvNumScheme(Kind_ConvNumScheme_Flow, Kind_Centered_Flow, + Kind_Upwind_Flow, Kind_SlopeLimit_Flow, MUSCL_Flow, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Flow); } @@ -9137,7 +8385,8 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, unsigned short val_system) auto SetTurbParam = [&]() { if (val_system == RUNTIME_TURB_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, Kind_Upwind_Turb, Kind_SlopeLimit_Turb, + SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, + Kind_Upwind_Turb, Kind_SlopeLimit_Turb, MUSCL_Turb, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Turb); } @@ -9145,56 +8394,51 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, unsigned short val_system) auto SetHeatParam = [&]() { if (val_system == RUNTIME_HEAT_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Heat, Kind_Centered_Heat, Kind_Upwind_Heat, Kind_SlopeLimit_Heat, - MUSCL_Heat, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_Heat, Kind_Centered_Heat, + Kind_Upwind_Heat, Kind_SlopeLimit_Heat, MUSCL_Heat, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Heat); } }; auto SetSpeciesParam = [&]() { if (val_system == RUNTIME_SPECIES_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Species, Kind_Centered_Species, Kind_Upwind_Species, - Kind_SlopeLimit_Species, MUSCL_Species, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_Species, Kind_Centered_Species, + Kind_Upwind_Species, Kind_SlopeLimit_Species, + MUSCL_Species, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Species); } }; auto SetAdjFlowParam = [&]() { if (val_system == RUNTIME_ADJFLOW_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, Kind_Upwind_AdjFlow, - Kind_SlopeLimit_AdjFlow, MUSCL_AdjFlow, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, + Kind_Upwind_AdjFlow, Kind_SlopeLimit_AdjFlow, + MUSCL_AdjFlow, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_AdjFlow); } }; switch (val_solver) { - case MAIN_SOLVER::EULER: - case MAIN_SOLVER::INC_EULER: - case MAIN_SOLVER::NEMO_EULER: - case MAIN_SOLVER::DISC_ADJ_EULER: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: + case MAIN_SOLVER::EULER: case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::NEMO_EULER: + case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_INC_EULER: SetFlowParam(); break; - case MAIN_SOLVER::NAVIER_STOKES: - case MAIN_SOLVER::INC_NAVIER_STOKES: - case MAIN_SOLVER::NEMO_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: + case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::NEMO_NAVIER_STOKES: + case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: SetFlowParam(); SetSpeciesParam(); SetHeatParam(); break; - case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_RANS: + case MAIN_SOLVER::RANS: case MAIN_SOLVER::INC_RANS: + case MAIN_SOLVER::DISC_ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_INC_RANS: SetFlowParam(); SetTurbParam(); SetSpeciesParam(); SetHeatParam(); if (val_system == RUNTIME_TRANS_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, Kind_Upwind_Turb, Kind_SlopeLimit_Turb, + SetKind_ConvNumScheme(Kind_ConvNumScheme_Turb, Kind_Centered_Turb, + Kind_Upwind_Turb, Kind_SlopeLimit_Turb, MUSCL_Turb, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_Turb); } @@ -9207,7 +8451,8 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, unsigned short val_system) case MAIN_SOLVER::DISC_ADJ_FEM_NS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: if (val_system == RUNTIME_FLOW_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_FEM_Flow, Kind_Centered_Flow, Kind_Upwind_Flow, Kind_SlopeLimit_Flow, + SetKind_ConvNumScheme(Kind_ConvNumScheme_FEM_Flow, Kind_Centered_Flow, + Kind_Upwind_Flow, Kind_SlopeLimit_Flow, MUSCL_Flow, Kind_FEM_Flow); SetKind_TimeIntScheme(Kind_TimeIntScheme_FEM_Flow); } @@ -9223,8 +8468,9 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, unsigned short val_system) SetAdjFlowParam(); if (val_system == RUNTIME_ADJTURB_SYS) { - SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjTurb, Kind_Centered_AdjTurb, Kind_Upwind_AdjTurb, - Kind_SlopeLimit_AdjTurb, MUSCL_AdjTurb, NONE); + SetKind_ConvNumScheme(Kind_ConvNumScheme_AdjTurb, Kind_Centered_AdjTurb, + Kind_Upwind_AdjTurb, Kind_SlopeLimit_AdjTurb, + MUSCL_AdjTurb, NONE); SetKind_TimeIntScheme(Kind_TimeIntScheme_AdjTurb); } break; @@ -9291,115 +8537,113 @@ unsigned short CConfig::GetMarker_Periodic_Donor(const string& val_marker) const su2double CConfig::GetActDisk_NetThrust(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_NetThrust[iMarker_ActDisk]; } su2double CConfig::GetActDisk_Power(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_Power[iMarker_ActDisk]; } su2double CConfig::GetActDisk_MassFlow(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_MassFlow[iMarker_ActDisk]; } su2double CConfig::GetActDisk_Mach(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_Mach[iMarker_ActDisk]; } su2double CConfig::GetActDisk_Force(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_Force[iMarker_ActDisk]; } su2double CConfig::GetActDisk_BCThrust(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_BCThrust[iMarker_ActDisk]; } su2double CConfig::GetActDisk_BCThrust_Old(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_BCThrust_Old[iMarker_ActDisk]; } void CConfig::SetActDisk_BCThrust(const string& val_marker, su2double val_actdisk_bcthrust) { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; ActDisk_BCThrust[iMarker_ActDisk] = val_actdisk_bcthrust; } void CConfig::SetActDisk_BCThrust_Old(const string& val_marker, su2double val_actdisk_bcthrust_old) { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; ActDisk_BCThrust_Old[iMarker_ActDisk] = val_actdisk_bcthrust_old; } su2double CConfig::GetActDisk_Area(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_Area[iMarker_ActDisk]; } su2double CConfig::GetActDisk_ReverseMassFlow(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_ReverseMassFlow[iMarker_ActDisk]; } su2double CConfig::GetActDisk_PressJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_PressJump[iMarker_ActDisk][val_value]; } su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; - return ActDisk_TempJump[iMarker_ActDisk][val_value]; - ; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDisk_TempJump[iMarker_ActDisk][val_value];; } su2double CConfig::GetActDisk_Omega(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) - break; - return ActDisk_Omega[iMarker_ActDisk][val_value]; - ; + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDisk_Omega[iMarker_ActDisk][val_value];; } su2double CConfig::GetOutlet_MassFlow(const string& val_marker) const { @@ -9458,21 +8702,24 @@ unsigned short CConfig::GetMarker_CfgFile_EngineExhaust(const string& val_marker bool CConfig::GetVolumetric_Movement() const { bool volumetric_movement = false; - if (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION) || - GetSurface_Movement(EXTERNAL) || GetSurface_Movement(EXTERNAL_ROTATION)) { + if (GetSurface_Movement(AEROELASTIC) || + GetSurface_Movement(AEROELASTIC_RIGID_MOTION)|| + GetSurface_Movement(EXTERNAL) || + GetSurface_Movement(EXTERNAL_ROTATION)){ volumetric_movement = true; } - if (Kind_SU2 == SU2_COMPONENT::SU2_DEF || Kind_SU2 == SU2_COMPONENT::SU2_DOT || DirectDiff) { - volumetric_movement = true; - } + if (Kind_SU2 == SU2_COMPONENT::SU2_DEF || + Kind_SU2 == SU2_COMPONENT::SU2_DOT || + DirectDiff) + { volumetric_movement = true;} return volumetric_movement; } bool CConfig::GetSurface_Movement(unsigned short kind_movement) const { - for (unsigned short iMarkerMoving = 0; iMarkerMoving < nKind_SurfaceMovement; iMarkerMoving++) { - if (Kind_SurfaceMovement[iMarkerMoving] == kind_movement) { + for (unsigned short iMarkerMoving = 0; iMarkerMoving < nKind_SurfaceMovement; iMarkerMoving++){ + if (Kind_SurfaceMovement[iMarkerMoving] == kind_movement){ return true; } } @@ -9574,7 +8821,8 @@ su2double CConfig::GetInlet_Ptotal(const string& val_marker) const { void CConfig::SetInlet_Ptotal(su2double val_pressure, const string& val_marker) { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) - if (Marker_Inlet[iMarker_Inlet] == val_marker) Inlet_Ptotal[iMarker_Inlet] = val_pressure; + if (Marker_Inlet[iMarker_Inlet] == val_marker) + Inlet_Ptotal[iMarker_Inlet] = val_pressure; } const su2double* CConfig::GetInlet_FlowDir(const string& val_marker) const { @@ -9633,7 +8881,8 @@ su2double CConfig::GetOutlet_Pressure(const string& val_marker) const { void CConfig::SetOutlet_Pressure(su2double val_pressure, const string& val_marker) { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) - if (Marker_Outlet[iMarker_Outlet] == val_marker) Outlet_Pressure[iMarker_Outlet] = val_pressure; + if (Marker_Outlet[iMarker_Outlet] == val_marker) + Outlet_Pressure[iMarker_Outlet] = val_pressure; } su2double CConfig::GetRiemann_Var1(const string& val_marker) const { @@ -9716,31 +8965,29 @@ unsigned short CConfig::GetKind_Data_Giles(const string& val_marker) const { su2double CConfig::GetPressureOut_BC() const { unsigned short iMarker_BC; su2double pres_out = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { - if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || - Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM) { + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ + if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM ){ pres_out = Giles_Var1[iMarker_BC]; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { - if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM) { + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ + if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM){ pres_out = Riemann_Var1[iMarker_BC]; } } - return pres_out / Pressure_Ref; + return pres_out/Pressure_Ref; } void CConfig::SetPressureOut_BC(su2double val_press) { unsigned short iMarker_BC; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { - if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || - Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM) { - Giles_Var1[iMarker_BC] = val_press * Pressure_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ + if (Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Giles[iMarker_BC] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker_BC] == RADIAL_EQUILIBRIUM ){ + Giles_Var1[iMarker_BC] = val_press*Pressure_Ref; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { - if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM) { - Riemann_Var1[iMarker_BC] = val_press * Pressure_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ + if (Kind_Data_Riemann[iMarker_BC] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker_BC] == RADIAL_EQUILIBRIUM){ + Riemann_Var1[iMarker_BC] = val_press*Pressure_Ref; } } } @@ -9748,159 +8995,175 @@ void CConfig::SetPressureOut_BC(su2double val_press) { su2double CConfig::GetTotalPressureIn_BC() const { unsigned short iMarker_BC; su2double tot_pres_in = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ tot_pres_in = Giles_Var1[iMarker_BC]; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ tot_pres_in = Riemann_Var1[iMarker_BC]; } } - if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ tot_pres_in = Inlet_Ptotal[0]; } - return tot_pres_in / Pressure_Ref; + return tot_pres_in/Pressure_Ref; } su2double CConfig::GetTotalTemperatureIn_BC() const { unsigned short iMarker_BC; su2double tot_temp_in = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ tot_temp_in = Giles_Var2[iMarker_BC]; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ tot_temp_in = Riemann_Var2[iMarker_BC]; } } - if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ tot_temp_in = Inlet_Ttotal[0]; } - return tot_temp_in / Temperature_Ref; + return tot_temp_in/Temperature_Ref; } void CConfig::SetTotalTemperatureIn_BC(su2double val_temp) { unsigned short iMarker_BC; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { - Giles_Var2[iMarker_BC] = val_temp * Temperature_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ + Giles_Var2[iMarker_BC] = val_temp*Temperature_Ref; } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { - Riemann_Var2[iMarker_BC] = val_temp * Temperature_Ref; + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ + Riemann_Var2[iMarker_BC] = val_temp*Temperature_Ref; } } - if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { - Inlet_Ttotal[0] = val_temp * Temperature_Ref; + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ + Inlet_Ttotal[0] = val_temp*Temperature_Ref; } } su2double CConfig::GetFlowAngleIn_BC() const { unsigned short iMarker_BC; su2double alpha_in = 0.0; - for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++) { - if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D) { - alpha_in = atan(Giles_FlowDir[iMarker_BC][1] / Giles_FlowDir[iMarker_BC][0]); + for (iMarker_BC = 0; iMarker_BC < nMarker_Giles; iMarker_BC++){ + if (Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT || Kind_Data_Giles[iMarker_BC] == TOTAL_CONDITIONS_PT_1D){ + alpha_in = atan(Giles_FlowDir[iMarker_BC][1]/Giles_FlowDir[iMarker_BC][0]); } } - for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++) { - if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT) { - alpha_in = atan(Riemann_FlowDir[iMarker_BC][1] / Riemann_FlowDir[iMarker_BC][0]); + for (iMarker_BC = 0; iMarker_BC < nMarker_Riemann; iMarker_BC++){ + if (Kind_Data_Riemann[iMarker_BC] == TOTAL_CONDITIONS_PT ){ + alpha_in = atan(Riemann_FlowDir[iMarker_BC][1]/Riemann_FlowDir[iMarker_BC][0]); } } - if (nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS) { - alpha_in = atan(Inlet_FlowDir[0][1] / Inlet_FlowDir[0][0]); + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ + alpha_in = atan(Inlet_FlowDir[0][1]/Inlet_FlowDir[0][0]); } return alpha_in; } su2double CConfig::GetIncInlet_BC() const { + su2double val_out = 0.0; if (nMarker_Inlet > 0) { if (Kind_Inc_Inlet[0] == INLET_TYPE::VELOCITY_INLET) - val_out = Inlet_Ptotal[0] / Velocity_Ref; + val_out = Inlet_Ptotal[0]/Velocity_Ref; else if (Kind_Inc_Inlet[0] == INLET_TYPE::PRESSURE_INLET) - val_out = Inlet_Ptotal[0] / Pressure_Ref; + val_out = Inlet_Ptotal[0]/Pressure_Ref; } return val_out; } void CConfig::SetIncInlet_BC(su2double val_in) { + if (nMarker_Inlet > 0) { if (Kind_Inc_Inlet[0] == INLET_TYPE::VELOCITY_INLET) - Inlet_Ptotal[0] = val_in * Velocity_Ref; + Inlet_Ptotal[0] = val_in*Velocity_Ref; else if (Kind_Inc_Inlet[0] == INLET_TYPE::PRESSURE_INLET) - Inlet_Ptotal[0] = val_in * Pressure_Ref; + Inlet_Ptotal[0] = val_in*Pressure_Ref; } } su2double CConfig::GetIncTemperature_BC() const { + su2double val_out = 0.0; - if (nMarker_Inlet > 0) val_out = Inlet_Ttotal[0] / Temperature_Ref; + if (nMarker_Inlet > 0) + val_out = Inlet_Ttotal[0]/Temperature_Ref; return val_out; } void CConfig::SetIncTemperature_BC(su2double val_temperature) { - if (nMarker_Inlet > 0) Inlet_Ttotal[0] = val_temperature * Temperature_Ref; + if (nMarker_Inlet > 0) + Inlet_Ttotal[0] = val_temperature*Temperature_Ref; } su2double CConfig::GetIncPressureOut_BC() const { + su2double pressure_out = 0.0; - if (nMarker_FarField > 0) { + if (nMarker_FarField > 0){ pressure_out = Pressure_FreeStreamND; } else if (nMarker_Outlet > 0) { - pressure_out = Outlet_Pressure[0] / Pressure_Ref; + pressure_out = Outlet_Pressure[0]/Pressure_Ref; } return pressure_out; } void CConfig::SetIncPressureOut_BC(su2double val_pressure) { - if (nMarker_FarField > 0) { + + if (nMarker_FarField > 0){ Pressure_FreeStreamND = val_pressure; } else if (nMarker_Outlet > 0) { - Outlet_Pressure[0] = val_pressure * Pressure_Ref; + Outlet_Pressure[0] = val_pressure*Pressure_Ref; } + } su2double CConfig::GetIsothermal_Temperature(const string& val_marker) const { + for (unsigned short iMarker_Isothermal = 0; iMarker_Isothermal < nMarker_Isothermal; iMarker_Isothermal++) - if (Marker_Isothermal[iMarker_Isothermal] == val_marker) return Isothermal_Temperature[iMarker_Isothermal]; + if (Marker_Isothermal[iMarker_Isothermal] == val_marker) + return Isothermal_Temperature[iMarker_Isothermal]; return Isothermal_Temperature[0]; } su2double CConfig::GetWall_HeatFlux(const string& val_marker) const { + for (unsigned short iMarker_HeatFlux = 0; iMarker_HeatFlux < nMarker_HeatFlux; iMarker_HeatFlux++) - if (Marker_HeatFlux[iMarker_HeatFlux] == val_marker) return Heat_Flux[iMarker_HeatFlux]; + if (Marker_HeatFlux[iMarker_HeatFlux] == val_marker) + return Heat_Flux[iMarker_HeatFlux]; return Heat_Flux[0]; } su2double CConfig::GetWall_HeatTransfer_Coefficient(const string& val_marker) const { + for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) - if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) return HeatTransfer_Coeff[iMarker_HeatTransfer]; + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) + return HeatTransfer_Coeff[iMarker_HeatTransfer]; return HeatTransfer_Coeff[0]; } su2double CConfig::GetWall_HeatTransfer_Temperature(const string& val_marker) const { + for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) - if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) return HeatTransfer_WallTemp[iMarker_HeatTransfer]; + if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) + return HeatTransfer_WallTemp[iMarker_HeatTransfer]; return HeatTransfer_WallTemp[0]; } @@ -9917,10 +9180,11 @@ pair CConfig::GetWallRoughnessProperties(const string& val } WALL_FUNCTIONS CConfig::GetWallFunction_Treatment(const string& val_marker) const { + WALL_FUNCTIONS WallFunction = WALL_FUNCTIONS::NONE; - for (unsigned short iMarker = 0; iMarker < nMarker_WallFunctions; iMarker++) { - if (Marker_WallFunctions[iMarker] == val_marker) { + for(unsigned short iMarker=0; iMarker 0) { @@ -10275,6 +9540,7 @@ su2double CConfig::GetWall_Emissivity(const string& val_marker) const { } bool CConfig::GetMarker_StrongBC(const string& val_marker) const { + unsigned short iMarker_StrongBC = 0; for (iMarker_StrongBC = 0; iMarker_StrongBC < nMarker_StrongBC; iMarker_StrongBC++) @@ -10284,9 +9550,10 @@ bool CConfig::GetMarker_StrongBC(const string& val_marker) const { } short CConfig::FindInterfaceMarker(unsigned short iInterface) const { + /*--- The names of the two markers that form the interface. ---*/ - const auto& sideA = Marker_ZoneInterface[2 * iInterface]; - const auto& sideB = Marker_ZoneInterface[2 * iInterface + 1]; + const auto& sideA = Marker_ZoneInterface[2*iInterface]; + const auto& sideB = Marker_ZoneInterface[2*iInterface+1]; for (unsigned short iMarker = 0; iMarker < nMarker_All; iMarker++) { /*--- If the marker is sideA or sideB of the interface (order does not matter). ---*/ const auto& tag = Marker_All_TagBound[iMarker]; @@ -10295,13 +9562,16 @@ short CConfig::FindInterfaceMarker(unsigned short iInterface) const { return -1; } -void CConfig::Tick(double* val_start_time) { +void CConfig::Tick(double *val_start_time) { + #ifdef PROFILE *val_start_time = SU2_MPI::Wtime(); #endif + } void CConfig::Tock(double val_start_time, const string& val_function_name, int val_group_id) { + #ifdef PROFILE double val_stop_time = 0.0, val_elapsed_time = 0.0; @@ -10317,9 +9587,11 @@ void CConfig::Tock(double val_start_time, const string& val_function_name, int v Profile_ID_tp.push_back(val_group_id); #endif + } void CConfig::SetProfilingCSV() { + #ifdef PROFILE int rank = MASTER_NODE; @@ -10337,18 +9609,21 @@ void CConfig::SetProfilingCSV() { min and max values for each function. ---*/ for (unsigned int i = 0; i < Profile_Function_tp.size(); i++) { + /*--- Add the function and initialize if not already stored (the ID only needs to be stored the first time).---*/ if (Profile_Map_tp.find(Profile_Function_tp[i]) == Profile_Map_tp.end()) { - vector profile; - profile.push_back(i); - Profile_Map_tp.insert(pair >(Profile_Function_tp[i], profile)); + + vector profile; profile.push_back(i); + Profile_Map_tp.insert(pair >(Profile_Function_tp[i],profile)); } else { + /*--- This function has already been added, so simply increment the number of calls and total time for this function. ---*/ Profile_Map_tp[Profile_Function_tp[i]].push_back(i); + } } @@ -10356,31 +9631,33 @@ void CConfig::SetProfilingCSV() { each function and store the min/max times. ---*/ int map_size = 0; - for (map >::iterator it = Profile_Map_tp.begin(); it != Profile_Map_tp.end(); ++it) { + for (map >::iterator it=Profile_Map_tp.begin(); it!=Profile_Map_tp.end(); ++it) { map_size++; } /*--- Allocate and initialize memory ---*/ double *l_min_red = NULL, *l_max_red = NULL, *l_tot_red = NULL, *l_avg_red = NULL; - int* n_calls_red = NULL; + int *n_calls_red = NULL; double* l_min = new double[map_size]; double* l_max = new double[map_size]; double* l_tot = new double[map_size]; double* l_avg = new double[map_size]; - int* n_calls = new int[map_size]; - for (int i = 0; i < map_size; i++) { - l_min[i] = 1e10; - l_max[i] = 0.0; - l_tot[i] = 0.0; - l_avg[i] = 0.0; + int* n_calls = new int[map_size]; + for (int i = 0; i < map_size; i++) + { + l_min[i] = 1e10; + l_max[i] = 0.0; + l_tot[i] = 0.0; + l_avg[i] = 0.0; n_calls[i] = 0; } /*--- Collect the info for each function from the current rank ---*/ int func_counter = 0; - for (map >::iterator it = Profile_Map_tp.begin(); it != Profile_Map_tp.end(); ++it) { + for (map >::iterator it=Profile_Map_tp.begin(); it!=Profile_Map_tp.end(); ++it) { + for (unsigned int i = 0; i < (it->second).size(); i++) { n_calls[func_counter]++; l_tot[func_counter] += Profile_Time_tp[(it->second)[i]]; @@ -10388,8 +9665,9 @@ void CConfig::SetProfilingCSV() { l_min[func_counter] = Profile_Time_tp[(it->second)[i]]; if (Profile_Time_tp[(it->second)[i]] > l_max[func_counter]) l_max[func_counter] = Profile_Time_tp[(it->second)[i]]; + } - l_avg[func_counter] = l_tot[func_counter] / ((double)n_calls[func_counter]); + l_avg[func_counter] = l_tot[func_counter]/((double)n_calls[func_counter]); func_counter++; } @@ -10400,7 +9678,7 @@ void CConfig::SetProfilingCSV() { l_max_red = new double[map_size]; l_tot_red = new double[map_size]; l_avg_red = new double[map_size]; - n_calls_red = new int[map_size]; + n_calls_red = new int[map_size]; } #ifdef HAVE_MPI @@ -10410,22 +9688,23 @@ void CConfig::SetProfilingCSV() { MPI_Reduce(l_min, l_min_red, map_size, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); MPI_Reduce(l_max, l_max_red, map_size, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); #else - memcpy(n_calls_red, n_calls, map_size * sizeof(int)); - memcpy(l_tot_red, l_tot, map_size * sizeof(double)); - memcpy(l_avg_red, l_avg, map_size * sizeof(double)); - memcpy(l_min_red, l_min, map_size * sizeof(double)); - memcpy(l_max_red, l_max, map_size * sizeof(double)); + memcpy(n_calls_red, n_calls, map_size*sizeof(int)); + memcpy(l_tot_red, l_tot, map_size*sizeof(double)); + memcpy(l_avg_red, l_avg, map_size*sizeof(double)); + memcpy(l_min_red, l_min, map_size*sizeof(double)); + memcpy(l_max_red, l_max, map_size*sizeof(double)); #endif /*--- The master rank will write the file ---*/ if (rank == MASTER_NODE) { + /*--- Take averages over all ranks on the master ---*/ for (int i = 0; i < map_size; i++) { - l_tot_red[i] = l_tot_red[i] / (double)size; - l_avg_red[i] = l_avg_red[i] / (double)size; - n_calls_red[i] = n_calls_red[i] / size; + l_tot_red[i] = l_tot_red[i]/(double)size; + l_avg_red[i] = l_avg_red[i]/(double)size; + n_calls_red[i] = n_calls_red[i]/size; } /*--- Now write a CSV file with the processed results ---*/ @@ -10436,40 +9715,40 @@ void CConfig::SetProfilingCSV() { /*--- Create the CSV header ---*/ - Profile_File << "\"Function_Name\", \"N_Calls\", \"Avg_Total_Time\", \"Avg_Time\", \"Min_Time\", \"Max_Time\", " - "\"Function_ID\"" - << endl; + Profile_File << "\"Function_Name\", \"N_Calls\", \"Avg_Total_Time\", \"Avg_Time\", \"Min_Time\", \"Max_Time\", \"Function_ID\"" << endl; /*--- Loop through the map and write the results to the file ---*/ func_counter = 0; - for (map >::iterator it = Profile_Map_tp.begin(); it != Profile_Map_tp.end(); ++it) { - Profile_File << scientific << it->first << ", " << n_calls_red[func_counter] << ", " << l_tot_red[func_counter] - << ", " << l_avg_red[func_counter] << ", " << l_min_red[func_counter] << ", " - << l_max_red[func_counter] << ", " << (int)Profile_ID_tp[(it->second)[0]] << endl; + for (map >::iterator it=Profile_Map_tp.begin(); it!=Profile_Map_tp.end(); ++it) { + + Profile_File << scientific << it->first << ", " << n_calls_red[func_counter] << ", " << l_tot_red[func_counter] << ", " << l_avg_red[func_counter] << ", " << l_min_red[func_counter] << ", " << l_max_red[func_counter] << ", " << (int)Profile_ID_tp[(it->second)[0]] << endl; func_counter++; } Profile_File.close(); + } - delete[] l_min; - delete[] l_max; - delete[] l_avg; - delete[] l_tot; - delete[] n_calls; + delete [] l_min; + delete [] l_max; + delete [] l_avg; + delete [] l_tot; + delete [] n_calls; if (rank == MASTER_NODE) { - delete[] l_min_red; - delete[] l_max_red; - delete[] l_avg_red; - delete[] l_tot_red; - delete[] n_calls_red; + delete [] l_min_red; + delete [] l_max_red; + delete [] l_avg_red; + delete [] l_tot_red; + delete [] n_calls_red; } #endif + } -void CConfig::GEMM_Tick(double* val_start_time) const { +void CConfig::GEMM_Tick(double *val_start_time) const { + #ifdef PROFILE #ifdef HAVE_MKL @@ -10479,9 +9758,11 @@ void CConfig::GEMM_Tick(double* val_start_time) const { #endif #endif + } void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) const { + #ifdef PROFILE /* Determine the timing value. The actual function called depends on @@ -10502,7 +9783,8 @@ void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) const { CLong3T MNK(M, N, K); map::iterator MI = GEMM_Profile_MNK.find(MNK); - if (MI == GEMM_Profile_MNK.end()) { + if(MI == GEMM_Profile_MNK.end()) { + /* Entry is not present yet. Create it. */ const int ind = GEMM_Profile_MNK.size(); GEMM_Profile_MNK[MNK] = ind; @@ -10511,20 +9793,24 @@ void CConfig::GEMM_Tock(double val_start_time, int M, int N, int K) const { GEMM_Profile_TotTime.push_back(val_elapsed_time); GEMM_Profile_MinTime.push_back(val_elapsed_time); GEMM_Profile_MaxTime.push_back(val_elapsed_time); - } else { + } + else { + /* Entry is already present. Determine its index in the map and update the corresponding vectors. */ const int ind = MI->second; ++GEMM_Profile_NCalls[ind]; GEMM_Profile_TotTime[ind] += val_elapsed_time; - GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], val_elapsed_time); - GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], val_elapsed_time); + GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], val_elapsed_time); + GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], val_elapsed_time); } #endif + } void CConfig::GEMMProfilingCSV() { + #ifdef PROFILE /* Initialize the rank to the master node. */ @@ -10538,9 +9824,11 @@ void CConfig::GEMMProfilingCSV() { SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); /* Check for the master node. */ - if (rank == MASTER_NODE) { + if(rank == MASTER_NODE) { + /* Master node. Loop over the other ranks to receive their data. */ - for (int proc = 1; proc < size; ++proc) { + for(int proc=1; proc recvBufNCalls(nEntries); + vector recvBufNCalls(nEntries); vector recvBufTotTime(nEntries); vector recvBufMinTime(nEntries); vector recvBufMaxTime(nEntries); - vector recvBufMNK(3 * nEntries); - - SU2_MPI::Recv(recvBufNCalls.data(), recvBufNCalls.size(), MPI_LONG, proc, 0, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufTotTime.data(), recvBufTotTime.size(), MPI_DOUBLE, proc, 1, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufMinTime.data(), recvBufMinTime.size(), MPI_DOUBLE, proc, 2, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufMaxTime.data(), recvBufMaxTime.size(), MPI_DOUBLE, proc, 3, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(recvBufMNK.data(), recvBufMNK.size(), MPI_LONG, proc, 4, SU2_MPI::GetComm(), &status); + vector recvBufMNK(3*nEntries); + + SU2_MPI::Recv(recvBufNCalls.data(), recvBufNCalls.size(), + MPI_LONG, proc, 0, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBufTotTime.data(), recvBufTotTime.size(), + MPI_DOUBLE, proc, 1, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBufMinTime.data(), recvBufMinTime.size(), + MPI_DOUBLE, proc, 2, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBufMaxTime.data(), recvBufMaxTime.size(), + MPI_DOUBLE, proc, 3, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBufMNK.data(), recvBufMNK.size(), + MPI_LONG, proc, 4, SU2_MPI::GetComm(), &status); /* Loop over the number of entries. */ - for (int i = 0; i < nEntries; ++i) { + for(int i=0; i::iterator MI = GEMM_Profile_MNK.find(MNK); - if (MI == GEMM_Profile_MNK.end()) { + if(MI == GEMM_Profile_MNK.end()) { + /* Entry is not present yet. Create it. */ const int ind = GEMM_Profile_MNK.size(); GEMM_Profile_MNK[MNK] = ind; @@ -10579,47 +9874,58 @@ void CConfig::GEMMProfilingCSV() { GEMM_Profile_TotTime.push_back(recvBufTotTime[i]); GEMM_Profile_MinTime.push_back(recvBufMinTime[i]); GEMM_Profile_MaxTime.push_back(recvBufMaxTime[i]); - } else { + } + else { + /* Entry is already present. Determine its index in the map and update the corresponding vectors. */ const int ind = MI->second; - GEMM_Profile_NCalls[ind] += recvBufNCalls[i]; + GEMM_Profile_NCalls[ind] += recvBufNCalls[i]; GEMM_Profile_TotTime[ind] += recvBufTotTime[i]; - GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], recvBufMinTime[i]); - GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], recvBufMaxTime[i]); + GEMM_Profile_MinTime[ind] = min(GEMM_Profile_MinTime[ind], recvBufMinTime[i]); + GEMM_Profile_MaxTime[ind] = max(GEMM_Profile_MaxTime[ind], recvBufMaxTime[i]); } } } - } else { + } + else { + /* Not the master node. Create the send buffer for the MNK data. */ - vector sendBufMNK(3 * GEMM_Profile_NCalls.size()); - for (map::iterator MI = GEMM_Profile_MNK.begin(); MI != GEMM_Profile_MNK.end(); ++MI) { - const int ind = 3 * MI->second; - sendBufMNK[ind] = MI->first.long0; - sendBufMNK[ind + 1] = MI->first.long1; - sendBufMNK[ind + 2] = MI->first.long2; + vector sendBufMNK(3*GEMM_Profile_NCalls.size()); + for(map::iterator MI =GEMM_Profile_MNK.begin(); + MI!=GEMM_Profile_MNK.end(); ++MI) { + + const int ind = 3*MI->second; + sendBufMNK[ind] = MI->first.long0; + sendBufMNK[ind+1] = MI->first.long1; + sendBufMNK[ind+2] = MI->first.long2; } /* Send the data to the master node using blocking sends. */ - SU2_MPI::Send(GEMM_Profile_NCalls.data(), GEMM_Profile_NCalls.size(), MPI_LONG, MASTER_NODE, 0, SU2_MPI::GetComm()); - SU2_MPI::Send(GEMM_Profile_TotTime.data(), GEMM_Profile_TotTime.size(), MPI_DOUBLE, MASTER_NODE, 1, - SU2_MPI::GetComm()); - SU2_MPI::Send(GEMM_Profile_MinTime.data(), GEMM_Profile_MinTime.size(), MPI_DOUBLE, MASTER_NODE, 2, - SU2_MPI::GetComm()); - SU2_MPI::Send(GEMM_Profile_MaxTime.data(), GEMM_Profile_MaxTime.size(), MPI_DOUBLE, MASTER_NODE, 3, - SU2_MPI::GetComm()); - SU2_MPI::Send(sendBufMNK.data(), sendBufMNK.size(), MPI_LONG, MASTER_NODE, 4, SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_NCalls.data(), GEMM_Profile_NCalls.size(), + MPI_LONG, MASTER_NODE, 0, SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_TotTime.data(), GEMM_Profile_TotTime.size(), + MPI_DOUBLE, MASTER_NODE, 1, SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_MinTime.data(), GEMM_Profile_MinTime.size(), + MPI_DOUBLE, MASTER_NODE, 2, SU2_MPI::GetComm()); + SU2_MPI::Send(GEMM_Profile_MaxTime.data(), GEMM_Profile_MaxTime.size(), + MPI_DOUBLE, MASTER_NODE, 3, SU2_MPI::GetComm()); + SU2_MPI::Send(sendBufMNK.data(), sendBufMNK.size(), + MPI_LONG, MASTER_NODE, 4, SU2_MPI::GetComm()); } #endif /*--- The master rank will write the file ---*/ if (rank == MASTER_NODE) { + /* Store the elements of the map GEMM_Profile_MNK in vectors for post processing reasons. */ const unsigned int nItems = GEMM_Profile_MNK.size(); vector M(nItems), N(nItems), K(nItems); - for (map::iterator MI = GEMM_Profile_MNK.begin(); MI != GEMM_Profile_MNK.end(); ++MI) { + for(map::iterator MI =GEMM_Profile_MNK.begin(); + MI!=GEMM_Profile_MNK.end(); ++MI) { + const int ind = MI->second; M[ind] = MI->first.long0; N[ind] = MI->first.long1; @@ -10631,7 +9937,7 @@ void CConfig::GEMMProfilingCSV() { out this sort. */ vector > sortedTime; - for (unsigned int i = 0; i < GEMM_Profile_TotTime.size(); ++i) + for(unsigned int i=0; i >::reverse_iterator rit = sortedTime.rbegin(); rit != sortedTime.rend(); - ++rit) { + for(vector >::reverse_iterator rit =sortedTime.rbegin(); + rit!=sortedTime.rend(); ++rit) { /* Determine the original index in the profiling vectors. */ const unsigned int ind = rit->second; - const double AvgTime = GEMM_Profile_TotTime[ind] / GEMM_Profile_NCalls[ind]; - const double GFlops = 2.0e-9 * M[ind] * N[ind] * K[ind] / AvgTime; + const double AvgTime = GEMM_Profile_TotTime[ind]/GEMM_Profile_NCalls[ind]; + const double GFlops = 2.0e-9*M[ind]*N[ind]*K[ind]/AvgTime; /* Write the data. */ - Profile_File << scientific << GEMM_Profile_TotTime[ind] << ", " << GEMM_Profile_NCalls[ind] << ", " << AvgTime - << ", " << GEMM_Profile_MinTime[ind] << ", " << GEMM_Profile_MaxTime[ind] << ", " << M[ind] << ", " - << N[ind] << ", " << K[ind] << ", " << GFlops << endl; + Profile_File << scientific << GEMM_Profile_TotTime[ind] << ", " << GEMM_Profile_NCalls[ind] << ", " + << AvgTime << ", " << GEMM_Profile_MinTime[ind] << ", " << GEMM_Profile_MaxTime[ind] << ", " + << M[ind] << ", " << N[ind] << ", " << K[ind] << ", " << GFlops << endl; } /* Close the file. */ @@ -10667,73 +9971,74 @@ void CConfig::GEMMProfilingCSV() { } #endif + } -void CConfig::SetFreeStreamTurboNormal(const su2double* turboNormal) { +void CConfig::SetFreeStreamTurboNormal(const su2double* turboNormal){ + FreeStreamTurboNormal[0] = turboNormal[0]; FreeStreamTurboNormal[1] = turboNormal[1]; FreeStreamTurboNormal[2] = 0.0; + } -void CConfig::SetMultizone(const CConfig* driver_config, const CConfig* const* config_container) { - for (unsigned short iZone = 0; iZone < nZone; iZone++) { - if (config_container[iZone]->GetTime_Domain() != GetTime_Domain()) { +void CConfig::SetMultizone(const CConfig *driver_config, const CConfig* const* config_container){ + + for (unsigned short iZone = 0; iZone < nZone; iZone++){ + + if (config_container[iZone]->GetTime_Domain() != GetTime_Domain()){ SU2_MPI::Error("Option TIME_DOMAIN must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetnTime_Iter() != GetnTime_Iter()) { + if (config_container[iZone]->GetnTime_Iter() != GetnTime_Iter()){ SU2_MPI::Error("Option TIME_ITER must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetnOuter_Iter() != GetnOuter_Iter()) { + if (config_container[iZone]->GetnOuter_Iter() != GetnOuter_Iter()){ SU2_MPI::Error("Option OUTER_ITER must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetTime_Step() != GetTime_Step()) { + if (config_container[iZone]->GetTime_Step() != GetTime_Step()){ SU2_MPI::Error("Option TIME_STEP must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetUnst_CFL() != 0.0) { - SU2_MPI::Error( - "Option UNST_CFL_NUMBER cannot be used in multizone problems (must be 0)," - " use a fixed TIME_STEP instead.", - CURRENT_FUNCTION); + if (config_container[iZone]->GetUnst_CFL() != 0.0){ + SU2_MPI::Error("Option UNST_CFL_NUMBER cannot be used in multizone problems (must be 0)," + " use a fixed TIME_STEP instead.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetMultizone_Problem() != GetMultizone_Problem()) { + if (config_container[iZone]->GetMultizone_Problem() != GetMultizone_Problem()){ SU2_MPI::Error("Option MULTIZONE must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetMultizone_Mesh() != GetMultizone_Mesh()) { + if (config_container[iZone]->GetMultizone_Mesh() != GetMultizone_Mesh()){ SU2_MPI::Error("Option MULTIZONE_MESH must be the same in all zones.", CURRENT_FUNCTION); } - if (config_container[iZone]->GetWnd_Cauchy_Crit()) { + if(config_container[iZone]->GetWnd_Cauchy_Crit()){ SU2_MPI::Error("Option WINDOW_CAUCHY_CRIT must be deactivated for multizone problems.", CURRENT_FUNCTION); } } - if (driver_config->GetWnd_Cauchy_Crit()) { + if(driver_config->GetWnd_Cauchy_Crit()){ SU2_MPI::Error("Option WINDOW_CAUCHY_CRIT must be deactivated for multizone problems.", CURRENT_FUNCTION); } bool multiblockDriver = false; - for (unsigned short iFiles = 0; iFiles < driver_config->GetnVolumeOutputFiles(); iFiles++) { - if (driver_config->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK) { + for (unsigned short iFiles = 0; iFiles < driver_config->GetnVolumeOutputFiles(); iFiles++){ + if (driver_config->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK){ multiblockDriver = true; } } bool multiblockZone = false; - for (unsigned short iZone = 0; iZone < nZone; iZone++) { + for (unsigned short iZone = 0; iZone < nZone; iZone++){ multiblockZone = false; - for (unsigned short iFiles = 0; iFiles < config_container[iZone]->GetnVolumeOutputFiles(); iFiles++) { - if (config_container[iZone]->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK) { + for (unsigned short iFiles = 0; iFiles < config_container[iZone]->GetnVolumeOutputFiles(); iFiles++){ + if (config_container[iZone]->GetVolumeOutputFiles()[iFiles] == OUTPUT_TYPE::PARAVIEW_MULTIBLOCK){ multiblockZone = true; } } - if (multiblockZone != multiblockDriver) { - SU2_MPI::Error( - "To enable PARAVIEW_MULTIBLOCK output, add it to OUTPUT_FILES option in main config and\n" - "remove option from sub-config files.", - CURRENT_FUNCTION); + if (multiblockZone != multiblockDriver){ + SU2_MPI::Error("To enable PARAVIEW_MULTIBLOCK output, add it to OUTPUT_FILES option in main config and\n" + "remove option from sub-config files.", CURRENT_FUNCTION); } } /*--- Fix the Time Step for all subdomains, for the case of time-dependent problems ---*/ - if (driver_config->GetTime_Domain()) { + if (driver_config->GetTime_Domain()){ Delta_UnstTime = driver_config->GetTime_Step(); Time_Domain = true; From b668005f5d9755f007e323688f1ebf002db7d1b9 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 11 Aug 2023 09:29:41 +0200 Subject: [PATCH 029/139] remove marker_flowload --- Common/src/CConfig.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 1365f1a3cd9..77e7f40f8f8 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -7300,15 +7300,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { BoundaryTable.PrintFooter(); } - // if (nMarker_FlowLoad != 0) { - // BoundaryTable << "Flow load boundary"; - // for (iMarker_FlowLoad = 0; iMarker_FlowLoad < nMarker_FlowLoad; iMarker_FlowLoad++) { - // BoundaryTable << Marker_FlowLoad[iMarker_FlowLoad]; - // if (iMarker_FlowLoad < nMarker_FlowLoad-1) BoundaryTable << " "; - // } - // BoundaryTable.PrintFooter(); - // } - if (nMarker_Internal != 0) { BoundaryTable << "Internal boundary"; for (iMarker_Internal = 0; iMarker_Internal < nMarker_Internal; iMarker_Internal++) { From 80193b646079dccd094cbc4b5b675589fa1775b9 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Tue, 22 Aug 2023 00:06:55 +0200 Subject: [PATCH 030/139] change actdisk --- Common/src/CConfig.cpp | 2 +- Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 26c15cbd8ec..62ae961b3d0 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1650,7 +1650,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Only half engine is in the computational grid */ addBoolOption("ENGINE_HALF_MODEL", Engine_HalfModel, false); // /* DESCRIPTION: Actuator disk double surface */ - // addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); + addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); /* DESCRIPTION: Definition of the distortion rack (radial number of proves / circumferential density (degree) */ distortion[0] = 5.0; distortion[1] = 15.0; addDoubleArrayOption("DISTORTION_RACK", 2, distortion); diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp index bf91c423d05..a32c290c4d9 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp @@ -34,9 +34,9 @@ CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig* val_config, unsigned sho myZone(val_iZone), nZones(val_nZone), meshFilename(config->GetMesh_FileName()) { - actuator_disk = - (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && - ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF)))); + actuator_disk = (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && + ((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; /* Read the basic metadata and perform some basic error checks. */ From 219feae5b49ccc1e1b32eb4aa95203c776cc9d25 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Tue, 22 Aug 2023 00:09:49 +0200 Subject: [PATCH 031/139] change actdisk --- Common/include/CConfig.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index b3379b587cb..7426906bb21 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -96,6 +96,7 @@ class CConfig { *TemperatureLimits; /*!< \brief Limits for the primitive variables */ bool ActDisk_DoubleSurface; /*!< \brief actuator disk double surface */ bool Engine_HalfModel; /*!< \brief only half model is in the computational grid */ + bool ActDisk_SU2_DEF; /*!< \brief actuator disk double surface */ unsigned short nFFD_Iter; /*!< \brief Iteration for the point inversion problem. */ unsigned short FFD_Blending; /*!< \brief Kind of FFD Blending function. */ su2double FFD_Tol; /*!< \brief Tolerance in the point inversion problem. */ From 461e104c3006f704fcba84f4d056ae5b94868d1c Mon Sep 17 00:00:00 2001 From: bigfooted Date: Wed, 23 Aug 2023 12:05:34 +0200 Subject: [PATCH 032/139] add disk --- Common/include/CConfig.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 7426906bb21..268d4342479 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -5761,6 +5761,12 @@ class CConfig { */ bool GetEngine_HalfModel(void) const { return Engine_HalfModel; } + /*! + * \brief Actuator disk defined with a double surface. + * \return TRUE if the elements must be divided; otherwise FALSE. + */ + bool GetActDisk_SU2_DEF(void) const { return ActDisk_SU2_DEF; } + /*! * \brief Value of the design variable step, we use this value in design problems. * \param[in] val_dv - Number of the design variable that we want to read. From a9136c7a662e8d9bc0a0ab38f8c5dc37d91f4edd Mon Sep 17 00:00:00 2001 From: bigfooted Date: Thu, 21 Sep 2023 21:22:45 +0200 Subject: [PATCH 033/139] remove commented lined --- Common/src/CConfig.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index a31136a866f..6c2ac514097 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1458,9 +1458,6 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Boundary Markers \ingroup Config*/ /*--- Options related to various boundary markers ---*/ - /*!\brief HTP_AXIS\n DESCRIPTION: Location of the HTP axis*/ - //htp_axis[0] = 0.0; htp_axis[1] = 0.0; - //addDoubleArrayOption("HTP_AXIS", 2, htp_axis); /*!\brief MARKER_PLOTTING\n DESCRIPTION: Marker(s) of the surface in the surface flow solution file \ingroup Config*/ addStringListOption("MARKER_PLOTTING", nMarker_Plotting, Marker_Plotting); /*!\brief MARKER_MONITORING\n DESCRIPTION: Marker(s) of the surface where evaluate the non-dimensional coefficients \ingroup Config*/ @@ -1649,7 +1646,7 @@ void CConfig::SetConfig_Options() { addBoolOption("ACTDISK_DOUBLE_SURFACE", ActDisk_DoubleSurface, false); /* DESCRIPTION: Only half engine is in the computational grid */ addBoolOption("ENGINE_HALF_MODEL", Engine_HalfModel, false); - // /* DESCRIPTION: Actuator disk double surface */ + /* DESCRIPTION: Actuator disk SU2_DEF */ addBoolOption("ACTDISK_SU2_DEF", ActDisk_SU2_DEF, false); /* DESCRIPTION: Definition of the distortion rack (radial number of proves / circumferential density (degree) */ distortion[0] = 5.0; distortion[1] = 15.0; @@ -1678,9 +1675,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Load boundary marker(s) Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), i.e. primitive variables specified. */ addInletOption("MARKER_DISPLACEMENT", nMarker_Disp_Dir, Marker_Disp_Dir, Disp_Dir_Value, Disp_Dir_Multiplier, Disp_Dir); - /* DESCRIPTION: Sine load boundary marker(s) - Format: (inlet marker, load, multiplier, dir_x, dir_y, dir_z, ... ), i.e. primitive variables specified. */ - //addInletOption("MARKER_SINE_LOAD", nMarker_Load_Sine, Marker_Load_Sine, Load_Sine_Amplitude, Load_Sine_Frequency, Load_Sine_Dir); /*!\brief SINE_LOAD\n DESCRIPTION: option to apply the load as a sine*/ addBoolOption("SINE_LOAD", Sine_Load, false); sineload_coeff[0] = 0.0; sineload_coeff[1] = 0.0; sineload_coeff[2] = 0.0; @@ -1689,8 +1683,6 @@ void CConfig::SetConfig_Options() { /*!\brief RAMP_AND_RELEASE\n DESCRIPTION: release the load after applying the ramp*/ addBoolOption("RAMP_AND_RELEASE_LOAD", RampAndRelease, false); - /* DESCRIPTION: Flow load boundary marker(s) */ - //addStringDoubleListOption("MARKER_FLOWLOAD", nMarker_FlowLoad, Marker_FlowLoad, FlowLoad_Value); /* DESCRIPTION: Damping factor for engine inlet condition */ addDoubleOption("DAMP_ENGINE_INFLOW", Damp_Engine_Inflow, 0.95); /* DESCRIPTION: Damping factor for engine exhaust condition */ @@ -2347,14 +2339,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Maximum number of iterations of the linear solver for the implicit formulation */ addUnsignedLongOption("DEFORM_LINEAR_SOLVER_ITER", Deform_Linear_Solver_Iter, 1000); - /*!\par CONFIG_CATEGORY: Rotorcraft problem \ingroup Config*/ - /*--- option related to rotorcraft problems ---*/ - - // /* DESCRIPTION: MISSING ---*/ - // addDoubleOption("CYCLIC_PITCH", Cyclic_Pitch, 0.0); - // /* DESCRIPTION: MISSING ---*/ - // addDoubleOption("COLLECTIVE_PITCH", Collective_Pitch, 0.0); - /*!\par CONFIG_CATEGORY: FEM flow solver definition \ingroup Config*/ /*--- Options related to the finite element flow solver---*/ From 6e83a4b2b66af4d1a6e88e8f78f22c7120f60025 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Mon, 25 Sep 2023 07:54:02 +0200 Subject: [PATCH 034/139] remove commented line --- Common/include/CConfig.hpp | 2 -- config_template.cfg | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 3dc28e10f8d..57b58ecf01b 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -917,8 +917,6 @@ class CConfig { bool RampAndRelease; /*!< \brief option for ramp load and release */ bool Sine_Load; /*!< \brief option for sine load */ su2double Thermal_Diffusivity; /*!< \brief Thermal diffusivity used in the heat solver. */ - //su2double Cyclic_Pitch, /*!< \brief Cyclic pitch for rotorcraft simulations. */ - //Collective_Pitch; /*!< \brief Collective pitch for rotorcraft simulations. */ su2double Mach_Motion; /*!< \brief Mach number based on mesh velocity and freestream quantities. */ su2double Motion_Origin[3] = {0.0}, /*!< \brief Mesh motion origin. */ diff --git a/config_template.cfg b/config_template.cfg index 18239c801bc..19930447b06 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -2266,7 +2266,7 @@ EXTRA_HEAT_ZONE_OUTPUT= -1 % Mesh input file MESH_FILENAME= mesh_NACA0012_inv.su2 % -% Mesh input file format (SU2, CGNS, RECTANGLE, BOX) +% Mesh input file format (SU2, CGNS) MESH_FORMAT= SU2 % % List of the number of grid points in the RECTANGLE or BOX grid in the x,y,z directions. (default: (33,33,33) ). From c47a67af1af81edcac17d8075e3cadcaee41f788 Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Wed, 27 Sep 2023 09:12:16 +0530 Subject: [PATCH 035/139] Update CConfig.cpp Updated from branch feature-bem-variable-load --- Common/src/CConfig.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index f660ec5633d..122e5693349 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -920,6 +920,8 @@ void CConfig::SetPointersNull() { ActDiskOutlet_TotalPressure = nullptr; ActDiskOutlet_GrossThrust = nullptr; ActDiskOutlet_Force = nullptr; ActDiskOutlet_Power = nullptr; ActDiskOutlet_Temperature = nullptr; ActDiskOutlet_TotalTemperature = nullptr; ActDiskOutlet_MassFlow = nullptr; + ActDiskOutlet_Thrust_BEM = nullptr; + ActDiskOutlet_Torque_BEM = nullptr; ActDisk_DeltaPress = nullptr; ActDisk_DeltaTemp = nullptr; ActDisk_TotalPressRatio = nullptr; ActDisk_TotalTempRatio = nullptr; ActDisk_StaticPressRatio = nullptr; @@ -1522,6 +1524,9 @@ void CConfig::SetConfig_Options() { addActDiskOption("MARKER_ACTDISK", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); + addActDiskOption("MARKER_ACTDISK_CG", + nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, + ActDisk_XCG, ActDisk_YCG, ActDisk_ZCG); /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/ addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat")); @@ -1648,6 +1653,13 @@ void CConfig::SetConfig_Options() { addBoolOption("SUBSONIC_ENGINE", SubsonicEngine, false); /* DESCRIPTION: Actuator disk double surface */ addBoolOption("ACTDISK_DOUBLE_SURFACE", ActDisk_DoubleSurface, false); + + /* DESCRIPTION: History File Append */ + addBoolOption("HISTORY_FILE_APPEND", History_File_Append_Flag, false); + /* DESCRIPTION: Propeller_Blade_angle */ + addDoubleOption("BEM_PROP_BLADE_ANGLE", BEM_blade_angle, 23.9); + addStringOption("BEM_PROP_FILENAME", BEM_prop_filename,string("prop_geom_alfclcd_data.txt")); + /* DESCRIPTION: Only half engine is in the computational grid */ addBoolOption("ENGINE_HALF_MODEL", Engine_HalfModel, false); /* DESCRIPTION: Actuator disk double surface */ @@ -5682,6 +5694,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { ActDiskOutlet_Force = new su2double[nMarker_ActDiskOutlet] (); ActDiskOutlet_Power = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_Thrust_BEM = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_Torque_BEM = new su2double[nMarker_ActDiskOutlet] (); + for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_ActDiskOutlet[iMarker_ActDiskOutlet]; Marker_CfgFile_KindBC[iMarker_CfgFile] = ACTDISK_OUTLET; @@ -8091,6 +8106,9 @@ CConfig::~CConfig() { delete[] ActDiskOutlet_Force; delete[] ActDiskOutlet_Power; + delete[] ActDiskOutlet_Thrust_BEM; + delete[] ActDiskOutlet_Torque_BEM; + delete[] Outlet_MassFlow; delete[] Outlet_Density; delete[] Outlet_Area; @@ -8660,6 +8678,30 @@ su2double CConfig::GetActDisk_PressJump(const string& val_marker, unsigned short return ActDisk_PressJump[iMarker_ActDisk][val_value]; } +su2double CConfig::GetActDisk_XCG(string val_marker, unsigned short val_value) const { + unsigned short iMarker_ActDisk; + for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDisk_XCG[iMarker_ActDisk][val_value]; +} + +su2double CConfig::GetActDisk_YCG(string val_marker, unsigned short val_value) const { + unsigned short iMarker_ActDisk; + for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDisk_YCG[iMarker_ActDisk][val_value]; +} + +su2double CConfig::GetActDisk_ZCG(string val_marker, unsigned short val_value) const { + unsigned short iMarker_ActDisk; + for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDisk_ZCG[iMarker_ActDisk][val_value]; +} + su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) @@ -9452,6 +9494,20 @@ su2double CConfig::GetActDiskOutlet_Power(const string& val_marker) const { return ActDiskOutlet_Power[iMarker_ActDiskOutlet]; } +su2double CConfig::GetActDiskOutlet_Thrust_BEM(string val_marker) const { + unsigned short iMarker_ActDiskOutlet; + for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++) + if (Marker_ActDiskOutlet[iMarker_ActDiskOutlet] == val_marker) break; + return ActDiskOutlet_Thrust_BEM[iMarker_ActDiskOutlet]; +} + +su2double CConfig::GetActDiskOutlet_Torque_BEM(string val_marker) const { + unsigned short iMarker_ActDiskOutlet; + for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++) + if (Marker_ActDiskOutlet[iMarker_ActDiskOutlet] == val_marker) break; + return ActDiskOutlet_Torque_BEM[iMarker_ActDiskOutlet]; +} + su2double CConfig::GetActDiskInlet_Temperature(const string& val_marker) const { unsigned short iMarker_ActDiskInlet; for (iMarker_ActDiskInlet = 0; iMarker_ActDiskInlet < nMarker_ActDiskInlet; iMarker_ActDiskInlet++) From 1b9d8a57c1a11245b2016623f48a105b76d956b3 Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Wed, 27 Sep 2023 09:14:15 +0530 Subject: [PATCH 036/139] Update CEulerSolver.hpp Updated from feature-bem-variable-load --- SU2_CFD/include/solvers/CEulerSolver.hpp | 59 +++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 04b49d9c523..56d60fcf37c 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -29,6 +29,7 @@ #include "CFVMFlowSolverBase.hpp" #include "../variables/CEulerVariable.hpp" +#include "prop_defs.hpp" /*! * \class CEulerSolver @@ -65,6 +66,13 @@ class CEulerSolver : public CFVMFlowSolverBase > DonorGlobalIndex; /*!< \brief Value of the donor global index. */ vector DonorPrimVar; /*!< \brief Value of the donor variables at each boundary. */ vector > ActDisk_DeltaP; /*!< \brief Value of the Delta P. */ + vector > ActDisk_DeltaP_r; /*!< \brief Value of the Delta P. */ + vector > ActDisk_Thrust_r; /*!< \brief Value of the Delta P. */ + vector > ActDisk_Torque_r; /*!< \brief Value of the Delta P. */ + vector > ActDisk_RotRate; /*!< \brief Value of the Rotation Rate. */ + vector > ActDisk_XCG; + vector > ActDisk_YCG; + vector > ActDisk_ZCG; vector > ActDisk_DeltaT; /*!< \brief Value of the Delta T. */ su2activevector @@ -76,6 +84,10 @@ class CEulerSolver : public CFVMFlowSolverBase > ActDisk_Fx; /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */ vector > ActDisk_Fy; /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */ vector > ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fa_BEM; /*!< \brief Value of the actuator disk Axial Force per Unit Area. */ + vector > ActDisk_Fx_BEM; /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fy_BEM; /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fz_BEM; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */ su2double Total_CL_Prev = 0.0, /*!< \brief Total lift coefficient for all the boundaries (fixed lift mode). */ @@ -505,6 +517,7 @@ class CEulerSolver : public CFVMFlowSolverBase Date: Wed, 27 Sep 2023 09:15:49 +0530 Subject: [PATCH 037/139] Update CEulerSolver.cpp Updated from feature-bem-variable-load --- SU2_CFD/src/solvers/CEulerSolver.cpp | 737 +++++++++++++++++++++++++++ 1 file changed, 737 insertions(+) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e665fbe06e1..aa7946b81c2 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -194,10 +194,24 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, AllocVectorOfVectors(nVertex, ActDisk_Fy); AllocVectorOfVectors(nVertex, ActDisk_Fz); + AllocVectorOfVectors(nVertex, ActDisk_Fa_BEM); + AllocVectorOfVectors(nVertex, ActDisk_Fx_BEM); + AllocVectorOfVectors(nVertex, ActDisk_Fy_BEM); + AllocVectorOfVectors(nVertex, ActDisk_Fz_BEM); + /*--- Store the value of the Delta P at the Actuator Disk ---*/ AllocVectorOfVectors(nVertex, ActDisk_DeltaP); + AllocVectorOfVectors(nVertex, ActDisk_RotRate); + AllocVectorOfVectors(nVertex, ActDisk_XCG); + AllocVectorOfVectors(nVertex, ActDisk_YCG); + AllocVectorOfVectors(nVertex, ActDisk_ZCG); + + AllocVectorOfVectors(nVertex, ActDisk_DeltaP_r); + AllocVectorOfVectors(nVertex, ActDisk_Thrust_r); + AllocVectorOfVectors(nVertex, ActDisk_Torque_r); + /*--- Store the value of the Delta T at the Actuator Disk ---*/ AllocVectorOfVectors(nVertex, ActDisk_DeltaT); @@ -2514,6 +2528,7 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns Velocity2, Density, Area, SoundSpeed, TotalPressure, Vel_Infty2, RamDrag, TotalTemperature, VelocityJet, Vel_Infty, MaxPressure, MinPressure, MFR, InfVel2; + su2double DeltaPressure=0.0, DeltaThrust=0.0, DeltaTorque=0.0; unsigned short iMarker_Inlet, iMarker_Outlet, nMarker_Inlet, nMarker_Outlet; string Inlet_TagBound, Outlet_TagBound; su2double DeltaPress = 0.0, DeltaTemp = 0.0, TotalPressRatio = 0.0, TotalTempRatio = 0.0, StaticPressRatio = 0.0, StaticTempRatio = 0.0, @@ -2566,6 +2581,10 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns auto *Outlet_Force = new su2double [config->GetnMarker_All()](); auto *Outlet_Power = new su2double [config->GetnMarker_All()](); + auto *Outlet_DeltaP = new su2double [config->GetnMarker_All()](); + auto *Outlet_Thrust = new su2double [config->GetnMarker_All()](); + auto *Outlet_Torque = new su2double [config->GetnMarker_All()](); + /*--- Comute MassFlow, average temp, press, etc. ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -2674,6 +2693,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns TotalPressure = Pressure * pow( 1.0 + Mach * Mach * 0.5 * (Gamma - 1.0), Gamma / (Gamma - 1.0)); TotalTemperature = Temperature * (1.0 + Mach * Mach * 0.5 * (Gamma - 1.0)); VelocityJet = sqrt(Velocity2) ; + DeltaPressure = ActDisk_DeltaP_r[iMarker][iVertex]; + DeltaThrust = ActDisk_Thrust_r[iMarker][iVertex]; + DeltaTorque = ActDisk_Torque_r[iMarker][iVertex]; GrossThrust = MassFlow * VelocityJet; @@ -2685,6 +2707,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns Outlet_Area[iMarker] += Area; Outlet_GrossThrust[iMarker] += GrossThrust; Outlet_Power[iMarker] += MassFlow*Cp*TotalTemperature; + Outlet_DeltaP[iMarker] += DeltaPressure*Area; + Outlet_Thrust[iMarker] += DeltaThrust*Area; + Outlet_Torque[iMarker] += DeltaTorque*Area; su2double Outlet_ForceX = -(Pressure - Pressure_Inf)*Vector[0] -MassFlow*Velocity[0]; su2double Outlet_ForceY = -(Pressure - Pressure_Inf)*Vector[1] -MassFlow*Velocity[1]; @@ -2746,6 +2771,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns auto *Outlet_Force_Local = new su2double [nMarker_Outlet](); auto *Outlet_Power_Local = new su2double [nMarker_Outlet](); auto *Outlet_Area_Local = new su2double [nMarker_Outlet](); + auto *Outlet_DeltaP_Local = new su2double [nMarker_Outlet](); + auto *Outlet_Thrust_Local = new su2double [nMarker_Outlet](); + auto *Outlet_Torque_Local = new su2double [nMarker_Outlet](); auto *Outlet_MassFlow_Total = new su2double [nMarker_Outlet](); auto *Outlet_Pressure_Total = new su2double [nMarker_Outlet](); @@ -2756,6 +2784,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns auto *Outlet_Force_Total = new su2double [nMarker_Outlet](); auto *Outlet_Power_Total = new su2double [nMarker_Outlet](); auto *Outlet_Area_Total = new su2double [nMarker_Outlet](); + auto *Outlet_DeltaP_Total = new su2double [nMarker_Outlet](); + auto *Outlet_Thrust_Total = new su2double [nMarker_Outlet](); + auto *Outlet_Torque_Total = new su2double [nMarker_Outlet](); /*--- Copy the values to the local array for MPI ---*/ @@ -2805,6 +2836,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns Outlet_Force_Local[iMarker_Outlet] += Outlet_Force[iMarker]; Outlet_Power_Local[iMarker_Outlet] += Outlet_Power[iMarker]; Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; + Outlet_DeltaP_Local[iMarker_Outlet] += Outlet_DeltaP[iMarker]; + Outlet_Thrust_Local[iMarker_Outlet] += Outlet_Thrust[iMarker]; + Outlet_Torque_Local[iMarker_Outlet] += Outlet_Torque[iMarker]; } } @@ -2855,6 +2889,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns SU2_MPI::Allreduce(Outlet_Force_Local, Outlet_Force_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(Outlet_Power_Local, Outlet_Power_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_DeltaP_Local, Outlet_DeltaP_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Thrust_Local, Outlet_Thrust_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_Torque_Local, Outlet_Torque_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); /*--- Compute the value of the average surface temperature and pressure and set the value in the config structure for future use ---*/ @@ -2945,6 +2982,8 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns config->SetActDiskOutlet_GrossThrust(iMarker_Outlet, Outlet_GrossThrust_Total[iMarker_Outlet]); config->SetActDiskOutlet_Force(iMarker_Outlet, Outlet_Force_Total[iMarker_Outlet]); config->SetActDiskOutlet_Power(iMarker_Outlet, Outlet_Power_Total[iMarker_Outlet]); + config->SetActDiskOutlet_Thrust_BEM(iMarker_Outlet, Outlet_Thrust_Total[iMarker_Outlet]); + config->SetActDiskOutlet_Torque_BEM(iMarker_Outlet, Outlet_Torque_Total[iMarker_Outlet]); } } @@ -3299,6 +3338,7 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns cout << ". Power (HP): "; cout << setprecision(1) << Power * Ref * config->GetVelocity_Ref() / 550.0 << "." << endl; } + cout<GetActDiskOutlet_Thrust_BEM(Outlet_TagBound) <<" "<<"Torque_BEM(N-m).: "<< config->GetActDiskOutlet_Torque_BEM(Outlet_TagBound)<nblades); + fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->dia); + fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->rhub); + fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->ang0_75); +//.Skip reading next line................................................. + fgets(dummy,120,file_ang); + fgets(dummy,120,file_ang); + sscanf(dummy,"%d%d",&MAXRK,&MAXALFK); + sprop_sec-> nrad = MAXRK; + sprop_sec-> nalf = MAXALFK; +// + fgets(dummy,120,file_ang); + for(i=0; i < MAXRK; i++) + { + fgets(dummy,120,file_ang); + sscanf(dummy,"%d %lf %lf %lf",§[i],&sprop_sec->r1[i],&sprop_sec->chord[i],&sprop_sec->setangle[i]); + } +//.Read computed alpha v/s cl and cd from the file +// + for(i=0; i < MAXRK; i++) + { + fgets(dummy,128,file_ang); + for(j=0; j < MAXALFK; j++) + { + fgets(dummy,128,file_ang); + sscanf(dummy,"%lf %lf %lf",&sprop_sec->alf[j][i],&sprop_sec->cl_arr[j][i],&sprop_sec->cd_arr[j][i]); + } +} +// +} + + +void get_clcd_(int *isec,dpropeller_section_struct *sprop_sec,su2double *alpha,su2double *cl,su2double *cd) +{ + int i,salf=0; + su2double fact; + +//.interpolating values of cl and cd for given alpha..................................................... + if(*alpha >= sprop_sec->alf[salf][*isec-1] && *alpha <= sprop_sec->alf[sprop_sec->nalf-1][*isec-1]) + { + for(i=0;i < sprop_sec->nalf-1; i++) + { + if(*alpha>=sprop_sec->alf[i][*isec-1] && *alpha <= sprop_sec->alf[i+1][*isec-1]) + { + fact=(*alpha-sprop_sec->alf[i][*isec-1])/(sprop_sec->alf[i+1][*isec-1]-sprop_sec->alf[i][*isec-1]); + *cl=sprop_sec->cl_arr[i][*isec-1] + fact*(sprop_sec->cl_arr[i+1][*isec-1] - sprop_sec->cl_arr[i][*isec-1]); + *cd=sprop_sec->cd_arr[i][*isec-1] + fact*(sprop_sec->cd_arr[i+1][*isec-1] - sprop_sec->cd_arr[i][*isec-1]); + } + } + } + else + { + if(*alpha < sprop_sec->alf[salf][*isec-1]) + { + *cl=sprop_sec->cl_arr[0][*isec-1]; + *cd=sprop_sec->cd_arr[0][*isec-1]; + } + if(*alpha > sprop_sec->alf[sprop_sec->nalf-1][*isec-1]) + { + *cl=sprop_sec->cl_arr[sprop_sec->nalf-1][*isec-1]; + *cd=sprop_sec->cd_arr[sprop_sec->nalf-1][*isec-1]; + } + } +} + +//------------------------------------------------------------------------------------------ +//-------------------------------------------------------------------------------------- +void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *sprop_sec,su2double rad_p,su2double V, su2double RPM, su2double rho, su2double T, su2double blade_angle,su2double DtDr[], su2double *Thrust, su2double *Torque, su2double *dp_av,su2double *dp_at_r) +{ + int j,isec,converged,n_iter; + int NR=sprop_sec->nrad; + su2double r_75,dia,r_hub,r_tip,alpha_corr,cl_corr_fac; + su2double base_mach,s_mach,b_num,thrust,torque; + su2double r_dash,t_loss,c_phi,rad,phi,alpha,radtodeg; + su2double anew,bnew,V0,V2,cl,cd,Vlocal,DqDr,tem1,tem2,q; + su2double delta_r[BEM_MAXR],a[BEM_MAXR],b[BEM_MAXR]; + static su2double Dtorq[BEM_MAXR]; + + su2double n,omega,a0,den; + su2double ang_offset=0.0; + char line[1024]; + +//........................................... + radtodeg = 180.0/M_PI; + dia = s_prop.dia; + r_hub = s_prop.rhub; + r_tip = 0.5*dia ; + ang_offset = blade_angle - s_prop.ang0_75; +//........................................... + alpha_corr = 0.0; + base_mach = 0.22 ; + b_num = sqrt(1.0-base_mach*base_mach); + a0 = sqrt(1.4*287*T); +//........................................... +// +//Change pitch by ang_offset +//and calculate delta_r for integration by trapezoidal rule + + n = RPM/60.0; + omega =n*2.0*M_PI; +// + for (j=0; j < NR; j++) + { + + if (j < 1) + { delta_r[j] = sprop_sec->r1[j+1] - r_hub; } + else + { + if (j < NR-1) + { delta_r[j] = sprop_sec->r1[j+1] - sprop_sec->r1[j-1]; } + else + { delta_r[j] = r_tip - sprop_sec->r1[j-1]; } + } + + delta_r[j] *= 0.5; + } +//-------------------------------------------------------- + + thrust=0.0; + torque=0.0; + +//Main Loop ------------------------------------------------------------- + for (j=0; j < NR; j++) + { + b[j]=0.01; + converged=0; + n_iter=1; + while (converged==0) + { + V2=omega*sprop_sec->r1[j]*(1-b[j]); + V0=V; +// + phi=atan2(V0,V2); +// + alpha=sprop_sec->setangle[j] + ang_offset-radtodeg*phi+alpha_corr; + rad = sprop_sec->r1[j] ; +// get cl, cd from lookup table + isec = j+1 ; + get_clcd_(&isec,sprop_sec, &alpha, &cl, &cd) ; +// ...................................... + Vlocal=sqrt(V0*V0+V2*V2); + q = 0.5*rho*Vlocal*Vlocal ; + s_mach = Vlocal/a0; + cl_corr_fac = 1.0; + if (s_mach > base_mach) + { + den = 1.0-s_mach*s_mach ; + if (den > 0.0) cl_corr_fac = b_num / sqrt(den); + } +// ****************************** + cl *= cl_corr_fac ; +// ****************************** +// tip loss factor + r_dash = rad / r_tip+1.0e-5; + c_phi = cos(phi) ; + t_loss = 1.0; + if (r_dash > 0.90) + { + t_loss = (2.0/M_PI)*acos(exp(-(1.0*s_prop.nblades*(1-r_dash)/(r_dash*c_phi)))) ; + } + + DtDr[j]=q*s_prop.nblades*sprop_sec->chord[j]*(cl*cos(phi)-cd*sin(phi)); + DqDr=q*s_prop.nblades*sprop_sec->chord[j]*rad*(cd*cos(phi)+cl*sin(phi)); + + DtDr[j] *= t_loss; + DqDr *= t_loss; + + tem2=DqDr/(4.0*M_PI*rad*rad*rad*rho*V*omega); + bnew=0.6*b[j]+0.4*tem2; +// + if (bnew > 0.9) bnew = 0.9; + + if (fabs(bnew-b[j])<1.0e-5) + { + converged=1; + } + if (bnew<0.1) + b[j]=bnew; + n_iter++ ; + if (n_iter>BEM_MAX_ITER) + { + converged=1; + } + } // while loop + thrust=thrust+DtDr[j]*delta_r[j]; + torque=torque+DqDr*delta_r[j]; + Dtorq[j] = DqDr; + } // j loop +//End of Main Loop ------------------------------------------------------------- + + tem1 = rho*n*n*dia*dia*dia*dia; + tem2 = tem1*dia; + + + *Thrust=thrust; + *Torque=2.0*M_PI* torque; + *dp_av=2.0*M_PI* torque; + + for (j=0; j < NR; j++) + { + DtDr[j] /= (2.0*M_PI*sprop_sec->r1[j]) ; + Dtorq[j] = Dtorq[j]; + } + + if (rad_p < sprop_sec->r1[0]) + { + tem2 = sprop_sec->r1[0] - r_hub ; + tem1 = (rad_p - r_hub)/tem2 ; + tem2 = 1.0 - tem1 ; + *dp_at_r = DtDr[0]*tem1; + *Torque = Dtorq[0]*tem1; + } + else + { + if (rad_p > r_tip) + { + *dp_at_r = 0.0; + *Torque = 0.0; + } + else + { + if (rad_p > sprop_sec->r1[NR-1]) + { + tem2 = r_tip - sprop_sec->r1[NR-1]; + tem1 = (rad_p - sprop_sec->r1[NR-1])/tem2 ; + tem2 = 1.0 - tem1 ; + *dp_at_r = DtDr[NR-1]*tem2; + *Torque = Dtorq[NR-1]*tem2; + } + else + { + for (j=0; j < NR-1; j++) + { + if ((sprop_sec->r1[j] < rad_p) && (sprop_sec->r1[j+1] >= rad_p)) + { + tem2 = sprop_sec->r1[j+1] - sprop_sec->r1[j]; + tem1 = (rad_p - sprop_sec->r1[j])/tem2 ; + tem2 = 1.0 - tem1 ; + *dp_at_r = DtDr[j]*tem2+DtDr[j+1]*tem1; + *Torque = Dtorq[j]*tem2+Dtorq[j+1]*tem1; + } + } + } + }// r > r_tip + } +//---------------------------------------------------------------------- +} + void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, bool Output) { @@ -3425,6 +3736,12 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con su2double Fan_Poly_Eff = config->GetFan_Poly_Eff(); su2double PolyCoeff = 1.0/(1.0-((Gamma-1.0)/Gamma)/Fan_Poly_Eff); + static su2double AD_Omega= 0.0; + static su2double AD_XCG= 0.0,AD_YCG=0.0,AD_ZCG=0.0; + static dpropeller_geom_struct s_prop; + static dpropeller_section_struct sprop_sec; + char section_prop_filename[1024]; + RefDensity = Density_Inf; RefArea = config->GetRefArea(); RefVel2 = 0.0; for (iDim = 0; iDim < nDim; iDim++) RefVel2 += Velocity_Inf[iDim]*Velocity_Inf[iDim]; @@ -3432,6 +3749,39 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con Factor = (0.5*RefDensity*RefArea*RefVel2); Ref = config->GetDensity_Ref() * config->GetVelocity_Ref() * config->GetVelocity_Ref() * 1.0 * 1.0; + if (Kind_ActDisk == BLADE_ELEMENT) { + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || + (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { + + Marker_Tag = config->GetMarker_All_TagBound(iMarker); + AD_Omega = config->GetActDisk_Omega(Marker_Tag, 0); + AD_XCG = config->GetActDisk_XCG(Marker_Tag, 0); + AD_YCG = config->GetActDisk_YCG(Marker_Tag, 0); + AD_ZCG = config->GetActDisk_ZCG(Marker_Tag, 0); + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + //SetActDisk_DeltaP(iMarker, iVertex, DeltaP); + //SetActDisk_DeltaT(iMarker, iVertex, DeltaT); + SetActDisk_RotRate(iMarker, iVertex, AD_Omega); + SetActDisk_XCG(iMarker, iVertex, AD_XCG); + SetActDisk_YCG(iMarker, iVertex, AD_YCG); + SetActDisk_ZCG(iMarker, iVertex, AD_ZCG); + } + } + } + if(InnerIter == 0) + { + strcpy(section_prop_filename,config->GetBEM_prop_filename().c_str()); + readsdata_(section_prop_filename,&s_prop,&sprop_sec); + } + /* Update the propeller load according to the modified flow field after every 40 inner iterations */ + if(InnerIter % 40 == 0){ + GenActDiskData_BEM_VLAD(geometry, solver_container, config, iMesh,s_prop,sprop_sec,Output); + } + } + /*--- Variable load distribution is in input file. ---*/ if (Kind_ActDisk == VARIABLE_LOAD) { if(InnerIter == 0) { @@ -4037,6 +4387,145 @@ void CEulerSolver::ReadActDisk_InputFile(CGeometry *geometry, CSolver **solver_c } } +// { bem-vlad +void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver_container,CConfig *config, unsigned short iMesh, dpropeller_geom_struct s_prop, dpropeller_section_struct &sprop_sec, bool Output) { + + unsigned short iDim, iMarker; + unsigned long iVertex, iPoint; + string Marker_Tag; + int iRow, nRow, iEl; + su2double Omega_sw=0.0,Omega_RPM=0.0,Origin[3]={0.0},radius_[3]={0.0}; + static su2double omega_ref=0.0, Lref=0.0; + unsigned long InnerIter = config->GetInnerIter(); + static su2double RPM=0.0,blade_angle=0.0,dia=0.0,r_hub=0.0,r_tip=0.0,rps=0.0,radius=0.0; + static su2double V=0.0,rho=0.0,T=0.0; + static su2double Thrust=0.0,Torque=0.0,dp_av=0.0,dp_av1=0.0,dp_at_r=0.0,dp_at_r_Vn=0.0; + static su2double deltap_r[BEM_MAXR]={0.0}; + static su2double AD_Axis[MAXNDIM] = {0.0}, AD_J=0.0; + static su2double Target_Press_Jump=0.0, Target_Temp_Jump=0.0,Area=0.0,UnitNormal[3]={0.0},Vn=0.0; + static su2double Fa=0.0,Ft=0.0,Fr=0.0,Fx=0.0,Fy=0.0,Fz=0.0,dCt_v=0.0,dCp_v=0.0,dCr_v=0.0,rad_v=0.0; + su2double *V_domain,*Coord; + static su2double loc_Torque = 0.0,tot_Torque = 0.0; + static su2double loc_thrust = 0.0,tot_thrust=0.0; + static su2double tot_area = 0.0,tot_tq = 0.0; + dia = s_prop.dia; + r_hub = s_prop.rhub; + r_tip = 0.5*dia ; + + su2double Dens_FreeStream = config->GetDensity_FreeStream(); + const su2double *Vel_FreeStream = config->GetVelocity_FreeStream(); + + su2double *Normal = new su2double[nDim]; + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || + (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + //Read Swirl params + Omega_RPM = GetActDisk_RotRate(iMarker, iVertex); + Origin[0] = GetActDisk_CGX(iMarker, iVertex) ; + Origin[1] = GetActDisk_CGY(iMarker, iVertex) ; + Origin[2] = GetActDisk_CGZ(iMarker, iVertex) ; + + omega_ref= config->GetOmega_Ref(); + Lref = config->GetLength_Ref(); + Omega_sw = Omega_RPM*(PI_NUMBER/30.0)/(omega_ref);//Swirl rate + Origin[0] = Origin[0]/Lref; + Origin[1] = Origin[1]/Lref; + Origin[2] = Origin[2]/Lref; +//---------------------------------------------------------------------- + /*--- Compute the distance to the center of the rotor ---*/ + + geometry->vertex[iMarker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; + + /*Current version works only when propeller axis is aligned to horizontal*/ + AD_Axis[0] = 1.0; + AD_Axis[1] = 0.0; + AD_Axis[2] = 0.0; + for (iDim = 0; iDim < nDim; iDim++){ + ActDisk_Axis(iMarker, iDim) = AD_Axis[iDim]; + } + Area = 0.0; + for (iDim = 0; iDim < nDim; iDim++) Area += Normal[iDim]*Normal[iDim]; + Area = sqrt (Area); + + for (iDim = 0; iDim < nDim; iDim++) + UnitNormal[iDim] = Normal[iDim]/Area; + + if (geometry->nodes->GetDomain(iPoint)) { + Coord = geometry->nodes->GetCoord(iPoint) ; + } + + radius = 0.0; + for (iDim = 0; iDim < nDim; iDim++){ + radius += (Coord[iDim]-Origin[iDim])*(Coord[iDim]-Origin[iDim]); + radius_[iDim] = (Coord[iDim]-Origin[iDim]); + } + radius = sqrt(radius); + /*--- Current solution at this boundary node and jumps values ---*/ + V_domain = nodes->GetPrimitive(iPoint); +//--------------------------------------------------------------- + if (abs(Omega_sw) > 1.0e-1) + { + Vn = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { Vn += V_domain[iDim+1]*UnitNormal[iDim]; } + + RPM = abs(Omega_RPM); + rps = RPM/60.0; + AD_J = Vel_FreeStream[0]/(rps*dia); + rho = V_domain[nDim+2] ; + T = V_domain[0] ; + blade_angle = config->GetBEM_blade_angle(); + V = config->GetModVel_FreeStream(); + V = fabs(Vn); + bem_model_noa(s_prop,&sprop_sec, // Propeller properties + radius,V,RPM,rho,T,blade_angle, // Input + deltap_r,&Thrust,&Torque,&dp_av,&dp_at_r); // Output + + tot_area += Area; + loc_Torque += Torque*Area; + tot_tq += dp_av; + loc_thrust += dp_at_r*Area; + Target_Press_Jump = dp_at_r; + Target_Temp_Jump = Target_Press_Jump/(rho*287.0); + + ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; + ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; + ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); + /* Non-dimensionalize the elemental load */ + dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); + //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); + dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); + /* Force radial load to 0 as there is no information of radial load from BEM */ + dCr_v = 0.0; + rad_v = radius/r_tip; + //Fa = (dCt_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ + // (pow(AD_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); + Fa = dp_at_r; + Ft = (dCp_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ + ((AD_J*PI_NUMBER*rad_v)*(AD_J*PI_NUMBER*rad_v))) / config->GetPressure_Ref(); + Fr = (dCr_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ + (pow(AD_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); + Fx = (Ft+Fr)*(radius_[0]/(radius)); + Fy = (Ft+Fr)*(radius_[2]/(radius)); + Fz = -(Ft+Fr)*(radius_[1]/(radius)); + ActDisk_Fa_BEM[iMarker][iVertex] = Fa; + ActDisk_Fx_BEM[iMarker][iVertex] = Fx; + ActDisk_Fy_BEM[iMarker][iVertex] = Fy; + ActDisk_Fz_BEM[iMarker][iVertex] = Fz; + + } +//--------------------------------------------------------------------------------------------------------------------------------------------------------- + } + } + } + delete [] Normal; +} +// } bem-vlad + void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, bool Output) { @@ -7646,6 +8135,9 @@ void CEulerSolver::BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_contai if(Kind_ActDisk == VARIABLE_LOAD){ BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); } + else if(Kind_ActDisk == BLADE_ELEMENT){ + BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); + } else{ BC_ActDisk(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); } @@ -7660,6 +8152,9 @@ void CEulerSolver::BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_conta if(Kind_ActDisk == VARIABLE_LOAD){ BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); } + else if(Kind_ActDisk == BLADE_ELEMENT){ + BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); + } else{ BC_ActDisk(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); } @@ -8309,6 +8804,248 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver END_SU2_OMP_FOR } +// { bem-vlad +void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, + CConfig *config, unsigned short val_marker, bool val_inlet_surface) { + + /*! + * \function BC_ActDisk_BEM_VLAD + * \brief Actuator disk model with Blade Element Method (BEM) + * \author: Chandukrishna Y., T. N. Venkatesh and Josy Pullockara + * Institution: Computational and Theoretical Fluid Dynamics (CTFD), + * CSIR - National Aerospace Laboratories, Bangalore + * Academy of Scientific and Innovative Research, Ghaziabad + * \version 8.0.0 "Harrier" + * First release date : September 26 2023 + * modified on: + * + * Section properties of the propeller given in an input file. + * Cl, Cd of propeller sections need to be generated earlier and saved in this file + * Actuator disk data initialized in function SetActDisk_BCThrust. + * Propeller load calculated with Blade Element Method + * Interpolated load at each point on the actuator disk is set in GenActDiskData_BEM_VLAD function + * Rest calculations follows the Variable Load (BC_ActDisk_VariableLoad) approach + * + */ + + unsigned short iDim; + unsigned long iVertex, iPoint, GlobalIndex_donor, GlobalIndex; + su2double Pressure, Velocity[MAXNDIM], + Velocity2, Entropy, Density, Energy, Riemann, Vn, SoundSpeed, Vn_Inlet, + Area, UnitNormal[MAXNDIM] = {0.0}, *V_outlet, *V_domain, *V_inlet; + + su2double Pressure_out, Density_out, + Pressure_in, Density_in; + + su2double Prop_Axis[MAXNDIM]; + su2double Fa, Fx, Fy, Fz; + su2double u_in, v_in, w_in, u_out, v_out, w_out, uJ, vJ, wJ; + su2double Temperature_out, H_in, H_out; + su2double FQ, Q_out, Density_Disk; + su2double SoSextr, Vnextr[MAXNDIM], Vnextr_, RiemannExtr, QdMnorm[MAXNDIM], QdMnorm2, appo2, SoS_out; + su2double Normal[MAXNDIM]; + + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const auto Gas_Constant = config->GetGas_ConstantND(); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST);// || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); + + /*--- Get the actuator disk center and axis coordinates for the current marker. ---*/ + for (iDim = 0; iDim < nDim; iDim++){ + Prop_Axis[iDim] = ActDisk_Axis(val_marker, iDim); + } + + /*--- Loop over all the vertices on this boundary marker. ---*/ + SU2_OMP_FOR_DYN(OMP_MIN_SIZE) + for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { + + iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + GlobalIndex = geometry->nodes->GetGlobalIndex(iPoint); + GlobalIndex_donor = GetDonorGlobalIndex(val_marker, iVertex); + + /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ + + if ((geometry->nodes->GetDomain(iPoint)) && + (GlobalIndex != GlobalIndex_donor)) { + + /*--- Normal vector for this vertex (negative for outward convention) ---*/ + + geometry->vertex[val_marker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; + conv_numerics->SetNormal(Normal); + + Area = GeometryToolbox::Norm(nDim, Normal); + for (iDim = 0; iDim < nDim; iDim++) + UnitNormal[iDim] = Normal[iDim]/Area; + + /*--- Current solution at this boundary node. ---*/ + + V_domain = nodes->GetPrimitive(iPoint); + + /*--- Get the values of Fa (axial force per unit area), Fx, Fy and Fz (x, y and z components of the tangential and + radial forces per unit area resultant). ---*/ + Fa = ActDisk_Fa_BEM[val_marker][iVertex]; + Fx = ActDisk_Fx_BEM[val_marker][iVertex]; + Fy = ActDisk_Fy_BEM[val_marker][iVertex]; + Fz = ActDisk_Fz_BEM[val_marker][iVertex]; + + /*--- Get the primitive variables and the extrapolated variables. ---*/ + if (val_inlet_surface){ + V_inlet = nodes->GetPrimitive(iPoint); + V_outlet = DonorPrimVar[val_marker][iVertex];} + else{ + V_outlet = nodes->GetPrimitive(iPoint); + V_inlet = DonorPrimVar[val_marker][iVertex];} + + /*--- u, v and w are the three momentum components. ---*/ + Pressure_out = V_outlet[nDim+1]; + Density_out = V_outlet[nDim+2]; + u_out = V_outlet[1]*V_outlet[nDim+2]; + v_out = V_outlet[2]*V_outlet[nDim+2]; + w_out = V_outlet[3]*V_outlet[nDim+2]; + + Pressure_in = V_inlet[nDim+1]; + Density_in = V_inlet[nDim+2]; + u_in = V_inlet[1]*Density_in; + v_in = V_inlet[2]*Density_in; + w_in = V_inlet[3]*Density_in; + H_in = V_inlet[nDim+3]*Density_in; + + /*--- Density on the disk is computed as an everage value between the inlet and outlet values. ---*/ + Density_Disk = 0.5*(Density_in + Density_out); + + /*--- Computation of the normal momentum flowing through the disk. ---*/ + Q_out = 0.5*((u_in + u_out)*Prop_Axis[0] + (v_in + v_out)*Prop_Axis[1] + (w_in + w_out)*Prop_Axis[2]); + + FQ = Q_out/Density_Disk; + + /*--- Computation of the momentum jumps due to the tnagential and radial forces per unit area. ---*/ + if (FQ < EPS){ + uJ = 0.0; + vJ = 0.0; + wJ = 0.0;} + else{ + uJ = Fx/FQ; + vJ = Fy/FQ; + wJ = Fz/FQ;} + + if (val_inlet_surface) { + /*--- Build the fictitious intlet state based on characteristics. + Retrieve the specified back pressure for this inlet ---*/ + + Density = V_domain[nDim+2]; + Velocity2 = 0.0; Vn = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Velocity[iDim] = V_domain[iDim+1]; + Velocity2 += Velocity[iDim]*Velocity[iDim]; + Vn += Velocity[iDim]*UnitNormal[iDim]; + } + Pressure = V_domain[nDim+1]; + SoundSpeed = sqrt(Gamma*Pressure/Density); + + Entropy = Pressure*pow(1.0/Density, Gamma); + Riemann = Vn + 2.0*SoundSpeed/Gamma_Minus_One; + + /*--- Compute the new fictious state at the outlet ---*/ + + Pressure = Pressure_out - Fa; + Density = pow(Pressure/Entropy,1.0/Gamma); + SoundSpeed = sqrt(Gamma*Pressure/Density); + Vn_Inlet = Riemann - 2.0*SoundSpeed/Gamma_Minus_One; + + Velocity2 = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Velocity[iDim] = Velocity[iDim] + (Vn_Inlet-Vn)*UnitNormal[iDim]; + Velocity2 += Velocity[iDim]*Velocity[iDim]; + } + Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; + if (tkeNeeded) Energy += GetTke_Inf(); + + /*--- Conservative variables, using the derived quantities ---*/ + + V_inlet[0] = Pressure / ( Gas_Constant * Density); + for (iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+1] = Velocity[iDim]; + V_inlet[nDim+1] = Pressure; + V_inlet[nDim+2] = Density; + V_inlet[nDim+3] = Energy + Pressure/Density; + V_inlet[nDim+4] = SoundSpeed; + conv_numerics->SetPrimitive(V_domain, V_inlet); + } + else { + /*--- Acoustic Riemann invariant extrapolation form the interior domain. ---*/ + SoSextr = V_domain[nDim+4]; + + Vnextr_ = 0.0; + for (iDim = 0; iDim < nDim; iDim++){ + Vnextr[iDim] = V_domain[iDim+1]*Prop_Axis[iDim]; + Vnextr_ += Vnextr[iDim]*Vnextr[iDim]; + } + Vnextr_ = sqrt(max(0.0,Vnextr_)); + RiemannExtr = Vnextr_ - ((2*SoSextr)/(Gamma_Minus_One)); + + /*--- Assigning the momentum in tangential direction jump and the pressure jump. ---*/ + Velocity[0] = u_in + uJ; + Velocity[1] = v_in + vJ; + Velocity[2] = w_in + wJ; + Pressure_out = Pressure_in + Fa; + + /*--- Computation of the momentum normal to the disk plane. ---*/ + QdMnorm[0] = u_in*Prop_Axis[0]; + QdMnorm[1] = v_in*Prop_Axis[1]; + QdMnorm[2] = w_in*Prop_Axis[2]; + + QdMnorm2 = 0.0; + for (iDim = 0; iDim < nDim; iDim++) QdMnorm2 += QdMnorm[iDim]*QdMnorm[iDim]; + + /*--- Resolving the second grade equation for the density. ---*/ + appo2 = -((2*sqrt(QdMnorm2)*RiemannExtr)+((4*Gamma*Pressure_out)/(pow(Gamma_Minus_One,2)))); + Density_out = (-appo2+sqrt(max(0.0,pow(appo2,2)-4*QdMnorm2*pow(RiemannExtr,2))))/(2*pow(RiemannExtr,2)); + + Velocity2 = 0; + for (iDim = 0; iDim < nDim; iDim++) Velocity2 += (Velocity[iDim]*Velocity[iDim]); + + /*--- Computation of the enthalpy, total energy, temperature and speed of sound. ---*/ + H_out = H_in/Density_in + Fa/Density_out; + Energy = H_out - Pressure_out/Density_out; + if (tkeNeeded) Energy += GetTke_Inf(); + Temperature_out = (Energy-0.5*Velocity2/(pow(Density_out,2)))*(Gamma_Minus_One/Gas_Constant); + + SoS_out = sqrt(Gamma*Gas_Constant*Temperature_out); + + /*--- Set the primitive variables. ---*/ + V_outlet[0] = Temperature_out; + for (iDim = 0; iDim < nDim; iDim++) + V_outlet[iDim+1] = Velocity[iDim]/Density_out; + V_outlet[nDim+1] = Pressure_out; + V_outlet[nDim+2] = Density_out; + V_outlet[nDim+3] = H_out; + V_outlet[nDim+4] = SoS_out; + conv_numerics->SetPrimitive(V_domain, V_outlet); + } + + /*--- Grid Movement (NOT TESTED!)---*/ + + if (dynamic_grid) + conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint)); + + /*--- Compute the residual using an upwind scheme ---*/ + + auto residual = conv_numerics->ComputeResidual(config); + + /*--- Update residual value ---*/ + + LinSysRes.AddBlock(iPoint, residual); + + /*--- Jacobian contribution for implicit integration ---*/ + + if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); + } + } +} + + + +// } bem-vlad + void CEulerSolver::PrintVerificationError(const CConfig *config) const { if ((rank != MASTER_NODE) || (MGLevel != MESH_0)) return; From 4e1b6c675a4b094b5f395bad1c26ab65457436e3 Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Wed, 27 Sep 2023 10:22:28 +0530 Subject: [PATCH 038/139] Update CConfig.hpp Updated --- Common/include/CConfig.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 563d477a696..e50576ba2eb 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -344,8 +344,15 @@ class CConfig { su2double *ActDiskOutlet_GrossThrust; /*!< \brief Specified outlet gross thrust for actuator disk. */ su2double *ActDiskOutlet_Force; /*!< \brief Specified outlet force for actuator disk. */ su2double *ActDiskOutlet_Power; /*!< \brief Specified outlet power for actuator disk. */ + su2double *ActDiskOutlet_Thrust_BEM; /*!< \brief Specified outlet power for actuator disk. */ + su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet power for actuator disk. */ su2double **ActDisk_PressJump, **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ + su2double **ActDisk_XCG, **ActDisk_YCG, **ActDisk_ZCG; + su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate */ + su2double BEM_blade_angle ; /*!< \brief Propeller blade angle */ + string BEM_prop_filename ; /*!< \brief Propeller blade angle */ + bool History_File_Append_Flag; /*!< \brief Flag to append history file */ su2double *ActDisk_DeltaPress; /*!< \brief Specified pressure delta for actuator disk. */ su2double *ActDisk_DeltaTemp; /*!< \brief Specified temperature delta for actuator disk. */ su2double *ActDisk_TotalPressRatio; /*!< \brief Specified tot. pres. ratio for actuator disk. */ @@ -6649,6 +6656,15 @@ class CConfig { */ su2double GetActDisk_PressJump(const string& val_marker, unsigned short val_index) const; + /*! + * \brief Get the CG of the actuator disk. + */ + su2double GetActDisk_XCG(string val_marker, unsigned short val_index) const; + su2double GetActDisk_YCG(string val_marker, unsigned short val_index) const; + su2double GetActDisk_ZCG(string val_marker, unsigned short val_index) const; + su2double GetBEM_blade_angle(void) { return BEM_blade_angle; } + string GetBEM_prop_filename(void) { return BEM_prop_filename; } + /*! * \brief Get the thrust corffient of the actuator disk. */ @@ -8191,6 +8207,9 @@ class CConfig { */ su2double GetActDiskOutlet_Power(const string& val_marker) const; + su2double GetActDiskOutlet_Thrust_BEM(string val_marker) const; + su2double GetActDiskOutlet_Torque_BEM(string val_marker) const; + /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. @@ -8226,6 +8245,9 @@ class CConfig { */ void SetActDiskOutlet_Power(unsigned short val_marker, su2double val_actdisk_power) { ActDiskOutlet_Power[val_marker] = val_actdisk_power; } + void SetActDiskOutlet_Thrust_BEM(unsigned short val_marker, su2double val_actdisk_thrust_bem) { ActDiskOutlet_Thrust_BEM[val_marker] = val_actdisk_thrust_bem; } + void SetActDiskOutlet_Torque_BEM(unsigned short val_marker, su2double val_actdisk_torque_bem) { ActDiskOutlet_Torque_BEM[val_marker] = val_actdisk_torque_bem; } + /*! * \brief Get the displacement value at an displacement boundary. * \param[in] val_index - Index corresponding to the displacement boundary. From 1c2d53ce114b58657c2fb408f2573633fdddaf7c Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Wed, 27 Sep 2023 10:36:37 +0530 Subject: [PATCH 039/139] Create prop_defs.hpp --- SU2_CFD/include/solvers/prop_defs.hpp | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 SU2_CFD/include/solvers/prop_defs.hpp diff --git a/SU2_CFD/include/solvers/prop_defs.hpp b/SU2_CFD/include/solvers/prop_defs.hpp new file mode 100644 index 00000000000..977ff854eec --- /dev/null +++ b/SU2_CFD/include/solvers/prop_defs.hpp @@ -0,0 +1,43 @@ +#define BEM_MAXR 50 +#define BEM_MAXALF 100 +#define BEM_MAX_ITER 20 + +typedef struct +{ + int nblades; + float dia; + float rhub; + float ang0_75; +} propeller_geom_struct; + +typedef struct +{ + int nblades; + su2double dia; + su2double rhub; + su2double ang0_75; +} dpropeller_geom_struct; + +typedef struct +{ + int nalf; + int nrad; + float r1[BEM_MAXR]; + float chord[BEM_MAXR]; + float setangle[BEM_MAXR]; + float alf[BEM_MAXALF][BEM_MAXR]; + float cl_arr[BEM_MAXALF][BEM_MAXR]; + float cd_arr[BEM_MAXALF][BEM_MAXR]; +} propeller_section_struct; + +typedef struct +{ + int nalf; + int nrad; + su2double r1[BEM_MAXR]; + su2double chord[BEM_MAXR]; + su2double setangle[BEM_MAXR]; + su2double alf[BEM_MAXALF][BEM_MAXR]; + su2double cl_arr[BEM_MAXALF][BEM_MAXR]; + su2double cd_arr[BEM_MAXALF][BEM_MAXR]; +} dpropeller_section_struct; From a6154e6c862e8e70f8d42beae15e49ee790b9cb1 Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Wed, 27 Sep 2023 10:42:05 +0530 Subject: [PATCH 040/139] Update option_structure.hpp --- Common/include/option_structure.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 5fe8228925e..2cc62ac4813 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1857,7 +1857,8 @@ enum ACTDISK_TYPE { DRAG_MINUS_THRUST = 4, /*!< \brief User specifies the D-T. */ MASSFLOW = 5, /*!< \brief User specifies the massflow. */ POWER = 6, /*!< \brief User specifies the power. */ - VARIABLE_LOAD = 7 /*!< \brief User specifies the load distribution. */ + VARIABLE_LOAD = 7, /*!< \brief User specifies the load distribution. */ + BLADE_ELEMENT = 8 /*!< \brief User specifies to use Blade element method. */ }; static const MapType ActDisk_Map = { MakePair("VARIABLES_JUMP", VARIABLES_JUMP) @@ -1867,6 +1868,7 @@ static const MapType ActDisk_Map = { MakePair("MASSFLOW", MASSFLOW) MakePair("POWER", POWER) MakePair("VARIABLE_LOAD", VARIABLE_LOAD) + MakePair("BLADE_ELEMENT", BLADE_ELEMENT) }; /*! @@ -2240,7 +2242,7 @@ static const MapType Continuity_Map = { MakePair("2ND_DERIVATIVE", DERIVATIVE_2ND) MakePair("USER_INPUT", USER_INPUT) }; - +BLADE /*! * \brief Types of coordinates systems for the FFD */ From 7638f800011e2b225f33cca7f16db183eb309fb5 Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Wed, 27 Sep 2023 10:44:30 +0530 Subject: [PATCH 041/139] Update option_structure.inl --- Common/include/option_structure.inl | 96 +++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index ce94055fca5..c4592c56681 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -1772,6 +1772,102 @@ class COptionActDisk : public COptionBase { } }; +// { bem-vlad +class COptionActDiskCentroid : public COptionBase { + string name; // identifier for the option + unsigned short & inlet_size; + unsigned short & outlet_size; + string * & marker_inlet; + string * & marker_outlet; + su2double ** & actdisk_xcg; + su2double ** & actdisk_ycg; + su2double ** & actdisk_zcg; + +public: + COptionActDiskCentroid(const string name, + unsigned short & nMarker_ActDiskInlet, unsigned short & nMarker_ActDiskOutlet, string * & Marker_ActDiskInlet, string * & Marker_ActDiskOutlet, + su2double ** & ActDisk_XCG, su2double ** & ActDisk_YCG, su2double ** & ActDisk_ZCG) : + inlet_size(nMarker_ActDiskInlet), outlet_size(nMarker_ActDiskOutlet), marker_inlet(Marker_ActDiskInlet), marker_outlet(Marker_ActDiskOutlet), + actdisk_xcg(ActDisk_XCG), actdisk_ycg(ActDisk_YCG), actdisk_zcg(ActDisk_ZCG) { + this->name = name; + } + + ~COptionActDiskCentroid() {}; + string SetValue(vector option_value) { + const int mod_num = 8; + unsigned short totalVals = option_value.size(); + if ((totalVals == 1) && (option_value[0].compare("NONE") == 0)) { + this->SetDefault(); + return ""; + } + + if (totalVals % mod_num != 0) { + string newstring; + newstring.append(this->name); + newstring.append(": must have a number of entries divisible by 8"); + this->SetDefault(); + return newstring; + } + + unsigned short nVals = totalVals / mod_num; + this->inlet_size = nVals; + this->outlet_size = nVals; + this->marker_inlet = new string[this->inlet_size]; + this->marker_outlet = new string[this->outlet_size]; + + this->actdisk_xcg = new su2double*[this->inlet_size]; + this->actdisk_ycg = new su2double*[this->inlet_size]; + this->actdisk_zcg = new su2double*[this->inlet_size]; + for (int i = 0; i < this->inlet_size; i++) { + this->actdisk_xcg[i] = new su2double[2]; + this->actdisk_ycg[i] = new su2double[2]; + this->actdisk_zcg[i] = new su2double[2]; + } + + string tname = "actuator disk"; + + for (int i = 0; i < this->inlet_size; i++) { + this->marker_inlet[i].assign(option_value[mod_num*i]); + this->marker_outlet[i].assign(option_value[mod_num*i+1]); + istringstream ss_1st(option_value[mod_num*i + 2]); + if (!(ss_1st >> this->actdisk_xcg[i][0])) { + return badValue(tname, this->name); + } + istringstream ss_2nd(option_value[mod_num*i + 3]); + if (!(ss_2nd >> this->actdisk_ycg[i][0])) { + return badValue(tname, this->name); + } + istringstream ss_3rd(option_value[mod_num*i + 4]); + if (!(ss_3rd >> this->actdisk_zcg[i][0])) { + return badValue(tname, this->name); + } + istringstream ss_4th(option_value[mod_num*i + 5]); + if (!(ss_4th >> this->actdisk_xcg[i][1])) { + return badValue(tname, this->name); + } + istringstream ss_5th(option_value[mod_num*i + 6]); + if (!(ss_5th >> this->actdisk_ycg[i][1])) { + return badValue(tname, this->name); + } + istringstream ss_6th(option_value[mod_num*i + 7]); + if (!(ss_6th >> this->actdisk_zcg[i][1])) { + return badValue(tname, this->name); + } + } + return ""; + } + void SetDefault() { + this->inlet_size = 0; + this->outlet_size = 0; + this->marker_inlet = NULL; + this->marker_outlet = NULL; + this->actdisk_xcg = NULL; + this->actdisk_ycg = NULL; + this->actdisk_zcg = NULL; + } +}; +// } bem-vlad + class COptionWallFunction : public COptionBase { string name; // identifier for the option unsigned short& nMarkers; From 4362d89737becc7dcc90f993417238d6bba54c8d Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Wed, 27 Sep 2023 11:19:33 +0530 Subject: [PATCH 042/139] Update option_structure.hpp Removed extra statement --- Common/include/option_structure.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 2cc62ac4813..b26b4fcf699 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2242,7 +2242,7 @@ static const MapType Continuity_Map = { MakePair("2ND_DERIVATIVE", DERIVATIVE_2ND) MakePair("USER_INPUT", USER_INPUT) }; -BLADE + /*! * \brief Types of coordinates systems for the FFD */ From 29118b4d10e82edf428abecf7cf38b165a9d9aca Mon Sep 17 00:00:00 2001 From: Y Chandukrishna Date: Thu, 28 Sep 2023 08:13:00 +0530 Subject: [PATCH 043/139] added test case for actuatordisk-bem --- .../actuatordisk_bem/actuatordisk_bem.cfg | 253 ++++++++ .../prop_geom_alfclcd_data.txt | 558 ++++++++++++++++++ TestCases/rans/actuatordisk_bem/readme.txt | 15 + 3 files changed, 826 insertions(+) create mode 100644 TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg create mode 100644 TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt create mode 100644 TestCases/rans/actuatordisk_bem/readme.txt diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg new file mode 100644 index 00000000000..45d2094f64b --- /dev/null +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -0,0 +1,253 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Actuator Disk - Blade Element Method % +% Author: Y Chandukrishna, Josy Poulose Pullockara, T N Venkatesh % +% Institution: Computational and Theoretical Fluid Dynamics (CTFD), % +% CSIR - National Aerospace Laboratories, Bangalore % +% Academy of Scientific and Innovative Research, Ghaziabad % +% Comments : +% Date: 23/09/2023 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%----------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION -------------------------% +% Solver type (EULER, NAVIER_STOKES, RANS, +% INC_EULER, INC_NAVIER_STOKES, INC_RANS +% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, +% HEAT_EQUATION_FVM, ELASTICITY) +SOLVER= RANS +% +% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) +KIND_TURB_MODEL= SA +% +% Turbulence intensity at freestream +%FREESTREAM_TURBULENCEINTENSITY=0.01 +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) +MATH_PROBLEM= DIRECT +% +% Restart solution (NO, YES) +RESTART_SOL= NO +% +% System of measurements (SI, US) +% International system of units (SI): ( meters, kilograms, Kelvins, +% Newtons = kg m/s^2, Pascals = N/m^2, +% Density = kg/m^3, Speed = m/s, +% Equiv. Area = m^2 ) +SYSTEM_MEASUREMENTS= SI +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 0.11617164 +% +% Angle of attack (degrees, only for compressible flows) +AOA= 0.0 +% +% Side-slip angle (degrees, only for compressible flows) +SIDESLIP_ANGLE= 0.0 +% +% Reynolds number (non-dimensional, based on the free-stream values) +REYNOLDS_NUMBER= 0.62E6 +% +% Reynolds length (1 m, 1 inch by default) +REYNOLDS_LENGTH= 0.237 +% +FREESTREAM_TEMPERATURE= 295 +% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +% Molecular Viscosity that would be constant (1.716E-5 by default) +MU_CONSTANT= 1.84554E-5 +% +% Sutherland Viscosity Ref (1.716E-5 default value for AIR SI) +MU_REF= 1.716E-5 +% +% Sutherland Temperature Ref (273.15 K default value for AIR SI) +MU_T_REF= 273.15 +% +% Sutherland constant (110.4 default value for AIR SI) +SUTHERLAND_CONSTANT= 110.4 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% Reference origin for moment computation (m or in) +REF_ORIGIN_MOMENT_X = 0.0 +REF_ORIGIN_MOMENT_Y = 0.0 +REF_ORIGIN_MOMENT_Z = 0.0 +% +% Reference length for moment non-dimensional coefficients (m or in) +REF_LENGTH= 1.0 +% +% Reference area for non-dimensional force coefficients (0 implies automatic +% calculation) (m^2 or in^2) +REF_AREA= 0.04411429 +% +% Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, +% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) +REF_DIMENSIONALIZATION= DIMENSIONAL +% +% --------------- ENGINE AND ACTUATOR DISK SIMULATION -------------------------% +% Highlite area to compute MFR (1 in by default) +HIGHLITE_AREA= 0.04411429 +% +% Engine nu factor (SA model). +ENGINE_NU_FACTOR= 0.0 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +ACTDISK_DOUBLE_SURFACE = YES +% +% Actuator disk boundary type (VARIABLE_LOAD, VARIABLES_JUMP, BC_THRUST, +% DRAG_MINUS_THRUST) +ACTDISK_TYPE= BLADE_ELEMENT +ACTDISK_JUMP= DIFFERENCE +% +% Actuator disk boundary marker(s) with the following formats (NONE = no marker) +% Variable Load: (inlet face marker, outlet face marker, +% 0.0, 0.0, RPM , 0.0, 0.0, RPM) Markers only effectively used. +% Change the sign of RPM to change the direction of rotation of the propeller +MARKER_ACTDISK = ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 12715.2, 0.0, 0.0, 12715.2) +%Actuator Disk CG +%(inlet face marker, outlet face marker, X_CG of inlet, Y_CG of inlet, Z_CG of inlet , +% X_CG of outlet, Y_CG of outlet, Z_CG of outlet), X_CG, Y_CG, Z_CG of both inlet and +% outlet markers should be same +MARKER_ACTDISK_CG= ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 0.0, 0.0,0.0,0.0) +% Input file containing the propeller section data and aerodynamic details of blade sections +BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt +% Propeller blade angle (Degrees) at 0.75*Radius for the current calculation +BEM_PROP_BLADE_ANGLE = 23.9 +% +% Far-field boundary marker(s) (NONE = no marker) +MARKER_FAR= ( Farfield ) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% Marker(s) of the surface in the surface flow solution file +MARKER_PLOTTING = ( ACTDISK_IN, ACTDISK_OUT ) +% +% Marker(s) of the surface where the non-dimensional coefficients are evaluated. +MARKER_MONITORING = ( ACTDISK_IN, ACTDISK_OUT ) +% +% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) +MARKER_ANALYZE = ( ACTDISK_IN, ACTDISK_OUT ) +% +% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). +MARKER_ANALYZE_AVERAGE = MASSFLUX +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +% +% CFL number (initial value for the adaptive CFL number) +CFL_NUMBER= 4.0 +% +% Adaptive CFL number (NO, YES) +CFL_ADAPT= NO +% +% Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, +% MOMENT_Y, MOMENT_Z, EFFICIENCY, BUFFET, +% EQUIVALENT_AREA, NEARFIELD_PRESSURE, +% FORCE_X, FORCE_Y, FORCE_Z, THRUST, +% TORQUE, TOTAL_HEATFLUX, +% MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, +% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, +% SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) +% For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. +OBJECTIVE_FUNCTION= DRAG +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% Linear solver or smoother for implicit formulations: +% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. +LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER_PREC= ILU +% +% Minimum error of the linear solver for implicit formulations +LINEAR_SOLVER_ERROR= 1E-12 +% +% Max number of iterations of the linear solver for the implicit formulation +LINEAR_SOLVER_ITER= 3 +% +% Number of elements to apply the criteria +CONV_CAUCHY_ELEMS= 1000 +% +% Epsilon to control the series convergence +CONV_CAUCHY_EPS= 1E-10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, +% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) +CONV_NUM_METHOD_FLOW= ROE +MUSCL_FLOW= YES +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_TURB= NO +% +% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, +% BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_TURB= VENKATAKRISHNAN +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% Maximum number of iterations +ITER= 5000 +% +% Convergence criteria (CAUCHY, RESIDUAL) +%CONV_CRITERIA= RESIDUAL +% +% Min value of the residual (log10 of the residual) +CONV_RESIDUAL_MINVAL= -8 +% +% Start convergence criteria at iteration number +CONV_STARTITER= 10 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% Mesh input file +MESH_FILENAME= actuatordisk_bem.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FILENAME= actuatordisk_bem.dat +% +% Output tabular file format (TECPLOT, CSV) +TABULAR_FORMAT= CSV +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history_actuatordisk_bem +% +% Write the forces breakdown file option (NO, YES) +WRT_FORCES_BREAKDOWN= YES +% +% Output file with the forces breakdown +BREAKDOWN_FILENAME= forces_breakdown_actuatordisk_bem.dat +% +% Output file restart flow +RESTART_FILENAME= restart_flow_actuatordisk_bem.dat +% +% Output file flow (w/o extension) variables +VOLUME_FILENAME= flow_actuatordisk_bem +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FILENAME= surface_flow_actuatordisk_bem +% +% Writing solution file frequency +OUTPUT_WRT_FREQ= 500 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, RMS_NU_TILDE, NONPHYSICAL_POINTS, LIFT, DRAG) +HISTORY_OUTPUT= (INNER_ITER, RMS_RES, LIFT, DRAG, AERO_COEFF) diff --git a/TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt b/TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt new file mode 100644 index 00000000000..97dbb803b84 --- /dev/null +++ b/TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt @@ -0,0 +1,558 @@ +# Geometric parameters of propeller +4 : number of blades +0.237 : diameter (m) +0.01754 : radius of hub (m) +23.9 : angle at 75% radius, has to be consistent with section data +# Nsection, Nalf + 22 23 +#section,radius,chord,set angle +1 0.029625 0.011802 39.738358 +2 0.035550 0.013272 36.824936 +3 0.041475 0.014546 34.978134 +4 0.047400 0.016093 33.867138 +5 0.053325 0.017495 32.648598 +6 0.056288 0.018061 31.824940 +7 0.059250 0.018628 30.987774 +8 0.065175 0.019253 29.155754 +9 0.068137 0.019335 28.223461 +10 0.071100 0.019398 27.291164 +11 0.077025 0.019398 26.051857 +12 0.079988 0.019224 25.441435 +13 0.082950 0.019038 24.831013 +14 0.088875 0.018572 23.900000 +15 0.091837 0.018218 23.311188 +16 0.094800 0.017864 22.824017 +17 0.100725 0.016862 21.970278 +18 0.103688 0.016231 21.604017 +19 0.106650 0.015600 21.237759 +20 0.109613 0.014859 20.871506 +21 0.112575 0.014110 20.506992 +22 0.115538 0.011545 20.322815 +#Sec_1, alpha,cl,cd +-15.00 -0.42201 0.14538 +-10.00 -0.47384 0.03066 +-7.000 -0.31633 0.02323 +-5.000 -0.17261 0.02101 +-2.000 0.062180 0.02041 +0.0000 0.217500 0.02160 +2.0000 0.362500 0.02415 +5.0000 0.545000 0.03092 +8.0000 0.663400 0.04315 +10.000 0.715250 0.05540 +12.000 0.772350 0.07025 +15.000 0.846930 0.09997 +17.000 0.793240 0.14274 +20.000 0.741380 0.21541 +25.000 0.809181 0.31423 +30.000 0.799410 0.45780 +35.000 0.842714 0.58514 +40.000 0.859940 0.72557 +50.000 0.842806 1.01662 +60.000 0.753790 1.27954 +70.000 0.581530 1.49396 +80.000 0.346121 1.63350 +90.000 0.074679 1.67220 +#Sec_2, alpha,cl,cd +-15.00 -0.42201 0.14538 +-10.00 -0.47384 0.03066 +-7.000 -0.31633 0.02323 +-5.000 -0.17261 0.02101 +-2.000 0.062180 0.02041 +0.0000 0.217500 0.02160 +2.0000 0.362500 0.02415 +5.0000 0.545000 0.03092 +8.0000 0.663400 0.04315 +10.000 0.715250 0.05540 +12.000 0.772350 0.07025 +15.000 0.846930 0.09997 +17.000 0.793240 0.14274 +20.000 0.741380 0.21541 +25.000 0.809181 0.31423 +30.000 0.799410 0.45780 +35.000 0.842714 0.58514 +40.000 0.859940 0.72557 +50.000 0.842806 1.01662 +60.000 0.753790 1.27954 +70.000 0.581530 1.49396 +80.000 0.346121 1.63350 +90.000 0.074679 1.67220 +#Sec_3, alpha,cl,cd +-15.00 -0.42201 0.14538 +-10.00 -0.47384 0.03066 +-7.000 -0.31633 0.02323 +-5.000 -0.17261 0.02101 +-2.000 0.062180 0.02041 +0.0000 0.217500 0.02160 +2.0000 0.362500 0.02415 +5.0000 0.545000 0.03092 +8.0000 0.663400 0.04315 +10.000 0.715250 0.05540 +12.000 0.772350 0.07025 +15.000 0.846930 0.09997 +17.000 0.793240 0.14274 +20.000 0.741380 0.21541 +25.000 0.809181 0.31423 +30.000 0.799410 0.45780 +35.000 0.842714 0.58514 +40.000 0.859940 0.72557 +50.000 0.842806 1.01662 +60.000 0.753790 1.27954 +70.000 0.581530 1.49396 +80.000 0.346121 1.63350 +90.000 0.074679 1.67220 +#Sec_4, alpha,cl,cd +-15.00 -0.42201 0.14538 +-10.00 -0.47384 0.03066 +-7.000 -0.31633 0.02323 +-5.000 -0.17261 0.02101 +-2.000 0.062180 0.02041 +0.0000 0.217500 0.02160 +2.0000 0.362500 0.02415 +5.0000 0.545000 0.03092 +8.0000 0.663400 0.04315 +10.000 0.715250 0.05540 +12.000 0.772350 0.07025 +15.000 0.846930 0.09997 +17.000 0.793240 0.14274 +20.000 0.741380 0.21541 +25.000 0.809181 0.31423 +30.000 0.799410 0.45780 +35.000 0.842714 0.58514 +40.000 0.859940 0.72557 +50.000 0.842806 1.01662 +60.000 0.753790 1.27954 +70.000 0.581530 1.49396 +80.000 0.346121 1.63350 +90.000 0.074679 1.67220 +#Sec_5, alpha,cl,cd +-15.00 -0.42201 0.14538 +-10.00 -0.47384 0.03066 +-7.000 -0.31633 0.02323 +-5.000 -0.17261 0.02101 +-2.000 0.062180 0.02041 +0.0000 0.217500 0.02160 +2.0000 0.362500 0.02415 +5.0000 0.545000 0.03092 +8.0000 0.663400 0.04315 +10.000 0.715250 0.05540 +12.000 0.772350 0.07025 +15.000 0.846930 0.09997 +17.000 0.793240 0.14274 +20.000 0.741380 0.21541 +25.000 0.809181 0.31423 +30.000 0.799410 0.45780 +35.000 0.842714 0.58514 +40.000 0.859940 0.72557 +50.000 0.842806 1.01662 +60.000 0.753790 1.27954 +70.000 0.581530 1.49396 +80.000 0.346121 1.63350 +90.000 0.074679 1.67220 +#Sec_6,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_7,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_8,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_9,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_10,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_11,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_12,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_13,alpha,cl,cd +-15.00 -0.38500 0.18600 +-10.00 -0.39240 0.08201 +-7.000 -0.34387 0.02873 +-5.000 -0.16518 0.02386 +-2.000 0.119372 0.02119 +0.0000 0.311530 0.02133 +2.0000 0.500006 0.02276 +5.0000 0.767233 0.02742 +8.0000 0.997630 0.03621 +10.000 1.114230 0.04588 +12.000 1.181340 0.06145 +15.000 1.152260 0.10511 +17.000 1.004230 0.16952 +20.000 0.920632 0.26388 +25.000 0.932029 0.40397 +30.000 0.956910 0.54778 +35.000 0.974480 0.71086 +40.000 0.990417 0.86521 +50.000 0.953389 1.17309 +60.000 0.823469 1.46302 +70.000 0.606730 1.70462 +80.000 0.320770 1.86131 +90.000 -0.00218 1.90357 +#Sec_14,alpha,cl,cd +-15.00 -0.71025 0.250000 +-10.00 -0.62520 0.152360 +-7.000 -0.46165 0.067514 +-5.000 -0.31109 0.028340 +-2.000 0.002995 0.020170 +0.0000 0.209724 0.019035 +2.0000 0.420804 0.019842 +5.0000 0.726100 0.024640 +8.0000 1.005110 0.035811 +10.000 1.142203 0.051340 +12.000 1.071063 0.097789 +15.000 0.885860 0.219350 +17.000 0.917480 0.273890 +20.000 0.929127 0.350000 +25.000 0.982100 0.480000 +30.000 1.038380 0.614900 +35.000 1.072214 0.704314 +40.000 1.082084 0.920430 +50.000 1.032150 1.244025 +60.000 0.884800 1.549000 +70.000 0.652577 1.810174 +80.000 0.346247 1.982400 +90.000 -0.00090 2.034369 +#Sec_15,alpha,cl,cd +-15.00 -0.71025 0.250000 +-10.00 -0.62520 0.152360 +-7.000 -0.46165 0.067514 +-5.000 -0.31109 0.028340 +-2.000 0.002995 0.020170 +0.0000 0.209724 0.019035 +2.0000 0.420804 0.019842 +5.0000 0.726100 0.024640 +8.0000 1.005110 0.035811 +10.000 1.142203 0.051340 +12.000 1.071063 0.097789 +15.000 0.885860 0.219350 +17.000 0.917480 0.273890 +20.000 0.929127 0.350000 +25.000 0.982100 0.480000 +30.000 1.038380 0.614900 +35.000 1.072214 0.704314 +40.000 1.082084 0.920430 +50.000 1.032150 1.244025 +60.000 0.884800 1.549000 +70.000 0.652577 1.810174 +80.000 0.346247 1.982400 +90.000 -0.00090 2.034369 +#Sec_16,alpha,cl,cd +-15.00 -0.450235 0.123572 +-10.00 -0.509059 0.092961 +-7.000 -0.473475 0.068098 +-5.000 -0.311293 0.028335 +-2.000 -0.000500 0.020111 +0.0000 0.212258 0.019451 +2.0000 0.423786 0.020642 +5.0000 0.731349 0.026056 +8.0000 1.008821 0.038666 +10.000 1.135043 0.058155 +12.000 0.937040 0.138576 +15.000 0.964997 0.255187 +17.000 0.872200 0.324306 +20.000 0.857793 0.333029 +25.000 0.922114 0.460801 +30.000 1.045545 0.626256 +35.000 1.076223 0.775646 +40.000 1.084297 0.932095 +50.000 1.031466 1.254707 +60.000 0.883621 1.561348 +70.000 0.645650 1.814277 +80.000 0.337736 1.982865 +90.000 -0.00965 2.034968 +#Sec_17,alpha,cl,cd +-15.00 -0.450235 0.123572 +-10.00 -0.509059 0.092961 +-7.000 -0.473475 0.068098 +-5.000 -0.311293 0.028335 +-2.000 -0.000500 0.020111 +0.0000 0.212258 0.019451 +2.0000 0.423786 0.020642 +5.0000 0.731349 0.026056 +8.0000 1.008821 0.038666 +10.000 1.135043 0.058155 +12.000 0.937040 0.138576 +15.000 0.964997 0.255187 +17.000 0.872200 0.324306 +20.000 0.857793 0.333029 +25.000 0.922114 0.460801 +30.000 1.045545 0.626256 +35.000 1.076223 0.775646 +40.000 1.084297 0.932095 +50.000 1.031466 1.254707 +60.000 0.883621 1.561348 +70.000 0.645650 1.814277 +80.000 0.337736 1.982865 +90.000 -0.00965 2.034968 +#Sec_18,alpha,cl,cd +-15.00 -0.450235 0.123572 +-10.00 -0.509059 0.092961 +-7.000 -0.473475 0.068098 +-5.000 -0.311293 0.028335 +-2.000 -0.000500 0.020111 +0.0000 0.212258 0.019451 +2.0000 0.423786 0.020642 +5.0000 0.731349 0.026056 +8.0000 1.008821 0.038666 +10.000 1.135043 0.058155 +12.000 0.937040 0.138576 +15.000 0.964997 0.255187 +17.000 0.872200 0.324306 +20.000 0.857793 0.333029 +25.000 0.922114 0.460801 +30.000 1.045545 0.626256 +35.000 1.076223 0.775646 +40.000 1.084297 0.932095 +50.000 1.031466 1.254707 +60.000 0.883621 1.561348 +70.000 0.645650 1.814277 +80.000 0.337736 1.982865 +90.000 -0.00965 2.034968 +#Sec_19,alpha,cl,cd +-15.00 -0.624154 0.154154 +-10.00 -0.538409 0.080512 +-7.000 -0.481732 0.075544 +-5.000 -0.313564 0.031177 +-2.000 -0.002507 0.018085 +0.0000 0.210838 0.016733 +2.0000 0.422316 0.017475 +5.0000 0.727235 0.022779 +8.0000 0.990487 0.038041 +10.000 1.023327 0.079155 +12.000 1.014323 0.123481 +15.000 1.002321 0.213523 +17.000 0.965321 0.261254 +20.000 0.942346 0.312364 +25.000 0.925641 0.375215 +30.000 1.056059 0.616220 +35.000 1.086160 0.764234 +40.000 1.097267 0.923027 +50.000 1.046694 1.250085 +60.000 0.903101 1.564407 +70.000 0.665977 1.821230 +80.000 0.357959 1.994476 +90.000 0.008920 2.053167 +#Sec_20,alpha,cl,cd +-15.00 -0.624154 0.154154 +-10.00 -0.538409 0.080512 +-7.000 -0.481732 0.075544 +-5.000 -0.313564 0.031177 +-2.000 -0.002507 0.018085 +0.0000 0.210838 0.016733 +2.0000 0.422316 0.017475 +5.0000 0.727235 0.022779 +8.0000 0.990487 0.038041 +10.000 1.023327 0.079155 +12.000 1.014323 0.123481 +15.000 1.002321 0.213523 +17.000 0.965321 0.261254 +20.000 0.942346 0.312364 +25.000 0.925641 0.375215 +30.000 1.056059 0.616220 +35.000 1.086160 0.764234 +40.000 1.097267 0.923027 +50.000 1.046694 1.250085 +60.000 0.903101 1.564407 +70.000 0.665977 1.821230 +80.000 0.357959 1.994476 +90.000 0.008920 2.053167 +#Sec_21,alpha,cl,cd +-15.00 -0.624154 0.154154 +-10.00 -0.538409 0.080512 +-7.000 -0.481732 0.075544 +-5.000 -0.313564 0.031177 +-2.000 -0.002507 0.018085 +0.0000 0.210838 0.016733 +2.0000 0.422316 0.017475 +5.0000 0.727235 0.022779 +8.0000 0.990487 0.038041 +10.000 1.023327 0.079155 +12.000 1.014323 0.123481 +15.000 1.002321 0.213523 +17.000 0.965321 0.261254 +20.000 0.942346 0.312364 +25.000 0.925641 0.375215 +30.000 1.056059 0.616220 +35.000 1.086160 0.764234 +40.000 1.097267 0.923027 +50.000 1.046694 1.250085 +60.000 0.903101 1.564407 +70.000 0.665977 1.821230 +80.000 0.357959 1.994476 +90.000 0.008920 2.053167 +#Sec_22,alpha,cl,cd +-15.00 -0.624154 0.154154 +-10.00 -0.538409 0.080512 +-7.000 -0.481732 0.075544 +-5.000 -0.313564 0.031177 +-2.000 -0.002507 0.018085 +0.0000 0.210838 0.016733 +2.0000 0.422316 0.017475 +5.0000 0.727235 0.022779 +8.0000 0.990487 0.038041 +10.000 1.023327 0.079155 +12.000 1.014323 0.123481 +15.000 1.002321 0.213523 +17.000 0.965321 0.261254 +20.000 0.942346 0.312364 +25.000 0.925641 0.375215 +30.000 1.056059 0.616220 +35.000 1.086160 0.764234 +40.000 1.097267 0.923027 +50.000 1.046694 1.250085 +60.000 0.903101 1.564407 +70.000 0.665977 1.821230 +80.000 0.357959 1.994476 +90.000 0.008920 2.053167 diff --git a/TestCases/rans/actuatordisk_bem/readme.txt b/TestCases/rans/actuatordisk_bem/readme.txt new file mode 100644 index 00000000000..be9887fd9f4 --- /dev/null +++ b/TestCases/rans/actuatordisk_bem/readme.txt @@ -0,0 +1,15 @@ +Propeller data provided as the test case here is the propeller used in the studies of Sinnige et al. 2018 in their experimental studies. Isolated propeller geometry as .stp file and experimental results (J vs CT, J vs CP) are provided as supplementary materials along with the publication. + +The current test case corresponds to the four bladed propeller of diameter 0.237m in a freestream velocity (Vinf) of 40m/s, advance ratio of J=0.8, propeller blade angle at 0.75R is 23.9 degrees. + +The experimental thrust and power (Non-Dimensional) at J ~ 0.8 are as follows: + +J=Vinf/nD CT=Thrust/rho*n2*D4 CP=Power/rho*n3*D5 +0.7963 0.0953 0.1025 + + +Reference: +----------- +Sinnige, T., van Arnhem, N., Stokkermans, T. C. A., Eitelberg, G., Veldhuis, L. L. M., ``Wingtip-Mounted + Propellers: Aerodynamic Analysis of Interaction Effects and Comparison with Conventional Layout,'' + Journal of Aircraft, 2018. From d3eb65300ea538f97920a518187418e36630f7e3 Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Thu, 28 Sep 2023 10:08:30 +0530 Subject: [PATCH 044/139] Update readme.txt Added dimensional values of Thrust and Torque which can be compared with the simulation output --- TestCases/rans/actuatordisk_bem/readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/TestCases/rans/actuatordisk_bem/readme.txt b/TestCases/rans/actuatordisk_bem/readme.txt index be9887fd9f4..82853c69a44 100644 --- a/TestCases/rans/actuatordisk_bem/readme.txt +++ b/TestCases/rans/actuatordisk_bem/readme.txt @@ -7,6 +7,7 @@ The experimental thrust and power (Non-Dimensional) at J ~ 0.8 are as follows: J=Vinf/nD CT=Thrust/rho*n2*D4 CP=Power/rho*n3*D5 0.7963 0.0953 0.1025 +The dimensional values are Thrust = 16.30 N and Torque = 0.6612 N-m. Reference: ----------- From 458dddd7a60247343933b6f5d2e1dbf896aaae84 Mon Sep 17 00:00:00 2001 From: tnv-nal Date: Thu, 28 Sep 2023 10:50:27 +0530 Subject: [PATCH 045/139] Update actuatordisk_bem.cfg Reduced number of iterations to 2000 --- TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index 45d2094f64b..130e0cda4e2 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -199,7 +199,7 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % Maximum number of iterations -ITER= 5000 +ITER= 2000 % % Convergence criteria (CAUCHY, RESIDUAL) %CONV_CRITERIA= RESIDUAL From c62e7cd40df81aeebaf9ba7005008d04d5656e2c Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Thu, 28 Sep 2023 15:39:16 +0530 Subject: [PATCH 046/139] corrections in comments, su2 style comments, whitespaces --- Common/include/CConfig.hpp | 54 ++++++++++-- Common/include/option_structure.inl | 2 - Common/src/CConfig.cpp | 8 +- SU2_CFD/include/solvers/CEulerSolver.hpp | 13 ++- SU2_CFD/include/solvers/prop_defs.hpp | 27 ++++++ SU2_CFD/src/solvers/CEulerSolver.cpp | 102 +++++++++++------------ subprojects/CoolProp | 1 - 7 files changed, 141 insertions(+), 66 deletions(-) delete mode 160000 subprojects/CoolProp diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index e50576ba2eb..5bb9daa5d3f 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -344,15 +344,15 @@ class CConfig { su2double *ActDiskOutlet_GrossThrust; /*!< \brief Specified outlet gross thrust for actuator disk. */ su2double *ActDiskOutlet_Force; /*!< \brief Specified outlet force for actuator disk. */ su2double *ActDiskOutlet_Power; /*!< \brief Specified outlet power for actuator disk. */ - su2double *ActDiskOutlet_Thrust_BEM; /*!< \brief Specified outlet power for actuator disk. */ - su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet power for actuator disk. */ + su2double *ActDiskOutlet_Thrust_BEM; /*!< \brief Specified outlet thrust for actuator disk. */ + su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet torque for actuator disk. */ su2double **ActDisk_PressJump, **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ - su2double **ActDisk_XCG, **ActDisk_YCG, **ActDisk_ZCG; - su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate */ - su2double BEM_blade_angle ; /*!< \brief Propeller blade angle */ - string BEM_prop_filename ; /*!< \brief Propeller blade angle */ - bool History_File_Append_Flag; /*!< \brief Flag to append history file */ + su2double **ActDisk_XCG, **ActDisk_YCG, **ActDisk_ZCG; /*!< \brief Specified CG for actuator disk.*/ + su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate.*/ + su2double BEM_blade_angle ; /*!< \brief Propeller blade angle.*/ + string BEM_prop_filename ; /*!< \brief Propeller filename.*/ + bool History_File_Append_Flag; /*!< \brief Flag to append history file.*/ su2double *ActDisk_DeltaPress; /*!< \brief Specified pressure delta for actuator disk. */ su2double *ActDisk_DeltaTemp; /*!< \brief Specified temperature delta for actuator disk. */ su2double *ActDisk_TotalPressRatio; /*!< \brief Specified tot. pres. ratio for actuator disk. */ @@ -6657,12 +6657,28 @@ class CConfig { su2double GetActDisk_PressJump(const string& val_marker, unsigned short val_index) const; /*! - * \brief Get the CG of the actuator disk. + * \brief Get the XCG of the actuator disk. */ su2double GetActDisk_XCG(string val_marker, unsigned short val_index) const; + + /*! + * \brief Get the YCG of the actuator disk. + */ su2double GetActDisk_YCG(string val_marker, unsigned short val_index) const; + + /*! + * \brief Get the ZCG of the actuator disk. + */ su2double GetActDisk_ZCG(string val_marker, unsigned short val_index) const; + + /*! + * \brief Get the blade angle of the propeller. + */ su2double GetBEM_blade_angle(void) { return BEM_blade_angle; } + + /*! + * \brief Get the filename of the propeller. + */ string GetBEM_prop_filename(void) { return BEM_prop_filename; } /*! @@ -8207,7 +8223,18 @@ class CConfig { */ su2double GetActDiskOutlet_Power(const string& val_marker) const; + /*! + * \brief Get the thrust at the actuator disk outlet boundary. + * \param[in] val_marker - Marker corresponding to the outlet (actuator disk) boundary. + * \return The outlet (actuator disk) thrust. + */ su2double GetActDiskOutlet_Thrust_BEM(string val_marker) const; + + /*! + * \brief Get the torque at the actuator disk outlet boundary. + * \param[in] val_marker - Marker corresponding to the outlet boundary. + * \return The outlet (actuator disk) torque. + */ su2double GetActDiskOutlet_Torque_BEM(string val_marker) const; /*! @@ -8245,7 +8272,18 @@ class CConfig { */ void SetActDiskOutlet_Power(unsigned short val_marker, su2double val_actdisk_power) { ActDiskOutlet_Power[val_marker] = val_actdisk_power; } + /*! + * \brief Set the thrust at the outlet (actuator disk) boundary. + * \param[in] val_marker - Marker corresponding to the outlet (actuator disk) boundary. + * \param[in] val_actdisk_thrust_bem - Value of the actuator disk thrust. + */ void SetActDiskOutlet_Thrust_BEM(unsigned short val_marker, su2double val_actdisk_thrust_bem) { ActDiskOutlet_Thrust_BEM[val_marker] = val_actdisk_thrust_bem; } + + /*! + * \brief Get the back pressure (static) at an outlet boundary. + * \param[in] val_marker - Marker corresponding to the outlet boundary. + * \param[in] val_actdisk_torque_bem - Value of the actuator disk torque. + */ void SetActDiskOutlet_Torque_BEM(unsigned short val_marker, su2double val_actdisk_torque_bem) { ActDiskOutlet_Torque_BEM[val_marker] = val_actdisk_torque_bem; } /*! diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index c4592c56681..12c7340aafc 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -1772,7 +1772,6 @@ class COptionActDisk : public COptionBase { } }; -// { bem-vlad class COptionActDiskCentroid : public COptionBase { string name; // identifier for the option unsigned short & inlet_size; @@ -1866,7 +1865,6 @@ public: this->actdisk_zcg = NULL; } }; -// } bem-vlad class COptionWallFunction : public COptionBase { string name; // identifier for the option diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 07be649f1b8..17f534557c9 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -920,6 +920,7 @@ void CConfig::SetPointersNull() { ActDiskOutlet_TotalPressure = nullptr; ActDiskOutlet_GrossThrust = nullptr; ActDiskOutlet_Force = nullptr; ActDiskOutlet_Power = nullptr; ActDiskOutlet_Temperature = nullptr; ActDiskOutlet_TotalTemperature = nullptr; ActDiskOutlet_MassFlow = nullptr; + ActDiskOutlet_Thrust_BEM = nullptr; ActDiskOutlet_Torque_BEM = nullptr; @@ -1524,6 +1525,8 @@ void CConfig::SetConfig_Options() { addActDiskOption("MARKER_ACTDISK", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); + + /*!\brief MARKER_ACTDISK_CG\n DESCRIPTION: Actuator disk with CG for blade element momentum (BEM) method. \ingroup Config*/ addActDiskOption("MARKER_ACTDISK_CG", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_XCG, ActDisk_YCG, ActDisk_ZCG); @@ -1654,10 +1657,11 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Actuator disk double surface */ addBoolOption("ACTDISK_DOUBLE_SURFACE", ActDisk_DoubleSurface, false); - /* DESCRIPTION: History File Append */ + /* DESCRIPTION: Actuator disk BEM switch for history file appending.*/ addBoolOption("HISTORY_FILE_APPEND", History_File_Append_Flag, false); - /* DESCRIPTION: Propeller_Blade_angle */ + /* DESCRIPTION: Propeller blade angle for actuator disk BEM.*/ addDoubleOption("BEM_PROP_BLADE_ANGLE", BEM_blade_angle, 23.9); + /* DESCRIPTION: Propeller file name for actuator disk BEM.*/ addStringOption("BEM_PROP_FILENAME", BEM_prop_filename,string("prop_geom_alfclcd_data.txt")); /* DESCRIPTION: Only half engine is in the computational grid */ diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 56d60fcf37c..22ae4b338a2 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -537,7 +537,16 @@ class CEulerSolver : public CFVMFlowSolverBase. + */ + #define BEM_MAXR 50 #define BEM_MAXALF 100 #define BEM_MAX_ITER 20 diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index aa7946b81c2..5efd95e9839 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -194,6 +194,8 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, AllocVectorOfVectors(nVertex, ActDisk_Fy); AllocVectorOfVectors(nVertex, ActDisk_Fz); + /*--- Actuator Disk BEM Fa, Fx, Fy and Fz allocations ---*/ + AllocVectorOfVectors(nVertex, ActDisk_Fa_BEM); AllocVectorOfVectors(nVertex, ActDisk_Fx_BEM); AllocVectorOfVectors(nVertex, ActDisk_Fy_BEM); @@ -203,11 +205,18 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, AllocVectorOfVectors(nVertex, ActDisk_DeltaP); + /*--- Store the value of rotation rate of the Actuator Disk for BEM ---*/ + AllocVectorOfVectors(nVertex, ActDisk_RotRate); + + /*--- Store the value of CG of the Actuator Disk for BEM ---*/ + AllocVectorOfVectors(nVertex, ActDisk_XCG); AllocVectorOfVectors(nVertex, ActDisk_YCG); AllocVectorOfVectors(nVertex, ActDisk_ZCG); + /*--- Store the value of DeltaP_r, Thrust_r and Torque_r at the Actuator Disk for BEM ---*/ + AllocVectorOfVectors(nVertex, ActDisk_DeltaP_r); AllocVectorOfVectors(nVertex, ActDisk_Thrust_r); AllocVectorOfVectors(nVertex, ActDisk_Torque_r); @@ -2836,9 +2845,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns Outlet_Force_Local[iMarker_Outlet] += Outlet_Force[iMarker]; Outlet_Power_Local[iMarker_Outlet] += Outlet_Power[iMarker]; Outlet_Area_Local[iMarker_Outlet] += Outlet_Area[iMarker]; - Outlet_DeltaP_Local[iMarker_Outlet] += Outlet_DeltaP[iMarker]; - Outlet_Thrust_Local[iMarker_Outlet] += Outlet_Thrust[iMarker]; - Outlet_Torque_Local[iMarker_Outlet] += Outlet_Torque[iMarker]; + Outlet_DeltaP_Local[iMarker_Outlet] += Outlet_DeltaP[iMarker]; + Outlet_Thrust_Local[iMarker_Outlet] += Outlet_Thrust[iMarker]; + Outlet_Torque_Local[iMarker_Outlet] += Outlet_Torque[iMarker]; } } @@ -3444,7 +3453,7 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns } -// { bem-vlad +// { actuatordisk-bem //.......function 'readsdata_' reads alpha, cl and cd values from the files........................ //float readsdata_(char *sec_filename,propeller_geom_struct *s_prop, propeller_section_struct *sprop_sec) void readsdata_(char *sec_filename,dpropeller_geom_struct *s_prop, dpropeller_section_struct *sprop_sec) @@ -3671,7 +3680,7 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro *Torque = Dtorq[0]*tem1; } else - { + { if (rad_p > r_tip) { *dp_at_r = 0.0; @@ -3705,6 +3714,7 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro } //---------------------------------------------------------------------- } +// } actuatordisk-bem void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, bool Output) { @@ -3771,15 +3781,15 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con } } } - if(InnerIter == 0) - { + if(InnerIter == 0) + { strcpy(section_prop_filename,config->GetBEM_prop_filename().c_str()); readsdata_(section_prop_filename,&s_prop,&sprop_sec); - } - /* Update the propeller load according to the modified flow field after every 40 inner iterations */ - if(InnerIter % 40 == 0){ - GenActDiskData_BEM_VLAD(geometry, solver_container, config, iMesh,s_prop,sprop_sec,Output); - } + } + /* Update the propeller load according to the modified flow field after every 40 inner iterations */ + if(InnerIter % 40 == 0){ + GenActDiskData_BEM_VLAD(geometry, solver_container, config, iMesh,s_prop,sprop_sec,Output); + } } /*--- Variable load distribution is in input file. ---*/ @@ -4387,7 +4397,6 @@ void CEulerSolver::ReadActDisk_InputFile(CGeometry *geometry, CSolver **solver_c } } -// { bem-vlad void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver_container,CConfig *config, unsigned short iMesh, dpropeller_geom_struct s_prop, dpropeller_section_struct &sprop_sec, bool Output) { unsigned short iDim, iMarker; @@ -4419,9 +4428,8 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); //Read Swirl params Omega_RPM = GetActDisk_RotRate(iMarker, iVertex); @@ -4452,18 +4460,17 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver for (iDim = 0; iDim < nDim; iDim++) Area += Normal[iDim]*Normal[iDim]; Area = sqrt (Area); - for (iDim = 0; iDim < nDim; iDim++) - UnitNormal[iDim] = Normal[iDim]/Area; + for (iDim = 0; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; - if (geometry->nodes->GetDomain(iPoint)) { - Coord = geometry->nodes->GetCoord(iPoint) ; - } + if (geometry->nodes->GetDomain(iPoint)) { + Coord = geometry->nodes->GetCoord(iPoint) ; + } - radius = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - radius += (Coord[iDim]-Origin[iDim])*(Coord[iDim]-Origin[iDim]); - radius_[iDim] = (Coord[iDim]-Origin[iDim]); - } + radius = 0.0; + for (iDim = 0; iDim < nDim; iDim++){ + radius += (Coord[iDim]-Origin[iDim])*(Coord[iDim]-Origin[iDim]); + radius_[iDim] = (Coord[iDim]-Origin[iDim]); + } radius = sqrt(radius); /*--- Current solution at this boundary node and jumps values ---*/ V_domain = nodes->GetPrimitive(iPoint); @@ -4474,7 +4481,7 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver for (iDim = 0; iDim < nDim; iDim++) { Vn += V_domain[iDim+1]*UnitNormal[iDim]; } RPM = abs(Omega_RPM); - rps = RPM/60.0; + rps = RPM/60.0; AD_J = Vel_FreeStream[0]/(rps*dia); rho = V_domain[nDim+2] ; T = V_domain[0] ; @@ -4491,40 +4498,38 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver loc_thrust += dp_at_r*Area; Target_Press_Jump = dp_at_r; Target_Temp_Jump = Target_Press_Jump/(rho*287.0); - - ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; - ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; - ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); - /* Non-dimensionalize the elemental load */ - dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); - //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); - dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); - /* Force radial load to 0 as there is no information of radial load from BEM */ - dCr_v = 0.0; - rad_v = radius/r_tip; - //Fa = (dCt_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ + + ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; + ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; + ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); + /* Non-dimensionalize the elemental load */ + dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); + //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); + dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); + /* Force radial load to 0 as there is no information of radial load from BEM */ + dCr_v = 0.0; + rad_v = radius/r_tip; + //Fa = (dCt_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ // (pow(AD_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); - Fa = dp_at_r; + Fa = dp_at_r; Ft = (dCp_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ ((AD_J*PI_NUMBER*rad_v)*(AD_J*PI_NUMBER*rad_v))) / config->GetPressure_Ref(); Fr = (dCr_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ (pow(AD_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); - Fx = (Ft+Fr)*(radius_[0]/(radius)); + Fx = (Ft+Fr)*(radius_[0]/(radius)); Fy = (Ft+Fr)*(radius_[2]/(radius)); Fz = -(Ft+Fr)*(radius_[1]/(radius)); - ActDisk_Fa_BEM[iMarker][iVertex] = Fa; + ActDisk_Fa_BEM[iMarker][iVertex] = Fa; ActDisk_Fx_BEM[iMarker][iVertex] = Fx; ActDisk_Fy_BEM[iMarker][iVertex] = Fy; ActDisk_Fz_BEM[iMarker][iVertex] = Fz; - } -//--------------------------------------------------------------------------------------------------------------------------------------------------------- - } +//--------------------------------------------------------------- + } } } delete [] Normal; } -// } bem-vlad void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, bool Output) { @@ -8804,7 +8809,6 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver END_SU2_OMP_FOR } -// { bem-vlad void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker, bool val_inlet_surface) { @@ -9042,10 +9046,6 @@ void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con } } - - -// } bem-vlad - void CEulerSolver::PrintVerificationError(const CConfig *config) const { if ((rank != MASTER_NODE) || (MGLevel != MESH_0)) return; diff --git a/subprojects/CoolProp b/subprojects/CoolProp deleted file mode 160000 index bafdea1f39e..00000000000 --- a/subprojects/CoolProp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bafdea1f39ee873a6bb9833e3a21fe41f90b85e8 From 9ae8d28553e104d0fdcb02c728075a0f04f1eda4 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Thu, 28 Sep 2023 16:45:32 +0530 Subject: [PATCH 047/139] restore accidental rm of subprojects/CoolProp --- subprojects/CoolProp | 1 + 1 file changed, 1 insertion(+) create mode 160000 subprojects/CoolProp diff --git a/subprojects/CoolProp b/subprojects/CoolProp new file mode 160000 index 00000000000..0ce42fcf3bb --- /dev/null +++ b/subprojects/CoolProp @@ -0,0 +1 @@ +Subproject commit 0ce42fcf3bb2c373512bc825a4f0c1973a78f307 From 4c4e200c32bf3500e421eca9ddca0a34657a2733 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 29 Sep 2023 07:05:37 +0530 Subject: [PATCH 048/139] minor whitespaces --- SU2_CFD/include/solvers/prop_defs.hpp | 64 ++++---- SU2_CFD/src/solvers/CEulerSolver.cpp | 144 +++++++++--------- .../actuatordisk_bem/actuatordisk_bem.cfg | 12 +- .../prop_geom_alfclcd_data.txt | 2 +- TestCases/rans/actuatordisk_bem/readme.txt | 2 +- 5 files changed, 112 insertions(+), 112 deletions(-) diff --git a/SU2_CFD/include/solvers/prop_defs.hpp b/SU2_CFD/include/solvers/prop_defs.hpp index 7a4a6b9cbe8..c599606dce5 100644 --- a/SU2_CFD/include/solvers/prop_defs.hpp +++ b/SU2_CFD/include/solvers/prop_defs.hpp @@ -29,42 +29,42 @@ #define BEM_MAXALF 100 #define BEM_MAX_ITER 20 -typedef struct +typedef struct { - int nblades; - float dia; - float rhub; - float ang0_75; -} propeller_geom_struct; + int nblades; + float dia; + float rhub; + float ang0_75; +} propeller_geom_struct; -typedef struct +typedef struct { - int nblades; - su2double dia; - su2double rhub; - su2double ang0_75; -} dpropeller_geom_struct; + int nblades; + su2double dia; + su2double rhub; + su2double ang0_75; +} dpropeller_geom_struct; -typedef struct +typedef struct { - int nalf; - int nrad; - float r1[BEM_MAXR]; - float chord[BEM_MAXR]; - float setangle[BEM_MAXR]; - float alf[BEM_MAXALF][BEM_MAXR]; - float cl_arr[BEM_MAXALF][BEM_MAXR]; - float cd_arr[BEM_MAXALF][BEM_MAXR]; -} propeller_section_struct; + int nalf; + int nrad; + float r1[BEM_MAXR]; + float chord[BEM_MAXR]; + float setangle[BEM_MAXR]; + float alf[BEM_MAXALF][BEM_MAXR]; + float cl_arr[BEM_MAXALF][BEM_MAXR]; + float cd_arr[BEM_MAXALF][BEM_MAXR]; +} propeller_section_struct; -typedef struct +typedef struct { - int nalf; - int nrad; - su2double r1[BEM_MAXR]; - su2double chord[BEM_MAXR]; - su2double setangle[BEM_MAXR]; - su2double alf[BEM_MAXALF][BEM_MAXR]; - su2double cl_arr[BEM_MAXALF][BEM_MAXR]; - su2double cd_arr[BEM_MAXALF][BEM_MAXR]; -} dpropeller_section_struct; + int nalf; + int nrad; + su2double r1[BEM_MAXR]; + su2double chord[BEM_MAXR]; + su2double setangle[BEM_MAXR]; + su2double alf[BEM_MAXALF][BEM_MAXR]; + su2double cl_arr[BEM_MAXALF][BEM_MAXR]; + su2double cd_arr[BEM_MAXALF][BEM_MAXR]; +} dpropeller_section_struct; diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 5efd95e9839..2db165c63bf 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -876,7 +876,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes auxFluidModel = new CPengRobinson(Gamma, config->GetGas_Constant(), config->GetPressure_Critical(), config->GetTemperature_Critical(), config->GetAcentric_Factor()); break; - + case DATADRIVEN_FLUID: auxFluidModel = new CDataDrivenFluid(config); @@ -3545,21 +3545,21 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro su2double delta_r[BEM_MAXR],a[BEM_MAXR],b[BEM_MAXR]; static su2double Dtorq[BEM_MAXR]; - su2double n,omega,a0,den; + su2double n,omega,a0,den; su2double ang_offset=0.0; char line[1024]; //........................................... - radtodeg = 180.0/M_PI; - dia = s_prop.dia; - r_hub = s_prop.rhub; + radtodeg = 180.0/M_PI; + dia = s_prop.dia; + r_hub = s_prop.rhub; r_tip = 0.5*dia ; - ang_offset = blade_angle - s_prop.ang0_75; + ang_offset = blade_angle - s_prop.ang0_75; //........................................... alpha_corr = 0.0; base_mach = 0.22 ; b_num = sqrt(1.0-base_mach*base_mach); - a0 = sqrt(1.4*287*T); + a0 = sqrt(1.4*287*T); //........................................... // //Change pitch by ang_offset @@ -3568,20 +3568,20 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro n = RPM/60.0; omega =n*2.0*M_PI; // - for (j=0; j < NR; j++) + for (j=0; j < NR; j++) { - if (j < 1) + if (j < 1) { delta_r[j] = sprop_sec->r1[j+1] - r_hub; } - else + else { - if (j < NR-1) + if (j < NR-1) { delta_r[j] = sprop_sec->r1[j+1] - sprop_sec->r1[j-1]; } else { delta_r[j] = r_tip - sprop_sec->r1[j-1]; } } - delta_r[j] *= 0.5; + delta_r[j] *= 0.5; } //-------------------------------------------------------- @@ -3589,7 +3589,7 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro torque=0.0; //Main Loop ------------------------------------------------------------- - for (j=0; j < NR; j++) + for (j=0; j < NR; j++) { b[j]=0.01; converged=0; @@ -3598,32 +3598,32 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro { V2=omega*sprop_sec->r1[j]*(1-b[j]); V0=V; -// +// phi=atan2(V0,V2); -// +// alpha=sprop_sec->setangle[j] + ang_offset-radtodeg*phi+alpha_corr; - rad = sprop_sec->r1[j] ; -// get cl, cd from lookup table - isec = j+1 ; + rad = sprop_sec->r1[j]; +// get cl, cd from lookup table + isec = j+1; get_clcd_(&isec,sprop_sec, &alpha, &cl, &cd) ; // ...................................... Vlocal=sqrt(V0*V0+V2*V2); - q = 0.5*rho*Vlocal*Vlocal ; - s_mach = Vlocal/a0; - cl_corr_fac = 1.0; - if (s_mach > base_mach) + q = 0.5*rho*Vlocal*Vlocal; + s_mach = Vlocal/a0; + cl_corr_fac = 1.0; + if (s_mach > base_mach) { - den = 1.0-s_mach*s_mach ; - if (den > 0.0) cl_corr_fac = b_num / sqrt(den); + den = 1.0-s_mach*s_mach; + if (den > 0.0) cl_corr_fac = b_num / sqrt(den); } -// ****************************** +// ****************************** cl *= cl_corr_fac ; -// ****************************** -// tip loss factor +// ****************************** +// tip loss factor r_dash = rad / r_tip+1.0e-5; c_phi = cos(phi) ; t_loss = 1.0; - if (r_dash > 0.90) + if (r_dash > 0.90) { t_loss = (2.0/M_PI)*acos(exp(-(1.0*s_prop.nblades*(1-r_dash)/(r_dash*c_phi)))) ; } @@ -3631,8 +3631,8 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro DtDr[j]=q*s_prop.nblades*sprop_sec->chord[j]*(cl*cos(phi)-cd*sin(phi)); DqDr=q*s_prop.nblades*sprop_sec->chord[j]*rad*(cd*cos(phi)+cl*sin(phi)); - DtDr[j] *= t_loss; - DqDr *= t_loss; + DtDr[j] *= t_loss; + DqDr *= t_loss; tem2=DqDr/(4.0*M_PI*rad*rad*rad*rho*V*omega); bnew=0.6*b[j]+0.4*tem2; @@ -3645,7 +3645,7 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro } if (bnew<0.1) b[j]=bnew; - n_iter++ ; + n_iter++ ; if (n_iter>BEM_MAX_ITER) { converged=1; @@ -3658,53 +3658,53 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro //End of Main Loop ------------------------------------------------------------- tem1 = rho*n*n*dia*dia*dia*dia; - tem2 = tem1*dia; + tem2 = tem1*dia; - *Thrust=thrust; + *Thrust=thrust; *Torque=2.0*M_PI* torque; *dp_av=2.0*M_PI* torque; - for (j=0; j < NR; j++) + for (j=0; j < NR; j++) { - DtDr[j] /= (2.0*M_PI*sprop_sec->r1[j]) ; + DtDr[j] /= (2.0*M_PI*sprop_sec->r1[j]) ; Dtorq[j] = Dtorq[j]; } if (rad_p < sprop_sec->r1[0]) { - tem2 = sprop_sec->r1[0] - r_hub ; - tem1 = (rad_p - r_hub)/tem2 ; - tem2 = 1.0 - tem1 ; - *dp_at_r = DtDr[0]*tem1; + tem2 = sprop_sec->r1[0] - r_hub; + tem1 = (rad_p - r_hub)/tem2; + tem2 = 1.0 - tem1; + *dp_at_r = DtDr[0]*tem1; *Torque = Dtorq[0]*tem1; } - else + else { if (rad_p > r_tip) { - *dp_at_r = 0.0; + *dp_at_r = 0.0; *Torque = 0.0; } - else + else { if (rad_p > sprop_sec->r1[NR-1]) { tem2 = r_tip - sprop_sec->r1[NR-1]; tem1 = (rad_p - sprop_sec->r1[NR-1])/tem2 ; - tem2 = 1.0 - tem1 ; - *dp_at_r = DtDr[NR-1]*tem2; + tem2 = 1.0 - tem1; + *dp_at_r = DtDr[NR-1]*tem2; *Torque = Dtorq[NR-1]*tem2; } - else + else { - for (j=0; j < NR-1; j++) + for (j=0; j < NR-1; j++) { - if ((sprop_sec->r1[j] < rad_p) && (sprop_sec->r1[j+1] >= rad_p)) + if ((sprop_sec->r1[j] < rad_p) && (sprop_sec->r1[j+1] >= rad_p)) { tem2 = sprop_sec->r1[j+1] - sprop_sec->r1[j]; tem1 = (rad_p - sprop_sec->r1[j])/tem2 ; - tem2 = 1.0 - tem1 ; + tem2 = 1.0 - tem1; *dp_at_r = DtDr[j]*tem2+DtDr[j+1]*tem1; *Torque = Dtorq[j]*tem2+Dtorq[j+1]*tem1; } @@ -4417,8 +4417,8 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver static su2double loc_Torque = 0.0,tot_Torque = 0.0; static su2double loc_thrust = 0.0,tot_thrust=0.0; static su2double tot_area = 0.0,tot_tq = 0.0; - dia = s_prop.dia; - r_hub = s_prop.rhub; + dia = s_prop.dia; + r_hub = s_prop.rhub; r_tip = 0.5*dia ; su2double Dens_FreeStream = config->GetDensity_FreeStream(); @@ -4463,7 +4463,7 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver for (iDim = 0; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; if (geometry->nodes->GetDomain(iPoint)) { - Coord = geometry->nodes->GetCoord(iPoint) ; + Coord = geometry->nodes->GetCoord(iPoint); } radius = 0.0; @@ -4475,29 +4475,29 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver /*--- Current solution at this boundary node and jumps values ---*/ V_domain = nodes->GetPrimitive(iPoint); //--------------------------------------------------------------- - if (abs(Omega_sw) > 1.0e-1) + if (abs(Omega_sw) > 1.0e-1) { - Vn = 0.0; + Vn = 0.0; for (iDim = 0; iDim < nDim; iDim++) { Vn += V_domain[iDim+1]*UnitNormal[iDim]; } RPM = abs(Omega_RPM); rps = RPM/60.0; AD_J = Vel_FreeStream[0]/(rps*dia); - rho = V_domain[nDim+2] ; - T = V_domain[0] ; - blade_angle = config->GetBEM_blade_angle(); + rho = V_domain[nDim+2]; + T = V_domain[0]; + blade_angle = config->GetBEM_blade_angle(); V = config->GetModVel_FreeStream(); - V = fabs(Vn); + V = fabs(Vn); bem_model_noa(s_prop,&sprop_sec, // Propeller properties radius,V,RPM,rho,T,blade_angle, // Input deltap_r,&Thrust,&Torque,&dp_av,&dp_at_r); // Output - tot_area += Area; - loc_Torque += Torque*Area; - tot_tq += dp_av; - loc_thrust += dp_at_r*Area; + tot_area += Area; + loc_Torque += Torque*Area; + tot_tq += dp_av; + loc_thrust += dp_at_r*Area; Target_Press_Jump = dp_at_r; - Target_Temp_Jump = Target_Press_Jump/(rho*287.0); + Target_Temp_Jump = Target_Press_Jump/(rho*287.0); ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; @@ -4506,7 +4506,7 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); - /* Force radial load to 0 as there is no information of radial load from BEM */ + /* Force radial load to 0 as there is no information of radial load from BEM */ dCr_v = 0.0; rad_v = radius/r_tip; //Fa = (dCt_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ @@ -6113,7 +6113,7 @@ void CEulerSolver::PreprocessBC_Giles(CGeometry *geometry, CConfig *config, CNum { Velocity_i[iDim] = nodes->GetVelocity(iPoint,iDim); } - + ComputeTurboVelocity(Velocity_i, turboNormal, turboVelocity, marker_flag, config->GetKind_TurboMachinery(iZone)); if(nDim ==2){ @@ -8814,22 +8814,22 @@ void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*! * \function BC_ActDisk_BEM_VLAD - * \brief Actuator disk model with Blade Element Method (BEM) + * \brief Actuator disk model with Blade Element Method (BEM) * \author: Chandukrishna Y., T. N. Venkatesh and Josy Pullockara - * Institution: Computational and Theoretical Fluid Dynamics (CTFD), - * CSIR - National Aerospace Laboratories, Bangalore - * Academy of Scientific and Innovative Research, Ghaziabad - * \version 8.0.0 "Harrier" + * Institution: Computational and Theoretical Fluid Dynamics (CTFD), + * CSIR - National Aerospace Laboratories, Bangalore + * Academy of Scientific and Innovative Research, Ghaziabad + * \version 8.0.0 "Harrier" * First release date : September 26 2023 * modified on: * - * Section properties of the propeller given in an input file. + * Section properties of the propeller given in an input file. * Cl, Cd of propeller sections need to be generated earlier and saved in this file * Actuator disk data initialized in function SetActDisk_BCThrust. * Propeller load calculated with Blade Element Method - * Interpolated load at each point on the actuator disk is set in GenActDiskData_BEM_VLAD function + * Interpolated load at each point on the actuator disk is set in GenActDiskData_BEM_VLAD function * Rest calculations follows the Variable Load (BC_ActDisk_VariableLoad) approach - * + * */ unsigned short iDim; diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index 130e0cda4e2..09e594e32a6 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -33,7 +33,7 @@ RESTART_SOL= NO % % System of measurements (SI, US) % International system of units (SI): ( meters, kilograms, Kelvins, -% Newtons = kg m/s^2, Pascals = N/m^2, +% Newtons = kg m/s^2, Pascals = N/m^2, % Density = kg/m^3, Speed = m/s, % Equiv. Area = m^2 ) SYSTEM_MEASUREMENTS= SI @@ -103,16 +103,16 @@ ACTDISK_JUMP= DIFFERENCE % % Actuator disk boundary marker(s) with the following formats (NONE = no marker) % Variable Load: (inlet face marker, outlet face marker, -% 0.0, 0.0, RPM , 0.0, 0.0, RPM) Markers only effectively used. +% 0.0, 0.0, RPM , 0.0, 0.0, RPM) Markers only effectively used. % Change the sign of RPM to change the direction of rotation of the propeller MARKER_ACTDISK = ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 12715.2, 0.0, 0.0, 12715.2) %Actuator Disk CG -%(inlet face marker, outlet face marker, X_CG of inlet, Y_CG of inlet, Z_CG of inlet , -% X_CG of outlet, Y_CG of outlet, Z_CG of outlet), X_CG, Y_CG, Z_CG of both inlet and +%(inlet face marker, outlet face marker, X_CG of inlet, Y_CG of inlet, Z_CG of inlet , +% X_CG of outlet, Y_CG of outlet, Z_CG of outlet), X_CG, Y_CG, Z_CG of both inlet and % outlet markers should be same MARKER_ACTDISK_CG= ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 0.0, 0.0,0.0,0.0) % Input file containing the propeller section data and aerodynamic details of blade sections -BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt +BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt % Propeller blade angle (Degrees) at 0.75*Radius for the current calculation BEM_PROP_BLADE_ANGLE = 23.9 % @@ -148,7 +148,7 @@ CFL_ADAPT= NO % FORCE_X, FORCE_Y, FORCE_Z, THRUST, % TORQUE, TOTAL_HEATFLUX, % MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, -% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, +% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, % SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) % For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. OBJECTIVE_FUNCTION= DRAG diff --git a/TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt b/TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt index 97dbb803b84..8ee50cc1728 100644 --- a/TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt +++ b/TestCases/rans/actuatordisk_bem/prop_geom_alfclcd_data.txt @@ -1,5 +1,5 @@ # Geometric parameters of propeller -4 : number of blades +4 : number of blades 0.237 : diameter (m) 0.01754 : radius of hub (m) 23.9 : angle at 75% radius, has to be consistent with section data diff --git a/TestCases/rans/actuatordisk_bem/readme.txt b/TestCases/rans/actuatordisk_bem/readme.txt index 82853c69a44..58d2abceca3 100644 --- a/TestCases/rans/actuatordisk_bem/readme.txt +++ b/TestCases/rans/actuatordisk_bem/readme.txt @@ -11,6 +11,6 @@ The dimensional values are Thrust = 16.30 N and Torque = 0.6612 N-m. Reference: ----------- -Sinnige, T., van Arnhem, N., Stokkermans, T. C. A., Eitelberg, G., Veldhuis, L. L. M., ``Wingtip-Mounted +Sinnige, T., van Arnhem, N., Stokkermans, T. C. A., Eitelberg, G., Veldhuis, L. L. M., ``Wingtip-Mounted Propellers: Aerodynamic Analysis of Interaction Effects and Comparison with Conventional Layout,'' Journal of Aircraft, 2018. From d46f79cbb1cf6883183907edb22138fc00851083 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 29 Sep 2023 07:06:39 +0530 Subject: [PATCH 049/139] TestCases/parallel_regression.py --- TestCases/parallel_regression.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index f26049592b8..7fe2cc40a55 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -486,6 +486,15 @@ def main(): propeller.timeout = 3200 test_list.append(propeller) + # Actuator disk BEM method for propeller + propeller = TestCase('actuatordisk_bem') + propeller.cfg_dir = "rans/actuatordisk_bem" + propeller.cfg_file = "actuatordisk_bem.cfg" + propeller.test_iter = 15 + propeller.test_vals = [4.4835e-01, -5.226958, -8.297197, 0, -0.004325, -0.565388] + propeller.timeout = 3200 + test_list.append(propeller) + ####################################### ### Axisymmetric Compressible RANS ### ####################################### From 8aa0e5e60536c8926da906a411702c8a4f7958af Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 29 Sep 2023 09:38:07 +0530 Subject: [PATCH 050/139] missed test case regression name --- TestCases/parallel_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 7fe2cc40a55..6ad9c4c3708 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -493,7 +493,7 @@ def main(): propeller.test_iter = 15 propeller.test_vals = [4.4835e-01, -5.226958, -8.297197, 0, -0.004325, -0.565388] propeller.timeout = 3200 - test_list.append(propeller) + test_list.append(actuatordisk_bem) ####################################### ### Axisymmetric Compressible RANS ### From 73fe4ad3c747924cfa4a5ac69e3b345dd345f675 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 29 Sep 2023 12:13:36 +0530 Subject: [PATCH 051/139] remove compiler warnings of unset, unused variabes --- SU2_CFD/src/solvers/CEulerSolver.cpp | 59 +++++++++++++--------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 2db165c63bf..ae390354c77 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -3456,46 +3456,46 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns // { actuatordisk-bem //.......function 'readsdata_' reads alpha, cl and cd values from the files........................ //float readsdata_(char *sec_filename,propeller_geom_struct *s_prop, propeller_section_struct *sprop_sec) -void readsdata_(char *sec_filename,dpropeller_geom_struct *s_prop, dpropeller_section_struct *sprop_sec) +char* readsdata_(char *sec_filename,dpropeller_geom_struct *s_prop, dpropeller_section_struct *sprop_sec) { int i,j,MAXRK,MAXALFK; char dummy[1024]; FILE *file_ang; int sect[BEM_MAXR]; + char* fgets_r=0; //.Read blade section data from file file_ang = fopen(sec_filename,"r"); // To be read from file - fgets(dummy,120,file_ang); + fgets_r = fgets(dummy,120,file_ang); // Skip header - fgets(dummy,120,file_ang); sscanf(dummy,"%d", &s_prop->nblades); - fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->dia); - fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->rhub); - fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->ang0_75); + fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%d", &s_prop->nblades); + fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->dia); + fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->rhub); + fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->ang0_75); //.Skip reading next line................................................. - fgets(dummy,120,file_ang); - fgets(dummy,120,file_ang); + fgets_r = fgets(dummy,120,file_ang); + fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%d%d",&MAXRK,&MAXALFK); sprop_sec-> nrad = MAXRK; sprop_sec-> nalf = MAXALFK; // - fgets(dummy,120,file_ang); + fgets_r = fgets(dummy,120,file_ang); for(i=0; i < MAXRK; i++) { - fgets(dummy,120,file_ang); + fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%d %lf %lf %lf",§[i],&sprop_sec->r1[i],&sprop_sec->chord[i],&sprop_sec->setangle[i]); } //.Read computed alpha v/s cl and cd from the file -// for(i=0; i < MAXRK; i++) { - fgets(dummy,128,file_ang); + fgets_r = fgets(dummy,128,file_ang); for(j=0; j < MAXALFK; j++) { - fgets(dummy,128,file_ang); + fgets_r = fgets(dummy,128,file_ang); sscanf(dummy,"%lf %lf %lf",&sprop_sec->alf[j][i],&sprop_sec->cl_arr[j][i],&sprop_sec->cd_arr[j][i]); } -} -// + } + return fgets_r; } @@ -3538,16 +3538,15 @@ void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *spro { int j,isec,converged,n_iter; int NR=sprop_sec->nrad; - su2double r_75,dia,r_hub,r_tip,alpha_corr,cl_corr_fac; + su2double dia,r_hub,r_tip,alpha_corr,cl_corr_fac; su2double base_mach,s_mach,b_num,thrust,torque; su2double r_dash,t_loss,c_phi,rad,phi,alpha,radtodeg; - su2double anew,bnew,V0,V2,cl,cd,Vlocal,DqDr,tem1,tem2,q; - su2double delta_r[BEM_MAXR],a[BEM_MAXR],b[BEM_MAXR]; + su2double bnew,V0,V2,cl,cd,Vlocal,DqDr,tem1,tem2,q; + su2double delta_r[BEM_MAXR],b[BEM_MAXR]; static su2double Dtorq[BEM_MAXR]; su2double n,omega,a0,den; su2double ang_offset=0.0; - char line[1024]; //........................................... radtodeg = 180.0/M_PI; @@ -4402,23 +4401,21 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver unsigned short iDim, iMarker; unsigned long iVertex, iPoint; string Marker_Tag; - int iRow, nRow, iEl; su2double Omega_sw=0.0,Omega_RPM=0.0,Origin[3]={0.0},radius_[3]={0.0}; static su2double omega_ref=0.0, Lref=0.0; - unsigned long InnerIter = config->GetInnerIter(); - static su2double RPM=0.0,blade_angle=0.0,dia=0.0,r_hub=0.0,r_tip=0.0,rps=0.0,radius=0.0; + static su2double RPM=0.0,blade_angle=0.0,dia=0.0,/*r_hub=0.0,*/r_tip=0.0,rps=0.0,radius=0.0; static su2double V=0.0,rho=0.0,T=0.0; - static su2double Thrust=0.0,Torque=0.0,dp_av=0.0,dp_av1=0.0,dp_at_r=0.0,dp_at_r_Vn=0.0; + static su2double Thrust=0.0,Torque=0.0,dp_av=0.0,/*dp_av1=0.0,*/dp_at_r=0.0; static su2double deltap_r[BEM_MAXR]={0.0}; static su2double AD_Axis[MAXNDIM] = {0.0}, AD_J=0.0; - static su2double Target_Press_Jump=0.0, Target_Temp_Jump=0.0,Area=0.0,UnitNormal[3]={0.0},Vn=0.0; - static su2double Fa=0.0,Ft=0.0,Fr=0.0,Fx=0.0,Fy=0.0,Fz=0.0,dCt_v=0.0,dCp_v=0.0,dCr_v=0.0,rad_v=0.0; - su2double *V_domain,*Coord; - static su2double loc_Torque = 0.0,tot_Torque = 0.0; - static su2double loc_thrust = 0.0,tot_thrust=0.0; + static su2double Target_Press_Jump=0.0, /*Target_Temp_Jump=0.0,*/Area=0.0,UnitNormal[3]={0.0},Vn=0.0; + static su2double Fa=0.0,Ft=0.0,Fr=0.0,Fx=0.0,Fy=0.0,Fz=0.0,/*dCt_v=0.0,*/dCp_v=0.0,dCr_v=0.0,rad_v=0.0; + su2double *V_domain=0, *Coord=0; + static su2double loc_Torque = 0.0; + static su2double loc_thrust = 0.0; static su2double tot_area = 0.0,tot_tq = 0.0; dia = s_prop.dia; - r_hub = s_prop.rhub; + // r_hub = s_prop.rhub; r_tip = 0.5*dia ; su2double Dens_FreeStream = config->GetDensity_FreeStream(); @@ -4497,13 +4494,13 @@ void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver tot_tq += dp_av; loc_thrust += dp_at_r*Area; Target_Press_Jump = dp_at_r; - Target_Temp_Jump = Target_Press_Jump/(rho*287.0); + // Target_Temp_Jump = Target_Press_Jump/(rho*287.0); ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); /* Non-dimensionalize the elemental load */ - dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); + //dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); /* Force radial load to 0 as there is no information of radial load from BEM */ From 345483020dd78650963a4df1f72b02be9536ef01 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 29 Sep 2023 15:02:16 +0530 Subject: [PATCH 052/139] Actuator disk BEM method for propellers feature currently not supported for incompressible or non-equilibrium model or axisymmetric flows. --- Common/src/CConfig.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 17f534557c9..aff893ada9b 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4991,6 +4991,18 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SU2_MPI::Error("Vorticity confinement feature currently not supported for incompressible or non-equilibrium model or axisymmetric flows.", CURRENT_FUNCTION); } + /*--- Actuator disk BEM method for propellers feature currently not supported for incompressible or non-equilibrium model or axisymmetric flows. ---*/ + + if ((Kind_Solver == MAIN_SOLVER::INC_EULER + || Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES + || Kind_Solver == MAIN_SOLVER::INC_RANS + || Kind_Solver == MAIN_SOLVER::NEMO_EULER + || Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES + || Axisymmetric) + && ActDisk_DoubleSurface) { + SU2_MPI::Error("Actuator disk BEM method for propellers feature currently not supported for incompressible or non-equilibrium model or axisymmetric flows.", CURRENT_FUNCTION); + } + /*--- Check the coefficients for the polynomial models. ---*/ if (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::INC_RANS) { From 5adffd027debba50312d5de299a07f30f90309d0 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 29 Sep 2023 20:14:51 +0530 Subject: [PATCH 053/139] BEM method related user input template in config_template.cfg --- config_template.cfg | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config_template.cfg b/config_template.cfg index 811df18a014..e29e6a77626 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -923,8 +923,11 @@ MARKER_INLET= ( NONE ) % Inc. Mass Flow: ( outlet marker, mass flow target (kg/s), ... ) MARKER_OUTLET= ( NONE ) % +% Propeller blade element actuator disk double surface (inlet, outlet) boundary condition +ACTDISK_DOUBLE_SURFACE = NO +% % Actuator disk boundary type (VARIABLE_LOAD, VARIABLES_JUMP, BC_THRUST, -% DRAG_MINUS_THRUST) +% DRAG_MINUS_THRUST, BLADE_ELEMENT) ACTDISK_TYPE= VARIABLES_JUMP % % Actuator disk boundary marker(s) with the following formats (NONE = no marker) @@ -938,11 +941,25 @@ ACTDISK_TYPE= VARIABLES_JUMP % Drag-Thrust: ( inlet face marker, outlet face marker, % Takeoff Drag-Thrust (lbs), 0.0, Takeoff rev/min, % Cruise Drag-Thrust (lbs), 0.0, Cruise rev/min ) +% Blade element: ( inlet face marker, outlet face marker, +% Takeoff Drag-Thrust (lbs), 0.0, Takeoff rev/min, +% Cruise Drag-Thrust (lbs), 0.0, Cruise rev/min ) MARKER_ACTDISK= ( NONE ) % +% Blade element: ( inlet face marker, outlet face marker, +% X_CG of inlet, Y_CG of inlet, Z_CG of inlet, +% X_CG of outlet, Y_CG of outlet, Z_CG of outlet ) +MARKER_ACTDISK_CG= ( NONE ) +% % Actuator disk data input file name ACTDISK_FILENAME= actuatordisk.dat % +% Propeller blade element section and aerodynamic data input file name +BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt +% +% Propeller blade angle (degrees) at (0.75 * radius) +BEM_PROP_BLADE_ANGLE = 25.0 +% % Supersonic inlet boundary marker(s) (NONE = no marker) % Format: (inlet marker, temperature, static pressure, velocity_x, % velocity_y, velocity_z, ... ), i.e. primitive variables specified. From 047d7c4391e8c4c6e42ac1df8605d35cdcbd260f Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Thu, 12 Oct 2023 14:00:50 +0530 Subject: [PATCH 054/139] bem reorg: eliminate prop_defs.h, readsdata_(), bem_model_noa_() and get_clcd_() --- SU2_CFD/include/solvers/CEulerSolver.hpp | 15 +- SU2_CFD/include/solvers/prop_defs.hpp | 70 -- SU2_CFD/src/solvers/CEulerSolver.cpp | 845 ++++++++++++----------- 3 files changed, 461 insertions(+), 469 deletions(-) delete mode 100644 SU2_CFD/include/solvers/prop_defs.hpp diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 22ae4b338a2..373bc79ff38 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -29,7 +29,7 @@ #include "CFVMFlowSolverBase.hpp" #include "../variables/CEulerVariable.hpp" -#include "prop_defs.hpp" +//#include "prop_defs.hpp" /*! * \class CEulerSolver @@ -229,6 +229,17 @@ class CEulerSolver : public CFVMFlowSolverBase. - */ - -#define BEM_MAXR 50 -#define BEM_MAXALF 100 -#define BEM_MAX_ITER 20 - -typedef struct -{ - int nblades; - float dia; - float rhub; - float ang0_75; -} propeller_geom_struct; - -typedef struct -{ - int nblades; - su2double dia; - su2double rhub; - su2double ang0_75; -} dpropeller_geom_struct; - -typedef struct -{ - int nalf; - int nrad; - float r1[BEM_MAXR]; - float chord[BEM_MAXR]; - float setangle[BEM_MAXR]; - float alf[BEM_MAXALF][BEM_MAXR]; - float cl_arr[BEM_MAXALF][BEM_MAXR]; - float cd_arr[BEM_MAXALF][BEM_MAXR]; -} propeller_section_struct; - -typedef struct -{ - int nalf; - int nrad; - su2double r1[BEM_MAXR]; - su2double chord[BEM_MAXR]; - su2double setangle[BEM_MAXR]; - su2double alf[BEM_MAXALF][BEM_MAXR]; - su2double cl_arr[BEM_MAXALF][BEM_MAXR]; - su2double cd_arr[BEM_MAXALF][BEM_MAXR]; -} dpropeller_section_struct; diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index ae390354c77..e529d40a529 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -3453,268 +3453,6 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns } -// { actuatordisk-bem -//.......function 'readsdata_' reads alpha, cl and cd values from the files........................ -//float readsdata_(char *sec_filename,propeller_geom_struct *s_prop, propeller_section_struct *sprop_sec) -char* readsdata_(char *sec_filename,dpropeller_geom_struct *s_prop, dpropeller_section_struct *sprop_sec) -{ - int i,j,MAXRK,MAXALFK; - char dummy[1024]; - FILE *file_ang; - int sect[BEM_MAXR]; - char* fgets_r=0; -//.Read blade section data from file - file_ang = fopen(sec_filename,"r"); -// To be read from file - fgets_r = fgets(dummy,120,file_ang); -// Skip header - fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%d", &s_prop->nblades); - fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->dia); - fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->rhub); - fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->ang0_75); -//.Skip reading next line................................................. - fgets_r = fgets(dummy,120,file_ang); - fgets_r = fgets(dummy,120,file_ang); - sscanf(dummy,"%d%d",&MAXRK,&MAXALFK); - sprop_sec-> nrad = MAXRK; - sprop_sec-> nalf = MAXALFK; -// - fgets_r = fgets(dummy,120,file_ang); - for(i=0; i < MAXRK; i++) - { - fgets_r = fgets(dummy,120,file_ang); - sscanf(dummy,"%d %lf %lf %lf",§[i],&sprop_sec->r1[i],&sprop_sec->chord[i],&sprop_sec->setangle[i]); - } -//.Read computed alpha v/s cl and cd from the file - for(i=0; i < MAXRK; i++) - { - fgets_r = fgets(dummy,128,file_ang); - for(j=0; j < MAXALFK; j++) - { - fgets_r = fgets(dummy,128,file_ang); - sscanf(dummy,"%lf %lf %lf",&sprop_sec->alf[j][i],&sprop_sec->cl_arr[j][i],&sprop_sec->cd_arr[j][i]); - } - } - return fgets_r; -} - - -void get_clcd_(int *isec,dpropeller_section_struct *sprop_sec,su2double *alpha,su2double *cl,su2double *cd) -{ - int i,salf=0; - su2double fact; - -//.interpolating values of cl and cd for given alpha..................................................... - if(*alpha >= sprop_sec->alf[salf][*isec-1] && *alpha <= sprop_sec->alf[sprop_sec->nalf-1][*isec-1]) - { - for(i=0;i < sprop_sec->nalf-1; i++) - { - if(*alpha>=sprop_sec->alf[i][*isec-1] && *alpha <= sprop_sec->alf[i+1][*isec-1]) - { - fact=(*alpha-sprop_sec->alf[i][*isec-1])/(sprop_sec->alf[i+1][*isec-1]-sprop_sec->alf[i][*isec-1]); - *cl=sprop_sec->cl_arr[i][*isec-1] + fact*(sprop_sec->cl_arr[i+1][*isec-1] - sprop_sec->cl_arr[i][*isec-1]); - *cd=sprop_sec->cd_arr[i][*isec-1] + fact*(sprop_sec->cd_arr[i+1][*isec-1] - sprop_sec->cd_arr[i][*isec-1]); - } - } - } - else - { - if(*alpha < sprop_sec->alf[salf][*isec-1]) - { - *cl=sprop_sec->cl_arr[0][*isec-1]; - *cd=sprop_sec->cd_arr[0][*isec-1]; - } - if(*alpha > sprop_sec->alf[sprop_sec->nalf-1][*isec-1]) - { - *cl=sprop_sec->cl_arr[sprop_sec->nalf-1][*isec-1]; - *cd=sprop_sec->cd_arr[sprop_sec->nalf-1][*isec-1]; - } - } -} - -//------------------------------------------------------------------------------------------ -//-------------------------------------------------------------------------------------- -void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *sprop_sec,su2double rad_p,su2double V, su2double RPM, su2double rho, su2double T, su2double blade_angle,su2double DtDr[], su2double *Thrust, su2double *Torque, su2double *dp_av,su2double *dp_at_r) -{ - int j,isec,converged,n_iter; - int NR=sprop_sec->nrad; - su2double dia,r_hub,r_tip,alpha_corr,cl_corr_fac; - su2double base_mach,s_mach,b_num,thrust,torque; - su2double r_dash,t_loss,c_phi,rad,phi,alpha,radtodeg; - su2double bnew,V0,V2,cl,cd,Vlocal,DqDr,tem1,tem2,q; - su2double delta_r[BEM_MAXR],b[BEM_MAXR]; - static su2double Dtorq[BEM_MAXR]; - - su2double n,omega,a0,den; - su2double ang_offset=0.0; - -//........................................... - radtodeg = 180.0/M_PI; - dia = s_prop.dia; - r_hub = s_prop.rhub; - r_tip = 0.5*dia ; - ang_offset = blade_angle - s_prop.ang0_75; -//........................................... - alpha_corr = 0.0; - base_mach = 0.22 ; - b_num = sqrt(1.0-base_mach*base_mach); - a0 = sqrt(1.4*287*T); -//........................................... -// -//Change pitch by ang_offset -//and calculate delta_r for integration by trapezoidal rule - - n = RPM/60.0; - omega =n*2.0*M_PI; -// - for (j=0; j < NR; j++) - { - - if (j < 1) - { delta_r[j] = sprop_sec->r1[j+1] - r_hub; } - else - { - if (j < NR-1) - { delta_r[j] = sprop_sec->r1[j+1] - sprop_sec->r1[j-1]; } - else - { delta_r[j] = r_tip - sprop_sec->r1[j-1]; } - } - - delta_r[j] *= 0.5; - } -//-------------------------------------------------------- - - thrust=0.0; - torque=0.0; - -//Main Loop ------------------------------------------------------------- - for (j=0; j < NR; j++) - { - b[j]=0.01; - converged=0; - n_iter=1; - while (converged==0) - { - V2=omega*sprop_sec->r1[j]*(1-b[j]); - V0=V; -// - phi=atan2(V0,V2); -// - alpha=sprop_sec->setangle[j] + ang_offset-radtodeg*phi+alpha_corr; - rad = sprop_sec->r1[j]; -// get cl, cd from lookup table - isec = j+1; - get_clcd_(&isec,sprop_sec, &alpha, &cl, &cd) ; -// ...................................... - Vlocal=sqrt(V0*V0+V2*V2); - q = 0.5*rho*Vlocal*Vlocal; - s_mach = Vlocal/a0; - cl_corr_fac = 1.0; - if (s_mach > base_mach) - { - den = 1.0-s_mach*s_mach; - if (den > 0.0) cl_corr_fac = b_num / sqrt(den); - } -// ****************************** - cl *= cl_corr_fac ; -// ****************************** -// tip loss factor - r_dash = rad / r_tip+1.0e-5; - c_phi = cos(phi) ; - t_loss = 1.0; - if (r_dash > 0.90) - { - t_loss = (2.0/M_PI)*acos(exp(-(1.0*s_prop.nblades*(1-r_dash)/(r_dash*c_phi)))) ; - } - - DtDr[j]=q*s_prop.nblades*sprop_sec->chord[j]*(cl*cos(phi)-cd*sin(phi)); - DqDr=q*s_prop.nblades*sprop_sec->chord[j]*rad*(cd*cos(phi)+cl*sin(phi)); - - DtDr[j] *= t_loss; - DqDr *= t_loss; - - tem2=DqDr/(4.0*M_PI*rad*rad*rad*rho*V*omega); - bnew=0.6*b[j]+0.4*tem2; -// - if (bnew > 0.9) bnew = 0.9; - - if (fabs(bnew-b[j])<1.0e-5) - { - converged=1; - } - if (bnew<0.1) - b[j]=bnew; - n_iter++ ; - if (n_iter>BEM_MAX_ITER) - { - converged=1; - } - } // while loop - thrust=thrust+DtDr[j]*delta_r[j]; - torque=torque+DqDr*delta_r[j]; - Dtorq[j] = DqDr; - } // j loop -//End of Main Loop ------------------------------------------------------------- - - tem1 = rho*n*n*dia*dia*dia*dia; - tem2 = tem1*dia; - - - *Thrust=thrust; - *Torque=2.0*M_PI* torque; - *dp_av=2.0*M_PI* torque; - - for (j=0; j < NR; j++) - { - DtDr[j] /= (2.0*M_PI*sprop_sec->r1[j]) ; - Dtorq[j] = Dtorq[j]; - } - - if (rad_p < sprop_sec->r1[0]) - { - tem2 = sprop_sec->r1[0] - r_hub; - tem1 = (rad_p - r_hub)/tem2; - tem2 = 1.0 - tem1; - *dp_at_r = DtDr[0]*tem1; - *Torque = Dtorq[0]*tem1; - } - else - { - if (rad_p > r_tip) - { - *dp_at_r = 0.0; - *Torque = 0.0; - } - else - { - if (rad_p > sprop_sec->r1[NR-1]) - { - tem2 = r_tip - sprop_sec->r1[NR-1]; - tem1 = (rad_p - sprop_sec->r1[NR-1])/tem2 ; - tem2 = 1.0 - tem1; - *dp_at_r = DtDr[NR-1]*tem2; - *Torque = Dtorq[NR-1]*tem2; - } - else - { - for (j=0; j < NR-1; j++) - { - if ((sprop_sec->r1[j] < rad_p) && (sprop_sec->r1[j+1] >= rad_p)) - { - tem2 = sprop_sec->r1[j+1] - sprop_sec->r1[j]; - tem1 = (rad_p - sprop_sec->r1[j])/tem2 ; - tem2 = 1.0 - tem1; - *dp_at_r = DtDr[j]*tem2+DtDr[j+1]*tem1; - *Torque = Dtorq[j]*tem2+Dtorq[j+1]*tem1; - } - } - } - }// r > r_tip - } -//---------------------------------------------------------------------- -} -// } actuatordisk-bem - void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, bool Output) { @@ -3745,11 +3483,11 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con su2double Fan_Poly_Eff = config->GetFan_Poly_Eff(); su2double PolyCoeff = 1.0/(1.0-((Gamma-1.0)/Gamma)/Fan_Poly_Eff); - static su2double AD_Omega= 0.0; - static su2double AD_XCG= 0.0,AD_YCG=0.0,AD_ZCG=0.0; - static dpropeller_geom_struct s_prop; - static dpropeller_section_struct sprop_sec; - char section_prop_filename[1024]; + static su2double ADBem_Omega= 0.0; + static su2double ADBem_XCG= 0.0,ADBem_YCG=0.0,ADBem_ZCG=0.0; +//static dpropeller_geom_struct s_prop; +//static dpropeller_section_struct sprop_sec; +//char section_prop_filename[1024]; RefDensity = Density_Inf; RefArea = config->GetRefArea(); @@ -3758,6 +3496,7 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con Factor = (0.5*RefDensity*RefArea*RefVel2); Ref = config->GetDensity_Ref() * config->GetVelocity_Ref() * config->GetVelocity_Ref() * 1.0 * 1.0; + /*--- Blade element distribution is in input file. ---*/ if (Kind_ActDisk == BLADE_ELEMENT) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -3765,30 +3504,30 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { Marker_Tag = config->GetMarker_All_TagBound(iMarker); - AD_Omega = config->GetActDisk_Omega(Marker_Tag, 0); - AD_XCG = config->GetActDisk_XCG(Marker_Tag, 0); - AD_YCG = config->GetActDisk_YCG(Marker_Tag, 0); - AD_ZCG = config->GetActDisk_ZCG(Marker_Tag, 0); + ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); + ADBem_XCG = config->GetActDisk_XCG(Marker_Tag, 0); + ADBem_YCG = config->GetActDisk_YCG(Marker_Tag, 0); + ADBem_ZCG = config->GetActDisk_ZCG(Marker_Tag, 0); for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); //SetActDisk_DeltaP(iMarker, iVertex, DeltaP); //SetActDisk_DeltaT(iMarker, iVertex, DeltaT); - SetActDisk_RotRate(iMarker, iVertex, AD_Omega); - SetActDisk_XCG(iMarker, iVertex, AD_XCG); - SetActDisk_YCG(iMarker, iVertex, AD_YCG); - SetActDisk_ZCG(iMarker, iVertex, AD_ZCG); + SetActDisk_RotRate(iMarker, iVertex, ADBem_Omega); + SetActDisk_XCG(iMarker, iVertex, ADBem_XCG); + SetActDisk_YCG(iMarker, iVertex, ADBem_YCG); + SetActDisk_ZCG(iMarker, iVertex, ADBem_ZCG); } } } - if(InnerIter == 0) - { - strcpy(section_prop_filename,config->GetBEM_prop_filename().c_str()); - readsdata_(section_prop_filename,&s_prop,&sprop_sec); - } - /* Update the propeller load according to the modified flow field after every 40 inner iterations */ - if(InnerIter % 40 == 0){ - GenActDiskData_BEM_VLAD(geometry, solver_container, config, iMesh,s_prop,sprop_sec,Output); - } +// if (InnerIter == 0) { +// strcpy(section_prop_filename,config->GetBEM_prop_filename().c_str()); +// readsdata_(section_prop_filename,&s_prop,&sprop_sec); +// } +// /* Update the propeller load according to the modified flow field after every 40 inner iterations */ +// if (InnerIter % 40 == 0){ +// GenActDiskData_BEM_VLAD(geometry, solver_container, config, iMesh,s_prop,sprop_sec,Output); +// } + SetActDisk_BEM_VLAD(geometry, solver_container, config, iMesh, Output); } /*--- Variable load distribution is in input file. ---*/ @@ -4396,136 +4135,450 @@ void CEulerSolver::ReadActDisk_InputFile(CGeometry *geometry, CSolver **solver_c } } -void CEulerSolver::GenActDiskData_BEM_VLAD(CGeometry *geometry, CSolver **solver_container,CConfig *config, unsigned short iMesh, dpropeller_geom_struct s_prop, dpropeller_section_struct &sprop_sec, bool Output) { +void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, + CConfig *config, unsigned short iMesh, bool Output) { - unsigned short iDim, iMarker; + /*--- ReadActDiskBem_InputFile (InnerIter == 0) ---*/ + unsigned short iDim, iMarker; unsigned long iVertex, iPoint; string Marker_Tag; - su2double Omega_sw=0.0,Omega_RPM=0.0,Origin[3]={0.0},radius_[3]={0.0}; - static su2double omega_ref=0.0, Lref=0.0; - static su2double RPM=0.0,blade_angle=0.0,dia=0.0,/*r_hub=0.0,*/r_tip=0.0,rps=0.0,radius=0.0; - static su2double V=0.0,rho=0.0,T=0.0; - static su2double Thrust=0.0,Torque=0.0,dp_av=0.0,/*dp_av1=0.0,*/dp_at_r=0.0; - static su2double deltap_r[BEM_MAXR]={0.0}; - static su2double AD_Axis[MAXNDIM] = {0.0}, AD_J=0.0; - static su2double Target_Press_Jump=0.0, /*Target_Temp_Jump=0.0,*/Area=0.0,UnitNormal[3]={0.0},Vn=0.0; - static su2double Fa=0.0,Ft=0.0,Fr=0.0,Fx=0.0,Fy=0.0,Fz=0.0,/*dCt_v=0.0,*/dCp_v=0.0,dCr_v=0.0,rad_v=0.0; + int iSection, iAlpha; + static int ADBem_NBlade=0, ADBem_NSection=0, ADBem_NAlpha=0; + static su2double ADBem_Diameter=0.0, ADBem_HubRadius=0.0, ADBem_Angle75R=0.0; + static std::vector i_v, radius_v, chord_v, angle75r_v; + static std::vector > alpha_m, cl_m, cd_m; + //su2double r_ = 0.0, r[MAXNDIM] = {0.0}, + su2double /*ADBem_Center[MAXNDIM] = {0.0},*/ ADBem_Axis[MAXNDIM] = {0.0}, /*ADBem_Radius = 0.0,*/ ADBem_J = 0.0; + //const su2double *P = nullptr; + + /*--- GenActDiskData_BEM_VLAD (InnerIter == 40) ---*/ + const int BEM_MAX_ITER = 20; + su2double Omega_sw=0.0, Omega_RPM=0.0, Origin[3]={0.0}, radius_[3]={0.0}; + static su2double omega_ref=0.0, Lref=0.0; + static su2double RPM=0.0, blade_angle=0.0, dia=0.0, /*r_hub=0.0, */r_tip=0.0, rps=0.0, radius=0.0; + static su2double V=0.0, rho=0.0, T=0.0; + static su2double /*Thrust=0.0,*/ Torque=0.0, dp_av=0.0, /*dp_av1=0.0, */dp_at_r=0.0; + static std::vector DtDr; // su2double deltap_r[BEM_MAXR]={0.0}; + static su2double Target_Press_Jump=0.0, /*Target_Temp_Jump=0.0, */Area=0.0, UnitNormal[3]={0.0}, Vn=0.0; + static su2double Fa=0.0, Ft=0.0, Fr=0.0, Fx=0.0, Fy=0.0, Fz=0.0, /*dCt_v=0.0, */dCp_v=0.0, dCr_v=0.0, rad_v=0.0; su2double *V_domain=0, *Coord=0; static su2double loc_Torque = 0.0; static su2double loc_thrust = 0.0; - static su2double tot_area = 0.0,tot_tq = 0.0; - dia = s_prop.dia; - // r_hub = s_prop.rhub; - r_tip = 0.5*dia ; + static su2double tot_area = 0.0, tot_tq = 0.0; + unsigned long InnerIter = config->GetInnerIter(); su2double Dens_FreeStream = config->GetDensity_FreeStream(); const su2double *Vel_FreeStream = config->GetVelocity_FreeStream(); - su2double *Normal = new su2double[nDim]; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || - (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - //Read Swirl params - Omega_RPM = GetActDisk_RotRate(iMarker, iVertex); - Origin[0] = GetActDisk_CGX(iMarker, iVertex) ; - Origin[1] = GetActDisk_CGY(iMarker, iVertex) ; - Origin[2] = GetActDisk_CGZ(iMarker, iVertex) ; - - omega_ref= config->GetOmega_Ref(); - Lref = config->GetLength_Ref(); - Omega_sw = Omega_RPM*(PI_NUMBER/30.0)/(omega_ref);//Swirl rate - Origin[0] = Origin[0]/Lref; - Origin[1] = Origin[1]/Lref; - Origin[2] = Origin[2]/Lref; -//---------------------------------------------------------------------- - /*--- Compute the distance to the center of the rotor ---*/ - - geometry->vertex[iMarker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; - - /*Current version works only when propeller axis is aligned to horizontal*/ - AD_Axis[0] = 1.0; - AD_Axis[1] = 0.0; - AD_Axis[2] = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - ActDisk_Axis(iMarker, iDim) = AD_Axis[iDim]; + /*--- Input file provides force coefficients distributions along disk radius. + Initialization necessary only at initial iteration. ---*/ +////.......function 'readsdata_' reads alpha, cl and cd values from the files........................ +////float readsdata_(char *sec_filename,propeller_geom_struct *s_prop, propeller_section_struct *sprop_sec) +//char* readsdata_(char *sec_filename,dpropeller_geom_struct *s_prop, dpropeller_section_struct *sprop_sec) +//{ +// int i,j,MAXRK,MAXALFK; +// char dummy[1024]; +// FILE *file_ang; +// int sect[BEM_MAXR]; +// char* fgets_r=0; +////.Read blade section data from file +// file_ang = fopen(sec_filename,"r"); +//// To be read from file +// fgets_r = fgets(dummy,120,file_ang); +//// Skip header +// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%d", &s_prop->nblades); +// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->dia); +// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->rhub); +// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->ang0_75); +////.Skip reading next line................................................. +// fgets_r = fgets(dummy,120,file_ang); +// fgets_r = fgets(dummy,120,file_ang); +// sscanf(dummy,"%d%d",&MAXRK,&MAXALFK); +// sprop_sec-> nrad = MAXRK; +// sprop_sec-> nalf = MAXALFK; +//// +// fgets_r = fgets(dummy,120,file_ang); +// for(i=0; i < MAXRK; i++) +// { +// fgets_r = fgets(dummy,120,file_ang); +// sscanf(dummy,"%d %lf %lf %lf",§[i],&sprop_sec->r1[i],&sprop_sec->chord[i],&sprop_sec->setangle[i]); +// } +////.Read computed alpha v/s cl and cd from the file +// for(i=0; i < MAXRK; i++) +// { +// fgets_r = fgets(dummy,128,file_ang); +// for(j=0; j < MAXALFK; j++) +// { +// fgets_r = fgets(dummy,128,file_ang); +// sscanf(dummy,"%lf %lf %lf",&sprop_sec->alf[j][i],&sprop_sec->cl_arr[j][i],&sprop_sec->cd_arr[j][i]); +// } +// } +// return fgets_r; +//} + if (InnerIter == 0) { + /*--- Get the file name that contains the propeller data. ---*/ + string ActDiskBem_filename = config->GetBEM_prop_filename(); + ifstream ActDiskBem_file; + + /*--- Open the file that contains the propeller data. ---*/ + ActDiskBem_file.open(ActDiskBem_filename.data(), ios::in); + + /*--- Error message if the propeller data input file fails to open. ---*/ + if (ActDiskBem_file.fail()) SU2_MPI::Error("Unable to open Actuator Disk BEM Input File", CURRENT_FUNCTION); + + string text_line_appo; + + getline (ActDiskBem_file, text_line_appo); + /*--- Read and assign the value of the number of propeller blades. ---*/ + getline (ActDiskBem_file, text_line_appo); + istringstream NBlade_value(text_line_appo); + NBlade_value >> ADBem_NBlade; + + /*--- Read and assign the value of the propeller diameter. ---*/ + getline (ActDiskBem_file, text_line_appo); + istringstream Diameter_value(text_line_appo); + Diameter_value >> ADBem_Diameter; + + /*--- Read and assign the value of the propeller hub radius. ---*/ + getline (ActDiskBem_file, text_line_appo); + istringstream HubR_value(text_line_appo); + HubR_value >> ADBem_HubRadius; + + /*--- Read and assign the value of the blade angle at 75% of R. ---*/ + getline (ActDiskBem_file, text_line_appo); + istringstream Angle75R_value(text_line_appo); + Angle75R_value >> ADBem_Angle75R; + + getline (ActDiskBem_file, text_line_appo); + /*--- Read and assign the value of the number of radial propeller blade sections and alphas for each. ---*/ + getline (ActDiskBem_file, text_line_appo); + istringstream NSection_NAlpha_value(text_line_appo); + NSection_NAlpha_value >> ADBem_NSection >> ADBem_NAlpha; + + /*--- Assign the vector dimensions. ---*/ + i_v.resize(ADBem_NSection, 0.0); + radius_v.resize(ADBem_NSection, 0.0); + chord_v.resize(ADBem_NSection, 0.0); + angle75r_v.resize(ADBem_NSection, 0.0); + + getline (ActDiskBem_file, text_line_appo); + /*--- Read and assign the values of the propeller blade section's id, radius, chord, angle75R. ---*/ + for (iSection = 0; iSection < ADBem_NSection; iSection++) { + getline (ActDiskBem_file, text_line_appo); + istringstream sectionStream(text_line_appo); + sectionStream >> i_v[iSection] >> radius_v[iSection] >> chord_v[iSection] >> angle75r_v[iSection]; + } + + /*--- Assign the matrix dimensions. ---*/ + alpha_m.resize(ADBem_NAlpha, std::vector(ADBem_NSection, 0.0)); + cl_m.resize(ADBem_NAlpha, std::vector(ADBem_NSection, 0.0)); + cd_m.resize(ADBem_NAlpha, std::vector(ADBem_NSection, 0.0)); + + /*--- Read and assign the values for each of the propeller blade section's alpha, cl, cd. ---*/ + for (iSection = 0; iSection < ADBem_NSection; iSection++) { + getline (ActDiskBem_file, text_line_appo); + for (iAlpha = 0; iAlpha < ADBem_NAlpha; iAlpha++) { + getline (ActDiskBem_file, text_line_appo); + istringstream alphaStream(text_line_appo); + alphaStream >> alpha_m[iAlpha][iSection] >> cl_m[iAlpha][iSection] >> cd_m[iAlpha][iSection]; } - Area = 0.0; - for (iDim = 0; iDim < nDim; iDim++) Area += Normal[iDim]*Normal[iDim]; - Area = sqrt (Area); + } + } - for (iDim = 0; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; + /*--- Update the propeller load according to the modified flow field after every 40 inner iterations. ---*/ + if (InnerIter % 40 == 0) { + dia = ADBem_Diameter; + // r_hub = s_prop.rhub; + r_tip = 0.5 * dia ; - if (geometry->nodes->GetDomain(iPoint)) { - Coord = geometry->nodes->GetCoord(iPoint); - } + su2double Normal[MAXNDIM]; + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || + (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - radius = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - radius += (Coord[iDim]-Origin[iDim])*(Coord[iDim]-Origin[iDim]); - radius_[iDim] = (Coord[iDim]-Origin[iDim]); - } - radius = sqrt(radius); - /*--- Current solution at this boundary node and jumps values ---*/ - V_domain = nodes->GetPrimitive(iPoint); -//--------------------------------------------------------------- - if (abs(Omega_sw) > 1.0e-1) + /*--- Read Swirl params. ---*/ + Omega_RPM = GetActDisk_RotRate(iMarker, iVertex); + Origin[0] = GetActDisk_CGX(iMarker, iVertex); + Origin[1] = GetActDisk_CGY(iMarker, iVertex); + Origin[2] = GetActDisk_CGZ(iMarker, iVertex); + + omega_ref= config->GetOmega_Ref(); + Lref = config->GetLength_Ref(); + Omega_sw = Omega_RPM*(PI_NUMBER/30.0) / (omega_ref); // Swirl rate + Origin[0] = Origin[0]/Lref; + Origin[1] = Origin[1]/Lref; + Origin[2] = Origin[2]/Lref; + + /*--- Compute the distance to the center of the rotor ---*/ + geometry->vertex[iMarker][iVertex]->GetNormal(Normal); + for (iDim = 0; iDim < nDim; iDim++) { Normal[iDim] = -Normal[iDim]; } + + /*--- Current version works only when propeller axis is aligned to horizontal. ---*/ + ADBem_Axis[0] = 1.0; + ADBem_Axis[1] = 0.0; + ADBem_Axis[2] = 0.0; + for (iDim = 0; iDim < nDim; iDim++){ + ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; + } + Area = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { Area += Normal[iDim]*Normal[iDim]; } + Area = sqrt (Area); + + for (iDim = 0; iDim < nDim; iDim++) { UnitNormal[iDim] = Normal[iDim]/Area; } + + if (geometry->nodes->GetDomain(iPoint)) { + Coord = geometry->nodes->GetCoord(iPoint); + } + + radius = 0.0; + for (iDim = 0; iDim < nDim; iDim++){ + radius += (Coord[iDim]-Origin[iDim])*(Coord[iDim]-Origin[iDim]); + radius_[iDim] = (Coord[iDim]-Origin[iDim]); + } + radius = sqrt(radius); + + /*--- Current solution at this boundary node and jumps values ---*/ + V_domain = nodes->GetPrimitive(iPoint); + + if (abs(Omega_sw) > 1.0e-1) { + Vn = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { Vn += V_domain[iDim+1]*UnitNormal[iDim]; } + + RPM = abs(Omega_RPM); + rps = RPM/60.0; + ADBem_J = Vel_FreeStream[0]/(rps*dia); + rho = V_domain[nDim+2]; + T = V_domain[0]; + blade_angle = config->GetBEM_blade_angle(); + V = config->GetModVel_FreeStream(); + V = fabs(Vn); +// bem_model_noa(s_prop,&sprop_sec, // Propeller properties +// radius,V,RPM,rho,T,blade_angle, // Input +// deltap_r,&Thrust,&Torque,&dp_av,&dp_at_r); // Output +// void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *sprop_sec,su2double rad_p,su2double V, su2double RPM, su2double rho, su2double T, su2double blade_angle,su2double DtDr[], su2double *Thrust, su2double *Torque, su2double *dp_av,su2double *dp_at_r) + /*--- bem_model_noa(). ---*/ { - Vn = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { Vn += V_domain[iDim+1]*UnitNormal[iDim]; } - - RPM = abs(Omega_RPM); - rps = RPM/60.0; - AD_J = Vel_FreeStream[0]/(rps*dia); - rho = V_domain[nDim+2]; - T = V_domain[0]; - blade_angle = config->GetBEM_blade_angle(); - V = config->GetModVel_FreeStream(); - V = fabs(Vn); - bem_model_noa(s_prop,&sprop_sec, // Propeller properties - radius,V,RPM,rho,T,blade_angle, // Input - deltap_r,&Thrust,&Torque,&dp_av,&dp_at_r); // Output - - tot_area += Area; - loc_Torque += Torque*Area; - tot_tq += dp_av; - loc_thrust += dp_at_r*Area; - Target_Press_Jump = dp_at_r; - // Target_Temp_Jump = Target_Press_Jump/(rho*287.0); - - ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; - ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; - ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); - /* Non-dimensionalize the elemental load */ - //dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); - //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); - dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); - /* Force radial load to 0 as there is no information of radial load from BEM */ - dCr_v = 0.0; - rad_v = radius/r_tip; - //Fa = (dCt_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ - // (pow(AD_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); - Fa = dp_at_r; - Ft = (dCp_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ - ((AD_J*PI_NUMBER*rad_v)*(AD_J*PI_NUMBER*rad_v))) / config->GetPressure_Ref(); - Fr = (dCr_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ - (pow(AD_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); - Fx = (Ft+Fr)*(radius_[0]/(radius)); - Fy = (Ft+Fr)*(radius_[2]/(radius)); - Fz = -(Ft+Fr)*(radius_[1]/(radius)); - ActDisk_Fa_BEM[iMarker][iVertex] = Fa; - ActDisk_Fx_BEM[iMarker][iVertex] = Fx; - ActDisk_Fy_BEM[iMarker][iVertex] = Fy; - ActDisk_Fz_BEM[iMarker][iVertex] = Fz; + DtDr.resize(ADBem_NSection, 0.0); + + int s_prop_nblades = ADBem_NBlade; + int sprop_sec_nalf = ADBem_NAlpha; + int sprop_sec_nrad = ADBem_NSection; + std::vector& sprop_sec_r1 = radius_v; + std::vector& sprop_sec_chord = chord_v; + std::vector& sprop_sec_setangle = angle75r_v; + std::vector >& sprop_sec_alf = alpha_m; + std::vector >& sprop_sec_cl_arr = cl_m; + std::vector >& sprop_sec_cd_arr = cd_m; + + su2double rad_p = radius; + + int j, isec,converged, n_iter; + int NR = sprop_sec_nrad; + su2double dia, r_hub, r_tip, alpha_corr, cl_corr_fac; + su2double base_mach, s_mach, b_num, thrust, torque; + su2double r_dash, t_loss, c_phi, rad, phi, alpha, radtodeg; + su2double bnew, V0, V2, cl=0.0, cd=0.0, Vlocal, DqDr, tem1, tem2, q; + std::vector delta_r(ADBem_NSection, 0.0); + std::vector b(ADBem_NSection, 0.0); + static std::vector Dtorq(ADBem_NSection, 0.0); + + su2double n, omega, a0, den; + su2double ang_offset = 0.0; + + radtodeg = 180.0/M_PI; + dia = ADBem_Diameter; // s_prop.dia; + r_hub = ADBem_HubRadius; // s_prop.rhub; + r_tip = 0.5*dia ; + ang_offset = blade_angle - ADBem_Angle75R; // s_prop.ang0_75; + + alpha_corr = 0.0; + base_mach = 0.22 ; + b_num = sqrt(1.0-base_mach*base_mach); + a0 = sqrt(1.4*287*T); + /*--- Change pitch by ang_offset and calculate delta_r for integration by trapezoidal rule. ---*/ + n = RPM / 60.0; + omega = n*2.0*M_PI; + + for (j=0; j < NR; j++) { + if (j < 1) { delta_r[j] = sprop_sec_r1[j+1] - r_hub; } + else { + if (j < NR-1) { delta_r[j] = sprop_sec_r1[j+1] - sprop_sec_r1[j-1]; } + else { delta_r[j] = r_tip - sprop_sec_r1[j-1]; } + } + delta_r[j] *= 0.5; + } + + thrust = 0.0; + torque = 0.0; + + for (j=0; j < NR; j++) { + b[j] = 0.01; + converged = 0; + n_iter = 1; + while (converged == 0) { + V2 = omega*sprop_sec_r1[j]*(1-b[j]); + V0 = V; + + phi=atan2(V0,V2); + + alpha=sprop_sec_setangle[j] + ang_offset-radtodeg*phi+alpha_corr; + rad = sprop_sec_r1[j]; + /*--- get cl, cd from lookup table. ---*/ + isec = j+1; +// get_clcd_(&isec,sprop_sec, &alpha, &cl, &cd) ; +// void get_clcd_(int *isec,dpropeller_section_struct *sprop_sec,su2double *alpha,su2double *cl,su2double *cd) + { + int i, salf=0; + su2double fact; + + /*--- interpolating values of cl and cd for given alpha. ---*/ + if ( alpha >= sprop_sec_alf[salf][isec-1] + && alpha <= sprop_sec_alf[sprop_sec_nalf-1][isec-1]) { + for(i=0; i < sprop_sec_nalf-1; i++) { + if (alpha>=sprop_sec_alf[i][isec-1] && alpha <= sprop_sec_alf[i+1][isec-1]) { + fact = (alpha-sprop_sec_alf[i][isec-1]) + / (sprop_sec_alf[i+1][isec-1]-sprop_sec_alf[i][isec-1]); + cl = sprop_sec_cl_arr[i][isec-1] + + fact * (sprop_sec_cl_arr[i+1][isec-1] - sprop_sec_cl_arr[i][isec-1]); + cd = sprop_sec_cd_arr[i][isec-1] + + fact * (sprop_sec_cd_arr[i+1][isec-1] - sprop_sec_cd_arr[i][isec-1]); + } + } + } else { + if (alpha < sprop_sec_alf[salf][isec-1]) { + cl = sprop_sec_cl_arr[0][isec-1]; + cd = sprop_sec_cd_arr[0][isec-1]; + } + if (alpha > sprop_sec_alf[sprop_sec_nalf-1][isec-1]) { + cl = sprop_sec_cl_arr[sprop_sec_nalf-1][isec-1]; + cd = sprop_sec_cd_arr[sprop_sec_nalf-1][isec-1]; + } + } + } + + Vlocal = sqrt(V0*V0 + V2*V2); + q = 0.5 * rho * Vlocal * Vlocal; + s_mach = Vlocal / a0; + cl_corr_fac = 1.0; + if (s_mach > base_mach) { + den = 1.0-s_mach*s_mach; + if (den > 0.0) cl_corr_fac = b_num / sqrt(den); + } + cl *= cl_corr_fac; + + /*--- tip loss factor. ---*/ + r_dash = rad / r_tip+1.0e-5; + c_phi = cos(phi) ; + t_loss = 1.0; + if (r_dash > 0.90) { + t_loss = (2.0/M_PI) * acos(exp(-(1.0*s_prop_nblades*(1-r_dash)/(r_dash*c_phi)))) ; + } + + DtDr[j] = q * s_prop_nblades * sprop_sec_chord[j] * (cl*cos(phi) - cd*sin(phi)); + DqDr = q * s_prop_nblades * sprop_sec_chord[j] * rad * (cd*cos(phi) + cl*sin(phi)); + + DtDr[j] *= t_loss; + DqDr *= t_loss; + + tem2 = DqDr / (4.0*M_PI * rad*rad*rad * rho * V * omega); + bnew = 0.6 * b[j] + 0.4 * tem2; + if (bnew > 0.9) bnew = 0.9; + if (fabs(bnew-b[j]) < 1.0e-5) { + converged = 1; + } + if (bnew < 0.1) { b[j]=bnew; } + n_iter++ ; + if (n_iter > BEM_MAX_ITER) { + converged=1; + } + } + thrust=thrust+DtDr[j]*delta_r[j]; + torque=torque+DqDr*delta_r[j]; + Dtorq[j] = DqDr; + } + + tem1 = rho*n*n*dia*dia*dia*dia; + tem2 = tem1*dia; + + //Thrust=thrust; + Torque=2.0*M_PI* torque; + dp_av=2.0*M_PI* torque; + + for (j=0; j < NR; j++) { + DtDr[j] /= (2.0*M_PI * sprop_sec_r1[j]) ; + Dtorq[j] = Dtorq[j]; + } + + if (rad_p < sprop_sec_r1[0]) { + tem2 = sprop_sec_r1[0] - r_hub; + tem1 = (rad_p - r_hub)/tem2; + tem2 = 1.0 - tem1; + dp_at_r = DtDr[0]*tem1; + Torque = Dtorq[0]*tem1; + } else { + if (rad_p > r_tip) { + dp_at_r = 0.0; + Torque = 0.0; + } else { + if (rad_p > sprop_sec_r1[NR-1]) { + tem2 = r_tip - sprop_sec_r1[NR-1]; + tem1 = (rad_p - sprop_sec_r1[NR-1])/tem2 ; + tem2 = 1.0 - tem1; + dp_at_r = DtDr[NR-1]*tem2; + Torque = Dtorq[NR-1]*tem2; + } else { + for (j=0; j < NR-1; j++) { + if ((sprop_sec_r1[j] < rad_p) && (sprop_sec_r1[j+1] >= rad_p)) { + tem2 = sprop_sec_r1[j+1] - sprop_sec_r1[j]; + tem1 = (rad_p - sprop_sec_r1[j])/tem2 ; + tem2 = 1.0 - tem1; + dp_at_r = DtDr[j]*tem2+DtDr[j+1]*tem1; + Torque = Dtorq[j]*tem2+Dtorq[j+1]*tem1; + } + } + } + } + } } -//--------------------------------------------------------------- + + tot_area += Area; + loc_Torque += Torque*Area; + tot_tq += dp_av; + loc_thrust += dp_at_r*Area; + Target_Press_Jump = dp_at_r; + // Target_Temp_Jump = Target_Press_Jump/(rho*287.0); + + ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; + ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; + ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); + /*--- Non-dimensionalize the elemental load. ---*/ + //dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); + //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); + dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); + /*--- Force radial load to 0 as there is no information of radial load from BEM. ---*/ + dCr_v = 0.0; + rad_v = radius/r_tip; + //Fa = (dCt_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ + // (pow(ADBem_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); + Fa = dp_at_r; + Ft = (dCp_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ + ((ADBem_J*PI_NUMBER*rad_v)*(ADBem_J*PI_NUMBER*rad_v))) / config->GetPressure_Ref(); + Fr = (dCr_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ + (pow(ADBem_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); + Fx = (Ft+Fr)*(radius_[0]/(radius)); + Fy = (Ft+Fr)*(radius_[2]/(radius)); + Fz = -(Ft+Fr)*(radius_[1]/(radius)); + ActDisk_Fa_BEM[iMarker][iVertex] = Fa; + ActDisk_Fx_BEM[iMarker][iVertex] = Fx; + ActDisk_Fy_BEM[iMarker][iVertex] = Fy; + ActDisk_Fz_BEM[iMarker][iVertex] = Fz; + } + } } } - } - delete [] Normal; + } } void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, From 35afe87de509cf7e5e0988190782011a9d8c39e5 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 13 Oct 2023 11:31:17 +0530 Subject: [PATCH 055/139] bem reorg cleanup --- SU2_CFD/include/solvers/CEulerSolver.hpp | 1 - SU2_CFD/src/solvers/CEulerSolver.cpp | 84 ++++-------------------- 2 files changed, 14 insertions(+), 71 deletions(-) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 373bc79ff38..d8eb4da36dd 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -29,7 +29,6 @@ #include "CFVMFlowSolverBase.hpp" #include "../variables/CEulerVariable.hpp" -//#include "prop_defs.hpp" /*! * \class CEulerSolver diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e529d40a529..a9b474ab832 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -4138,7 +4138,7 @@ void CEulerSolver::ReadActDisk_InputFile(CGeometry *geometry, CSolver **solver_c void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, bool Output) { - /*--- ReadActDiskBem_InputFile (InnerIter == 0) ---*/ + /*--- InputFile reading ---*/ unsigned short iDim, iMarker; unsigned long iVertex, iPoint; string Marker_Tag; @@ -4147,20 +4147,18 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con static su2double ADBem_Diameter=0.0, ADBem_HubRadius=0.0, ADBem_Angle75R=0.0; static std::vector i_v, radius_v, chord_v, angle75r_v; static std::vector > alpha_m, cl_m, cd_m; - //su2double r_ = 0.0, r[MAXNDIM] = {0.0}, - su2double /*ADBem_Center[MAXNDIM] = {0.0},*/ ADBem_Axis[MAXNDIM] = {0.0}, /*ADBem_Radius = 0.0,*/ ADBem_J = 0.0; - //const su2double *P = nullptr; + su2double ADBem_Axis[MAXNDIM] = {0.0}, ADBem_J = 0.0; - /*--- GenActDiskData_BEM_VLAD (InnerIter == 40) ---*/ + /*--- BEM VLAD ---*/ const int BEM_MAX_ITER = 20; su2double Omega_sw=0.0, Omega_RPM=0.0, Origin[3]={0.0}, radius_[3]={0.0}; static su2double omega_ref=0.0, Lref=0.0; - static su2double RPM=0.0, blade_angle=0.0, dia=0.0, /*r_hub=0.0, */r_tip=0.0, rps=0.0, radius=0.0; + static su2double RPM=0.0, blade_angle=0.0, dia=0.0, r_tip=0.0, rps=0.0, radius=0.0; static su2double V=0.0, rho=0.0, T=0.0; - static su2double /*Thrust=0.0,*/ Torque=0.0, dp_av=0.0, /*dp_av1=0.0, */dp_at_r=0.0; - static std::vector DtDr; // su2double deltap_r[BEM_MAXR]={0.0}; - static su2double Target_Press_Jump=0.0, /*Target_Temp_Jump=0.0, */Area=0.0, UnitNormal[3]={0.0}, Vn=0.0; - static su2double Fa=0.0, Ft=0.0, Fr=0.0, Fx=0.0, Fy=0.0, Fz=0.0, /*dCt_v=0.0, */dCp_v=0.0, dCr_v=0.0, rad_v=0.0; + static su2double Torque=0.0, dp_av=0.0, dp_at_r=0.0; + static std::vector DtDr; + static su2double Target_Press_Jump=0.0, Area=0.0, UnitNormal[3]={0.0}, Vn=0.0; + static su2double Fa=0.0, Ft=0.0, Fr=0.0, Fx=0.0, Fy=0.0, Fz=0.0, dCp_v=0.0, dCr_v=0.0, rad_v=0.0; su2double *V_domain=0, *Coord=0; static su2double loc_Torque = 0.0; static su2double loc_thrust = 0.0; @@ -4172,49 +4170,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- Input file provides force coefficients distributions along disk radius. Initialization necessary only at initial iteration. ---*/ -////.......function 'readsdata_' reads alpha, cl and cd values from the files........................ -////float readsdata_(char *sec_filename,propeller_geom_struct *s_prop, propeller_section_struct *sprop_sec) -//char* readsdata_(char *sec_filename,dpropeller_geom_struct *s_prop, dpropeller_section_struct *sprop_sec) -//{ -// int i,j,MAXRK,MAXALFK; -// char dummy[1024]; -// FILE *file_ang; -// int sect[BEM_MAXR]; -// char* fgets_r=0; -////.Read blade section data from file -// file_ang = fopen(sec_filename,"r"); -//// To be read from file -// fgets_r = fgets(dummy,120,file_ang); -//// Skip header -// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%d", &s_prop->nblades); -// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->dia); -// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->rhub); -// fgets_r = fgets(dummy,120,file_ang); sscanf(dummy,"%lf", &s_prop->ang0_75); -////.Skip reading next line................................................. -// fgets_r = fgets(dummy,120,file_ang); -// fgets_r = fgets(dummy,120,file_ang); -// sscanf(dummy,"%d%d",&MAXRK,&MAXALFK); -// sprop_sec-> nrad = MAXRK; -// sprop_sec-> nalf = MAXALFK; -//// -// fgets_r = fgets(dummy,120,file_ang); -// for(i=0; i < MAXRK; i++) -// { -// fgets_r = fgets(dummy,120,file_ang); -// sscanf(dummy,"%d %lf %lf %lf",§[i],&sprop_sec->r1[i],&sprop_sec->chord[i],&sprop_sec->setangle[i]); -// } -////.Read computed alpha v/s cl and cd from the file -// for(i=0; i < MAXRK; i++) -// { -// fgets_r = fgets(dummy,128,file_ang); -// for(j=0; j < MAXALFK; j++) -// { -// fgets_r = fgets(dummy,128,file_ang); -// sscanf(dummy,"%lf %lf %lf",&sprop_sec->alf[j][i],&sprop_sec->cl_arr[j][i],&sprop_sec->cd_arr[j][i]); -// } -// } -// return fgets_r; -//} if (InnerIter == 0) { /*--- Get the file name that contains the propeller data. ---*/ string ActDiskBem_filename = config->GetBEM_prop_filename(); @@ -4288,7 +4243,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- Update the propeller load according to the modified flow field after every 40 inner iterations. ---*/ if (InnerIter % 40 == 0) { dia = ADBem_Diameter; - // r_hub = s_prop.rhub; r_tip = 0.5 * dia ; su2double Normal[MAXNDIM]; @@ -4354,11 +4308,8 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con blade_angle = config->GetBEM_blade_angle(); V = config->GetModVel_FreeStream(); V = fabs(Vn); -// bem_model_noa(s_prop,&sprop_sec, // Propeller properties -// radius,V,RPM,rho,T,blade_angle, // Input -// deltap_r,&Thrust,&Torque,&dp_av,&dp_at_r); // Output -// void bem_model_noa(dpropeller_geom_struct s_prop,dpropeller_section_struct *sprop_sec,su2double rad_p,su2double V, su2double RPM, su2double rho, su2double T, su2double blade_angle,su2double DtDr[], su2double *Thrust, su2double *Torque, su2double *dp_av,su2double *dp_at_r) - /*--- bem_model_noa(). ---*/ + + /*--- BEM model without parameter 'a' (ref?) ---*/ { DtDr.resize(ADBem_NSection, 0.0); @@ -4388,10 +4339,10 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double ang_offset = 0.0; radtodeg = 180.0/M_PI; - dia = ADBem_Diameter; // s_prop.dia; - r_hub = ADBem_HubRadius; // s_prop.rhub; + dia = ADBem_Diameter; + r_hub = ADBem_HubRadius; r_tip = 0.5*dia ; - ang_offset = blade_angle - ADBem_Angle75R; // s_prop.ang0_75; + ang_offset = blade_angle - ADBem_Angle75R; alpha_corr = 0.0; base_mach = 0.22 ; @@ -4425,10 +4376,9 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con alpha=sprop_sec_setangle[j] + ang_offset-radtodeg*phi+alpha_corr; rad = sprop_sec_r1[j]; + /*--- get cl, cd from lookup table. ---*/ isec = j+1; -// get_clcd_(&isec,sprop_sec, &alpha, &cl, &cd) ; -// void get_clcd_(int *isec,dpropeller_section_struct *sprop_sec,su2double *alpha,su2double *cl,su2double *cd) { int i, salf=0; su2double fact; @@ -4502,7 +4452,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con tem1 = rho*n*n*dia*dia*dia*dia; tem2 = tem1*dia; - //Thrust=thrust; Torque=2.0*M_PI* torque; dp_av=2.0*M_PI* torque; @@ -4548,20 +4497,15 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con tot_tq += dp_av; loc_thrust += dp_at_r*Area; Target_Press_Jump = dp_at_r; - // Target_Temp_Jump = Target_Press_Jump/(rho*287.0); ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); /*--- Non-dimensionalize the elemental load. ---*/ - //dCt_v = dp_at_r*(r_tip/(rho*rps*rps*pow(dia,4))); - //dCp_v = Torque*((2*M_PI*r_tip)/(rho*rps*rps*pow(dia,5))); dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); /*--- Force radial load to 0 as there is no information of radial load from BEM. ---*/ dCr_v = 0.0; rad_v = radius/r_tip; - //Fa = (dCt_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ - // (pow(ADBem_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); Fa = dp_at_r; Ft = (dCp_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ ((ADBem_J*PI_NUMBER*rad_v)*(ADBem_J*PI_NUMBER*rad_v))) / config->GetPressure_Ref(); From 9ef05a7b550e10c738f4114052708e3c3a375293 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 13 Oct 2023 12:22:13 +0530 Subject: [PATCH 056/139] cleanup based on review and reorg --- Common/include/option_structure.inl | 94 ------------------- SU2_CFD/src/solvers/CEulerSolver.cpp | 12 +-- .../actuatordisk_bem/actuatordisk_bem.cfg | 6 +- 3 files changed, 3 insertions(+), 109 deletions(-) diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index 12c7340aafc..ce94055fca5 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -1772,100 +1772,6 @@ class COptionActDisk : public COptionBase { } }; -class COptionActDiskCentroid : public COptionBase { - string name; // identifier for the option - unsigned short & inlet_size; - unsigned short & outlet_size; - string * & marker_inlet; - string * & marker_outlet; - su2double ** & actdisk_xcg; - su2double ** & actdisk_ycg; - su2double ** & actdisk_zcg; - -public: - COptionActDiskCentroid(const string name, - unsigned short & nMarker_ActDiskInlet, unsigned short & nMarker_ActDiskOutlet, string * & Marker_ActDiskInlet, string * & Marker_ActDiskOutlet, - su2double ** & ActDisk_XCG, su2double ** & ActDisk_YCG, su2double ** & ActDisk_ZCG) : - inlet_size(nMarker_ActDiskInlet), outlet_size(nMarker_ActDiskOutlet), marker_inlet(Marker_ActDiskInlet), marker_outlet(Marker_ActDiskOutlet), - actdisk_xcg(ActDisk_XCG), actdisk_ycg(ActDisk_YCG), actdisk_zcg(ActDisk_ZCG) { - this->name = name; - } - - ~COptionActDiskCentroid() {}; - string SetValue(vector option_value) { - const int mod_num = 8; - unsigned short totalVals = option_value.size(); - if ((totalVals == 1) && (option_value[0].compare("NONE") == 0)) { - this->SetDefault(); - return ""; - } - - if (totalVals % mod_num != 0) { - string newstring; - newstring.append(this->name); - newstring.append(": must have a number of entries divisible by 8"); - this->SetDefault(); - return newstring; - } - - unsigned short nVals = totalVals / mod_num; - this->inlet_size = nVals; - this->outlet_size = nVals; - this->marker_inlet = new string[this->inlet_size]; - this->marker_outlet = new string[this->outlet_size]; - - this->actdisk_xcg = new su2double*[this->inlet_size]; - this->actdisk_ycg = new su2double*[this->inlet_size]; - this->actdisk_zcg = new su2double*[this->inlet_size]; - for (int i = 0; i < this->inlet_size; i++) { - this->actdisk_xcg[i] = new su2double[2]; - this->actdisk_ycg[i] = new su2double[2]; - this->actdisk_zcg[i] = new su2double[2]; - } - - string tname = "actuator disk"; - - for (int i = 0; i < this->inlet_size; i++) { - this->marker_inlet[i].assign(option_value[mod_num*i]); - this->marker_outlet[i].assign(option_value[mod_num*i+1]); - istringstream ss_1st(option_value[mod_num*i + 2]); - if (!(ss_1st >> this->actdisk_xcg[i][0])) { - return badValue(tname, this->name); - } - istringstream ss_2nd(option_value[mod_num*i + 3]); - if (!(ss_2nd >> this->actdisk_ycg[i][0])) { - return badValue(tname, this->name); - } - istringstream ss_3rd(option_value[mod_num*i + 4]); - if (!(ss_3rd >> this->actdisk_zcg[i][0])) { - return badValue(tname, this->name); - } - istringstream ss_4th(option_value[mod_num*i + 5]); - if (!(ss_4th >> this->actdisk_xcg[i][1])) { - return badValue(tname, this->name); - } - istringstream ss_5th(option_value[mod_num*i + 6]); - if (!(ss_5th >> this->actdisk_ycg[i][1])) { - return badValue(tname, this->name); - } - istringstream ss_6th(option_value[mod_num*i + 7]); - if (!(ss_6th >> this->actdisk_zcg[i][1])) { - return badValue(tname, this->name); - } - } - return ""; - } - void SetDefault() { - this->inlet_size = 0; - this->outlet_size = 0; - this->marker_inlet = NULL; - this->marker_outlet = NULL; - this->actdisk_xcg = NULL; - this->actdisk_ycg = NULL; - this->actdisk_zcg = NULL; - } -}; - class COptionWallFunction : public COptionBase { string name; // identifier for the option unsigned short& nMarkers; diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index a9b474ab832..935b5414d0e 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -3519,14 +3519,6 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con } } } -// if (InnerIter == 0) { -// strcpy(section_prop_filename,config->GetBEM_prop_filename().c_str()); -// readsdata_(section_prop_filename,&s_prop,&sprop_sec); -// } -// /* Update the propeller load according to the modified flow field after every 40 inner iterations */ -// if (InnerIter % 40 == 0){ -// GenActDiskData_BEM_VLAD(geometry, solver_container, config, iMesh,s_prop,sprop_sec,Output); -// } SetActDisk_BEM_VLAD(geometry, solver_container, config, iMesh, Output); } @@ -8821,7 +8813,7 @@ void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con * Cl, Cd of propeller sections need to be generated earlier and saved in this file * Actuator disk data initialized in function SetActDisk_BCThrust. * Propeller load calculated with Blade Element Method - * Interpolated load at each point on the actuator disk is set in GenActDiskData_BEM_VLAD function + * Interpolated load at each point on the actuator disk is set in SetActDisk_BEM_VLAD function * Rest calculations follows the Variable Load (BC_ActDisk_VariableLoad) approach * */ @@ -8845,7 +8837,7 @@ void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto Gas_Constant = config->GetGas_ConstantND(); - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST);// || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); /*--- Get the actuator disk center and axis coordinates for the current marker. ---*/ for (iDim = 0; iDim < nDim; iDim++){ diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index 09e594e32a6..d64dba58ff4 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -13,13 +13,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %----------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION -------------------------% -% Solver type (EULER, NAVIER_STOKES, RANS, -% INC_EULER, INC_NAVIER_STOKES, INC_RANS -% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES, -% HEAT_EQUATION_FVM, ELASTICITY) SOLVER= RANS % -% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP, SST_SUST) +% Specify turbulence model (NONE, SA, SST) KIND_TURB_MODEL= SA % % Turbulence intensity at freestream From 6f3b45ea4c43bf676853e873ba9c115a19077a33 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Mon, 16 Oct 2023 16:18:53 +0530 Subject: [PATCH 057/139] combined ActDisk_{X,Y,Z}CG into ActDisk_CG[3] --- Common/include/CConfig.hpp | 28 +++++---- Common/src/CConfig.cpp | 12 +++- SU2_CFD/include/solvers/CEulerSolver.hpp | 66 ++++++++++---------- SU2_CFD/src/solvers/CEulerSolver.cpp | 76 ++++++++++++------------ externals/codi | 2 +- 5 files changed, 101 insertions(+), 83 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 5bb9daa5d3f..ea147f2f64d 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -348,7 +348,8 @@ class CConfig { su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet torque for actuator disk. */ su2double **ActDisk_PressJump, **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ - su2double **ActDisk_XCG, **ActDisk_YCG, **ActDisk_ZCG; /*!< \brief Specified CG for actuator disk.*/ +//su2double **ActDisk_XCG, **ActDisk_YCG, **ActDisk_ZCG; /*!< \brief Specified CG for actuator disk.*/ + su2double **ActDisk_CG[3]; /*!< \brief Specified CG for actuator disk.*/ su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate.*/ su2double BEM_blade_angle ; /*!< \brief Propeller blade angle.*/ string BEM_prop_filename ; /*!< \brief Propeller filename.*/ @@ -6656,20 +6657,25 @@ class CConfig { */ su2double GetActDisk_PressJump(const string& val_marker, unsigned short val_index) const; - /*! - * \brief Get the XCG of the actuator disk. - */ - su2double GetActDisk_XCG(string val_marker, unsigned short val_index) const; +///*! +// * \brief Get the XCG of the actuator disk. +// */ +//su2double GetActDisk_XCG(string val_marker, unsigned short val_index) const; - /*! - * \brief Get the YCG of the actuator disk. - */ - su2double GetActDisk_YCG(string val_marker, unsigned short val_index) const; +///*! +// * \brief Get the YCG of the actuator disk. +// */ +//su2double GetActDisk_YCG(string val_marker, unsigned short val_index) const; +///*! +// * \brief Get the ZCG of the actuator disk. +// */ +//su2double GetActDisk_ZCG(string val_marker, unsigned short val_index) const; /*! - * \brief Get the ZCG of the actuator disk. + * \brief Get the CG of the actuator disk. */ - su2double GetActDisk_ZCG(string val_marker, unsigned short val_index) const; + su2double GetActDisk_CG(unsigned short iDim, string val_marker, unsigned short val_index) const; + /*! * \brief Get the blade angle of the propeller. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index aff893ada9b..738a215abd1 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1529,7 +1529,8 @@ void CConfig::SetConfig_Options() { /*!\brief MARKER_ACTDISK_CG\n DESCRIPTION: Actuator disk with CG for blade element momentum (BEM) method. \ingroup Config*/ addActDiskOption("MARKER_ACTDISK_CG", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, - ActDisk_XCG, ActDisk_YCG, ActDisk_ZCG); +// ActDisk_XCG, ActDisk_YCG, ActDisk_ZCG); + ActDisk_CG[0], ActDisk_CG[1], ActDisk_CG[2]); /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/ addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat")); @@ -8694,6 +8695,7 @@ su2double CConfig::GetActDisk_PressJump(const string& val_marker, unsigned short return ActDisk_PressJump[iMarker_ActDisk][val_value]; } +/* su2double CConfig::GetActDisk_XCG(string val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) @@ -8717,6 +8719,14 @@ su2double CConfig::GetActDisk_ZCG(string val_marker, unsigned short val_value) c (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; return ActDisk_ZCG[iMarker_ActDisk][val_value]; } +*/ +su2double CConfig::GetActDisk_CG(unsigned short iDim, string val_marker, unsigned short val_value) const { + unsigned short iMarker_ActDisk; + for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDisk_CG[iDim][iMarker_ActDisk][val_value]; +} su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index d8eb4da36dd..b09243cd0e1 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -69,9 +69,9 @@ class CEulerSolver : public CFVMFlowSolverBase > ActDisk_Thrust_r; /*!< \brief Value of the Delta P. */ vector > ActDisk_Torque_r; /*!< \brief Value of the Delta P. */ vector > ActDisk_RotRate; /*!< \brief Value of the Rotation Rate. */ - vector > ActDisk_XCG; - vector > ActDisk_YCG; - vector > ActDisk_ZCG; +//vector > ActDisk_XCG; +//vector > ActDisk_YCG; +//vector > ActDisk_ZCG; vector > ActDisk_DeltaT; /*!< \brief Value of the Delta T. */ su2activevector @@ -1037,36 +1037,36 @@ class CEulerSolver : public CFVMFlowSolverBaseGetFan_Poly_Eff(); su2double PolyCoeff = 1.0/(1.0-((Gamma-1.0)/Gamma)/Fan_Poly_Eff); - static su2double ADBem_Omega= 0.0; - static su2double ADBem_XCG= 0.0,ADBem_YCG=0.0,ADBem_ZCG=0.0; -//static dpropeller_geom_struct s_prop; -//static dpropeller_section_struct sprop_sec; -//char section_prop_filename[1024]; - RefDensity = Density_Inf; RefArea = config->GetRefArea(); RefVel2 = 0.0; for (iDim = 0; iDim < nDim; iDim++) RefVel2 += Velocity_Inf[iDim]*Velocity_Inf[iDim]; @@ -3498,27 +3492,6 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con /*--- Blade element distribution is in input file. ---*/ if (Kind_ActDisk == BLADE_ELEMENT) { - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || - (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { - - Marker_Tag = config->GetMarker_All_TagBound(iMarker); - ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); - ADBem_XCG = config->GetActDisk_XCG(Marker_Tag, 0); - ADBem_YCG = config->GetActDisk_YCG(Marker_Tag, 0); - ADBem_ZCG = config->GetActDisk_ZCG(Marker_Tag, 0); - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - //SetActDisk_DeltaP(iMarker, iVertex, DeltaP); - //SetActDisk_DeltaT(iMarker, iVertex, DeltaT); - SetActDisk_RotRate(iMarker, iVertex, ADBem_Omega); - SetActDisk_XCG(iMarker, iVertex, ADBem_XCG); - SetActDisk_YCG(iMarker, iVertex, ADBem_YCG); - SetActDisk_ZCG(iMarker, iVertex, ADBem_ZCG); - } - } - } SetActDisk_BEM_VLAD(geometry, solver_container, config, iMesh, Output); } @@ -4141,6 +4114,10 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con static std::vector > alpha_m, cl_m, cd_m; su2double ADBem_Axis[MAXNDIM] = {0.0}, ADBem_J = 0.0; + static su2double ADBem_Omega= 0.0; +//static su2double ADBem_XCG= 0.0, ADBem_YCG=0.0, ADBem_ZCG=0.0; + static su2double ADBem_CG[MAXNDIM] = {0.0, 0.0, 0.0}; + /*--- BEM VLAD ---*/ const int BEM_MAX_ITER = 20; su2double Omega_sw=0.0, Omega_RPM=0.0, Origin[3]={0.0}, radius_[3]={0.0}; @@ -4160,6 +4137,31 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double Dens_FreeStream = config->GetDensity_FreeStream(); const su2double *Vel_FreeStream = config->GetVelocity_FreeStream(); + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || + (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { + + Marker_Tag = config->GetMarker_All_TagBound(iMarker); + ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); + //ADBem_XCG = config->GetActDisk_XCG(Marker_Tag, 0); + //ADBem_YCG = config->GetActDisk_YCG(Marker_Tag, 0); + //ADBem_ZCG = config->GetActDisk_ZCG(Marker_Tag, 0); + for (iDim=0; iDim < nDim; iDim++){ + ADBem_CG[iDim] = config->GetActDisk_CG(iDim, Marker_Tag, 0); + } + /* + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + SetActDisk_RotRate(iMarker, iVertex, ADBem_Omega); + SetActDisk_XCG(iMarker, iVertex, ADBem_XCG); + SetActDisk_YCG(iMarker, iVertex, ADBem_YCG); + SetActDisk_ZCG(iMarker, iVertex, ADBem_ZCG); + } + */ + } + } + /*--- Input file provides force coefficients distributions along disk radius. Initialization necessary only at initial iteration. ---*/ if (InnerIter == 0) { @@ -4245,10 +4247,10 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); /*--- Read Swirl params. ---*/ - Omega_RPM = GetActDisk_RotRate(iMarker, iVertex); - Origin[0] = GetActDisk_CGX(iMarker, iVertex); - Origin[1] = GetActDisk_CGY(iMarker, iVertex); - Origin[2] = GetActDisk_CGZ(iMarker, iVertex); + Omega_RPM = ADBem_Omega; // GetActDisk_RotRate(iMarker, iVertex); + Origin[0] = ADBem_CG[0]; // GetActDisk_CGX(iMarker, iVertex); + Origin[1] = ADBem_CG[1]; // GetActDisk_CGY(iMarker, iVertex); + Origin[2] = ADBem_CG[2]; // GetActDisk_CGZ(iMarker, iVertex); omega_ref= config->GetOmega_Ref(); Lref = config->GetLength_Ref(); @@ -4319,10 +4321,10 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con int j, isec,converged, n_iter; int NR = sprop_sec_nrad; - su2double dia, r_hub, r_tip, alpha_corr, cl_corr_fac; + su2double r_hub, alpha_corr, cl_corr_fac; su2double base_mach, s_mach, b_num, thrust, torque; su2double r_dash, t_loss, c_phi, rad, phi, alpha, radtodeg; - su2double bnew, V0, V2, cl=0.0, cd=0.0, Vlocal, DqDr, tem1, tem2, q; + su2double bnew, V0, V2, cl=0.0, cd=0.0, Vlocal, DqDr=0.0, tem1, tem2, q; std::vector delta_r(ADBem_NSection, 0.0); std::vector b(ADBem_NSection, 0.0); static std::vector Dtorq(ADBem_NSection, 0.0); diff --git a/externals/codi b/externals/codi index eee1b5eea2d..8ee822a9b0b 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit eee1b5eea2ded8126c34c1415e3b9cf15a3e70f2 +Subproject commit 8ee822a9b0bb8235a2494467b774e27fb64ff14f From 5b678067ec9f660e7d08b278da8b0e244510efb6 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Mon, 16 Oct 2023 21:30:45 +0530 Subject: [PATCH 058/139] ActDisk_CG cleanup --- Common/include/CConfig.hpp | 16 ---------------- Common/src/CConfig.cpp | 26 -------------------------- SU2_CFD/src/solvers/CEulerSolver.cpp | 4 ---- 3 files changed, 46 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index ea147f2f64d..74fc04d6f7a 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -348,7 +348,6 @@ class CConfig { su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet torque for actuator disk. */ su2double **ActDisk_PressJump, **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ -//su2double **ActDisk_XCG, **ActDisk_YCG, **ActDisk_ZCG; /*!< \brief Specified CG for actuator disk.*/ su2double **ActDisk_CG[3]; /*!< \brief Specified CG for actuator disk.*/ su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate.*/ su2double BEM_blade_angle ; /*!< \brief Propeller blade angle.*/ @@ -6657,26 +6656,11 @@ class CConfig { */ su2double GetActDisk_PressJump(const string& val_marker, unsigned short val_index) const; -///*! -// * \brief Get the XCG of the actuator disk. -// */ -//su2double GetActDisk_XCG(string val_marker, unsigned short val_index) const; - -///*! -// * \brief Get the YCG of the actuator disk. -// */ -//su2double GetActDisk_YCG(string val_marker, unsigned short val_index) const; - -///*! -// * \brief Get the ZCG of the actuator disk. -// */ -//su2double GetActDisk_ZCG(string val_marker, unsigned short val_index) const; /*! * \brief Get the CG of the actuator disk. */ su2double GetActDisk_CG(unsigned short iDim, string val_marker, unsigned short val_index) const; - /*! * \brief Get the blade angle of the propeller. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 738a215abd1..b8489f1ff23 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1529,7 +1529,6 @@ void CConfig::SetConfig_Options() { /*!\brief MARKER_ACTDISK_CG\n DESCRIPTION: Actuator disk with CG for blade element momentum (BEM) method. \ingroup Config*/ addActDiskOption("MARKER_ACTDISK_CG", nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, -// ActDisk_XCG, ActDisk_YCG, ActDisk_ZCG); ActDisk_CG[0], ActDisk_CG[1], ActDisk_CG[2]); /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/ @@ -8695,31 +8694,6 @@ su2double CConfig::GetActDisk_PressJump(const string& val_marker, unsigned short return ActDisk_PressJump[iMarker_ActDisk][val_value]; } -/* -su2double CConfig::GetActDisk_XCG(string val_marker, unsigned short val_value) const { - unsigned short iMarker_ActDisk; - for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_XCG[iMarker_ActDisk][val_value]; -} - -su2double CConfig::GetActDisk_YCG(string val_marker, unsigned short val_value) const { - unsigned short iMarker_ActDisk; - for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_YCG[iMarker_ActDisk][val_value]; -} - -su2double CConfig::GetActDisk_ZCG(string val_marker, unsigned short val_value) const { - unsigned short iMarker_ActDisk; - for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_ZCG[iMarker_ActDisk][val_value]; -} -*/ su2double CConfig::GetActDisk_CG(unsigned short iDim, string val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 8dbfd602130..829af2fe572 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -4115,7 +4115,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double ADBem_Axis[MAXNDIM] = {0.0}, ADBem_J = 0.0; static su2double ADBem_Omega= 0.0; -//static su2double ADBem_XCG= 0.0, ADBem_YCG=0.0, ADBem_ZCG=0.0; static su2double ADBem_CG[MAXNDIM] = {0.0, 0.0, 0.0}; /*--- BEM VLAD ---*/ @@ -4144,9 +4143,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con Marker_Tag = config->GetMarker_All_TagBound(iMarker); ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); - //ADBem_XCG = config->GetActDisk_XCG(Marker_Tag, 0); - //ADBem_YCG = config->GetActDisk_YCG(Marker_Tag, 0); - //ADBem_ZCG = config->GetActDisk_ZCG(Marker_Tag, 0); for (iDim=0; iDim < nDim; iDim++){ ADBem_CG[iDim] = config->GetActDisk_CG(iDim, Marker_Tag, 0); } From 3b49e16b762c5c4f9d8fd328d587a9edf8dfe191 Mon Sep 17 00:00:00 2001 From: Y Chandukrishna Date: Wed, 18 Oct 2023 23:06:27 +0530 Subject: [PATCH 059/139] ActDisk axis, BEM minimal code --- Common/include/CConfig.hpp | 6 + Common/src/CConfig.cpp | 13 + SU2_CFD/include/solvers/CEulerSolver.hpp | 38 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 516 +++++++++--------- .../actuatordisk_bem/actuatordisk_bem.cfg | 5 + 5 files changed, 307 insertions(+), 271 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 74fc04d6f7a..a4cd84b7a48 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -349,6 +349,7 @@ class CConfig { su2double **ActDisk_PressJump, **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ su2double **ActDisk_CG[3]; /*!< \brief Specified CG for actuator disk.*/ + su2double **ActDisk_Axis_BEM[3]; /*!< \brief Specified axis for actuator disk.*/ su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate.*/ su2double BEM_blade_angle ; /*!< \brief Propeller blade angle.*/ string BEM_prop_filename ; /*!< \brief Propeller filename.*/ @@ -6661,6 +6662,11 @@ class CConfig { */ su2double GetActDisk_CG(unsigned short iDim, string val_marker, unsigned short val_index) const; + /*! + * \brief Get the axis of the actuator disk with Blade Element Method. + */ + su2double GetActDisk_Axis_BEM(unsigned short iDim, string val_marker, unsigned short val_index) const; + /*! * \brief Get the blade angle of the propeller. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index b8489f1ff23..d23546dbc69 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1531,6 +1531,11 @@ void CConfig::SetConfig_Options() { nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_CG[0], ActDisk_CG[1], ActDisk_CG[2]); + /*!\brief MARKER_ACTDISK_CG\n DESCRIPTION: Actuator disk axis for blade element momentum (BEM) method. \ingroup Config*/ + addActDiskOption("MARKER_ACTDISK_AXIS", + nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, + ActDisk_Axis_BEM[0], ActDisk_Axis_BEM[1], ActDisk_Axis_BEM[2]); + /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/ addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat")); @@ -8702,6 +8707,14 @@ su2double CConfig::GetActDisk_CG(unsigned short iDim, string val_marker, unsigne return ActDisk_CG[iDim][iMarker_ActDisk][val_value]; } +su2double CConfig::GetActDisk_Axis_BEM(unsigned short iDim, string val_marker, unsigned short val_value) const { + unsigned short iMarker_ActDisk; + for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) + if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDisk_Axis_BEM[iDim][iMarker_ActDisk][val_value]; +} + su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index b09243cd0e1..c6397f3e0ab 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -546,25 +546,25 @@ class CEulerSolver : public CFVMFlowSolverBasevertex[iMarker][iVertex]->GetNormal(Normal); for (iDim = 0; iDim < nDim; iDim++) { Normal[iDim] = -Normal[iDim]; } - /*--- Current version works only when propeller axis is aligned to horizontal. ---*/ - ADBem_Axis[0] = 1.0; - ADBem_Axis[1] = 0.0; - ADBem_Axis[2] = 0.0; + /*--- Get propeller axis from config file. ---*/ + //ADBem_Axis[0] = 1.0; + //ADBem_Axis[1] = 0.0; + //ADBem_Axis[2] = 0.0; + for (iDim=0; iDim < nDim; iDim++){ + ADBem_Axis[iDim] = config->GetActDisk_Axis_BEM(iDim, Marker_Tag, 0); + } for (iDim = 0; iDim < nDim; iDim++){ ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; } @@ -8121,12 +8124,12 @@ void CEulerSolver::BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_contai unsigned short Kind_ActDisk = config->GetKind_ActDisk(); - if(Kind_ActDisk == VARIABLE_LOAD){ + if(Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT){ BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); } - else if(Kind_ActDisk == BLADE_ELEMENT){ - BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); - } + //else if(Kind_ActDisk == BLADE_ELEMENT){ + // BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); + //} else{ BC_ActDisk(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); } @@ -8138,12 +8141,12 @@ void CEulerSolver::BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_conta unsigned short Kind_ActDisk = config->GetKind_ActDisk(); - if(Kind_ActDisk == VARIABLE_LOAD){ + if(Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT){ BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); } - else if(Kind_ActDisk == BLADE_ELEMENT){ - BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); - } + //else if(Kind_ActDisk == BLADE_ELEMENT){ + // BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); + //} else{ BC_ActDisk(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); } @@ -8599,6 +8602,8 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver const auto Gas_Constant = config->GetGas_ConstantND(); const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + unsigned short Kind_ActDisk = config->GetKind_ActDisk(); + /*--- Get the actuator disk center and axis coordinates for the current marker. ---*/ for (iDim = 0; iDim < nDim; iDim++){ Prop_Axis[iDim] = ActDisk_Axis(val_marker, iDim); @@ -8633,10 +8638,17 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver /*--- Get the values of Fa (axial force per unit area), Fx, Fy and Fz (x, y and z components of the tangential and radial forces per unit area resultant). ---*/ - Fa = ActDisk_Fa[val_marker][iVertex]; - Fx = ActDisk_Fx[val_marker][iVertex]; - Fy = ActDisk_Fy[val_marker][iVertex]; - Fz = ActDisk_Fz[val_marker][iVertex]; + if (Kind_ActDisk == BLADE_ELEMENT) { + Fa = ActDisk_Fa_BEM[val_marker][iVertex]; + Fx = ActDisk_Fx_BEM[val_marker][iVertex]; + Fy = ActDisk_Fy_BEM[val_marker][iVertex]; + Fz = ActDisk_Fz_BEM[val_marker][iVertex]; + } else { /*--- default (Kind_ActDisk == VARIABLE_LOAD) ---*/ + Fa = ActDisk_Fa[val_marker][iVertex]; + Fx = ActDisk_Fx[val_marker][iVertex]; + Fy = ActDisk_Fy[val_marker][iVertex]; + Fz = ActDisk_Fz[val_marker][iVertex]; + } /*--- Get the primitive variables and the extrapolated variables. ---*/ if (val_inlet_surface){ @@ -8793,242 +8805,242 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver END_SU2_OMP_FOR } -void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, - CConfig *config, unsigned short val_marker, bool val_inlet_surface) { - - /*! - * \function BC_ActDisk_BEM_VLAD - * \brief Actuator disk model with Blade Element Method (BEM) - * \author: Chandukrishna Y., T. N. Venkatesh and Josy Pullockara - * Institution: Computational and Theoretical Fluid Dynamics (CTFD), - * CSIR - National Aerospace Laboratories, Bangalore - * Academy of Scientific and Innovative Research, Ghaziabad - * \version 8.0.0 "Harrier" - * First release date : September 26 2023 - * modified on: - * - * Section properties of the propeller given in an input file. - * Cl, Cd of propeller sections need to be generated earlier and saved in this file - * Actuator disk data initialized in function SetActDisk_BCThrust. - * Propeller load calculated with Blade Element Method - * Interpolated load at each point on the actuator disk is set in SetActDisk_BEM_VLAD function - * Rest calculations follows the Variable Load (BC_ActDisk_VariableLoad) approach - * - */ - - unsigned short iDim; - unsigned long iVertex, iPoint, GlobalIndex_donor, GlobalIndex; - su2double Pressure, Velocity[MAXNDIM], - Velocity2, Entropy, Density, Energy, Riemann, Vn, SoundSpeed, Vn_Inlet, - Area, UnitNormal[MAXNDIM] = {0.0}, *V_outlet, *V_domain, *V_inlet; - - su2double Pressure_out, Density_out, - Pressure_in, Density_in; - - su2double Prop_Axis[MAXNDIM]; - su2double Fa, Fx, Fy, Fz; - su2double u_in, v_in, w_in, u_out, v_out, w_out, uJ, vJ, wJ; - su2double Temperature_out, H_in, H_out; - su2double FQ, Q_out, Density_Disk; - su2double SoSextr, Vnextr[MAXNDIM], Vnextr_, RiemannExtr, QdMnorm[MAXNDIM], QdMnorm2, appo2, SoS_out; - su2double Normal[MAXNDIM]; - - const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const auto Gas_Constant = config->GetGas_ConstantND(); - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); - - /*--- Get the actuator disk center and axis coordinates for the current marker. ---*/ - for (iDim = 0; iDim < nDim; iDim++){ - Prop_Axis[iDim] = ActDisk_Axis(val_marker, iDim); - } - - /*--- Loop over all the vertices on this boundary marker. ---*/ - SU2_OMP_FOR_DYN(OMP_MIN_SIZE) - for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); - GlobalIndex = geometry->nodes->GetGlobalIndex(iPoint); - GlobalIndex_donor = GetDonorGlobalIndex(val_marker, iVertex); - - /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ - - if ((geometry->nodes->GetDomain(iPoint)) && - (GlobalIndex != GlobalIndex_donor)) { - - /*--- Normal vector for this vertex (negative for outward convention) ---*/ - - geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; - conv_numerics->SetNormal(Normal); - - Area = GeometryToolbox::Norm(nDim, Normal); - for (iDim = 0; iDim < nDim; iDim++) - UnitNormal[iDim] = Normal[iDim]/Area; - - /*--- Current solution at this boundary node. ---*/ - - V_domain = nodes->GetPrimitive(iPoint); - - /*--- Get the values of Fa (axial force per unit area), Fx, Fy and Fz (x, y and z components of the tangential and - radial forces per unit area resultant). ---*/ - Fa = ActDisk_Fa_BEM[val_marker][iVertex]; - Fx = ActDisk_Fx_BEM[val_marker][iVertex]; - Fy = ActDisk_Fy_BEM[val_marker][iVertex]; - Fz = ActDisk_Fz_BEM[val_marker][iVertex]; - - /*--- Get the primitive variables and the extrapolated variables. ---*/ - if (val_inlet_surface){ - V_inlet = nodes->GetPrimitive(iPoint); - V_outlet = DonorPrimVar[val_marker][iVertex];} - else{ - V_outlet = nodes->GetPrimitive(iPoint); - V_inlet = DonorPrimVar[val_marker][iVertex];} - - /*--- u, v and w are the three momentum components. ---*/ - Pressure_out = V_outlet[nDim+1]; - Density_out = V_outlet[nDim+2]; - u_out = V_outlet[1]*V_outlet[nDim+2]; - v_out = V_outlet[2]*V_outlet[nDim+2]; - w_out = V_outlet[3]*V_outlet[nDim+2]; - - Pressure_in = V_inlet[nDim+1]; - Density_in = V_inlet[nDim+2]; - u_in = V_inlet[1]*Density_in; - v_in = V_inlet[2]*Density_in; - w_in = V_inlet[3]*Density_in; - H_in = V_inlet[nDim+3]*Density_in; - - /*--- Density on the disk is computed as an everage value between the inlet and outlet values. ---*/ - Density_Disk = 0.5*(Density_in + Density_out); - - /*--- Computation of the normal momentum flowing through the disk. ---*/ - Q_out = 0.5*((u_in + u_out)*Prop_Axis[0] + (v_in + v_out)*Prop_Axis[1] + (w_in + w_out)*Prop_Axis[2]); - - FQ = Q_out/Density_Disk; - - /*--- Computation of the momentum jumps due to the tnagential and radial forces per unit area. ---*/ - if (FQ < EPS){ - uJ = 0.0; - vJ = 0.0; - wJ = 0.0;} - else{ - uJ = Fx/FQ; - vJ = Fy/FQ; - wJ = Fz/FQ;} - - if (val_inlet_surface) { - /*--- Build the fictitious intlet state based on characteristics. - Retrieve the specified back pressure for this inlet ---*/ - - Density = V_domain[nDim+2]; - Velocity2 = 0.0; Vn = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - Velocity[iDim] = V_domain[iDim+1]; - Velocity2 += Velocity[iDim]*Velocity[iDim]; - Vn += Velocity[iDim]*UnitNormal[iDim]; - } - Pressure = V_domain[nDim+1]; - SoundSpeed = sqrt(Gamma*Pressure/Density); - - Entropy = Pressure*pow(1.0/Density, Gamma); - Riemann = Vn + 2.0*SoundSpeed/Gamma_Minus_One; - - /*--- Compute the new fictious state at the outlet ---*/ - - Pressure = Pressure_out - Fa; - Density = pow(Pressure/Entropy,1.0/Gamma); - SoundSpeed = sqrt(Gamma*Pressure/Density); - Vn_Inlet = Riemann - 2.0*SoundSpeed/Gamma_Minus_One; - - Velocity2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - Velocity[iDim] = Velocity[iDim] + (Vn_Inlet-Vn)*UnitNormal[iDim]; - Velocity2 += Velocity[iDim]*Velocity[iDim]; - } - Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); - - /*--- Conservative variables, using the derived quantities ---*/ - - V_inlet[0] = Pressure / ( Gas_Constant * Density); - for (iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+1] = Velocity[iDim]; - V_inlet[nDim+1] = Pressure; - V_inlet[nDim+2] = Density; - V_inlet[nDim+3] = Energy + Pressure/Density; - V_inlet[nDim+4] = SoundSpeed; - conv_numerics->SetPrimitive(V_domain, V_inlet); - } - else { - /*--- Acoustic Riemann invariant extrapolation form the interior domain. ---*/ - SoSextr = V_domain[nDim+4]; - - Vnextr_ = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - Vnextr[iDim] = V_domain[iDim+1]*Prop_Axis[iDim]; - Vnextr_ += Vnextr[iDim]*Vnextr[iDim]; - } - Vnextr_ = sqrt(max(0.0,Vnextr_)); - RiemannExtr = Vnextr_ - ((2*SoSextr)/(Gamma_Minus_One)); - - /*--- Assigning the momentum in tangential direction jump and the pressure jump. ---*/ - Velocity[0] = u_in + uJ; - Velocity[1] = v_in + vJ; - Velocity[2] = w_in + wJ; - Pressure_out = Pressure_in + Fa; - - /*--- Computation of the momentum normal to the disk plane. ---*/ - QdMnorm[0] = u_in*Prop_Axis[0]; - QdMnorm[1] = v_in*Prop_Axis[1]; - QdMnorm[2] = w_in*Prop_Axis[2]; - - QdMnorm2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++) QdMnorm2 += QdMnorm[iDim]*QdMnorm[iDim]; - - /*--- Resolving the second grade equation for the density. ---*/ - appo2 = -((2*sqrt(QdMnorm2)*RiemannExtr)+((4*Gamma*Pressure_out)/(pow(Gamma_Minus_One,2)))); - Density_out = (-appo2+sqrt(max(0.0,pow(appo2,2)-4*QdMnorm2*pow(RiemannExtr,2))))/(2*pow(RiemannExtr,2)); - - Velocity2 = 0; - for (iDim = 0; iDim < nDim; iDim++) Velocity2 += (Velocity[iDim]*Velocity[iDim]); - - /*--- Computation of the enthalpy, total energy, temperature and speed of sound. ---*/ - H_out = H_in/Density_in + Fa/Density_out; - Energy = H_out - Pressure_out/Density_out; - if (tkeNeeded) Energy += GetTke_Inf(); - Temperature_out = (Energy-0.5*Velocity2/(pow(Density_out,2)))*(Gamma_Minus_One/Gas_Constant); - - SoS_out = sqrt(Gamma*Gas_Constant*Temperature_out); - - /*--- Set the primitive variables. ---*/ - V_outlet[0] = Temperature_out; - for (iDim = 0; iDim < nDim; iDim++) - V_outlet[iDim+1] = Velocity[iDim]/Density_out; - V_outlet[nDim+1] = Pressure_out; - V_outlet[nDim+2] = Density_out; - V_outlet[nDim+3] = H_out; - V_outlet[nDim+4] = SoS_out; - conv_numerics->SetPrimitive(V_domain, V_outlet); - } - - /*--- Grid Movement (NOT TESTED!)---*/ - - if (dynamic_grid) - conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint)); - - /*--- Compute the residual using an upwind scheme ---*/ - - auto residual = conv_numerics->ComputeResidual(config); - - /*--- Update residual value ---*/ - - LinSysRes.AddBlock(iPoint, residual); - - /*--- Jacobian contribution for implicit integration ---*/ - - if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); - } - } -} +//void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, +// CConfig *config, unsigned short val_marker, bool val_inlet_surface) { +// +// /*! +// * \function BC_ActDisk_BEM_VLAD +// * \brief Actuator disk model with Blade Element Method (BEM) +// * \author: Chandukrishna Y., T. N. Venkatesh and Josy Pullockara +// * Institution: Computational and Theoretical Fluid Dynamics (CTFD), +// * CSIR - National Aerospace Laboratories, Bangalore +// * Academy of Scientific and Innovative Research, Ghaziabad +// * \version 8.0.0 "Harrier" +// * First release date : September 26 2023 +// * modified on: +// * +// * Section properties of the propeller given in an input file. +// * Cl, Cd of propeller sections need to be generated earlier and saved in this file +// * Actuator disk data initialized in function SetActDisk_BCThrust. +// * Propeller load calculated with Blade Element Method +// * Interpolated load at each point on the actuator disk is set in SetActDisk_BEM_VLAD function +// * Rest calculations follows the Variable Load (BC_ActDisk_VariableLoad) approach +// * +// */ +// +// unsigned short iDim; +// unsigned long iVertex, iPoint, GlobalIndex_donor, GlobalIndex; +// su2double Pressure, Velocity[MAXNDIM], +// Velocity2, Entropy, Density, Energy, Riemann, Vn, SoundSpeed, Vn_Inlet, +// Area, UnitNormal[MAXNDIM] = {0.0}, *V_outlet, *V_domain, *V_inlet; +// +// su2double Pressure_out, Density_out, +// Pressure_in, Density_in; +// +// su2double Prop_Axis[MAXNDIM]; +// su2double Fa, Fx, Fy, Fz; +// su2double u_in, v_in, w_in, u_out, v_out, w_out, uJ, vJ, wJ; +// su2double Temperature_out, H_in, H_out; +// su2double FQ, Q_out, Density_Disk; +// su2double SoSextr, Vnextr[MAXNDIM], Vnextr_, RiemannExtr, QdMnorm[MAXNDIM], QdMnorm2, appo2, SoS_out; +// su2double Normal[MAXNDIM]; +// +// const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); +// const auto Gas_Constant = config->GetGas_ConstantND(); +// const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); +// +// /*--- Get the actuator disk center and axis coordinates for the current marker. ---*/ +// for (iDim = 0; iDim < nDim; iDim++){ +// Prop_Axis[iDim] = ActDisk_Axis(val_marker, iDim); +// } +// +// /*--- Loop over all the vertices on this boundary marker. ---*/ +// SU2_OMP_FOR_DYN(OMP_MIN_SIZE) +// for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { +// +// iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); +// GlobalIndex = geometry->nodes->GetGlobalIndex(iPoint); +// GlobalIndex_donor = GetDonorGlobalIndex(val_marker, iVertex); +// +// /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ +// +// if ((geometry->nodes->GetDomain(iPoint)) && +// (GlobalIndex != GlobalIndex_donor)) { +// +// /*--- Normal vector for this vertex (negative for outward convention) ---*/ +// +// geometry->vertex[val_marker][iVertex]->GetNormal(Normal); +// for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; +// conv_numerics->SetNormal(Normal); +// +// Area = GeometryToolbox::Norm(nDim, Normal); +// for (iDim = 0; iDim < nDim; iDim++) +// UnitNormal[iDim] = Normal[iDim]/Area; +// +// /*--- Current solution at this boundary node. ---*/ +// +// V_domain = nodes->GetPrimitive(iPoint); +// +// /*--- Get the values of Fa (axial force per unit area), Fx, Fy and Fz (x, y and z components of the tangential and +// radial forces per unit area resultant). ---*/ +// Fa = ActDisk_Fa_BEM[val_marker][iVertex]; +// Fx = ActDisk_Fx_BEM[val_marker][iVertex]; +// Fy = ActDisk_Fy_BEM[val_marker][iVertex]; +// Fz = ActDisk_Fz_BEM[val_marker][iVertex]; +// +// /*--- Get the primitive variables and the extrapolated variables. ---*/ +// if (val_inlet_surface){ +// V_inlet = nodes->GetPrimitive(iPoint); +// V_outlet = DonorPrimVar[val_marker][iVertex];} +// else{ +// V_outlet = nodes->GetPrimitive(iPoint); +// V_inlet = DonorPrimVar[val_marker][iVertex];} +// +// /*--- u, v and w are the three momentum components. ---*/ +// Pressure_out = V_outlet[nDim+1]; +// Density_out = V_outlet[nDim+2]; +// u_out = V_outlet[1]*V_outlet[nDim+2]; +// v_out = V_outlet[2]*V_outlet[nDim+2]; +// w_out = V_outlet[3]*V_outlet[nDim+2]; +// +// Pressure_in = V_inlet[nDim+1]; +// Density_in = V_inlet[nDim+2]; +// u_in = V_inlet[1]*Density_in; +// v_in = V_inlet[2]*Density_in; +// w_in = V_inlet[3]*Density_in; +// H_in = V_inlet[nDim+3]*Density_in; +// +// /*--- Density on the disk is computed as an everage value between the inlet and outlet values. ---*/ +// Density_Disk = 0.5*(Density_in + Density_out); +// +// /*--- Computation of the normal momentum flowing through the disk. ---*/ +// Q_out = 0.5*((u_in + u_out)*Prop_Axis[0] + (v_in + v_out)*Prop_Axis[1] + (w_in + w_out)*Prop_Axis[2]); +// +// FQ = Q_out/Density_Disk; +// +// /*--- Computation of the momentum jumps due to the tnagential and radial forces per unit area. ---*/ +// if (FQ < EPS){ +// uJ = 0.0; +// vJ = 0.0; +// wJ = 0.0;} +// else{ +// uJ = Fx/FQ; +// vJ = Fy/FQ; +// wJ = Fz/FQ;} +// +// if (val_inlet_surface) { +// /*--- Build the fictitious intlet state based on characteristics. +// Retrieve the specified back pressure for this inlet ---*/ +// +// Density = V_domain[nDim+2]; +// Velocity2 = 0.0; Vn = 0.0; +// for (iDim = 0; iDim < nDim; iDim++) { +// Velocity[iDim] = V_domain[iDim+1]; +// Velocity2 += Velocity[iDim]*Velocity[iDim]; +// Vn += Velocity[iDim]*UnitNormal[iDim]; +// } +// Pressure = V_domain[nDim+1]; +// SoundSpeed = sqrt(Gamma*Pressure/Density); +// +// Entropy = Pressure*pow(1.0/Density, Gamma); +// Riemann = Vn + 2.0*SoundSpeed/Gamma_Minus_One; +// +// /*--- Compute the new fictious state at the outlet ---*/ +// +// Pressure = Pressure_out - Fa; +// Density = pow(Pressure/Entropy,1.0/Gamma); +// SoundSpeed = sqrt(Gamma*Pressure/Density); +// Vn_Inlet = Riemann - 2.0*SoundSpeed/Gamma_Minus_One; +// +// Velocity2 = 0.0; +// for (iDim = 0; iDim < nDim; iDim++) { +// Velocity[iDim] = Velocity[iDim] + (Vn_Inlet-Vn)*UnitNormal[iDim]; +// Velocity2 += Velocity[iDim]*Velocity[iDim]; +// } +// Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; +// if (tkeNeeded) Energy += GetTke_Inf(); +// +// /*--- Conservative variables, using the derived quantities ---*/ +// +// V_inlet[0] = Pressure / ( Gas_Constant * Density); +// for (iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+1] = Velocity[iDim]; +// V_inlet[nDim+1] = Pressure; +// V_inlet[nDim+2] = Density; +// V_inlet[nDim+3] = Energy + Pressure/Density; +// V_inlet[nDim+4] = SoundSpeed; +// conv_numerics->SetPrimitive(V_domain, V_inlet); +// } +// else { +// /*--- Acoustic Riemann invariant extrapolation form the interior domain. ---*/ +// SoSextr = V_domain[nDim+4]; +// +// Vnextr_ = 0.0; +// for (iDim = 0; iDim < nDim; iDim++){ +// Vnextr[iDim] = V_domain[iDim+1]*Prop_Axis[iDim]; +// Vnextr_ += Vnextr[iDim]*Vnextr[iDim]; +// } +// Vnextr_ = sqrt(max(0.0,Vnextr_)); +// RiemannExtr = Vnextr_ - ((2*SoSextr)/(Gamma_Minus_One)); +// +// /*--- Assigning the momentum in tangential direction jump and the pressure jump. ---*/ +// Velocity[0] = u_in + uJ; +// Velocity[1] = v_in + vJ; +// Velocity[2] = w_in + wJ; +// Pressure_out = Pressure_in + Fa; +// +// /*--- Computation of the momentum normal to the disk plane. ---*/ +// QdMnorm[0] = u_in*Prop_Axis[0]; +// QdMnorm[1] = v_in*Prop_Axis[1]; +// QdMnorm[2] = w_in*Prop_Axis[2]; +// +// QdMnorm2 = 0.0; +// for (iDim = 0; iDim < nDim; iDim++) QdMnorm2 += QdMnorm[iDim]*QdMnorm[iDim]; +// +// /*--- Resolving the second grade equation for the density. ---*/ +// appo2 = -((2*sqrt(QdMnorm2)*RiemannExtr)+((4*Gamma*Pressure_out)/(pow(Gamma_Minus_One,2)))); +// Density_out = (-appo2+sqrt(max(0.0,pow(appo2,2)-4*QdMnorm2*pow(RiemannExtr,2))))/(2*pow(RiemannExtr,2)); +// +// Velocity2 = 0; +// for (iDim = 0; iDim < nDim; iDim++) Velocity2 += (Velocity[iDim]*Velocity[iDim]); +// +// /*--- Computation of the enthalpy, total energy, temperature and speed of sound. ---*/ +// H_out = H_in/Density_in + Fa/Density_out; +// Energy = H_out - Pressure_out/Density_out; +// if (tkeNeeded) Energy += GetTke_Inf(); +// Temperature_out = (Energy-0.5*Velocity2/(pow(Density_out,2)))*(Gamma_Minus_One/Gas_Constant); +// +// SoS_out = sqrt(Gamma*Gas_Constant*Temperature_out); +// +// /*--- Set the primitive variables. ---*/ +// V_outlet[0] = Temperature_out; +// for (iDim = 0; iDim < nDim; iDim++) +// V_outlet[iDim+1] = Velocity[iDim]/Density_out; +// V_outlet[nDim+1] = Pressure_out; +// V_outlet[nDim+2] = Density_out; +// V_outlet[nDim+3] = H_out; +// V_outlet[nDim+4] = SoS_out; +// conv_numerics->SetPrimitive(V_domain, V_outlet); +// } +// +// /*--- Grid Movement (NOT TESTED!)---*/ +// +// if (dynamic_grid) +// conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint)); +// +// /*--- Compute the residual using an upwind scheme ---*/ +// +// auto residual = conv_numerics->ComputeResidual(config); +// +// /*--- Update residual value ---*/ +// +// LinSysRes.AddBlock(iPoint, residual); +// +// /*--- Jacobian contribution for implicit integration ---*/ +// +// if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); +// } +// } +//} void CEulerSolver::PrintVerificationError(const CConfig *config) const { diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index d64dba58ff4..07be1b9a3f7 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -107,6 +107,11 @@ MARKER_ACTDISK = ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 12715.2, 0.0, 0.0, 12715. % X_CG of outlet, Y_CG of outlet, Z_CG of outlet), X_CG, Y_CG, Z_CG of both inlet and % outlet markers should be same MARKER_ACTDISK_CG= ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 0.0, 0.0,0.0,0.0) +%Actuator Disk Axis +%(inlet face marker, outlet face marker, +% axis_x, axis_y, axis_z of inlet, axis_x, axis_y, axis_z of outlet), +% axis of both inlet and outlet markers should be same +MARKER_ACTDISK_AXIS= ( ACTDISK_IN, ACTDISK_OUT , 1.0, 0.0, 0.0, 1.0,0.0,0.0) % Input file containing the propeller section data and aerodynamic details of blade sections BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt % Propeller blade angle (Degrees) at 0.75*Radius for the current calculation From 59c825817f154acf0cb01f645cf3cf2205557e8c Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sat, 21 Oct 2023 20:42:33 +0530 Subject: [PATCH 060/139] config options for CG and Axis, other minor cleanup --- Common/include/CConfig.hpp | 38 ++- Common/include/option_structure.inl | 100 ++++++ Common/src/CConfig.cpp | 70 +++-- SU2_CFD/include/solvers/CEulerSolver.hpp | 32 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 297 +++--------------- .../actuatordisk_bem/actuatordisk_bem.cfg | 4 +- config_template.cfg | 7 +- 7 files changed, 219 insertions(+), 329 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index a4cd84b7a48..f60eb8f8fa0 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -184,6 +184,8 @@ class CConfig { nMarker_NearFieldBound, /*!< \brief Number of near field boundary markers. */ nMarker_ActDiskInlet, /*!< \brief Number of actuator disk inlet markers. */ nMarker_ActDiskOutlet, /*!< \brief Number of actuator disk outlet markers. */ + nMarker_ActDiskBemInlet, /*!< \brief Number of actuator disk BEM inlet markers. */ + nMarker_ActDiskBemOutlet, /*!< \brief Number of actuator disk BEM outlet markers. */ nMarker_Deform_Mesh_Sym_Plane, /*!< \brief Number of markers with symmetric deformation */ nMarker_Deform_Mesh, /*!< \brief Number of deformable markers at the boundary. */ nMarker_Fluid_Load, /*!< \brief Number of markers in which the flow load is computed/employed. */ @@ -242,6 +244,8 @@ class CConfig { *Marker_CHTInterface, /*!< \brief Conjugate heat transfer interface markers. */ *Marker_ActDiskInlet, /*!< \brief Actuator disk inlet markers. */ *Marker_ActDiskOutlet, /*!< \brief Actuator disk outlet markers. */ + *Marker_ActDiskBemInlet, /*!< \brief Actuator disk BEM inlet markers. */ + *Marker_ActDiskBemOutlet, /*!< \brief Actuator disk BEM outlet markers. */ *Marker_Inlet, /*!< \brief Inlet flow markers. */ *Marker_Inlet_Species, /*!< \brief Inlet species markers. */ *Marker_Inlet_Turb, /*!< \brief Inlet turbulent markers. */ @@ -348,9 +352,9 @@ class CConfig { su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet torque for actuator disk. */ su2double **ActDisk_PressJump, **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ - su2double **ActDisk_CG[3]; /*!< \brief Specified CG for actuator disk.*/ - su2double **ActDisk_Axis_BEM[3]; /*!< \brief Specified axis for actuator disk.*/ - su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate.*/ +//su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate.*/ + su2double **ActDiskBem_CG[3]; /*!< \brief Specified center for actuator disk BEM.*/ + su2double **ActDiskBem_Axis[3]; /*!< \brief Specified axis for actuator disk BEM.*/ su2double BEM_blade_angle ; /*!< \brief Propeller blade angle.*/ string BEM_prop_filename ; /*!< \brief Propeller filename.*/ bool History_File_Append_Flag; /*!< \brief Flag to append history file.*/ @@ -1373,6 +1377,10 @@ class CConfig { unsigned short & nMarker_ActDiskInlet, unsigned short & nMarker_ActDiskOutlet, string* & Marker_ActDiskInlet, string* & Marker_ActDiskOutlet, su2double** & ActDisk_PressJump, su2double** & ActDisk_TempJump, su2double** & ActDisk_Omega); + void addActDiskBemOption(const string & name, + unsigned short & nMarker_ActDiskBemInlet, unsigned short & nMarker_ActDiskBemOutlet, string* & Marker_ActDiskBemInlet, string* & Marker_ActDiskBemOutlet, + su2double** & ActDiskBem_X, su2double** & ActDiskBem_Y, su2double** & ActDiskBem_Z); + void addWallFunctionOption(const string &name, unsigned short &list_size, string* &string_field, WALL_FUNCTIONS* &val_Kind_WF, unsigned short** &val_IntInfo_WF, su2double** &val_DoubleInfo_WF); @@ -6658,34 +6666,34 @@ class CConfig { su2double GetActDisk_PressJump(const string& val_marker, unsigned short val_index) const; /*! - * \brief Get the CG of the actuator disk. + * \brief Get the thrust corffient of the actuator disk. */ - su2double GetActDisk_CG(unsigned short iDim, string val_marker, unsigned short val_index) const; + su2double GetActDisk_TempJump(const string& val_marker, unsigned short val_index) const; /*! - * \brief Get the axis of the actuator disk with Blade Element Method. + * \brief Get the rev / min of the actuator disk. */ - su2double GetActDisk_Axis_BEM(unsigned short iDim, string val_marker, unsigned short val_index) const; + su2double GetActDisk_Omega(const string& val_marker, unsigned short val_index) const; /*! - * \brief Get the blade angle of the propeller. + * \brief Get the Center of the actuator disk. */ - su2double GetBEM_blade_angle(void) { return BEM_blade_angle; } + su2double GetActDiskBem_CG(unsigned short iDim, string val_marker, unsigned short val_index) const; /*! - * \brief Get the filename of the propeller. + * \brief Get the axis of the actuator disk with Blade Element Method. */ - string GetBEM_prop_filename(void) { return BEM_prop_filename; } + su2double GetActDiskBem_Axis(unsigned short iDim, string val_marker, unsigned short val_index) const; /*! - * \brief Get the thrust corffient of the actuator disk. + * \brief Get the blade angle of the propeller. */ - su2double GetActDisk_TempJump(const string& val_marker, unsigned short val_index) const; + su2double GetBEM_blade_angle(void) { return BEM_blade_angle; } /*! - * \brief Get the rev / min of the actuator disk. + * \brief Get the filename of the propeller. */ - su2double GetActDisk_Omega(const string& val_marker, unsigned short val_index) const; + string GetBEM_prop_filename(void) { return BEM_prop_filename; } /*! * \brief Get Actuator Disk Outlet for boundary val_marker (actuator disk inlet). diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index ce94055fca5..8bd9644b42a 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -1772,6 +1772,106 @@ class COptionActDisk : public COptionBase { } }; +class COptionActDiskBem : public COptionBase { + string name; // identifier for the option + unsigned short& inlet_size; + unsigned short& outlet_size; + string*& marker_inlet; + string*& marker_outlet; + su2double**& dir_x; + su2double**& dir_y; + su2double**& dir_z; + + public: + COptionActDiskBem(const string name, unsigned short& nMarker_ActDiskInlet, unsigned short& nMarker_ActDiskOutlet, + string*& Marker_ActDiskInlet, string*& Marker_ActDiskOutlet, + su2double**& ActDiskBem_X, su2double**& ActDiskBem_Y, su2double**& ActDiskBem_Z) + : inlet_size(nMarker_ActDiskInlet), + outlet_size(nMarker_ActDiskOutlet), + marker_inlet(Marker_ActDiskInlet), + marker_outlet(Marker_ActDiskOutlet), + dir_x(ActDiskBem_X), + dir_y(ActDiskBem_Y), + dir_z(ActDiskBem_Z) { + this->name = name; + } + + ~COptionActDiskBem() override{}; + string SetValue(const vector& option_value) override { + COptionBase::SetValue(option_value); + const int mod_num = 8; + unsigned short totalVals = option_value.size(); + if ((totalVals == 1) && (option_value[0].compare("NONE") == 0)) { + this->SetDefault(); + return ""; + } + + if (totalVals % mod_num != 0) { + string newstring; + newstring.append(this->name); + newstring.append(": must have a number of entries divisible by 8"); + this->SetDefault(); + return newstring; + } + + unsigned short nVals = totalVals / mod_num; + this->inlet_size = nVals; + this->outlet_size = nVals; + this->marker_inlet = new string[this->inlet_size]; + this->marker_outlet = new string[this->outlet_size]; + + this->dir_x = new su2double*[this->inlet_size]; + this->dir_y = new su2double*[this->inlet_size]; + this->dir_z = new su2double*[this->inlet_size]; + for (int i = 0; i < this->inlet_size; i++) { + this->dir_x[i] = new su2double[2]; + this->dir_y[i] = new su2double[2]; + this->dir_z[i] = new su2double[2]; + } + + string tname = "actuator disk"; + + for (int i = 0; i < this->inlet_size; i++) { + this->marker_inlet[i].assign(option_value[mod_num * i]); + this->marker_outlet[i].assign(option_value[mod_num * i + 1]); + istringstream ss_1st(option_value[mod_num * i + 2]); + if (!(ss_1st >> this->dir_x[i][0])) { + return badValue(tname, this->name); + } + istringstream ss_2nd(option_value[mod_num * i + 3]); + if (!(ss_2nd >> this->dir_y[i][0])) { + return badValue(tname, this->name); + } + istringstream ss_3rd(option_value[mod_num * i + 4]); + if (!(ss_3rd >> this->dir_z[i][0])) { + return badValue(tname, this->name); + } + istringstream ss_4th(option_value[mod_num * i + 5]); + if (!(ss_4th >> this->dir_x[i][1])) { + return badValue(tname, this->name); + } + istringstream ss_5th(option_value[mod_num * i + 6]); + if (!(ss_5th >> this->dir_y[i][1])) { + return badValue(tname, this->name); + } + istringstream ss_6th(option_value[mod_num * i + 7]); + if (!(ss_6th >> this->dir_z[i][1])) { + return badValue(tname, this->name); + } + } + return ""; + } + void SetDefault() override { + this->inlet_size = 0; + this->outlet_size = 0; + this->marker_inlet = nullptr; + this->marker_outlet = nullptr; + this->dir_x = nullptr; + this->dir_y = nullptr; + this->dir_z = nullptr; + } +}; + class COptionWallFunction : public COptionBase { string name; // identifier for the option unsigned short& nMarkers; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index d23546dbc69..b21f896c7df 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -557,6 +557,17 @@ void CConfig::addActDiskOption(const string & name, unsigned short & nMarker_Act option_map.insert(pair(name, val)); } +void CConfig::addActDiskBemOption(const string & name, + unsigned short & nMarker_ActDiskBemInlet, unsigned short & nMarker_ActDiskBemOutlet, + string* & Marker_ActDiskBemInlet, string* & Marker_ActDiskBemOutlet, + su2double** & ActDiskBem_X, su2double** & ActDiskBem_Y, su2double** & ActDiskBem_Z) { + assert(option_map.find(name) == option_map.end()); + all_options.insert(pair(name, true)); + COptionBase* val = new COptionActDiskBem(name, nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet, + ActDiskBem_X, ActDiskBem_Y, ActDiskBem_Z); + option_map.insert(pair(name, val)); +} + void CConfig::addWallFunctionOption(const string &name, unsigned short &list_size, string* &string_field, WALL_FUNCTIONS* &val_Kind_WF, unsigned short** &val_IntInfo_WF, su2double** &val_DoubleInfo_WF) { @@ -1526,15 +1537,15 @@ void CConfig::SetConfig_Options() { nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, ActDisk_PressJump, ActDisk_TempJump, ActDisk_Omega); - /*!\brief MARKER_ACTDISK_CG\n DESCRIPTION: Actuator disk with CG for blade element momentum (BEM) method. \ingroup Config*/ - addActDiskOption("MARKER_ACTDISK_CG", - nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, - ActDisk_CG[0], ActDisk_CG[1], ActDisk_CG[2]); + /*!\brief MARKER_ACTDISK_BEM_CG\n DESCRIPTION: Actuator disk CG for blade element momentum (BEM) method. \ingroup Config*/ + addActDiskBemOption("MARKER_ACTDISK_BEM_CG", + nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet, + ActDiskBem_CG[0], ActDiskBem_CG[1], ActDiskBem_CG[2]); - /*!\brief MARKER_ACTDISK_CG\n DESCRIPTION: Actuator disk axis for blade element momentum (BEM) method. \ingroup Config*/ - addActDiskOption("MARKER_ACTDISK_AXIS", - nMarker_ActDiskInlet, nMarker_ActDiskOutlet, Marker_ActDiskInlet, Marker_ActDiskOutlet, - ActDisk_Axis_BEM[0], ActDisk_Axis_BEM[1], ActDisk_Axis_BEM[2]); + /*!\brief MARKER_ACTDISK_BEM_AXIS\n DESCRIPTION: Actuator disk axis for blade element momentum (BEM) method. \ingroup Config*/ + addActDiskBemOption("MARKER_ACTDISK_BEM_AXIS", + nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet, + ActDiskBem_Axis[0], ActDiskBem_Axis[1], ActDiskBem_Axis[2]); /*!\brief ACTDISK_FILENAME \n DESCRIPTION: Input file for a specified actuator disk (w/ extension) \n DEFAULT: actdiskinput.dat \ingroup Config*/ addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat")); @@ -5560,7 +5571,9 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { nMarker_Supersonic_Inlet + nMarker_Supersonic_Outlet + nMarker_Displacement + nMarker_Load + nMarker_FlowLoad + nMarker_Custom + nMarker_Damper + nMarker_Fluid_Load + nMarker_Clamped + nMarker_Load_Sine + nMarker_Load_Dir + nMarker_Disp_Dir + - nMarker_ActDiskInlet + nMarker_ActDiskOutlet + nMarker_ZoneInterface; + nMarker_ActDiskInlet + nMarker_ActDiskOutlet + + nMarker_ActDiskBemInlet + nMarker_ActDiskBemOutlet + + nMarker_ZoneInterface; /*--- Add the possible send/receive domains ---*/ @@ -7634,6 +7647,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } } + if (nMarker_ActDiskOutlet != 0) { + if (GetKind_ActDisk() == BLADE_ELEMENT) { + cout << endl << "Actuator disk with blade element momentum (BEM) method." << endl; + cout << "Actuator disk BEM method propeller data read from file: " << GetBEM_prop_filename() << endl; + } + } + } bool CConfig::TokenizeString(string & str, string & option_name, @@ -8127,8 +8147,8 @@ CConfig::~CConfig() { delete[] ActDiskOutlet_Force; delete[] ActDiskOutlet_Power; - delete[] ActDiskOutlet_Thrust_BEM; - delete[] ActDiskOutlet_Torque_BEM; + delete[] ActDiskOutlet_Thrust_BEM; + delete[] ActDiskOutlet_Torque_BEM; delete[] Outlet_MassFlow; delete[] Outlet_Density; @@ -8699,36 +8719,36 @@ su2double CConfig::GetActDisk_PressJump(const string& val_marker, unsigned short return ActDisk_PressJump[iMarker_ActDisk][val_value]; } -su2double CConfig::GetActDisk_CG(unsigned short iDim, string val_marker, unsigned short val_value) const { +su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_CG[iDim][iMarker_ActDisk][val_value]; + return ActDisk_TempJump[iMarker_ActDisk][val_value];; } -su2double CConfig::GetActDisk_Axis_BEM(unsigned short iDim, string val_marker, unsigned short val_value) const { +su2double CConfig::GetActDisk_Omega(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_Axis_BEM[iDim][iMarker_ActDisk][val_value]; + return ActDisk_Omega[iMarker_ActDisk][val_value];; } -su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { +su2double CConfig::GetActDiskBem_CG(unsigned short iDim, string val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; - for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_TempJump[iMarker_ActDisk][val_value];; + for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskBemInlet; iMarker_ActDisk++) + if ((Marker_ActDiskBemInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskBemOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDiskBem_CG[iDim][iMarker_ActDisk][val_value]; } -su2double CConfig::GetActDisk_Omega(const string& val_marker, unsigned short val_value) const { +su2double CConfig::GetActDiskBem_Axis(unsigned short iDim, string val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; - for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) - if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || - (Marker_ActDiskOutlet[iMarker_ActDisk] == val_marker)) break; - return ActDisk_Omega[iMarker_ActDisk][val_value];; + for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskBemInlet; iMarker_ActDisk++) + if ((Marker_ActDiskBemInlet[iMarker_ActDisk] == val_marker) || + (Marker_ActDiskBemOutlet[iMarker_ActDisk] == val_marker)) break; + return ActDiskBem_Axis[iDim][iMarker_ActDisk][val_value]; } su2double CConfig::GetOutlet_MassFlow(const string& val_marker) const { diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index c6397f3e0ab..b722c16aa86 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -68,7 +68,7 @@ class CEulerSolver : public CFVMFlowSolverBase > ActDisk_DeltaP_r; /*!< \brief Value of the Delta P. */ vector > ActDisk_Thrust_r; /*!< \brief Value of the Delta P. */ vector > ActDisk_Torque_r; /*!< \brief Value of the Delta P. */ - vector > ActDisk_RotRate; /*!< \brief Value of the Rotation Rate. */ +//vector > ActDisk_RotRate; /*!< \brief Value of the Rotation Rate. */ //vector > ActDisk_XCG; //vector > ActDisk_YCG; //vector > ActDisk_ZCG; @@ -83,10 +83,10 @@ class CEulerSolver : public CFVMFlowSolverBase > ActDisk_Fx; /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */ vector > ActDisk_Fy; /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */ vector > ActDisk_Fz; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */ - vector > ActDisk_Fa_BEM; /*!< \brief Value of the actuator disk Axial Force per Unit Area. */ - vector > ActDisk_Fx_BEM; /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */ - vector > ActDisk_Fy_BEM; /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */ - vector > ActDisk_Fz_BEM; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fa_BEM; /*!< \brief Value of the actuator disk Axial Force per Unit Area. */ + vector > ActDisk_Fx_BEM; /*!< \brief Value of the actuator disk X component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fy_BEM; /*!< \brief Value of the actuator disk Y component of the radial and tangential forces per Unit Area resultant. */ + vector > ActDisk_Fz_BEM; /*!< \brief Value of the actuator disk Z component of the radial and tangential forces per Unit Area resultant. */ su2double Total_CL_Prev = 0.0, /*!< \brief Total lift coefficient for all the boundaries (fixed lift mode). */ @@ -229,6 +229,7 @@ class CEulerSolver : public CFVMFlowSolverBaseGetMarker_All_TagBound(iMarker); ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); for (iDim=0; iDim < nDim; iDim++){ - ADBem_CG[iDim] = config->GetActDisk_CG(iDim, Marker_Tag, 0); + ADBem_CG[iDim] = config->GetActDiskBem_CG(iDim, Marker_Tag, 0); } /* for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -4264,7 +4284,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con //ADBem_Axis[1] = 0.0; //ADBem_Axis[2] = 0.0; for (iDim=0; iDim < nDim; iDim++){ - ADBem_Axis[iDim] = config->GetActDisk_Axis_BEM(iDim, Marker_Tag, 0); + ADBem_Axis[iDim] = config->GetActDiskBem_Axis(iDim, Marker_Tag, 0); } for (iDim = 0; iDim < nDim; iDim++){ ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; @@ -4302,21 +4322,21 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con V = config->GetModVel_FreeStream(); V = fabs(Vn); - /*--- BEM model without parameter 'a' (ref?) ---*/ + /*--- BEM model without parameter 'a' (ref?) ---*/ { DtDr.resize(ADBem_NSection, 0.0); int s_prop_nblades = ADBem_NBlade; - int sprop_sec_nalf = ADBem_NAlpha; - int sprop_sec_nrad = ADBem_NSection; - std::vector& sprop_sec_r1 = radius_v; - std::vector& sprop_sec_chord = chord_v; - std::vector& sprop_sec_setangle = angle75r_v; - std::vector >& sprop_sec_alf = alpha_m; - std::vector >& sprop_sec_cl_arr = cl_m; - std::vector >& sprop_sec_cd_arr = cd_m; + int sprop_sec_nalf = ADBem_NAlpha; + int sprop_sec_nrad = ADBem_NSection; + std::vector& sprop_sec_r1 = radius_v; + std::vector& sprop_sec_chord = chord_v; + std::vector& sprop_sec_setangle = angle75r_v; + std::vector >& sprop_sec_alf = alpha_m; + std::vector >& sprop_sec_cl_arr = cl_m; + std::vector >& sprop_sec_cd_arr = cd_m; - su2double rad_p = radius; + su2double rad_p = radius; int j, isec,converged, n_iter; int NR = sprop_sec_nrad; @@ -4324,8 +4344,8 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double base_mach, s_mach, b_num, thrust, torque; su2double r_dash, t_loss, c_phi, rad, phi, alpha, radtodeg; su2double bnew, V0, V2, cl=0.0, cd=0.0, Vlocal, DqDr=0.0, tem1, tem2, q; - std::vector delta_r(ADBem_NSection, 0.0); - std::vector b(ADBem_NSection, 0.0); + std::vector delta_r(ADBem_NSection, 0.0); + std::vector b(ADBem_NSection, 0.0); static std::vector Dtorq(ADBem_NSection, 0.0); su2double n, omega, a0, den; @@ -8127,9 +8147,6 @@ void CEulerSolver::BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_contai if(Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT){ BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); } - //else if(Kind_ActDisk == BLADE_ELEMENT){ - // BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); - //} else{ BC_ActDisk(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); } @@ -8144,9 +8161,6 @@ void CEulerSolver::BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_conta if(Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT){ BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); } - //else if(Kind_ActDisk == BLADE_ELEMENT){ - // BC_ActDisk_BEM_VLAD(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); - //} else{ BC_ActDisk(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); } @@ -8805,243 +8819,6 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver END_SU2_OMP_FOR } -//void CEulerSolver::BC_ActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, -// CConfig *config, unsigned short val_marker, bool val_inlet_surface) { -// -// /*! -// * \function BC_ActDisk_BEM_VLAD -// * \brief Actuator disk model with Blade Element Method (BEM) -// * \author: Chandukrishna Y., T. N. Venkatesh and Josy Pullockara -// * Institution: Computational and Theoretical Fluid Dynamics (CTFD), -// * CSIR - National Aerospace Laboratories, Bangalore -// * Academy of Scientific and Innovative Research, Ghaziabad -// * \version 8.0.0 "Harrier" -// * First release date : September 26 2023 -// * modified on: -// * -// * Section properties of the propeller given in an input file. -// * Cl, Cd of propeller sections need to be generated earlier and saved in this file -// * Actuator disk data initialized in function SetActDisk_BCThrust. -// * Propeller load calculated with Blade Element Method -// * Interpolated load at each point on the actuator disk is set in SetActDisk_BEM_VLAD function -// * Rest calculations follows the Variable Load (BC_ActDisk_VariableLoad) approach -// * -// */ -// -// unsigned short iDim; -// unsigned long iVertex, iPoint, GlobalIndex_donor, GlobalIndex; -// su2double Pressure, Velocity[MAXNDIM], -// Velocity2, Entropy, Density, Energy, Riemann, Vn, SoundSpeed, Vn_Inlet, -// Area, UnitNormal[MAXNDIM] = {0.0}, *V_outlet, *V_domain, *V_inlet; -// -// su2double Pressure_out, Density_out, -// Pressure_in, Density_in; -// -// su2double Prop_Axis[MAXNDIM]; -// su2double Fa, Fx, Fy, Fz; -// su2double u_in, v_in, w_in, u_out, v_out, w_out, uJ, vJ, wJ; -// su2double Temperature_out, H_in, H_out; -// su2double FQ, Q_out, Density_Disk; -// su2double SoSextr, Vnextr[MAXNDIM], Vnextr_, RiemannExtr, QdMnorm[MAXNDIM], QdMnorm2, appo2, SoS_out; -// su2double Normal[MAXNDIM]; -// -// const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); -// const auto Gas_Constant = config->GetGas_ConstantND(); -// const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); -// -// /*--- Get the actuator disk center and axis coordinates for the current marker. ---*/ -// for (iDim = 0; iDim < nDim; iDim++){ -// Prop_Axis[iDim] = ActDisk_Axis(val_marker, iDim); -// } -// -// /*--- Loop over all the vertices on this boundary marker. ---*/ -// SU2_OMP_FOR_DYN(OMP_MIN_SIZE) -// for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { -// -// iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); -// GlobalIndex = geometry->nodes->GetGlobalIndex(iPoint); -// GlobalIndex_donor = GetDonorGlobalIndex(val_marker, iVertex); -// -// /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ -// -// if ((geometry->nodes->GetDomain(iPoint)) && -// (GlobalIndex != GlobalIndex_donor)) { -// -// /*--- Normal vector for this vertex (negative for outward convention) ---*/ -// -// geometry->vertex[val_marker][iVertex]->GetNormal(Normal); -// for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; -// conv_numerics->SetNormal(Normal); -// -// Area = GeometryToolbox::Norm(nDim, Normal); -// for (iDim = 0; iDim < nDim; iDim++) -// UnitNormal[iDim] = Normal[iDim]/Area; -// -// /*--- Current solution at this boundary node. ---*/ -// -// V_domain = nodes->GetPrimitive(iPoint); -// -// /*--- Get the values of Fa (axial force per unit area), Fx, Fy and Fz (x, y and z components of the tangential and -// radial forces per unit area resultant). ---*/ -// Fa = ActDisk_Fa_BEM[val_marker][iVertex]; -// Fx = ActDisk_Fx_BEM[val_marker][iVertex]; -// Fy = ActDisk_Fy_BEM[val_marker][iVertex]; -// Fz = ActDisk_Fz_BEM[val_marker][iVertex]; -// -// /*--- Get the primitive variables and the extrapolated variables. ---*/ -// if (val_inlet_surface){ -// V_inlet = nodes->GetPrimitive(iPoint); -// V_outlet = DonorPrimVar[val_marker][iVertex];} -// else{ -// V_outlet = nodes->GetPrimitive(iPoint); -// V_inlet = DonorPrimVar[val_marker][iVertex];} -// -// /*--- u, v and w are the three momentum components. ---*/ -// Pressure_out = V_outlet[nDim+1]; -// Density_out = V_outlet[nDim+2]; -// u_out = V_outlet[1]*V_outlet[nDim+2]; -// v_out = V_outlet[2]*V_outlet[nDim+2]; -// w_out = V_outlet[3]*V_outlet[nDim+2]; -// -// Pressure_in = V_inlet[nDim+1]; -// Density_in = V_inlet[nDim+2]; -// u_in = V_inlet[1]*Density_in; -// v_in = V_inlet[2]*Density_in; -// w_in = V_inlet[3]*Density_in; -// H_in = V_inlet[nDim+3]*Density_in; -// -// /*--- Density on the disk is computed as an everage value between the inlet and outlet values. ---*/ -// Density_Disk = 0.5*(Density_in + Density_out); -// -// /*--- Computation of the normal momentum flowing through the disk. ---*/ -// Q_out = 0.5*((u_in + u_out)*Prop_Axis[0] + (v_in + v_out)*Prop_Axis[1] + (w_in + w_out)*Prop_Axis[2]); -// -// FQ = Q_out/Density_Disk; -// -// /*--- Computation of the momentum jumps due to the tnagential and radial forces per unit area. ---*/ -// if (FQ < EPS){ -// uJ = 0.0; -// vJ = 0.0; -// wJ = 0.0;} -// else{ -// uJ = Fx/FQ; -// vJ = Fy/FQ; -// wJ = Fz/FQ;} -// -// if (val_inlet_surface) { -// /*--- Build the fictitious intlet state based on characteristics. -// Retrieve the specified back pressure for this inlet ---*/ -// -// Density = V_domain[nDim+2]; -// Velocity2 = 0.0; Vn = 0.0; -// for (iDim = 0; iDim < nDim; iDim++) { -// Velocity[iDim] = V_domain[iDim+1]; -// Velocity2 += Velocity[iDim]*Velocity[iDim]; -// Vn += Velocity[iDim]*UnitNormal[iDim]; -// } -// Pressure = V_domain[nDim+1]; -// SoundSpeed = sqrt(Gamma*Pressure/Density); -// -// Entropy = Pressure*pow(1.0/Density, Gamma); -// Riemann = Vn + 2.0*SoundSpeed/Gamma_Minus_One; -// -// /*--- Compute the new fictious state at the outlet ---*/ -// -// Pressure = Pressure_out - Fa; -// Density = pow(Pressure/Entropy,1.0/Gamma); -// SoundSpeed = sqrt(Gamma*Pressure/Density); -// Vn_Inlet = Riemann - 2.0*SoundSpeed/Gamma_Minus_One; -// -// Velocity2 = 0.0; -// for (iDim = 0; iDim < nDim; iDim++) { -// Velocity[iDim] = Velocity[iDim] + (Vn_Inlet-Vn)*UnitNormal[iDim]; -// Velocity2 += Velocity[iDim]*Velocity[iDim]; -// } -// Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; -// if (tkeNeeded) Energy += GetTke_Inf(); -// -// /*--- Conservative variables, using the derived quantities ---*/ -// -// V_inlet[0] = Pressure / ( Gas_Constant * Density); -// for (iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+1] = Velocity[iDim]; -// V_inlet[nDim+1] = Pressure; -// V_inlet[nDim+2] = Density; -// V_inlet[nDim+3] = Energy + Pressure/Density; -// V_inlet[nDim+4] = SoundSpeed; -// conv_numerics->SetPrimitive(V_domain, V_inlet); -// } -// else { -// /*--- Acoustic Riemann invariant extrapolation form the interior domain. ---*/ -// SoSextr = V_domain[nDim+4]; -// -// Vnextr_ = 0.0; -// for (iDim = 0; iDim < nDim; iDim++){ -// Vnextr[iDim] = V_domain[iDim+1]*Prop_Axis[iDim]; -// Vnextr_ += Vnextr[iDim]*Vnextr[iDim]; -// } -// Vnextr_ = sqrt(max(0.0,Vnextr_)); -// RiemannExtr = Vnextr_ - ((2*SoSextr)/(Gamma_Minus_One)); -// -// /*--- Assigning the momentum in tangential direction jump and the pressure jump. ---*/ -// Velocity[0] = u_in + uJ; -// Velocity[1] = v_in + vJ; -// Velocity[2] = w_in + wJ; -// Pressure_out = Pressure_in + Fa; -// -// /*--- Computation of the momentum normal to the disk plane. ---*/ -// QdMnorm[0] = u_in*Prop_Axis[0]; -// QdMnorm[1] = v_in*Prop_Axis[1]; -// QdMnorm[2] = w_in*Prop_Axis[2]; -// -// QdMnorm2 = 0.0; -// for (iDim = 0; iDim < nDim; iDim++) QdMnorm2 += QdMnorm[iDim]*QdMnorm[iDim]; -// -// /*--- Resolving the second grade equation for the density. ---*/ -// appo2 = -((2*sqrt(QdMnorm2)*RiemannExtr)+((4*Gamma*Pressure_out)/(pow(Gamma_Minus_One,2)))); -// Density_out = (-appo2+sqrt(max(0.0,pow(appo2,2)-4*QdMnorm2*pow(RiemannExtr,2))))/(2*pow(RiemannExtr,2)); -// -// Velocity2 = 0; -// for (iDim = 0; iDim < nDim; iDim++) Velocity2 += (Velocity[iDim]*Velocity[iDim]); -// -// /*--- Computation of the enthalpy, total energy, temperature and speed of sound. ---*/ -// H_out = H_in/Density_in + Fa/Density_out; -// Energy = H_out - Pressure_out/Density_out; -// if (tkeNeeded) Energy += GetTke_Inf(); -// Temperature_out = (Energy-0.5*Velocity2/(pow(Density_out,2)))*(Gamma_Minus_One/Gas_Constant); -// -// SoS_out = sqrt(Gamma*Gas_Constant*Temperature_out); -// -// /*--- Set the primitive variables. ---*/ -// V_outlet[0] = Temperature_out; -// for (iDim = 0; iDim < nDim; iDim++) -// V_outlet[iDim+1] = Velocity[iDim]/Density_out; -// V_outlet[nDim+1] = Pressure_out; -// V_outlet[nDim+2] = Density_out; -// V_outlet[nDim+3] = H_out; -// V_outlet[nDim+4] = SoS_out; -// conv_numerics->SetPrimitive(V_domain, V_outlet); -// } -// -// /*--- Grid Movement (NOT TESTED!)---*/ -// -// if (dynamic_grid) -// conv_numerics->SetGridVel(geometry->nodes->GetGridVel(iPoint), geometry->nodes->GetGridVel(iPoint)); -// -// /*--- Compute the residual using an upwind scheme ---*/ -// -// auto residual = conv_numerics->ComputeResidual(config); -// -// /*--- Update residual value ---*/ -// -// LinSysRes.AddBlock(iPoint, residual); -// -// /*--- Jacobian contribution for implicit integration ---*/ -// -// if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); -// } -// } -//} - void CEulerSolver::PrintVerificationError(const CConfig *config) const { if ((rank != MASTER_NODE) || (MGLevel != MESH_0)) return; diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index 07be1b9a3f7..c372a22f735 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -106,12 +106,12 @@ MARKER_ACTDISK = ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 12715.2, 0.0, 0.0, 12715. %(inlet face marker, outlet face marker, X_CG of inlet, Y_CG of inlet, Z_CG of inlet , % X_CG of outlet, Y_CG of outlet, Z_CG of outlet), X_CG, Y_CG, Z_CG of both inlet and % outlet markers should be same -MARKER_ACTDISK_CG= ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 0.0, 0.0,0.0,0.0) +MARKER_ACTDISK_BEM_CG= ( ACTDISK_IN, ACTDISK_OUT, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) %Actuator Disk Axis %(inlet face marker, outlet face marker, % axis_x, axis_y, axis_z of inlet, axis_x, axis_y, axis_z of outlet), % axis of both inlet and outlet markers should be same -MARKER_ACTDISK_AXIS= ( ACTDISK_IN, ACTDISK_OUT , 1.0, 0.0, 0.0, 1.0,0.0,0.0) +MARKER_ACTDISK_BEM_AXIS= ( ACTDISK_IN, ACTDISK_OUT, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 ) % Input file containing the propeller section data and aerodynamic details of blade sections BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt % Propeller blade angle (Degrees) at 0.75*Radius for the current calculation diff --git a/config_template.cfg b/config_template.cfg index e29e6a77626..7bba2009560 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -949,7 +949,12 @@ MARKER_ACTDISK= ( NONE ) % Blade element: ( inlet face marker, outlet face marker, % X_CG of inlet, Y_CG of inlet, Z_CG of inlet, % X_CG of outlet, Y_CG of outlet, Z_CG of outlet ) -MARKER_ACTDISK_CG= ( NONE ) +MARKER_ACTDISK_BEM_CG= ( NONE ) +% +% Blade element: ( inlet face marker, outlet face marker, +% X_Axis of inlet, Y_Axis of inlet, Z_Axis of inlet, +% X_Axis of outlet, Y_Axis of outlet, Z_Axis of outlet ) +MARKER_ACTDISK_BEM_AXIS= ( NONE ) % % Actuator disk data input file name ACTDISK_FILENAME= actuatordisk.dat From 64591088ec411bb19a0cff9a161dd81de67eac9a Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sun, 22 Oct 2023 00:11:46 +0530 Subject: [PATCH 061/139] static RPM,CG,Axis set from config once. Other minor cleanup --- Common/include/CConfig.hpp | 1 - SU2_CFD/include/solvers/CEulerSolver.hpp | 35 ----------- SU2_CFD/src/solvers/CEulerSolver.cpp | 74 +++++++++--------------- 3 files changed, 27 insertions(+), 83 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index f60eb8f8fa0..c24d4b375f4 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -352,7 +352,6 @@ class CConfig { su2double *ActDiskOutlet_Torque_BEM; /*!< \brief Specified outlet torque for actuator disk. */ su2double **ActDisk_PressJump, **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ -//su2double **ActDisk_RotRate; /*!< \brief Value of the Rotation Rate.*/ su2double **ActDiskBem_CG[3]; /*!< \brief Specified center for actuator disk BEM.*/ su2double **ActDiskBem_Axis[3]; /*!< \brief Specified axis for actuator disk BEM.*/ su2double BEM_blade_angle ; /*!< \brief Propeller blade angle.*/ diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index b722c16aa86..586c9c788c5 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -68,10 +68,6 @@ class CEulerSolver : public CFVMFlowSolverBase > ActDisk_DeltaP_r; /*!< \brief Value of the Delta P. */ vector > ActDisk_Thrust_r; /*!< \brief Value of the Delta P. */ vector > ActDisk_Torque_r; /*!< \brief Value of the Delta P. */ -//vector > ActDisk_RotRate; /*!< \brief Value of the Rotation Rate. */ -//vector > ActDisk_XCG; -//vector > ActDisk_YCG; -//vector > ActDisk_ZCG; vector > ActDisk_DeltaT; /*!< \brief Value of the Delta T. */ su2activevector @@ -1017,37 +1013,6 @@ class CEulerSolver : public CFVMFlowSolverBaseGetVelocity_Ref() / 550.0 << "." << endl; } - cout<GetActDiskOutlet_Thrust_BEM(Outlet_TagBound) <<" "<<"Torque_BEM(N-m).: "<< config->GetActDiskOutlet_Torque_BEM(Outlet_TagBound)<GetKind_ActDisk() == BLADE_ELEMENT) { + cout << setprecision(5); + cout << "Thrust_BEM (N): " << config->GetActDiskOutlet_Thrust_BEM(Outlet_TagBound) << ". "; + cout << "Torque_BEM (N-m): " << config->GetActDiskOutlet_Torque_BEM(Outlet_TagBound) << "." << endl; + } } } @@ -4132,10 +4126,10 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con static su2double ADBem_Diameter=0.0, ADBem_HubRadius=0.0, ADBem_Angle75R=0.0; static std::vector i_v, radius_v, chord_v, angle75r_v; static std::vector > alpha_m, cl_m, cd_m; - su2double ADBem_Axis[MAXNDIM] = {0.0}, ADBem_J = 0.0; - static su2double ADBem_Omega= 0.0; + static su2double ADBem_Omega = 0.0; static su2double ADBem_CG[MAXNDIM] = {0.0, 0.0, 0.0}; + static su2double ADBem_Axis[MAXNDIM] = {0.0}, ADBem_J = 0.0; /*--- BEM VLAD ---*/ const int BEM_MAX_ITER = 20; @@ -4156,31 +4150,24 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double Dens_FreeStream = config->GetDensity_FreeStream(); const su2double *Vel_FreeStream = config->GetVelocity_FreeStream(); - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + /*--- Input file provides force coefficients distributions along disk radius. + Initialization necessary only at initial iteration. ---*/ + if (InnerIter == 0) { + /*--- Get the RPM, CG and Axis from config. ---*/ + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || - (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { + if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || + (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { - Marker_Tag = config->GetMarker_All_TagBound(iMarker); - ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); - for (iDim=0; iDim < nDim; iDim++){ - ADBem_CG[iDim] = config->GetActDiskBem_CG(iDim, Marker_Tag, 0); - } - /* - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - SetActDisk_RotRate(iMarker, iVertex, ADBem_Omega); - SetActDisk_XCG(iMarker, iVertex, ADBem_XCG); - SetActDisk_YCG(iMarker, iVertex, ADBem_YCG); - SetActDisk_ZCG(iMarker, iVertex, ADBem_ZCG); + Marker_Tag = config->GetMarker_All_TagBound(iMarker); + ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); + for (iDim=0; iDim < nDim; iDim++){ + ADBem_CG[iDim] = config->GetActDiskBem_CG(iDim, Marker_Tag, 0); + ADBem_Axis[iDim] = config->GetActDiskBem_Axis(iDim, Marker_Tag, 0); + } } - */ } - } - /*--- Input file provides force coefficients distributions along disk radius. - Initialization necessary only at initial iteration. ---*/ - if (InnerIter == 0) { /*--- Get the file name that contains the propeller data. ---*/ string ActDiskBem_filename = config->GetBEM_prop_filename(); ifstream ActDiskBem_file; @@ -4263,29 +4250,22 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); /*--- Read Swirl params. ---*/ - Omega_RPM = ADBem_Omega; // GetActDisk_RotRate(iMarker, iVertex); - Origin[0] = ADBem_CG[0]; // GetActDisk_CGX(iMarker, iVertex); - Origin[1] = ADBem_CG[1]; // GetActDisk_CGY(iMarker, iVertex); - Origin[2] = ADBem_CG[2]; // GetActDisk_CGZ(iMarker, iVertex); - + Omega_RPM = ADBem_Omega; omega_ref= config->GetOmega_Ref(); Lref = config->GetLength_Ref(); Omega_sw = Omega_RPM*(PI_NUMBER/30.0) / (omega_ref); // Swirl rate - Origin[0] = Origin[0]/Lref; - Origin[1] = Origin[1]/Lref; - Origin[2] = Origin[2]/Lref; + + /*--- Center of the rotor ---*/ + for (iDim = 0; iDim < nDim; iDim++) { Origin[iDim] = ADBem_CG[iDim] / Lref; } /*--- Compute the distance to the center of the rotor ---*/ geometry->vertex[iMarker][iVertex]->GetNormal(Normal); for (iDim = 0; iDim < nDim; iDim++) { Normal[iDim] = -Normal[iDim]; } /*--- Get propeller axis from config file. ---*/ - //ADBem_Axis[0] = 1.0; - //ADBem_Axis[1] = 0.0; - //ADBem_Axis[2] = 0.0; - for (iDim=0; iDim < nDim; iDim++){ - ADBem_Axis[iDim] = config->GetActDiskBem_Axis(iDim, Marker_Tag, 0); - } + //for (iDim=0; iDim < nDim; iDim++){ + // ADBem_Axis[iDim] = config->GetActDiskBem_Axis(iDim, Marker_Tag, 0); + //} for (iDim = 0; iDim < nDim; iDim++){ ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; } From 7cae4a4df75a353e4a5df466da8a55140fab6007 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sun, 22 Oct 2023 12:26:50 +0530 Subject: [PATCH 062/139] clang-format --- Common/include/CConfig.hpp | 14 +- Common/src/CConfig.cpp | 19 +- SU2_CFD/include/solvers/CEulerSolver.hpp | 6 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 336 ++++++++++++----------- TestCases/parallel_regression.py | 2 +- 5 files changed, 198 insertions(+), 179 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index c24d4b375f4..a9fe9b4b710 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1376,9 +1376,9 @@ class CConfig { unsigned short & nMarker_ActDiskInlet, unsigned short & nMarker_ActDiskOutlet, string* & Marker_ActDiskInlet, string* & Marker_ActDiskOutlet, su2double** & ActDisk_PressJump, su2double** & ActDisk_TempJump, su2double** & ActDisk_Omega); - void addActDiskBemOption(const string & name, - unsigned short & nMarker_ActDiskBemInlet, unsigned short & nMarker_ActDiskBemOutlet, string* & Marker_ActDiskBemInlet, string* & Marker_ActDiskBemOutlet, - su2double** & ActDiskBem_X, su2double** & ActDiskBem_Y, su2double** & ActDiskBem_Z); + void addActDiskBemOption(const string& name, + unsigned short& nMarker_ActDiskBemInlet, unsigned short& nMarker_ActDiskBemOutlet, string*& Marker_ActDiskBemInlet, string*& Marker_ActDiskBemOutlet, + su2double**& ActDiskBem_X, su2double**& ActDiskBem_Y, su2double**& ActDiskBem_Z); void addWallFunctionOption(const string &name, unsigned short &list_size, string* &string_field, WALL_FUNCTIONS* &val_Kind_WF, @@ -8280,14 +8280,18 @@ class CConfig { * \param[in] val_marker - Marker corresponding to the outlet (actuator disk) boundary. * \param[in] val_actdisk_thrust_bem - Value of the actuator disk thrust. */ - void SetActDiskOutlet_Thrust_BEM(unsigned short val_marker, su2double val_actdisk_thrust_bem) { ActDiskOutlet_Thrust_BEM[val_marker] = val_actdisk_thrust_bem; } + void SetActDiskOutlet_Thrust_BEM(unsigned short val_marker, su2double val_actdisk_thrust_bem) { + ActDiskOutlet_Thrust_BEM[val_marker] = val_actdisk_thrust_bem; + } /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_marker - Marker corresponding to the outlet boundary. * \param[in] val_actdisk_torque_bem - Value of the actuator disk torque. */ - void SetActDiskOutlet_Torque_BEM(unsigned short val_marker, su2double val_actdisk_torque_bem) { ActDiskOutlet_Torque_BEM[val_marker] = val_actdisk_torque_bem; } + void SetActDiskOutlet_Torque_BEM(unsigned short val_marker, su2double val_actdisk_torque_bem) { + ActDiskOutlet_Torque_BEM[val_marker] = val_actdisk_torque_bem; + } /*! * \brief Get the displacement value at an displacement boundary. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index b21f896c7df..eb64f51ddf9 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -557,13 +557,15 @@ void CConfig::addActDiskOption(const string & name, unsigned short & nMarker_Act option_map.insert(pair(name, val)); } -void CConfig::addActDiskBemOption(const string & name, - unsigned short & nMarker_ActDiskBemInlet, unsigned short & nMarker_ActDiskBemOutlet, - string* & Marker_ActDiskBemInlet, string* & Marker_ActDiskBemOutlet, - su2double** & ActDiskBem_X, su2double** & ActDiskBem_Y, su2double** & ActDiskBem_Z) { +void CConfig::addActDiskBemOption(const string& name, + unsigned short& nMarker_ActDiskBemInlet, unsigned short& nMarker_ActDiskBemOutlet, + string*& Marker_ActDiskBemInlet, string*& Marker_ActDiskBemOutlet, + su2double**& ActDiskBem_X, su2double**& ActDiskBem_Y, su2double**& ActDiskBem_Z) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionActDiskBem(name, nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet, + COptionBase* val = new COptionActDiskBem(name, + nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, + Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet, ActDiskBem_X, ActDiskBem_Y, ActDiskBem_Z); option_map.insert(pair(name, val)); } @@ -1678,7 +1680,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Propeller blade angle for actuator disk BEM.*/ addDoubleOption("BEM_PROP_BLADE_ANGLE", BEM_blade_angle, 23.9); /* DESCRIPTION: Propeller file name for actuator disk BEM.*/ - addStringOption("BEM_PROP_FILENAME", BEM_prop_filename,string("prop_geom_alfclcd_data.txt")); + addStringOption("BEM_PROP_FILENAME", BEM_prop_filename, string("prop_geom_alfclcd_data.txt")); /* DESCRIPTION: Only half engine is in the computational grid */ addBoolOption("ENGINE_HALF_MODEL", Engine_HalfModel, false); @@ -5728,8 +5730,8 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) { ActDiskOutlet_Force = new su2double[nMarker_ActDiskOutlet] (); ActDiskOutlet_Power = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_Thrust_BEM = new su2double[nMarker_ActDiskOutlet] (); - ActDiskOutlet_Torque_BEM = new su2double[nMarker_ActDiskOutlet] (); + ActDiskOutlet_Thrust_BEM = new su2double[nMarker_ActDiskOutlet](); + ActDiskOutlet_Torque_BEM = new su2double[nMarker_ActDiskOutlet](); for (iMarker_ActDiskOutlet = 0; iMarker_ActDiskOutlet < nMarker_ActDiskOutlet; iMarker_ActDiskOutlet++) { Marker_CfgFile_TagBound[iMarker_CfgFile] = Marker_ActDiskOutlet[iMarker_ActDiskOutlet]; @@ -7653,7 +7655,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "Actuator disk BEM method propeller data read from file: " << GetBEM_prop_filename() << endl; } } - } bool CConfig::TokenizeString(string & str, string & option_name, diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index 586c9c788c5..63f82f3fa7e 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -65,9 +65,9 @@ class CEulerSolver : public CFVMFlowSolverBase > DonorGlobalIndex; /*!< \brief Value of the donor global index. */ vector DonorPrimVar; /*!< \brief Value of the donor variables at each boundary. */ vector > ActDisk_DeltaP; /*!< \brief Value of the Delta P. */ - vector > ActDisk_DeltaP_r; /*!< \brief Value of the Delta P. */ - vector > ActDisk_Thrust_r; /*!< \brief Value of the Delta P. */ - vector > ActDisk_Torque_r; /*!< \brief Value of the Delta P. */ + vector > ActDisk_DeltaP_r; /*!< \brief Value of the DeltaP_r. */ + vector > ActDisk_Thrust_r; /*!< \brief Value of the Thrust_r. */ + vector > ActDisk_Torque_r; /*!< \brief Value of the Torque_r. */ vector > ActDisk_DeltaT; /*!< \brief Value of the Delta T. */ su2activevector diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 7f22e2a2f78..3f263d9e375 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2527,7 +2527,7 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns Velocity2, Density, Area, SoundSpeed, TotalPressure, Vel_Infty2, RamDrag, TotalTemperature, VelocityJet, Vel_Infty, MaxPressure, MinPressure, MFR, InfVel2; - su2double DeltaPressure=0.0, DeltaThrust=0.0, DeltaTorque=0.0; + su2double DeltaPressure = 0.0, DeltaThrust = 0.0, DeltaTorque = 0.0; unsigned short iMarker_Inlet, iMarker_Outlet, nMarker_Inlet, nMarker_Outlet; string Inlet_TagBound, Outlet_TagBound; su2double DeltaPress = 0.0, DeltaTemp = 0.0, TotalPressRatio = 0.0, TotalTempRatio = 0.0, StaticPressRatio = 0.0, StaticTempRatio = 0.0, @@ -2706,9 +2706,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns Outlet_Area[iMarker] += Area; Outlet_GrossThrust[iMarker] += GrossThrust; Outlet_Power[iMarker] += MassFlow*Cp*TotalTemperature; - Outlet_DeltaP[iMarker] += DeltaPressure*Area; - Outlet_Thrust[iMarker] += DeltaThrust*Area; - Outlet_Torque[iMarker] += DeltaTorque*Area; + Outlet_DeltaP[iMarker] += DeltaPressure * Area; + Outlet_Thrust[iMarker] += DeltaThrust * Area; + Outlet_Torque[iMarker] += DeltaTorque * Area; su2double Outlet_ForceX = -(Pressure - Pressure_Inf)*Vector[0] -MassFlow*Velocity[0]; su2double Outlet_ForceY = -(Pressure - Pressure_Inf)*Vector[1] -MassFlow*Velocity[1]; @@ -3338,10 +3338,10 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns cout << setprecision(1) << Power * Ref * config->GetVelocity_Ref() / 550.0 << "." << endl; } - if (config->GetKind_ActDisk() == BLADE_ELEMENT) { + if (config->GetKind_ActDisk() == BLADE_ELEMENT) { cout << setprecision(5); cout << "Thrust_BEM (N): " << config->GetActDiskOutlet_Thrust_BEM(Outlet_TagBound) << ". "; - cout << "Torque_BEM (N-m): " << config->GetActDiskOutlet_Torque_BEM(Outlet_TagBound) << "." << endl; + cout << "Torque_BEM (N-m): " << config->GetActDiskOutlet_Torque_BEM(Outlet_TagBound) << "." << endl; } } @@ -4095,7 +4095,7 @@ void CEulerSolver::ReadActDisk_InputFile(CGeometry *geometry, CSolver **solver_c } void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_container, - CConfig *config, unsigned short iMesh, bool Output) { + CConfig *config, unsigned short iMesh, bool Output) { /*! * \function SetActDisk_BEM_VLAD @@ -4122,8 +4122,8 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con unsigned long iVertex, iPoint; string Marker_Tag; int iSection, iAlpha; - static int ADBem_NBlade=0, ADBem_NSection=0, ADBem_NAlpha=0; - static su2double ADBem_Diameter=0.0, ADBem_HubRadius=0.0, ADBem_Angle75R=0.0; + static int ADBem_NBlade = 0, ADBem_NSection = 0, ADBem_NAlpha = 0; + static su2double ADBem_Diameter = 0.0, ADBem_HubRadius = 0.0, ADBem_Angle75R = 0.0; static std::vector i_v, radius_v, chord_v, angle75r_v; static std::vector > alpha_m, cl_m, cd_m; @@ -4133,22 +4133,22 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- BEM VLAD ---*/ const int BEM_MAX_ITER = 20; - su2double Omega_sw=0.0, Omega_RPM=0.0, Origin[3]={0.0}, radius_[3]={0.0}; - static su2double omega_ref=0.0, Lref=0.0; - static su2double RPM=0.0, blade_angle=0.0, dia=0.0, r_tip=0.0, rps=0.0, radius=0.0; - static su2double V=0.0, rho=0.0, T=0.0; - static su2double Torque=0.0, dp_av=0.0, dp_at_r=0.0; + su2double Omega_sw = 0.0, Omega_RPM = 0.0, Origin[3] = {0.0}, radius_[3] = {0.0}; + static su2double omega_ref = 0.0, Lref = 0.0; + static su2double RPM = 0.0, blade_angle = 0.0, dia = 0.0, r_tip = 0.0, rps = 0.0, radius = 0.0; + static su2double V = 0.0, rho = 0.0, T = 0.0; + static su2double Torque = 0.0, dp_av = 0.0, dp_at_r = 0.0; static std::vector DtDr; - static su2double Target_Press_Jump=0.0, Area=0.0, UnitNormal[3]={0.0}, Vn=0.0; - static su2double Fa=0.0, Ft=0.0, Fr=0.0, Fx=0.0, Fy=0.0, Fz=0.0, dCp_v=0.0, dCr_v=0.0, rad_v=0.0; - su2double *V_domain=0, *Coord=0; + static su2double Target_Press_Jump = 0.0, Area = 0.0, UnitNormal[3] = {0.0}, Vn = 0.0; + static su2double Fa = 0.0, Ft = 0.0, Fr = 0.0, Fx = 0.0, Fy = 0.0, Fz = 0.0, dCp_v = 0.0, dCr_v = 0.0, rad_v = 0.0; + su2double *V_domain = 0, *Coord = 0; static su2double loc_Torque = 0.0; static su2double loc_thrust = 0.0; static su2double tot_area = 0.0, tot_tq = 0.0; unsigned long InnerIter = config->GetInnerIter(); su2double Dens_FreeStream = config->GetDensity_FreeStream(); - const su2double *Vel_FreeStream = config->GetVelocity_FreeStream(); + const su2double* Vel_FreeStream = config->GetVelocity_FreeStream(); /*--- Input file provides force coefficients distributions along disk radius. Initialization necessary only at initial iteration. ---*/ @@ -4161,7 +4161,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con Marker_Tag = config->GetMarker_All_TagBound(iMarker); ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); - for (iDim=0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { ADBem_CG[iDim] = config->GetActDiskBem_CG(iDim, Marker_Tag, 0); ADBem_Axis[iDim] = config->GetActDiskBem_Axis(iDim, Marker_Tag, 0); } @@ -4180,30 +4180,30 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con string text_line_appo; - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); /*--- Read and assign the value of the number of propeller blades. ---*/ - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); istringstream NBlade_value(text_line_appo); NBlade_value >> ADBem_NBlade; /*--- Read and assign the value of the propeller diameter. ---*/ - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); istringstream Diameter_value(text_line_appo); Diameter_value >> ADBem_Diameter; /*--- Read and assign the value of the propeller hub radius. ---*/ - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); istringstream HubR_value(text_line_appo); HubR_value >> ADBem_HubRadius; /*--- Read and assign the value of the blade angle at 75% of R. ---*/ - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); istringstream Angle75R_value(text_line_appo); Angle75R_value >> ADBem_Angle75R; - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); /*--- Read and assign the value of the number of radial propeller blade sections and alphas for each. ---*/ - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); istringstream NSection_NAlpha_value(text_line_appo); NSection_NAlpha_value >> ADBem_NSection >> ADBem_NAlpha; @@ -4213,10 +4213,10 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con chord_v.resize(ADBem_NSection, 0.0); angle75r_v.resize(ADBem_NSection, 0.0); - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); /*--- Read and assign the values of the propeller blade section's id, radius, chord, angle75R. ---*/ for (iSection = 0; iSection < ADBem_NSection; iSection++) { - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); istringstream sectionStream(text_line_appo); sectionStream >> i_v[iSection] >> radius_v[iSection] >> chord_v[iSection] >> angle75r_v[iSection]; } @@ -4228,11 +4228,11 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- Read and assign the values for each of the propeller blade section's alpha, cl, cd. ---*/ for (iSection = 0; iSection < ADBem_NSection; iSection++) { - getline (ActDiskBem_file, text_line_appo); + getline(ActDiskBem_file, text_line_appo); for (iAlpha = 0; iAlpha < ADBem_NAlpha; iAlpha++) { - getline (ActDiskBem_file, text_line_appo); - istringstream alphaStream(text_line_appo); - alphaStream >> alpha_m[iAlpha][iSection] >> cl_m[iAlpha][iSection] >> cd_m[iAlpha][iSection]; + getline(ActDiskBem_file, text_line_appo); + istringstream alphaStream(text_line_appo); + alphaStream >> alpha_m[iAlpha][iSection] >> cl_m[iAlpha][iSection] >> cd_m[iAlpha][iSection]; } } } @@ -4240,7 +4240,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- Update the propeller load according to the modified flow field after every 40 inner iterations. ---*/ if (InnerIter % 40 == 0) { dia = ADBem_Diameter; - r_tip = 0.5 * dia ; + r_tip = 0.5 * dia; su2double Normal[MAXNDIM]; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -4251,38 +4251,43 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- Read Swirl params. ---*/ Omega_RPM = ADBem_Omega; - omega_ref= config->GetOmega_Ref(); + omega_ref = config->GetOmega_Ref(); Lref = config->GetLength_Ref(); - Omega_sw = Omega_RPM*(PI_NUMBER/30.0) / (omega_ref); // Swirl rate + Omega_sw = Omega_RPM * (PI_NUMBER / 30.0) / (omega_ref); // Swirl rate /*--- Center of the rotor ---*/ - for (iDim = 0; iDim < nDim; iDim++) { Origin[iDim] = ADBem_CG[iDim] / Lref; } + for (iDim = 0; iDim < nDim; iDim++) { + Origin[iDim] = ADBem_CG[iDim] / Lref; + } /*--- Compute the distance to the center of the rotor ---*/ geometry->vertex[iMarker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) { Normal[iDim] = -Normal[iDim]; } + for (iDim = 0; iDim < nDim; iDim++) { + Normal[iDim] = -Normal[iDim]; + } /*--- Get propeller axis from config file. ---*/ - //for (iDim=0; iDim < nDim; iDim++){ - // ADBem_Axis[iDim] = config->GetActDiskBem_Axis(iDim, Marker_Tag, 0); - //} for (iDim = 0; iDim < nDim; iDim++){ ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; } Area = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { Area += Normal[iDim]*Normal[iDim]; } - Area = sqrt (Area); - - for (iDim = 0; iDim < nDim; iDim++) { UnitNormal[iDim] = Normal[iDim]/Area; } - + for (iDim = 0; iDim < nDim; iDim++) { + Area += Normal[iDim] * Normal[iDim]; + } + Area = sqrt(Area); + + for (iDim = 0; iDim < nDim; iDim++) { + UnitNormal[iDim] = Normal[iDim] / Area; + } + if (geometry->nodes->GetDomain(iPoint)) { Coord = geometry->nodes->GetCoord(iPoint); } - + radius = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - radius += (Coord[iDim]-Origin[iDim])*(Coord[iDim]-Origin[iDim]); - radius_[iDim] = (Coord[iDim]-Origin[iDim]); + for (iDim = 0; iDim < nDim; iDim++) { + radius += (Coord[iDim] - Origin[iDim]) * (Coord[iDim] - Origin[iDim]); + radius_[iDim] = (Coord[iDim] - Origin[iDim]); } radius = sqrt(radius); @@ -4291,13 +4296,15 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con if (abs(Omega_sw) > 1.0e-1) { Vn = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { Vn += V_domain[iDim+1]*UnitNormal[iDim]; } + for (iDim = 0; iDim < nDim; iDim++) { + Vn += V_domain[iDim + 1] * UnitNormal[iDim]; + } RPM = abs(Omega_RPM); - rps = RPM/60.0; - ADBem_J = Vel_FreeStream[0]/(rps*dia); - rho = V_domain[nDim+2]; - T = V_domain[0]; + rps = RPM / 60.0; + ADBem_J = Vel_FreeStream[0] / (rps * dia); + rho = V_domain[nDim + 2]; + T = V_domain[0]; blade_angle = config->GetBEM_blade_angle(); V = config->GetModVel_FreeStream(); V = fabs(Vn); @@ -4318,166 +4325,172 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double rad_p = radius; - int j, isec,converged, n_iter; + int j, isec, converged, n_iter; int NR = sprop_sec_nrad; su2double r_hub, alpha_corr, cl_corr_fac; su2double base_mach, s_mach, b_num, thrust, torque; su2double r_dash, t_loss, c_phi, rad, phi, alpha, radtodeg; - su2double bnew, V0, V2, cl=0.0, cd=0.0, Vlocal, DqDr=0.0, tem1, tem2, q; + su2double bnew, V0, V2, cl = 0.0, cd = 0.0, Vlocal, DqDr = 0.0, tem1, tem2, q; std::vector delta_r(ADBem_NSection, 0.0); std::vector b(ADBem_NSection, 0.0); static std::vector Dtorq(ADBem_NSection, 0.0); - + su2double n, omega, a0, den; su2double ang_offset = 0.0; - - radtodeg = 180.0/M_PI; + + radtodeg = 180.0 / M_PI; dia = ADBem_Diameter; r_hub = ADBem_HubRadius; - r_tip = 0.5*dia ; + r_tip = 0.5 * dia; ang_offset = blade_angle - ADBem_Angle75R; - alpha_corr = 0.0; - base_mach = 0.22 ; - b_num = sqrt(1.0-base_mach*base_mach); - a0 = sqrt(1.4*287*T); + alpha_corr = 0.0; + base_mach = 0.22; + b_num = sqrt(1.0 - base_mach * base_mach); + a0 = sqrt(1.4 * 287 * T); /*--- Change pitch by ang_offset and calculate delta_r for integration by trapezoidal rule. ---*/ n = RPM / 60.0; - omega = n*2.0*M_PI; + omega = n * 2.0 * M_PI; - for (j=0; j < NR; j++) { - if (j < 1) { delta_r[j] = sprop_sec_r1[j+1] - r_hub; } - else { - if (j < NR-1) { delta_r[j] = sprop_sec_r1[j+1] - sprop_sec_r1[j-1]; } - else { delta_r[j] = r_tip - sprop_sec_r1[j-1]; } + for (j = 0; j < NR; j++) { + if (j < 1) { + delta_r[j] = sprop_sec_r1[j + 1] - r_hub; + } else { + if (j < NR - 1) { + delta_r[j] = sprop_sec_r1[j + 1] - sprop_sec_r1[j - 1]; + } else { + delta_r[j] = r_tip - sprop_sec_r1[j - 1]; + } } delta_r[j] *= 0.5; } thrust = 0.0; torque = 0.0; - - for (j=0; j < NR; j++) { + + for (j = 0; j < NR; j++) { b[j] = 0.01; converged = 0; n_iter = 1; while (converged == 0) { - V2 = omega*sprop_sec_r1[j]*(1-b[j]); + V2 = omega * sprop_sec_r1[j] * (1 - b[j]); V0 = V; - phi=atan2(V0,V2); + phi = atan2(V0, V2); - alpha=sprop_sec_setangle[j] + ang_offset-radtodeg*phi+alpha_corr; + alpha = sprop_sec_setangle[j] + ang_offset - radtodeg * phi + alpha_corr; rad = sprop_sec_r1[j]; /*--- get cl, cd from lookup table. ---*/ - isec = j+1; + isec = j + 1; { - int i, salf=0; - su2double fact; - - /*--- interpolating values of cl and cd for given alpha. ---*/ - if ( alpha >= sprop_sec_alf[salf][isec-1] - && alpha <= sprop_sec_alf[sprop_sec_nalf-1][isec-1]) { - for(i=0; i < sprop_sec_nalf-1; i++) { - if (alpha>=sprop_sec_alf[i][isec-1] && alpha <= sprop_sec_alf[i+1][isec-1]) { - fact = (alpha-sprop_sec_alf[i][isec-1]) - / (sprop_sec_alf[i+1][isec-1]-sprop_sec_alf[i][isec-1]); - cl = sprop_sec_cl_arr[i][isec-1] - + fact * (sprop_sec_cl_arr[i+1][isec-1] - sprop_sec_cl_arr[i][isec-1]); - cd = sprop_sec_cd_arr[i][isec-1] - + fact * (sprop_sec_cd_arr[i+1][isec-1] - sprop_sec_cd_arr[i][isec-1]); - } - } - } else { - if (alpha < sprop_sec_alf[salf][isec-1]) { - cl = sprop_sec_cl_arr[0][isec-1]; - cd = sprop_sec_cd_arr[0][isec-1]; - } - if (alpha > sprop_sec_alf[sprop_sec_nalf-1][isec-1]) { - cl = sprop_sec_cl_arr[sprop_sec_nalf-1][isec-1]; - cd = sprop_sec_cd_arr[sprop_sec_nalf-1][isec-1]; - } - } + int i, salf = 0; + su2double fact; + + /*--- interpolating values of cl and cd for given alpha. ---*/ + if (alpha >= sprop_sec_alf[salf][isec - 1] && + alpha <= sprop_sec_alf[sprop_sec_nalf - 1][isec - 1]) { + for (i = 0; i < sprop_sec_nalf - 1; i++) { + if (alpha >= sprop_sec_alf[i][isec - 1] && alpha <= sprop_sec_alf[i + 1][isec - 1]) { + fact = (alpha - sprop_sec_alf[i][isec - 1]) + / (sprop_sec_alf[i + 1][isec - 1] - sprop_sec_alf[i][isec - 1]); + cl = sprop_sec_cl_arr[i][isec - 1] + + fact * (sprop_sec_cl_arr[i + 1][isec - 1] - sprop_sec_cl_arr[i][isec - 1]); + cd = sprop_sec_cd_arr[i][isec - 1] + + fact * (sprop_sec_cd_arr[i + 1][isec - 1] - sprop_sec_cd_arr[i][isec - 1]); + } + } + } else { + if (alpha < sprop_sec_alf[salf][isec - 1]) { + cl = sprop_sec_cl_arr[0][isec - 1]; + cd = sprop_sec_cd_arr[0][isec - 1]; + } + if (alpha > sprop_sec_alf[sprop_sec_nalf - 1][isec - 1]) { + cl = sprop_sec_cl_arr[sprop_sec_nalf - 1][isec - 1]; + cd = sprop_sec_cd_arr[sprop_sec_nalf - 1][isec - 1]; + } + } } - Vlocal = sqrt(V0*V0 + V2*V2); + Vlocal = sqrt(V0 * V0 + V2 * V2); q = 0.5 * rho * Vlocal * Vlocal; s_mach = Vlocal / a0; cl_corr_fac = 1.0; if (s_mach > base_mach) { - den = 1.0-s_mach*s_mach; + den = 1.0 - s_mach * s_mach; if (den > 0.0) cl_corr_fac = b_num / sqrt(den); } cl *= cl_corr_fac; /*--- tip loss factor. ---*/ - r_dash = rad / r_tip+1.0e-5; - c_phi = cos(phi) ; + r_dash = rad / r_tip + 1.0e-5; + c_phi = cos(phi); t_loss = 1.0; if (r_dash > 0.90) { - t_loss = (2.0/M_PI) * acos(exp(-(1.0*s_prop_nblades*(1-r_dash)/(r_dash*c_phi)))) ; + t_loss = (2.0 / M_PI) * acos(exp(-(1.0 * s_prop_nblades * (1 - r_dash) / (r_dash * c_phi)))); } - - DtDr[j] = q * s_prop_nblades * sprop_sec_chord[j] * (cl*cos(phi) - cd*sin(phi)); - DqDr = q * s_prop_nblades * sprop_sec_chord[j] * rad * (cd*cos(phi) + cl*sin(phi)); - + + DtDr[j] = q * s_prop_nblades * sprop_sec_chord[j] * (cl * cos(phi) - cd * sin(phi)); + DqDr = q * s_prop_nblades * sprop_sec_chord[j] * rad * (cd * cos(phi) + cl * sin(phi)); + DtDr[j] *= t_loss; DqDr *= t_loss; - - tem2 = DqDr / (4.0*M_PI * rad*rad*rad * rho * V * omega); + + tem2 = DqDr / (4.0 * M_PI * rad * rad * rad * rho * V * omega); bnew = 0.6 * b[j] + 0.4 * tem2; - if (bnew > 0.9) bnew = 0.9; - if (fabs(bnew-b[j]) < 1.0e-5) { - converged = 1; + if (bnew > 0.9) bnew = 0.9; + if (fabs(bnew - b[j]) < 1.0e-5) { + converged = 1; + } + if (bnew < 0.1) { + b[j] = bnew; } - if (bnew < 0.1) { b[j]=bnew; } - n_iter++ ; + n_iter++; if (n_iter > BEM_MAX_ITER) { - converged=1; + converged = 1; } } - thrust=thrust+DtDr[j]*delta_r[j]; - torque=torque+DqDr*delta_r[j]; + thrust = thrust + DtDr[j] * delta_r[j]; + torque = torque + DqDr * delta_r[j]; Dtorq[j] = DqDr; } - - tem1 = rho*n*n*dia*dia*dia*dia; - tem2 = tem1*dia; - - Torque=2.0*M_PI* torque; - dp_av=2.0*M_PI* torque; - - for (j=0; j < NR; j++) { - DtDr[j] /= (2.0*M_PI * sprop_sec_r1[j]) ; + + tem1 = rho * n * n * dia * dia * dia * dia; + tem2 = tem1 * dia; + + Torque = 2.0 * M_PI * torque; + dp_av = 2.0 * M_PI * torque; + + for (j = 0; j < NR; j++) { + DtDr[j] /= (2.0 * M_PI * sprop_sec_r1[j]); Dtorq[j] = Dtorq[j]; } - + if (rad_p < sprop_sec_r1[0]) { - tem2 = sprop_sec_r1[0] - r_hub; - tem1 = (rad_p - r_hub)/tem2; + tem2 = sprop_sec_r1[0] - r_hub; + tem1 = (rad_p - r_hub) / tem2; tem2 = 1.0 - tem1; - dp_at_r = DtDr[0]*tem1; - Torque = Dtorq[0]*tem1; + dp_at_r = DtDr[0] * tem1; + Torque = Dtorq[0] * tem1; } else { if (rad_p > r_tip) { dp_at_r = 0.0; Torque = 0.0; } else { - if (rad_p > sprop_sec_r1[NR-1]) { - tem2 = r_tip - sprop_sec_r1[NR-1]; - tem1 = (rad_p - sprop_sec_r1[NR-1])/tem2 ; + if (rad_p > sprop_sec_r1[NR - 1]) { + tem2 = r_tip - sprop_sec_r1[NR - 1]; + tem1 = (rad_p - sprop_sec_r1[NR - 1]) / tem2; tem2 = 1.0 - tem1; - dp_at_r = DtDr[NR-1]*tem2; - Torque = Dtorq[NR-1]*tem2; + dp_at_r = DtDr[NR - 1] * tem2; + Torque = Dtorq[NR - 1] * tem2; } else { - for (j=0; j < NR-1; j++) { - if ((sprop_sec_r1[j] < rad_p) && (sprop_sec_r1[j+1] >= rad_p)) { - tem2 = sprop_sec_r1[j+1] - sprop_sec_r1[j]; - tem1 = (rad_p - sprop_sec_r1[j])/tem2 ; - tem2 = 1.0 - tem1; - dp_at_r = DtDr[j]*tem2+DtDr[j+1]*tem1; - Torque = Dtorq[j]*tem2+Dtorq[j+1]*tem1; + for (j = 0; j < NR - 1; j++) { + if ((sprop_sec_r1[j] < rad_p) && (sprop_sec_r1[j + 1] >= rad_p)) { + tem2 = sprop_sec_r1[j + 1] - sprop_sec_r1[j]; + tem1 = (rad_p - sprop_sec_r1[j]) / tem2; + tem2 = 1.0 - tem1; + dp_at_r = DtDr[j] * tem2 + DtDr[j + 1] * tem1; + Torque = Dtorq[j] * tem2 + Dtorq[j + 1] * tem1; } } } @@ -4486,27 +4499,28 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con } tot_area += Area; - loc_Torque += Torque*Area; + loc_Torque += Torque * Area; tot_tq += dp_av; - loc_thrust += dp_at_r*Area; + loc_thrust += dp_at_r * Area; Target_Press_Jump = dp_at_r; ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; - ActDisk_Torque_r[iMarker][iVertex] = Torque/(2*M_PI*radius); + ActDisk_Torque_r[iMarker][iVertex] = Torque / (2 * M_PI * radius); /*--- Non-dimensionalize the elemental load. ---*/ - dCp_v = Torque*((Omega_sw*r_tip)/(rho*rps*rps*rps*pow(dia,5))); + dCp_v = Torque * ((Omega_sw * r_tip) / (rho * rps * rps * rps * pow(dia, 5))); /*--- Force radial load to 0 as there is no information of radial load from BEM. ---*/ dCr_v = 0.0; - rad_v = radius/r_tip; + rad_v = radius / r_tip; Fa = dp_at_r; - Ft = (dCp_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ - ((ADBem_J*PI_NUMBER*rad_v)*(ADBem_J*PI_NUMBER*rad_v))) / config->GetPressure_Ref(); - Fr = (dCr_v*(2*Dens_FreeStream*pow(Vel_FreeStream[0],2))/ - (pow(ADBem_J,2)*PI_NUMBER*rad_v)) / config->GetPressure_Ref(); - Fx = (Ft+Fr)*(radius_[0]/(radius)); - Fy = (Ft+Fr)*(radius_[2]/(radius)); - Fz = -(Ft+Fr)*(radius_[1]/(radius)); + Ft = (dCp_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / + ((ADBem_J * PI_NUMBER * rad_v) * (ADBem_J * PI_NUMBER * rad_v))) / + config->GetPressure_Ref(); + Fr = (dCr_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / (pow(ADBem_J, 2) * PI_NUMBER * rad_v)) / + config->GetPressure_Ref(); + Fx = (Ft + Fr) * (radius_[0] / (radius)); + Fy = (Ft + Fr) * (radius_[2] / (radius)); + Fz = -(Ft + Fr) * (radius_[1] / (radius)); ActDisk_Fa_BEM[iMarker][iVertex] = Fa; ActDisk_Fx_BEM[iMarker][iVertex] = Fx; ActDisk_Fy_BEM[iMarker][iVertex] = Fy; @@ -8124,7 +8138,7 @@ void CEulerSolver::BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_contai unsigned short Kind_ActDisk = config->GetKind_ActDisk(); - if(Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT){ + if (Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT) { BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, true); } else{ @@ -8138,7 +8152,7 @@ void CEulerSolver::BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_conta unsigned short Kind_ActDisk = config->GetKind_ActDisk(); - if(Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT){ + if (Kind_ActDisk == VARIABLE_LOAD || Kind_ActDisk == BLADE_ELEMENT) { BC_ActDisk_VariableLoad(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker, false); } else{ diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 6ad9c4c3708..8c4203a45e3 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -491,7 +491,7 @@ def main(): propeller.cfg_dir = "rans/actuatordisk_bem" propeller.cfg_file = "actuatordisk_bem.cfg" propeller.test_iter = 15 - propeller.test_vals = [4.4835e-01, -5.226958, -8.297197, 0, -0.004325, -0.565388] + propeller.test_vals = [3.3764e-01, -5.226958, -8.297197, 0, -0.004325, -0.565388] propeller.timeout = 3200 test_list.append(actuatordisk_bem) From 98562a4bf66db0a5bb29cc4d5a231e47542efff7 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Wed, 25 Oct 2023 14:44:13 +0530 Subject: [PATCH 063/139] accidental change of externals/codi/ subprojects/CoolProp/ checked out from develop branch --- externals/codi | 2 +- subprojects/CoolProp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/externals/codi b/externals/codi index 8ee822a9b0b..eee1b5eea2d 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit 8ee822a9b0bb8235a2494467b774e27fb64ff14f +Subproject commit eee1b5eea2ded8126c34c1415e3b9cf15a3e70f2 diff --git a/subprojects/CoolProp b/subprojects/CoolProp index 0ce42fcf3bb..a14412559e5 160000 --- a/subprojects/CoolProp +++ b/subprojects/CoolProp @@ -1 +1 @@ -Subproject commit 0ce42fcf3bb2c373512bc825a4f0c1973a78f307 +Subproject commit a14412559e523e762ddee9dd68b8250343ef941f From 32dcd85b1f2118fbf0ae3607c82b7a037b682378 Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Thu, 26 Oct 2023 13:38:43 +0100 Subject: [PATCH 064/139] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: KürÅŸat Yurt <57598663+kursatyurt@users.noreply.github.com> --- SU2_CFD/include/drivers/CDriver.hpp | 1 + SU2_CFD/src/python_wrapper_structure.cpp | 16 ++++++---------- TestCases/py_wrapper/rotating_cylinder/run.py | 5 ++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 74bc0c11059..b2bafc35ea6 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -535,6 +535,7 @@ class CDriver : public CDriverBase { * \param[in] rot_z - Value of Angular velocity about z-axes. */ void SetRotationRate(passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); + /*! * \brief Set the moving wall marker rotation rates. * \param[in] iMaker - Index of moving wall marker. diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 3e18df5a84d..ede28e36943 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -168,18 +168,14 @@ void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passived } void CDriver::SetMarkerRotationRate(unsigned short iMarker, passivedouble rot_x, passivedouble rot_y, passivedouble rot_z) { - for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone]->SetMarkerRotationRate(iMarker, 0, rot_x); - config_container[iZone]->SetMarkerRotationRate(iMarker, 1, rot_y); - config_container[iZone]->SetMarkerRotationRate(iMarker, 2, rot_z); - } + config_container[selected_zone]->SetMarkerRotationRate(iMarker, 0, rot_x); + config_container[selected_zone]->SetMarkerRotationRate(iMarker, 1, rot_y); + config_container[selected_zone]->SetMarkerRotationRate(iMarker, 2, rot_z); } void CDriver::SetMarkerTranslationRate(unsigned short iMarker, passivedouble vel_x, passivedouble vel_y, passivedouble vel_z) { - for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone]->SetMarkerTranslationRate(iMarker, 0, vel_x); - config_container[iZone]->SetMarkerTranslationRate(iMarker, 1, vel_y); - config_container[iZone]->SetMarkerTranslationRate(iMarker, 2, vel_z); - } + config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 0, vel_x); + config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 1, vel_y); + config_container[selected_zone]->SetMarkerTranslationRate(iMarker, 2, vel_z); } diff --git a/TestCases/py_wrapper/rotating_cylinder/run.py b/TestCases/py_wrapper/rotating_cylinder/run.py index cbf2d968686..737c3dd74ee 100644 --- a/TestCases/py_wrapper/rotating_cylinder/run.py +++ b/TestCases/py_wrapper/rotating_cylinder/run.py @@ -13,9 +13,8 @@ SU2Driver = pysu2.CSinglezoneDriver("spinning_cylinder.cfg",1, comm) -for i in range(n_of_steps): - - SU2Driver.SetMarkerRotationRate(0,0,0,rotation_vector[n_of_steps-i-1]) +for i, rate in enumerate(rotation_vector): + SU2Driver.SetMarkerRotationRate(0,0,0,rate) SU2Driver.Preprocess(i) SU2Driver.Run() SU2Driver.Postprocess() From 2c085413b02a198d783227906e10c1d10de9023a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 31 Oct 2023 11:47:18 +0100 Subject: [PATCH 065/139] CoDiPack update. --- externals/codi | 2 +- meson_scripts/init.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/externals/codi b/externals/codi index eee1b5eea2d..0ad036f2c82 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit eee1b5eea2ded8126c34c1415e3b9cf15a3e70f2 +Subproject commit 0ad036f2c8254fa7b77180a443d99248c047c877 diff --git a/meson_scripts/init.py b/meson_scripts/init.py index 4ca1095e6e1..6bda759c734 100755 --- a/meson_scripts/init.py +++ b/meson_scripts/init.py @@ -55,7 +55,7 @@ def init_submodules( # This information of the modules is used if projects was not cloned using git # The sha tag must be maintained manually to point to the correct commit - sha_version_codi = "eee1b5eea2ded8126c34c1415e3b9cf15a3e70f2" + sha_version_codi = "0ad036f2c8254fa7b77180a443d99248c047c877" github_repo_codi = "https://github.com/scicompkl/CoDiPack" sha_version_medi = "aafc2d1966ba1233640af737e71c77c1a86183fd" github_repo_medi = "https://github.com/SciCompKL/MeDiPack" From 40fa01815214bfecafe018046facffc049ac7ca1 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Tue, 31 Oct 2023 16:36:13 +0100 Subject: [PATCH 066/139] Cleaned up TurboAverageProcess function and applied local variable declaration and const correctness --- SU2_CFD/src/solvers/CEulerSolver.cpp | 696 +++++++++------------------ 1 file changed, 239 insertions(+), 457 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e665fbe06e1..3730da69c27 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -8577,239 +8577,119 @@ void CEulerSolver::PreprocessAverage(CSolver **solver, CGeometry *geometry, CCon void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CConfig *config, unsigned short marker_flag) { - unsigned long iVertex, iPoint, nVert; - unsigned short iDim, iVar, iMarker, iMarkerTP, iSpan, jSpan; - unsigned short average_process = config->GetKind_AverageProcess(); - unsigned short performance_average_process = config->GetKind_PerformanceAverageProcess(); - su2double Pressure = 0.0, Density = 0.0, Enthalpy = 0.0, *Velocity = nullptr, *TurboVelocity, - Area, TotalArea, Radius1, Radius2, Vt2, TotalAreaPressure, TotalAreaDensity, *TotalAreaVelocity, *UnitNormal, *TurboNormal, - TotalMassPressure, TotalMassDensity, *TotalMassVelocity; - string Marker_Tag, Monitoring_Tag; - su2double val_init_pressure; - unsigned short iZone = config->GetiZone(); - su2double TotalDensity, TotalPressure, *TotalVelocity, *TotalFluxes; - const su2double *AverageTurboNormal; - su2double TotalNu, TotalOmega, TotalKine, TotalMassNu, TotalMassOmega, TotalMassKine, TotalAreaNu, TotalAreaOmega, TotalAreaKine; - su2double Nu, Kine, Omega; - su2double MachTest, soundSpeed; - bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); - bool spalart_allmaras = (config->GetKind_Turb_Model() == TURB_MODEL::SA); - bool menter_sst = (config->GetKind_Turb_Model() == TURB_MODEL::SST); - - /*-- Variables declaration and allocation ---*/ - Velocity = new su2double[nDim]; - UnitNormal = new su2double[nDim]; - TurboNormal = new su2double[nDim]; - TurboVelocity = new su2double[nDim]; - TotalVelocity = new su2double[nDim]; - TotalAreaVelocity = new su2double[nDim]; - TotalMassVelocity = new su2double[nDim]; - TotalFluxes = new su2double[nVar]; - - su2double avgDensity, *avgVelocity, avgPressure, avgKine, avgOmega, avgNu, avgAreaDensity, *avgAreaVelocity, avgAreaPressure, - avgAreaKine, avgAreaOmega, avgAreaNu, avgMassDensity, *avgMassVelocity, avgMassPressure, avgMassKine, avgMassOmega, avgMassNu, - avgMixDensity, *avgMixVelocity, *avgMixTurboVelocity, avgMixPressure, avgMixKine, avgMixOmega, avgMixNu; - - avgVelocity = new su2double[nDim]; - avgAreaVelocity = new su2double[nDim]; - avgMassVelocity = new su2double[nDim]; - avgMixVelocity = new su2double[nDim]; - avgMixTurboVelocity = new su2double[nDim]; - + const auto average_process = config->GetKind_AverageProcess(); + const auto performance_average_process = config->GetKind_PerformanceAverageProcess(); + const auto iZone = config->GetiZone(); + const bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); + const bool spalart_allmaras = (config->GetKind_Turb_Model() == TURB_MODEL::SA); + const bool menter_sst = (config->GetKind_Turb_Model() == TURB_MODEL::SST); const auto nSpanWiseSections = config->GetnSpanWiseSections(); - for (iSpan= 0; iSpan < nSpanWiseSections + 1; iSpan++){ + for (auto iSpan= 0; iSpan < nSpanWiseSections + 1; iSpan++){ + su2double TotalDensity{0}, TotalPressure{0}, TotalNu{0}, TotalOmega{0}, TotalKine{0}, TotalVelocity[nDim], + TotalAreaDensity{0}, TotalAreaPressure{0}, TotalAreaNu{0}, TotalAreaOmega{0}, TotalAreaKine{0}, TotalAreaVelocity[nDim], + TotalMassDensity{0}, TotalMassPressure{0}, TotalMassNu{0}, TotalMassOmega{0}, TotalMassKine{0}, TotalMassVelocity[nDim], + TotalFluxes[nVar]; /*--- Forces initialization for contenitors ---*/ - for (iVar=0;iVarGetnMarker_All(); iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ + auto iPoint = geometry->turbovertex[iMarker][iSpan][iVertex]->GetNode(); - /*--- Retrieve Old Solution ---*/ + /*--- Retrieve local quantities ---*/ + auto Pressure = nodes->GetPressure(iPoint); + auto Density = nodes->GetDensity(iPoint); + auto Enthalpy = nodes->GetEnthalpy(iPoint); - /*--- Loop over the vertices to sum all the quantities pithc-wise ---*/ - if(iSpan < nSpanWiseSections){ - for (iVertex = 0; iVertex < geometry->GetnVertexSpan(iMarker,iSpan); iVertex++) { - iPoint = geometry->turbovertex[iMarker][iSpan][iVertex]->GetNode(); - - /*--- Compute the integral fluxes for the boundaries ---*/ - Pressure = nodes->GetPressure(iPoint); - Density = nodes->GetDensity(iPoint); - Enthalpy = nodes->GetEnthalpy(iPoint); - - /*--- Normal vector for this vertex (negate for outward convention) ---*/ - geometry->turbovertex[iMarker][iSpan][iVertex]->GetNormal(UnitNormal); - geometry->turbovertex[iMarker][iSpan][iVertex]->GetTurboNormal(TurboNormal); - Area = geometry->turbovertex[iMarker][iSpan][iVertex]->GetArea(); - su2double VelNormal = 0.0, VelSq = 0.0; - - for (iDim = 0; iDim < nDim; iDim++) { - Velocity[iDim] = nodes->GetVelocity(iPoint,iDim); - VelNormal += UnitNormal[iDim]*Velocity[iDim]; - VelSq += Velocity[iDim]*Velocity[iDim]; - } - - ComputeTurboVelocity(Velocity, TurboNormal , TurboVelocity, marker_flag, config->GetKind_TurboMachinery(iZone)); - - /*--- Compute different integral quantities for the boundary of interest ---*/ - - TotalDensity += Density; - TotalPressure += Pressure; - for (iDim = 0; iDim < nDim; iDim++) - TotalVelocity[iDim] += Velocity[iDim]; + /*--- Normal vector for this vertex (negate for outward convention) ---*/ + su2double Velocity[nDim], UnitNormal[nDim], TurboNormal[nDim], TurboVelocity[nDim]; + geometry->turbovertex[iMarker][iSpan][iVertex]->GetNormal(UnitNormal); + geometry->turbovertex[iMarker][iSpan][iVertex]->GetTurboNormal(TurboNormal); + auto Area = geometry->turbovertex[iMarker][iSpan][iVertex]->GetArea(); - TotalAreaPressure += Area*Pressure; - TotalAreaDensity += Area*Density; - for (iDim = 0; iDim < nDim; iDim++) - TotalAreaVelocity[iDim] += Area*Velocity[iDim]; + for (auto iDim=0u; iDim < nDim; iDim++) Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); - TotalMassPressure += Area*(Density*TurboVelocity[0] )*Pressure; - TotalMassDensity += Area*(Density*TurboVelocity[0] )*Density; - for (iDim = 0; iDim < nDim; iDim++) - TotalMassVelocity[iDim] += Area*(Density*TurboVelocity[0] )*Velocity[iDim]; + ComputeTurboVelocity(Velocity, TurboNormal , TurboVelocity, marker_flag, config->GetKind_TurboMachinery(iZone)); - TotalFluxes[0] += Area*(Density*TurboVelocity[0]); - TotalFluxes[1] += Area*(Density*TurboVelocity[0]*TurboVelocity[0] + Pressure); - for (iDim = 2; iDim < nDim+1; iDim++) - TotalFluxes[iDim] += Area*(Density*TurboVelocity[0]*TurboVelocity[iDim -1]); - TotalFluxes[nDim+1] += Area*(Density*TurboVelocity[0]*Enthalpy); + /*--- Compute different integral quantities for the boundary of interest ---*/ + TotalDensity += Density; + TotalPressure += Pressure; + TotalAreaPressure += Area*Pressure; + TotalAreaDensity += Area*Density; - /*--- Compute turbulent integral quantities for the boundary of interest ---*/ + TotalMassPressure += Area*(Density*TurboVelocity[0] )*Pressure; + TotalMassDensity += Area*(Density*TurboVelocity[0] )*Density; - if(turbulent){ - if(menter_sst){ - Kine = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); - Omega = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,1); - } - if(spalart_allmaras){ - Nu = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); - } + for (auto iDim = 0u; iDim < nDim; iDim++) { + TotalVelocity[iDim] += Velocity[iDim]; + TotalAreaVelocity[iDim] += Area*Velocity[iDim]; + TotalMassVelocity[iDim] += Area*(Density*TurboVelocity[0] )*Velocity[iDim]; + } + + TotalFluxes[0] += Area*(Density*TurboVelocity[0]); + TotalFluxes[1] += Area*(Density*TurboVelocity[0]*TurboVelocity[0] + Pressure); + for (auto iDim = 2; iDim < nDim+1; iDim++) + TotalFluxes[iDim] += Area*(Density*TurboVelocity[0]*TurboVelocity[iDim -1]); + TotalFluxes[nDim+1] += Area*(Density*TurboVelocity[0]*Enthalpy); + + /*--- Compute turbulent integral quantities for the boundary of interest ---*/ + + if(turbulent){ + su2double Kine{0}, Omega{0}, Nu{0}; + if(menter_sst){ + Kine = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); + Omega = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,1); + } + if(spalart_allmaras){ + Nu = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); + } - TotalKine += Kine; - TotalOmega += Omega; - TotalNu += Nu; + TotalKine += Kine; + TotalOmega += Omega; + TotalNu += Nu; - TotalAreaKine += Area*Kine; - TotalAreaOmega += Area*Omega; - TotalAreaNu += Area*Nu; + TotalAreaKine += Area*Kine; + TotalAreaOmega += Area*Omega; + TotalAreaNu += Area*Nu; - TotalMassKine += Area*(Density*TurboVelocity[0] )*Kine; - TotalMassOmega += Area*(Density*TurboVelocity[0] )*Omega; - TotalMassNu += Area*(Density*TurboVelocity[0] )*Nu; + TotalMassKine += Area*(Density*TurboVelocity[0] )*Kine; + TotalMassOmega += Area*(Density*TurboVelocity[0] )*Omega; + TotalMassNu += Area*(Density*TurboVelocity[0] )*Nu; + } + }; + for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++){ + for (auto iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - } + /*--- Loop over the vertices to sum all the quantities pitch-wise ---*/ + if(iSpan < nSpanWiseSections){ + for (auto iVertex = 0ul; iVertex < geometry->GetnVertexSpan(iMarker,iSpan); iVertex++) { + UpdateTotalQuantities(iMarker, iSpan, iVertex); } - } - else{ - for (jSpan= 0; jSpan < nSpanWiseSections; jSpan++){ - for (iVertex = 0; iVertex < geometry->GetnVertexSpan(iMarker,jSpan); iVertex++) { - iPoint = geometry->turbovertex[iMarker][jSpan][iVertex]->GetNode(); - - /*--- Compute the integral fluxes for the boundaries ---*/ - Pressure = nodes->GetPressure(iPoint); - Density = nodes->GetDensity(iPoint); - Enthalpy = nodes->GetEnthalpy(iPoint); - - /*--- Normal vector for this vertex (negate for outward convention) ---*/ - geometry->turbovertex[iMarker][jSpan][iVertex]->GetNormal(UnitNormal); - geometry->turbovertex[iMarker][jSpan][iVertex]->GetTurboNormal(TurboNormal); - Area = geometry->turbovertex[iMarker][jSpan][iVertex]->GetArea(); - su2double VelNormal = 0.0, VelSq = 0.0; - - for (iDim = 0; iDim < nDim; iDim++) { - Velocity[iDim] = nodes->GetVelocity(iPoint,iDim); - VelNormal += UnitNormal[iDim]*Velocity[iDim]; - VelSq += Velocity[iDim]*Velocity[iDim]; - } - - ComputeTurboVelocity(Velocity, TurboNormal , TurboVelocity, marker_flag, config->GetKind_TurboMachinery(iZone)); - - /*--- Compute different integral quantities for the boundary of interest ---*/ - - TotalDensity += Density; - TotalPressure += Pressure; - for (iDim = 0; iDim < nDim; iDim++) - TotalVelocity[iDim] += Velocity[iDim]; - - TotalAreaPressure += Area*Pressure; - TotalAreaDensity += Area*Density; - for (iDim = 0; iDim < nDim; iDim++) - TotalAreaVelocity[iDim] += Area*Velocity[iDim]; - - TotalMassPressure += Area*(Density*TurboVelocity[0] )*Pressure; - TotalMassDensity += Area*(Density*TurboVelocity[0] )*Density; - for (iDim = 0; iDim < nDim; iDim++) - TotalMassVelocity[iDim] += Area*(Density*TurboVelocity[0] )*Velocity[iDim]; - - TotalFluxes[0] += Area*(Density*TurboVelocity[0]); - TotalFluxes[1] += Area*(Density*TurboVelocity[0]*TurboVelocity[0] + Pressure); - for (iDim = 2; iDim < nDim+1; iDim++) - TotalFluxes[iDim] += Area*(Density*TurboVelocity[0]*TurboVelocity[iDim -1]); - TotalFluxes[nDim+1] += Area*(Density*TurboVelocity[0]*Enthalpy); - - - /*--- Compute turbulent integral quantities for the boundary of interest ---*/ - - if(turbulent){ - if(menter_sst){ - Kine = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); - Omega = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,1); - } - if(spalart_allmaras){ - Nu = solver[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); - } - - TotalKine += Kine; - TotalOmega += Omega; - TotalNu += Nu; - - TotalAreaKine += Area*Kine; - TotalAreaOmega += Area*Omega; - TotalAreaNu += Area*Nu; - - TotalMassKine += Area*(Density*TurboVelocity[0] )*Kine; - TotalMassOmega += Area*(Density*TurboVelocity[0] )*Omega; - TotalMassNu += Area*(Density*TurboVelocity[0] )*Nu; - - } + } else { + for (auto jSpan= 0u; jSpan < nSpanWiseSections; jSpan++){ + for (auto iVertex = 0ul; iVertex < geometry->GetnVertexSpan(iMarker,jSpan); iVertex++) { + UpdateTotalQuantities(iMarker, jSpan, iVertex); } } - } - } - } - } - } + } + + } // marker_flag match + } // iMarkerTP match + } // iMarkerTP + } // iMarker #ifdef HAVE_MPI @@ -8855,155 +8735,149 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC #endif - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ + /*--- Compute pitch-wise averaged quantities ---*/ + for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++){ + for (auto iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - TotalArea = geometry->GetSpanArea(iMarker,iSpan); - AverageTurboNormal = geometry->GetAverageTurboNormal(iMarker,iSpan); - nVert = geometry->GetnTotVertexSpan(iMarker,iSpan); + auto TotalArea = geometry->GetSpanArea(iMarker,iSpan); + auto AverageTurboNormal = geometry->GetAverageTurboNormal(iMarker,iSpan); + auto nVert = geometry->GetnTotVertexSpan(iMarker,iSpan); /*--- compute normal Mach number as a check for massflow average and mixedout average ---*/ GetFluidModel()->SetTDState_Prho(TotalAreaPressure/TotalArea, TotalAreaDensity / TotalArea); - soundSpeed = GetFluidModel()->GetSoundSpeed(); - MachTest = TotalFluxes[0]/(TotalAreaDensity*soundSpeed); + auto soundSpeed = GetFluidModel()->GetSoundSpeed(); + auto MachTest = TotalFluxes[0]/(TotalAreaDensity*soundSpeed); /*--- Compute the averaged value for the boundary of interest for the span of interest ---*/ - /*--- compute algebraic average ---*/ - avgDensity = TotalDensity / nVert; - avgPressure = TotalPressure / nVert; - for (iDim = 0; iDim < nDim; iDim++) avgVelocity[iDim] = TotalVelocity[iDim] / nVert; - avgKine = TotalKine/nVert; - avgOmega = TotalOmega/nVert; - avgNu = TotalNu/nVert; + bool belowMachLimit = (abs(MachTest)< config->GetAverageMachLimit()); + su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}, avgVelocity[nDim], + avgMixTurboVelocity[nDim]; - /*--- compute area average ---*/ - avgAreaDensity = TotalAreaDensity / TotalArea; - avgAreaPressure = TotalAreaPressure / TotalArea; - for (iDim = 0; iDim < nDim; iDim++) avgAreaVelocity[iDim] = TotalAreaVelocity[iDim] / TotalArea; - avgAreaKine = TotalAreaKine / TotalArea; - avgAreaOmega = TotalAreaOmega / TotalArea; - avgAreaNu = TotalAreaNu / TotalArea; - - /*--- compute mass-flow average ---*/ - if (abs(MachTest)< config->GetAverageMachLimit()) { - avgMassDensity = avgAreaDensity; - avgMassPressure = avgAreaPressure; - for (iDim = 0; iDim < nDim; iDim++) avgMassVelocity[iDim] = avgAreaVelocity[iDim]; - avgMassKine = avgAreaKine; - avgMassOmega = avgAreaOmega; - avgMassNu = avgAreaNu; - }else{ - avgMassDensity = TotalMassDensity / TotalFluxes[0]; - avgMassPressure = TotalMassPressure / TotalFluxes[0]; - for (iDim = 0; iDim < nDim; iDim++) avgMassVelocity[iDim] = TotalMassVelocity[iDim] / TotalFluxes[0]; - avgMassKine = TotalMassKine / TotalFluxes[0]; - avgMassOmega = TotalMassOmega / TotalFluxes[0]; - avgMassNu = TotalMassNu / TotalFluxes[0]; - } - /*--- compute mixed-out average ---*/ - for (iVar = 0; iVarGetAverageMachLimit()) { - avgMixDensity = avgAreaDensity; - avgMixPressure = avgAreaPressure; - for (iDim = 0; iDim < nDim; iDim++) - avgMixVelocity[iDim] = avgAreaVelocity[iDim]; - ComputeTurboVelocity(avgMixVelocity, AverageTurboNormal , avgMixTurboVelocity, marker_flag, config->GetKind_TurboMachinery(iZone)); - avgMixKine = avgAreaKine; - avgMixOmega = avgAreaOmega; - avgMixNu = avgAreaNu; - }else { - MixedOut_Average (config, val_init_pressure, AverageFlux[iMarker][iSpan], AverageTurboNormal, avgMixPressure, avgMixDensity); - avgMixTurboVelocity[0] = ( AverageFlux[iMarker][iSpan][1] - avgMixPressure) / AverageFlux[iMarker][iSpan][0]; - for (iDim = 2; iDim < nDim +1;iDim++) - avgMixTurboVelocity[iDim-1] = AverageFlux[iMarker][iSpan][iDim] / AverageFlux[iMarker][iSpan][0]; - - if (avgMixDensity!= avgMixDensity || avgMixPressure!= avgMixPressure || avgMixPressure < 0.0 || avgMixDensity < 0.0 ){ - val_init_pressure = avgAreaPressure; - MixedOut_Average (config, val_init_pressure, AverageFlux[iMarker][iSpan], AverageTurboNormal, avgMixPressure, avgMixDensity); - avgMixTurboVelocity[0] = ( AverageFlux[iMarker][iSpan][1] - avgMixPressure) / AverageFlux[iMarker][iSpan][0]; - for (iDim = 2; iDim < nDim +1;iDim++) - avgMixTurboVelocity[iDim-1] = AverageFlux[iMarker][iSpan][iDim] / AverageFlux[iMarker][iSpan][0]; - } - avgMixKine = avgMassKine; - avgMixOmega = avgMassOmega; - avgMixNu = avgMassNu; - } - /*--- Store averaged value for the selected average method ---*/ - switch(average_process){ + switch (average_process) + { case ALGEBRAIC: - AverageDensity[iMarker][iSpan] = avgDensity; - AveragePressure[iMarker][iSpan] = avgPressure; - ComputeTurboVelocity(avgVelocity, AverageTurboNormal , AverageTurboVelocity[iMarker][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - AverageKine[iMarker][iSpan] = avgKine; - AverageOmega[iMarker][iSpan] = avgOmega; - AverageNu[iMarker][iSpan] = avgNu; + /*--- compute algebraic average ---*/ + avgDensity = TotalDensity / nVert; + avgPressure = TotalPressure / nVert; + for (auto iDim = 0u; iDim < nDim; iDim++) avgVelocity[iDim] = TotalVelocity[iDim] / nVert; + if (turbulent) { + avgKine = TotalKine/nVert; + avgOmega = TotalOmega/nVert; + avgNu = TotalNu/nVert; + } break; - case AREA: - AverageDensity[iMarker][iSpan] = avgAreaDensity; - AveragePressure[iMarker][iSpan] = avgAreaPressure; - ComputeTurboVelocity(avgAreaVelocity, AverageTurboNormal , AverageTurboVelocity[iMarker][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - AverageKine[iMarker][iSpan] = avgAreaKine; - AverageOmega[iMarker][iSpan] = avgAreaOmega; - AverageNu[iMarker][iSpan] = avgAreaNu; + /*--- compute area average ---*/ + avgDensity = TotalAreaDensity / TotalArea; + avgPressure = TotalAreaPressure / TotalArea; + for (auto iDim = 0u; iDim < nDim; iDim++) avgVelocity[iDim] = TotalAreaVelocity[iDim] / TotalArea; + if (turbulent) { + avgKine = TotalAreaKine / TotalArea; + avgOmega = TotalAreaOmega / TotalArea; + avgNu = TotalAreaNu / TotalArea; + } break; - case MASSFLUX: - AverageDensity[iMarker][iSpan] = avgMassDensity; - AveragePressure[iMarker][iSpan] = avgMassPressure; - ComputeTurboVelocity(avgAreaVelocity, AverageTurboNormal , AverageTurboVelocity[iMarker][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - AverageKine[iMarker][iSpan] = avgMassKine; - AverageOmega[iMarker][iSpan] = avgMassOmega; - AverageNu[iMarker][iSpan] = avgMassNu; + /*--- compute mass-flux average ---*/ + if (belowMachLimit) { + avgDensity = TotalAreaDensity / TotalArea; + avgPressure = TotalAreaPressure / TotalArea; + for (auto iDim = 0u; iDim < nDim; iDim++) avgVelocity[iDim] = TotalAreaVelocity[iDim] / TotalArea; + if (turbulent) { + avgKine = TotalAreaKine / TotalArea; + avgOmega = TotalAreaOmega / TotalArea; + avgNu = TotalAreaNu / TotalArea; + } + } else { + avgDensity = TotalMassDensity / TotalFluxes[0]; + avgPressure = TotalMassPressure / TotalFluxes[0]; + for (auto iDim = 0u; iDim < nDim; iDim++) avgVelocity[iDim] = TotalMassVelocity[iDim] / TotalFluxes[0]; + if (turbulent) { + avgKine = TotalMassKine / TotalFluxes[0]; + avgOmega = TotalMassOmega / TotalFluxes[0]; + avgNu = TotalMassNu / TotalFluxes[0]; + } + } break; - case MIXEDOUT: - AverageDensity[iMarker][iSpan] = avgMixDensity; - AveragePressure[iMarker][iSpan] = avgMixPressure; - for (iDim = 0; iDim < nDim; iDim++) AverageTurboVelocity[iMarker][iSpan][iDim] = avgMixTurboVelocity[iDim]; - AverageKine[iMarker][iSpan] = avgMixKine; - AverageOmega[iMarker][iSpan] = avgMixOmega; - AverageNu[iMarker][iSpan] = avgMixNu; + /*--- compute mixed-out average ---*/ + avgDensity = TotalAreaDensity / TotalArea; + avgPressure = TotalAreaPressure / TotalArea; + if (belowMachLimit) { + for (auto iDim = 0u; iDim < nDim; iDim++) + avgVelocity[iDim] = TotalAreaVelocity[iDim] / TotalArea; + if (turbulent) { + avgKine = TotalAreaKine / TotalArea; + avgOmega = TotalAreaOmega / TotalArea; + avgNu = TotalAreaNu / TotalArea; + } + }else { + auto val_init_pressure = OldAveragePressure[iMarker][iSpan]; + MixedOut_Average (config, val_init_pressure, AverageFlux[iMarker][iSpan], AverageTurboNormal, avgPressure, avgDensity); + avgVelocity[0] = ( AverageFlux[iMarker][iSpan][1] - avgPressure) / AverageFlux[iMarker][iSpan][0]; + for (auto iDim = 2; iDim < nDim +1;iDim++) + avgVelocity[iDim-1] = AverageFlux[iMarker][iSpan][iDim] / AverageFlux[iMarker][iSpan][0]; + + if (isnan(avgDensity) || isnan(avgPressure) || avgPressure < 0.0 || avgDensity < 0.0 ){ + val_init_pressure = TotalAreaPressure / TotalArea; + MixedOut_Average (config, val_init_pressure, AverageFlux[iMarker][iSpan], AverageTurboNormal, avgPressure, avgDensity); + avgVelocity[0] = ( AverageFlux[iMarker][iSpan][1] - avgPressure) / AverageFlux[iMarker][iSpan][0]; + for (auto iDim = 2; iDim < nDim +1;iDim++) + avgVelocity[iDim-1] = AverageFlux[iMarker][iSpan][iDim] / AverageFlux[iMarker][iSpan][0]; + } + if (turbulent) { + avgKine = TotalMassKine / TotalFluxes[0]; + avgOmega = TotalMassOmega / TotalFluxes[0]; + avgNu = TotalMassNu / TotalFluxes[0]; + } + } break; - default: SU2_MPI::Error(" Invalid AVERAGE PROCESS input!", CURRENT_FUNCTION); break; } - /* --- check if averaged quantities are correct otherwise reset the old quantities ---*/ - if (AverageDensity[iMarker][iSpan]!= AverageDensity[iMarker][iSpan] || AveragePressure[iMarker][iSpan]!= AveragePressure[iMarker][iSpan]){ - cout<<"nan in mixing process routine for iSpan: " << iSpan<< " in marker " << config->GetMarker_All_TagBound(iMarker)<< endl; - AverageDensity[iMarker][iSpan] = OldAverageDensity[iMarker][iSpan]; - AveragePressure[iMarker][iSpan] = OldAveragePressure[iMarker][iSpan]; - for(iDim = 0; iDim < nDim;iDim++) - AverageTurboVelocity[iMarker][iSpan][iDim] = OldAverageTurboVelocity[iMarker][iSpan][iDim]; + AverageDensity[iMarker][iSpan] = avgDensity; + AveragePressure[iMarker][iSpan] = avgPressure; + if ((average_process == MIXEDOUT) && !belowMachLimit) { + for (auto iDim = 0u; iDim < nDim; iDim++) AverageTurboVelocity[iMarker][iSpan][iDim] = avgVelocity[iDim]; + } else { + ComputeTurboVelocity(avgVelocity, AverageTurboNormal , AverageTurboVelocity[iMarker][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); + } + if (turbulent) { + AverageKine[iMarker][iSpan] = avgKine; + AverageOmega[iMarker][iSpan] = avgOmega; + AverageNu[iMarker][iSpan] = avgNu; } - - if (AverageDensity[iMarker][iSpan] < 0.0 || AveragePressure[iMarker][iSpan] < 0.0){ - cout << " negative density or pressure in mixing process routine for iSpan: " << iSpan<< " in marker " << config->GetMarker_All_TagBound(iMarker)<< endl; + /* --- check if averaged quantities are correct otherwise reset the old quantities ---*/ + const bool nanSolution = (isnan(AverageDensity[iMarker][iSpan]) || isnan(AveragePressure[iMarker][iSpan])); + const bool negSolution = (AverageDensity[iMarker][iSpan] < 0.0 || AveragePressure[iMarker][iSpan] < 0.0); + if (nanSolution || negSolution){ + if (nanSolution) + cout<<"nan in mixing process routine for iSpan: " << iSpan<< " in marker " << config->GetMarker_All_TagBound(iMarker)<< endl; + else + cout << " negative density or pressure in mixing process routine for iSpan: " << iSpan<< " in marker " << config->GetMarker_All_TagBound(iMarker)<< endl; AverageDensity[iMarker][iSpan] = OldAverageDensity[iMarker][iSpan]; AveragePressure[iMarker][iSpan] = OldAveragePressure[iMarker][iSpan]; - for(iDim = 0; iDim < nDim;iDim++) + for(auto iDim = 0u; iDim < nDim;iDim++) AverageTurboVelocity[iMarker][iSpan][iDim] = OldAverageTurboVelocity[iMarker][iSpan][iDim]; + } else { + /* --- update old average solution ---*/ + OldAverageDensity[iMarker][iSpan] = AverageDensity[iMarker][iSpan]; + OldAveragePressure[iMarker][iSpan] = AveragePressure[iMarker][iSpan]; + for(auto iDim = 0u; iDim < nDim;iDim++) + OldAverageTurboVelocity[iMarker][iSpan][iDim] = AverageTurboVelocity[iMarker][iSpan][iDim]; } - /* --- update old average solution ---*/ - OldAverageDensity[iMarker][iSpan] = AverageDensity[iMarker][iSpan]; - OldAveragePressure[iMarker][iSpan] = AveragePressure[iMarker][iSpan]; - for(iDim = 0; iDim < nDim;iDim++) - OldAverageTurboVelocity[iMarker][iSpan][iDim] = AverageTurboVelocity[iMarker][iSpan][iDim]; - /*--- to avoid back flow ---*/ if (AverageTurboVelocity[iMarker][iSpan][0] < 0.0){ AverageTurboVelocity[iMarker][iSpan][0] = soundSpeed*config->GetAverageMachLimit(); @@ -9012,161 +8886,69 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC /*--- compute cartesian average Velocity ---*/ ComputeBackVelocity(AverageTurboVelocity[iMarker][iSpan], AverageTurboNormal , AverageVelocity[iMarker][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - /*--- Store averaged performance value for the selected average method ---*/ - switch(performance_average_process){ - case ALGEBRAIC: - if(marker_flag == INFLOW){ - DensityIn[iMarkerTP - 1][iSpan] = avgDensity; - PressureIn[iMarkerTP - 1][iSpan] = avgPressure; - ComputeTurboVelocity(avgVelocity, AverageTurboNormal , TurboVelocityIn[iMarkerTP -1][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - KineIn[iMarkerTP - 1][iSpan] = avgKine; - OmegaIn[iMarkerTP - 1][iSpan] = avgOmega; - NuIn[iMarkerTP - 1][iSpan] = avgNu; - } - else{ - DensityOut[iMarkerTP - 1][iSpan] = avgDensity; - PressureOut[iMarkerTP - 1][iSpan] = avgPressure; - ComputeTurboVelocity(avgVelocity, AverageTurboNormal , TurboVelocityOut[iMarkerTP -1][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - KineOut[iMarkerTP - 1][iSpan] = avgKine; - OmegaOut[iMarkerTP - 1][iSpan] = avgOmega; - NuOut[iMarkerTP - 1][iSpan] = avgNu; - } - - break; - case AREA: - if(marker_flag == INFLOW){ - DensityIn[iMarkerTP - 1][iSpan] = avgAreaDensity; - PressureIn[iMarkerTP - 1][iSpan] = avgAreaPressure; - ComputeTurboVelocity(avgAreaVelocity, AverageTurboNormal , TurboVelocityIn[iMarkerTP -1][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - KineIn[iMarkerTP - 1][iSpan] = avgAreaKine; - OmegaIn[iMarkerTP - 1][iSpan] = avgAreaOmega; - NuIn[iMarkerTP - 1][iSpan] = avgAreaNu; - } - else{ - DensityOut[iMarkerTP - 1][iSpan] = avgAreaDensity; - PressureOut[iMarkerTP - 1][iSpan] = avgAreaPressure; - ComputeTurboVelocity(avgAreaVelocity, AverageTurboNormal , TurboVelocityOut[iMarkerTP -1][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - KineOut[iMarkerTP - 1][iSpan] = avgAreaKine; - OmegaOut[iMarkerTP - 1][iSpan] = avgAreaOmega; - NuOut[iMarkerTP - 1][iSpan] = avgAreaNu/TotalArea; - } - break; - - case MASSFLUX: - if(marker_flag == INFLOW){ - DensityIn[iMarkerTP - 1][iSpan] = avgMassDensity; - PressureIn[iMarkerTP - 1][iSpan] = avgMassPressure; - ComputeTurboVelocity(avgMassVelocity, AverageTurboNormal , TurboVelocityIn[iMarkerTP -1][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - KineIn[iMarkerTP - 1][iSpan] = avgMassKine; - OmegaIn[iMarkerTP - 1][iSpan] = avgMassOmega; - NuIn[iMarkerTP - 1][iSpan] = avgMassNu; - } - else{ - DensityOut[iMarkerTP - 1][iSpan] = avgMassDensity; - PressureOut[iMarkerTP - 1][iSpan] = avgMassPressure; - ComputeTurboVelocity(avgMassVelocity, AverageTurboNormal , TurboVelocityOut[iMarkerTP -1][iSpan], marker_flag, config->GetKind_TurboMachinery(iZone)); - KineOut[iMarkerTP - 1][iSpan] = avgMassKine; - OmegaOut[iMarkerTP - 1][iSpan] = avgMassOmega; - NuOut[iMarkerTP - 1][iSpan] = avgMassNu; - } - - break; - - case MIXEDOUT: - if (marker_flag == INFLOW){ - DensityIn[iMarkerTP - 1][iSpan] = avgMixDensity; - PressureIn[iMarkerTP - 1][iSpan] = avgMixPressure; - for (iDim = 0; iDim < nDim; iDim++) TurboVelocityIn[iMarkerTP -1][iSpan][iDim] = avgMixTurboVelocity[iDim]; - KineIn[iMarkerTP - 1][iSpan] = avgMixKine; - OmegaIn[iMarkerTP - 1][iSpan] = avgMixOmega; - NuIn[iMarkerTP - 1][iSpan] = avgMixNu; - } - else{ - DensityOut[iMarkerTP - 1][iSpan] = avgMixDensity; - PressureOut[iMarkerTP - 1][iSpan] = avgMixPressure; - for (iDim = 0; iDim < nDim; iDim++) TurboVelocityOut[iMarkerTP -1][iSpan][iDim] = avgMixTurboVelocity[iDim]; - KineOut[iMarkerTP - 1][iSpan] = avgMixKine; - OmegaOut[iMarkerTP - 1][iSpan] = avgMixOmega; - NuOut[iMarkerTP - 1][iSpan] = avgMixNu; - } - break; + if (marker_flag == INFLOW) { + DensityIn[iMarkerTP - 1][iSpan] = AverageDensity[iMarker][iSpan]; + PressureIn[iMarkerTP - 1][iSpan] = AveragePressure[iMarker][iSpan]; + KineIn[iMarkerTP - 1][iSpan] = AverageKine[iMarker][iSpan]; + OmegaIn[iMarkerTP - 1][iSpan] = AverageOmega[iMarker][iSpan]; + NuIn[iMarkerTP - 1][iSpan] = AverageNu[iMarker][iSpan]; + } else { + DensityOut[iMarkerTP - 1][iSpan] = AverageDensity[iMarker][iSpan]; + PressureOut[iMarkerTP - 1][iSpan] = AveragePressure[iMarker][iSpan]; + KineOut[iMarkerTP - 1][iSpan] = AverageKine[iMarker][iSpan]; + OmegaOut[iMarkerTP - 1][iSpan] = AverageOmega[iMarker][iSpan]; + NuOut[iMarkerTP - 1][iSpan] = AverageNu[iMarker][iSpan]; + } + + auto TurboVel = (marker_flag == INFLOW) ? TurboVelocityIn[iMarkerTP - 1][iSpan] : TurboVelocityOut[iMarkerTP - 1][iSpan]; - default: - SU2_MPI::Error(" Invalid MIXING_PROCESS input!", CURRENT_FUNCTION); - break; + if (performance_average_process == MIXEDOUT) { + for (auto iDim = 0u; iDim < nDim; iDim++) TurboVel[iDim] = avgMixTurboVelocity[iDim]; + } else { + ComputeTurboVelocity(avgVelocity, AverageTurboNormal , TurboVel, marker_flag, config->GetKind_TurboMachinery(iZone)); } } } - } - } - } + } // iMarkerTP + } // iMarker + } // iSpan /*--- Compute Outlet Static Pressure if Radial equilibrium is imposed ---*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ + for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++){ + for (auto iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - Marker_Tag = config->GetMarker_All_TagBound(iMarker); + auto Marker_Tag = config->GetMarker_All_TagBound(iMarker); if(config->GetBoolGiles() || config->GetBoolRiemann()){ if(config->GetBoolRiemann()){ if(config->GetKind_Data_Riemann(Marker_Tag) == RADIAL_EQUILIBRIUM){ RadialEquilibriumPressure[iMarker][nSpanWiseSections/2] = config->GetRiemann_Var1(Marker_Tag)/config->GetPressure_Ref(); - for (iSpan= nSpanWiseSections/2; iSpan < nSpanWiseSections-1; iSpan++){ - Radius2 = geometry->GetTurboRadius(iMarker,iSpan+1); - Radius1 = geometry->GetTurboRadius(iMarker,iSpan); - Vt2 = AverageTurboVelocity[iMarker][iSpan +1][1]*AverageTurboVelocity[iMarker][iSpan +1][1]; - RadialEquilibriumPressure[iMarker][iSpan +1] = RadialEquilibriumPressure[iMarker][iSpan] + AverageDensity[iMarker][iSpan +1]*Vt2/Radius2*(Radius2 - Radius1); - } - for (iSpan= nSpanWiseSections/2; iSpan > 0; iSpan--){ - Radius2 = geometry->GetTurboRadius(iMarker,iSpan); - Radius1 = geometry->GetTurboRadius(iMarker,iSpan-1); - Vt2 = AverageTurboVelocity[iMarker][iSpan - 1][1]*AverageTurboVelocity[iMarker][iSpan - 1][1]; - Radius1 = (Radius1 > EPS)? Radius1 : Radius2; - RadialEquilibriumPressure[iMarker][iSpan -1] = RadialEquilibriumPressure[iMarker][iSpan] - AverageDensity[iMarker][iSpan -1]*Vt2/Radius1*(Radius2 - Radius1); - } } - } - else{ + } else { if(config->GetKind_Data_Giles(Marker_Tag) == RADIAL_EQUILIBRIUM){ RadialEquilibriumPressure[iMarker][nSpanWiseSections/2] = config->GetGiles_Var1(Marker_Tag)/config->GetPressure_Ref(); - for (iSpan= nSpanWiseSections/2; iSpan < nSpanWiseSections-1; iSpan++){ - Radius2 = geometry->GetTurboRadius(iMarker,iSpan+1); - Radius1 = geometry->GetTurboRadius(iMarker,iSpan); - Vt2 = AverageTurboVelocity[iMarker][iSpan +1][1]*AverageTurboVelocity[iMarker][iSpan +1][1]; - RadialEquilibriumPressure[iMarker][iSpan +1] = RadialEquilibriumPressure[iMarker][iSpan] + AverageDensity[iMarker][iSpan +1]*Vt2/Radius2*(Radius2 - Radius1); - } - for (iSpan= nSpanWiseSections/2; iSpan > 0; iSpan--){ - Radius2 = geometry->GetTurboRadius(iMarker,iSpan); - Radius1 = geometry->GetTurboRadius(iMarker,iSpan-1); - Vt2 = AverageTurboVelocity[iMarker][iSpan -1][1]*AverageTurboVelocity[iMarker][iSpan - 1][1]; - Radius1 = (Radius1 > EPS)? Radius1 : Radius2; - RadialEquilibriumPressure[iMarker][iSpan -1] = RadialEquilibriumPressure[iMarker][iSpan] - AverageDensity[iMarker][iSpan -1]*Vt2/Radius1*(Radius2 - Radius1); - } } + } + for (auto iSpan= nSpanWiseSections/2; iSpan < nSpanWiseSections-1; iSpan++){ + auto Radius2 = geometry->GetTurboRadius(iMarker,iSpan+1); + auto Radius1 = geometry->GetTurboRadius(iMarker,iSpan); + auto Vt2 = AverageTurboVelocity[iMarker][iSpan +1][1]*AverageTurboVelocity[iMarker][iSpan +1][1]; + RadialEquilibriumPressure[iMarker][iSpan +1] = RadialEquilibriumPressure[iMarker][iSpan] + AverageDensity[iMarker][iSpan +1]*Vt2/Radius2*(Radius2 - Radius1); } - } - } - } - } - } - - /*--- Free locally allocated memory ---*/ - delete [] Velocity; - delete [] UnitNormal; - delete [] TurboNormal; - delete [] TurboVelocity; - delete [] TotalVelocity; - delete [] TotalAreaVelocity; - delete [] TotalFluxes; - delete [] TotalMassVelocity; - delete [] avgVelocity; - delete [] avgAreaVelocity; - delete [] avgMassVelocity; - delete [] avgMixVelocity; - delete [] avgMixTurboVelocity; - + for (auto iSpan= nSpanWiseSections/2; iSpan > 0; iSpan--){ + auto Radius2 = geometry->GetTurboRadius(iMarker,iSpan); + auto Radius1 = geometry->GetTurboRadius(iMarker,iSpan-1); + auto Vt2 = AverageTurboVelocity[iMarker][iSpan -1][1]*AverageTurboVelocity[iMarker][iSpan - 1][1]; + Radius1 = (Radius1 > EPS)? Radius1 : Radius2; + RadialEquilibriumPressure[iMarker][iSpan -1] = RadialEquilibriumPressure[iMarker][iSpan] - AverageDensity[iMarker][iSpan -1]*Vt2/Radius1*(Radius2 - Radius1); + } + } // Giles or Riemann + } // marker_flag + } // iMarkerTP + } // iMarker is iMarkerTP + } // iMarker } void CEulerSolver::MixedOut_Average (CConfig *config, su2double val_init_pressure, const su2double *val_Averaged_Flux, From e81bf0670674f6f4c554a78524c3c4cd1be8ac87 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Wed, 1 Nov 2023 09:40:50 +0100 Subject: [PATCH 067/139] Replaced variable length array declarations --- SU2_CFD/src/solvers/CEulerSolver.cpp | 37 ++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 3730da69c27..380b642234e 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -8586,11 +8586,14 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC const auto nSpanWiseSections = config->GetnSpanWiseSections(); for (auto iSpan= 0; iSpan < nSpanWiseSections + 1; iSpan++){ - su2double TotalDensity{0}, TotalPressure{0}, TotalNu{0}, TotalOmega{0}, TotalKine{0}, TotalVelocity[nDim], - TotalAreaDensity{0}, TotalAreaPressure{0}, TotalAreaNu{0}, TotalAreaOmega{0}, TotalAreaKine{0}, TotalAreaVelocity[nDim], - TotalMassDensity{0}, TotalMassPressure{0}, TotalMassNu{0}, TotalMassOmega{0}, TotalMassKine{0}, TotalMassVelocity[nDim], - TotalFluxes[nVar]; - + su2double TotalDensity{0}, TotalPressure{0}, TotalNu{0}, TotalOmega{0}, TotalKine{0}, + TotalAreaDensity{0}, TotalAreaPressure{0}, TotalAreaNu{0}, TotalAreaOmega{0}, TotalAreaKine{0}, + TotalMassDensity{0}, TotalMassPressure{0}, TotalMassNu{0}, TotalMassOmega{0}, TotalMassKine{0}; + + su2double *TotalVelocity = new su2double[nDim], + *TotalAreaVelocity = new su2double[nDim], + *TotalMassVelocity = new su2double[nDim], + *TotalFluxes = new su2double[nVar]; /*--- Forces initialization for contenitors ---*/ for (auto iVar=0u;iVarGetDensity(iPoint); auto Enthalpy = nodes->GetEnthalpy(iPoint); - /*--- Normal vector for this vertex (negate for outward convention) ---*/ - su2double Velocity[nDim], UnitNormal[nDim], TurboNormal[nDim], TurboVelocity[nDim]; + su2double *Velocity = new su2double[nDim], + *UnitNormal = new su2double[nDim], + *TurboNormal = new su2double[nDim], + *TurboVelocity = new su2double[nDim]; + geometry->turbovertex[iMarker][iSpan][iVertex]->GetNormal(UnitNormal); geometry->turbovertex[iMarker][iSpan][iVertex]->GetTurboNormal(TurboNormal); auto Area = geometry->turbovertex[iMarker][iSpan][iVertex]->GetArea(); @@ -8666,6 +8672,11 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC TotalMassOmega += Area*(Density*TurboVelocity[0] )*Omega; TotalMassNu += Area*(Density*TurboVelocity[0] )*Nu; } + + delete [] Velocity; + delete [] UnitNormal; + delete [] TurboNormal; + delete [] TurboVelocity; }; for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++){ @@ -8753,9 +8764,9 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC /*--- Compute the averaged value for the boundary of interest for the span of interest ---*/ bool belowMachLimit = (abs(MachTest)< config->GetAverageMachLimit()); - su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}, avgVelocity[nDim], - avgMixTurboVelocity[nDim]; - + su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}; + su2double *avgVelocity = new su2double[nDim], + *avgMixTurboVelocity = new su2double[nDim]; for (auto iVar = 0u; iVarGetKind_TurboMachinery(iZone)); } + delete [] avgVelocity; + delete [] avgMixTurboVelocity; } } } // iMarkerTP } // iMarker + delete [] TotalVelocity; + delete [] TotalMassVelocity; + delete [] TotalAreaVelocity; + delete [] TotalFluxes; } // iSpan /*--- Compute Outlet Static Pressure if Radial equilibrium is imposed ---*/ From a4b8bdd2c12354b9c1454a79b7cdd0f38fc4b08b Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" <119933136+josy-nal@users.noreply.github.com> Date: Thu, 2 Nov 2023 07:57:56 +0530 Subject: [PATCH 068/139] Update Common/include/CConfig.hpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- Common/include/CConfig.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index a9fe9b4b710..c9bfb36669b 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -6687,12 +6687,12 @@ class CConfig { /*! * \brief Get the blade angle of the propeller. */ - su2double GetBEM_blade_angle(void) { return BEM_blade_angle; } + su2double GetBEM_blade_angle(void) const { return BEM_blade_angle; } /*! * \brief Get the filename of the propeller. */ - string GetBEM_prop_filename(void) { return BEM_prop_filename; } + const string& GetBEM_prop_filename(void) const { return BEM_prop_filename; } /*! * \brief Get Actuator Disk Outlet for boundary val_marker (actuator disk inlet). From 47b3007df127cea5de30e2ebbe85ee4955aeffd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 2 Nov 2023 16:10:53 +0100 Subject: [PATCH 069/139] Add explicit locks for AD::GetDerivative() call trees. --- SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp | 8 ++++++++ SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp index a297039ea3a..7abd17805fa 100644 --- a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp @@ -232,12 +232,16 @@ void CDiscAdjFEASolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *co /*--- Extract and store the adjoint solution ---*/ + AD::BeginUseAdjoints(); + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { su2double Solution[MAXNVAR] = {0.0}; direct_solver->GetNodes()->GetAdjointSolution(iPoint,Solution); nodes->SetSolution(iPoint,Solution); } + AD::EndUseAdjoints(); + if (CrossTerm) return; /*--- Extract and store the adjoint solution at time n (including accel. and velocity) ---*/ @@ -358,6 +362,8 @@ void CDiscAdjFEASolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSo /*--- Extract the geometric sensitivities ---*/ + AD::BeginUseAdjoints(); + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { auto Coord = geometry->nodes->GetCoord(iPoint); @@ -375,6 +381,8 @@ void CDiscAdjFEASolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSo } } + AD::EndUseAdjoints(); + } void CDiscAdjFEASolver::ReadDV(const CConfig *config) { diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index c42e2b4925f..ac9c6043097 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -317,6 +317,8 @@ void CDiscAdjSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *confi if (!config->GetMultizone_Problem()) nodes->Set_OldSolution(); + AD::BeginUseAdjoints(); + SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { @@ -339,6 +341,8 @@ void CDiscAdjSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *confi } END_SU2_OMP_FOR + AD::EndUseAdjoints(); + direct_solver->ExtractAdjoint_SolutionExtra(nodes->GetSolutionExtra(), config); /*--- Residuals and time_n terms are not needed when evaluating multizone cross terms. ---*/ @@ -477,6 +481,8 @@ void CDiscAdjSolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config) { void CDiscAdjSolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSolver*) { + AD::BeginUseAdjoints(); + SU2_OMP_PARALLEL { const bool time_stepping = (config->GetTime_Marching() != TIME_MARCHING::STEADY); @@ -510,6 +516,8 @@ void CDiscAdjSolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSolve } END_SU2_OMP_PARALLEL + + AD::EndUseAdjoints(); } void CDiscAdjSolver::SetSurface_Sensitivity(CGeometry *geometry, CConfig *config) { From 81eb4910f959deaa9ed505b6d2fee83845d428ea Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Fri, 3 Nov 2023 09:52:37 +0530 Subject: [PATCH 070/139] eliminate class COptionActDiskBem --- Common/include/option_structure.inl | 100 ---------------------------- Common/src/CConfig.cpp | 8 +-- 2 files changed, 4 insertions(+), 104 deletions(-) diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index 8bd9644b42a..ce94055fca5 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -1772,106 +1772,6 @@ class COptionActDisk : public COptionBase { } }; -class COptionActDiskBem : public COptionBase { - string name; // identifier for the option - unsigned short& inlet_size; - unsigned short& outlet_size; - string*& marker_inlet; - string*& marker_outlet; - su2double**& dir_x; - su2double**& dir_y; - su2double**& dir_z; - - public: - COptionActDiskBem(const string name, unsigned short& nMarker_ActDiskInlet, unsigned short& nMarker_ActDiskOutlet, - string*& Marker_ActDiskInlet, string*& Marker_ActDiskOutlet, - su2double**& ActDiskBem_X, su2double**& ActDiskBem_Y, su2double**& ActDiskBem_Z) - : inlet_size(nMarker_ActDiskInlet), - outlet_size(nMarker_ActDiskOutlet), - marker_inlet(Marker_ActDiskInlet), - marker_outlet(Marker_ActDiskOutlet), - dir_x(ActDiskBem_X), - dir_y(ActDiskBem_Y), - dir_z(ActDiskBem_Z) { - this->name = name; - } - - ~COptionActDiskBem() override{}; - string SetValue(const vector& option_value) override { - COptionBase::SetValue(option_value); - const int mod_num = 8; - unsigned short totalVals = option_value.size(); - if ((totalVals == 1) && (option_value[0].compare("NONE") == 0)) { - this->SetDefault(); - return ""; - } - - if (totalVals % mod_num != 0) { - string newstring; - newstring.append(this->name); - newstring.append(": must have a number of entries divisible by 8"); - this->SetDefault(); - return newstring; - } - - unsigned short nVals = totalVals / mod_num; - this->inlet_size = nVals; - this->outlet_size = nVals; - this->marker_inlet = new string[this->inlet_size]; - this->marker_outlet = new string[this->outlet_size]; - - this->dir_x = new su2double*[this->inlet_size]; - this->dir_y = new su2double*[this->inlet_size]; - this->dir_z = new su2double*[this->inlet_size]; - for (int i = 0; i < this->inlet_size; i++) { - this->dir_x[i] = new su2double[2]; - this->dir_y[i] = new su2double[2]; - this->dir_z[i] = new su2double[2]; - } - - string tname = "actuator disk"; - - for (int i = 0; i < this->inlet_size; i++) { - this->marker_inlet[i].assign(option_value[mod_num * i]); - this->marker_outlet[i].assign(option_value[mod_num * i + 1]); - istringstream ss_1st(option_value[mod_num * i + 2]); - if (!(ss_1st >> this->dir_x[i][0])) { - return badValue(tname, this->name); - } - istringstream ss_2nd(option_value[mod_num * i + 3]); - if (!(ss_2nd >> this->dir_y[i][0])) { - return badValue(tname, this->name); - } - istringstream ss_3rd(option_value[mod_num * i + 4]); - if (!(ss_3rd >> this->dir_z[i][0])) { - return badValue(tname, this->name); - } - istringstream ss_4th(option_value[mod_num * i + 5]); - if (!(ss_4th >> this->dir_x[i][1])) { - return badValue(tname, this->name); - } - istringstream ss_5th(option_value[mod_num * i + 6]); - if (!(ss_5th >> this->dir_y[i][1])) { - return badValue(tname, this->name); - } - istringstream ss_6th(option_value[mod_num * i + 7]); - if (!(ss_6th >> this->dir_z[i][1])) { - return badValue(tname, this->name); - } - } - return ""; - } - void SetDefault() override { - this->inlet_size = 0; - this->outlet_size = 0; - this->marker_inlet = nullptr; - this->marker_outlet = nullptr; - this->dir_x = nullptr; - this->dir_y = nullptr; - this->dir_z = nullptr; - } -}; - class COptionWallFunction : public COptionBase { string name; // identifier for the option unsigned short& nMarkers; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index eb64f51ddf9..959c97e886d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -563,10 +563,10 @@ void CConfig::addActDiskBemOption(const string& name, su2double**& ActDiskBem_X, su2double**& ActDiskBem_Y, su2double**& ActDiskBem_Z) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionActDiskBem(name, - nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, - Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet, - ActDiskBem_X, ActDiskBem_Y, ActDiskBem_Z); + COptionBase* val = new COptionActDisk(name, + nMarker_ActDiskBemInlet, nMarker_ActDiskBemOutlet, + Marker_ActDiskBemInlet, Marker_ActDiskBemOutlet, + ActDiskBem_X, ActDiskBem_Y, ActDiskBem_Z); option_map.insert(pair(name, val)); } From fb364ead5f6fc92712485248d788b17f831e28c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 3 Nov 2023 12:36:35 +0100 Subject: [PATCH 071/139] Use more lock-free accesses and explicit locking. --- SU2_CFD/include/variables/CVariable.hpp | 14 ++++++++++---- SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp | 4 ++++ SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 8 ++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 050be2b7787..453dca7226b 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2170,13 +2170,19 @@ class CVariable { } inline void GetAdjointSolution_time_n(unsigned long iPoint, su2double *adj_sol) const { - for (unsigned long iVar = 0; iVar < Solution_time_n.cols(); iVar++) - adj_sol[iVar] = SU2_TYPE::GetDerivative(Solution_time_n(iPoint,iVar)); + int index = 0; + for (unsigned long iVar = 0; iVar < Solution_time_n.cols(); iVar++) { + AD::SetIndex(index, Solution_time_n(iPoint, iVar)); + adj_sol[iVar] = AD::GetDerivative(index); + } } inline void GetAdjointSolution_time_n1(unsigned long iPoint, su2double *adj_sol) const { - for (unsigned long iVar = 0; iVar < Solution_time_n1.cols(); iVar++) - adj_sol[iVar] = SU2_TYPE::GetDerivative(Solution_time_n1(iPoint,iVar)); + int index = 0; + for (unsigned long iVar = 0; iVar < Solution_time_n1.cols(); iVar++) { + AD::SetIndex(index, Solution_time_n1(iPoint, iVar)); + adj_sol[iVar] = AD::GetDerivative(index); + } } /*! diff --git a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp index 7abd17805fa..baf00a826a2 100644 --- a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp @@ -247,11 +247,15 @@ void CDiscAdjFEASolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *co /*--- Extract and store the adjoint solution at time n (including accel. and velocity) ---*/ if (config->GetTime_Domain()) { + AD::BeginUseAdjoints(); + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { su2double Solution[MAXNVAR] = {0.0}; direct_solver->GetNodes()->GetAdjointSolution_time_n(iPoint,Solution); nodes->Set_Solution_time_n(iPoint,Solution); } + + AD::EndUseAdjoints(); } /*--- Set the residuals ---*/ diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index ac9c6043097..6b8fd2a199d 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -359,6 +359,8 @@ void CDiscAdjSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *confi /*--- Extract and store the adjoint of the primal solution at time n ---*/ if (time_n_needed) { + AD::BeginUseAdjoints(); + SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { su2double Solution[MAXNVAR] = {0.0}; @@ -366,10 +368,14 @@ void CDiscAdjSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *confi nodes->Set_Solution_time_n(iPoint,Solution); } END_SU2_OMP_FOR + + AD::EndUseAdjoints(); } /*--- Extract and store the adjoint of the primal solution at time n-1 ---*/ if (time_n1_needed) { + AD::BeginUseAdjoints(); + SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { su2double Solution[MAXNVAR] = {0.0}; @@ -377,6 +383,8 @@ void CDiscAdjSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *confi nodes->Set_Solution_time_n1(iPoint,Solution); } END_SU2_OMP_FOR + + AD::EndUseAdjoints(); } } From eb844d4c1d021bda3741b0250a2caef26df938ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 3 Nov 2023 13:03:15 +0100 Subject: [PATCH 072/139] Extend comments. --- Common/include/basic_types/ad_structure.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Common/include/basic_types/ad_structure.hpp b/Common/include/basic_types/ad_structure.hpp index dd7e3691377..bbed2a91a2c 100644 --- a/Common/include/basic_types/ad_structure.hpp +++ b/Common/include/basic_types/ad_structure.hpp @@ -396,6 +396,8 @@ FORCEINLINE void SetIndex(int& index, const su2double& data) { index = data.getI // WARNING: For performance reasons, this method does not perform bounds checking. // When using it, please ensure sufficient adjoint vector size by a call to AD::ResizeAdjoints(). +// This method does not perform locking either. +// It should be safeguarded by calls to AD::BeginUseAdjoints() and AD::EndUseAdjoints(). FORCEINLINE void SetDerivative(int index, const double val) { if (index == 0) // Allow multiple threads to "set the derivative" of passive variables without causing data races. return; @@ -406,6 +408,8 @@ FORCEINLINE void SetDerivative(int index, const double val) { // WARNING: For performance reasons, this method does not perform bounds checking. // If called after tape evaluations, the adjoints should exist. // Otherwise, please ensure sufficient adjoint vector size by a call to AD::ResizeAdjoints(). +// This method does not perform locking either. +// It should be safeguarded by calls to AD::BeginUseAdjoints() and AD::EndUseAdjoints(). FORCEINLINE double GetDerivative(int index) { return AD::getTape().getGradient(index, codi::AdjointsManagement::Manual); } From 842232cf0595c7028e654886c05cc98198158f10 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sat, 4 Nov 2023 08:21:25 +0530 Subject: [PATCH 073/139] add BEM_FREQ option. move local variables in place. --- Common/include/CConfig.hpp | 14 +- Common/src/CConfig.cpp | 2 + SU2_CFD/src/solvers/CEulerSolver.cpp | 158 ++++++++++-------- .../actuatordisk_bem/actuatordisk_bem.cfg | 2 + config_template.cfg | 3 + 5 files changed, 101 insertions(+), 78 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index c9bfb36669b..da11f902606 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -354,8 +354,9 @@ class CConfig { **ActDisk_TempJump, **ActDisk_Omega; /*!< \brief Specified deltas for actuator disk.*/ su2double **ActDiskBem_CG[3]; /*!< \brief Specified center for actuator disk BEM.*/ su2double **ActDiskBem_Axis[3]; /*!< \brief Specified axis for actuator disk BEM.*/ - su2double BEM_blade_angle ; /*!< \brief Propeller blade angle.*/ - string BEM_prop_filename ; /*!< \brief Propeller filename.*/ + su2double BEM_blade_angle; /*!< \brief Propeller blade angle.*/ + string BEM_prop_filename; /*!< \brief Propeller filename.*/ + unsigned short ActDiskBem_Frequency; /*!< \brief Frequency of updating actuator disk with BEM. */ bool History_File_Append_Flag; /*!< \brief Flag to append history file.*/ su2double *ActDisk_DeltaPress; /*!< \brief Specified pressure delta for actuator disk. */ su2double *ActDisk_DeltaTemp; /*!< \brief Specified temperature delta for actuator disk. */ @@ -6675,15 +6676,20 @@ class CConfig { su2double GetActDisk_Omega(const string& val_marker, unsigned short val_index) const; /*! - * \brief Get the Center of the actuator disk. + * \brief Get the Center of the actuator disk with BEM. */ su2double GetActDiskBem_CG(unsigned short iDim, string val_marker, unsigned short val_index) const; /*! - * \brief Get the axis of the actuator disk with Blade Element Method. + * \brief Get the axis of the actuator disk with BEM. */ su2double GetActDiskBem_Axis(unsigned short iDim, string val_marker, unsigned short val_index) const; + /*! + * \brief Get the frequency of updating the actuator disk with BEM. + */ + const unsigned short& GetActDiskBem_Frequency(void) const { return ActDiskBem_Frequency; } + /*! * \brief Get the blade angle of the propeller. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 959c97e886d..a34902142cf 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1681,6 +1681,8 @@ void CConfig::SetConfig_Options() { addDoubleOption("BEM_PROP_BLADE_ANGLE", BEM_blade_angle, 23.9); /* DESCRIPTION: Propeller file name for actuator disk BEM.*/ addStringOption("BEM_PROP_FILENAME", BEM_prop_filename, string("prop_geom_alfclcd_data.txt")); + /* DESCRIPTION: Frequency for updating actuator disk with BEM.*/ + addUnsignedShortOption("BEM_FREQ", ActDiskBem_Frequency, 40); /* DESCRIPTION: Only half engine is in the computational grid */ addBoolOption("ENGINE_HALF_MODEL", Engine_HalfModel, false); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 3f263d9e375..1f9dd8e81db 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -4118,10 +4118,10 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con */ /*--- InputFile reading ---*/ - unsigned short iDim, iMarker; - unsigned long iVertex, iPoint; - string Marker_Tag; - int iSection, iAlpha; +//unsigned short iDim, iMarker; +//unsigned long iVertex, iPoint; +//string Marker_Tag; +//int iSection, iAlpha; static int ADBem_NBlade = 0, ADBem_NSection = 0, ADBem_NAlpha = 0; static su2double ADBem_Diameter = 0.0, ADBem_HubRadius = 0.0, ADBem_Angle75R = 0.0; static std::vector i_v, radius_v, chord_v, angle75r_v; @@ -4130,43 +4130,46 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con static su2double ADBem_Omega = 0.0; static su2double ADBem_CG[MAXNDIM] = {0.0, 0.0, 0.0}; static su2double ADBem_Axis[MAXNDIM] = {0.0}, ADBem_J = 0.0; + static unsigned short ADBem_Frequency = 0; /*--- BEM VLAD ---*/ const int BEM_MAX_ITER = 20; - su2double Omega_sw = 0.0, Omega_RPM = 0.0, Origin[3] = {0.0}, radius_[3] = {0.0}; - static su2double omega_ref = 0.0, Lref = 0.0; - static su2double RPM = 0.0, blade_angle = 0.0, dia = 0.0, r_tip = 0.0, rps = 0.0, radius = 0.0; - static su2double V = 0.0, rho = 0.0, T = 0.0; - static su2double Torque = 0.0, dp_av = 0.0, dp_at_r = 0.0; - static std::vector DtDr; - static su2double Target_Press_Jump = 0.0, Area = 0.0, UnitNormal[3] = {0.0}, Vn = 0.0; - static su2double Fa = 0.0, Ft = 0.0, Fr = 0.0, Fx = 0.0, Fy = 0.0, Fz = 0.0, dCp_v = 0.0, dCr_v = 0.0, rad_v = 0.0; - su2double *V_domain = 0, *Coord = 0; - static su2double loc_Torque = 0.0; - static su2double loc_thrust = 0.0; - static su2double tot_area = 0.0, tot_tq = 0.0; +//su2double Omega_sw = 0.0, Omega_RPM = 0.0, Origin[3] = {0.0}, radius_[3] = {0.0}; +//static su2double omega_ref = 0.0, Lref = 0.0; +//static su2double RPM = 0.0, blade_angle = 0.0, dia = 0.0, r_tip = 0.0, rps = 0.0, radius = 0.0; +//static su2double V = 0.0, rho = 0.0, T = 0.0; +//static su2double Torque = 0.0, dp_av = 0.0, dp_at_r = 0.0; +//static std::vector DtDr; +//static su2double Target_Press_Jump = 0.0, Area = 0.0, UnitNormal[3] = {0.0}, Vn = 0.0; +//static su2double Fa = 0.0, Ft = 0.0, Fr = 0.0, Fx = 0.0, Fy = 0.0, Fz = 0.0, dCp_v = 0.0, dCr_v = 0.0, rad_v = 0.0; +//su2double *V_domain = 0, *Coord = 0; +//static su2double loc_Torque = 0.0; +//static su2double loc_thrust = 0.0; +//static su2double tot_area = 0.0, tot_tq = 0.0; unsigned long InnerIter = config->GetInnerIter(); su2double Dens_FreeStream = config->GetDensity_FreeStream(); const su2double* Vel_FreeStream = config->GetVelocity_FreeStream(); /*--- Input file provides force coefficients distributions along disk radius. - Initialization necessary only at initial iteration. ---*/ - if (InnerIter == 0) { - /*--- Get the RPM, CG and Axis from config. ---*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + Initialization necessary only at initial iteration (InnerIter == 0) + when the tables (radius_v, chord_v, ...) are empty. ---*/ + if (radius_v.empty()) { + /*--- Get the RPM, CG, Axis and Frequency from config. ---*/ + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { - Marker_Tag = config->GetMarker_All_TagBound(iMarker); + const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); ADBem_Omega = config->GetActDisk_Omega(Marker_Tag, 0); - for (iDim = 0; iDim < nDim; iDim++) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) { ADBem_CG[iDim] = config->GetActDiskBem_CG(iDim, Marker_Tag, 0); ADBem_Axis[iDim] = config->GetActDiskBem_Axis(iDim, Marker_Tag, 0); } } } + ADBem_Frequency = config->GetActDiskBem_Frequency(); /*--- Get the file name that contains the propeller data. ---*/ string ActDiskBem_filename = config->GetBEM_prop_filename(); @@ -4215,7 +4218,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con getline(ActDiskBem_file, text_line_appo); /*--- Read and assign the values of the propeller blade section's id, radius, chord, angle75R. ---*/ - for (iSection = 0; iSection < ADBem_NSection; iSection++) { + for (int iSection = 0; iSection < ADBem_NSection; iSection++) { getline(ActDiskBem_file, text_line_appo); istringstream sectionStream(text_line_appo); sectionStream >> i_v[iSection] >> radius_v[iSection] >> chord_v[iSection] >> angle75r_v[iSection]; @@ -4227,9 +4230,9 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con cd_m.resize(ADBem_NAlpha, std::vector(ADBem_NSection, 0.0)); /*--- Read and assign the values for each of the propeller blade section's alpha, cl, cd. ---*/ - for (iSection = 0; iSection < ADBem_NSection; iSection++) { + for (int iSection = 0; iSection < ADBem_NSection; iSection++) { getline(ActDiskBem_file, text_line_appo); - for (iAlpha = 0; iAlpha < ADBem_NAlpha; iAlpha++) { + for (int iAlpha = 0; iAlpha < ADBem_NAlpha; iAlpha++) { getline(ActDiskBem_file, text_line_appo); istringstream alphaStream(text_line_appo); alphaStream >> alpha_m[iAlpha][iSection] >> cl_m[iAlpha][iSection] >> cd_m[iAlpha][iSection]; @@ -4237,81 +4240,89 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con } } - /*--- Update the propeller load according to the modified flow field after every 40 inner iterations. ---*/ - if (InnerIter % 40 == 0) { - dia = ADBem_Diameter; - r_tip = 0.5 * dia; + /*--- Update the propeller load according to the modified flow field after every ADBem_Frequency inner iterations. ---*/ + if (InnerIter % ADBem_Frequency != 0) return; + const su2double dia = ADBem_Diameter; + const su2double r_tip = 0.5 * dia; + su2double loc_Torque = 0.0; + su2double loc_thrust = 0.0; + su2double tot_area = 0.0, tot_tq = 0.0; su2double Normal[MAXNDIM]; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + for (unsigned long iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + const unsigned long iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); /*--- Read Swirl params. ---*/ - Omega_RPM = ADBem_Omega; - omega_ref = config->GetOmega_Ref(); - Lref = config->GetLength_Ref(); - Omega_sw = Omega_RPM * (PI_NUMBER / 30.0) / (omega_ref); // Swirl rate + const su2double Omega_RPM = ADBem_Omega; + const su2double omega_ref = config->GetOmega_Ref(); + const su2double Lref = config->GetLength_Ref(); + const su2double Omega_sw = Omega_RPM * (PI_NUMBER / 30.0) / (omega_ref); // Swirl rate /*--- Center of the rotor ---*/ - for (iDim = 0; iDim < nDim; iDim++) { + su2double Origin[3] = {0.0, 0.0, 0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { Origin[iDim] = ADBem_CG[iDim] / Lref; } /*--- Compute the distance to the center of the rotor ---*/ geometry->vertex[iMarker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) { Normal[iDim] = -Normal[iDim]; } /*--- Get propeller axis from config file. ---*/ - for (iDim = 0; iDim < nDim; iDim++){ + for (unsigned short iDim = 0; iDim < nDim; iDim++){ ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; } - Area = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + su2double Area = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { Area += Normal[iDim] * Normal[iDim]; } Area = sqrt(Area); - for (iDim = 0; iDim < nDim; iDim++) { + su2double UnitNormal[3] = {0.0, 0.0, 0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { UnitNormal[iDim] = Normal[iDim] / Area; } - if (geometry->nodes->GetDomain(iPoint)) { - Coord = geometry->nodes->GetCoord(iPoint); - } + const su2double* Coord = geometry->nodes->GetCoord(iPoint); + //if (geometry->nodes->GetDomain(iPoint)) { + // Coord = geometry->nodes->GetCoord(iPoint); + //} - radius = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + su2double radius = 0.0; + su2double radius_[3] = {0.0, 0.0, 0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { radius += (Coord[iDim] - Origin[iDim]) * (Coord[iDim] - Origin[iDim]); radius_[iDim] = (Coord[iDim] - Origin[iDim]); } radius = sqrt(radius); /*--- Current solution at this boundary node and jumps values ---*/ - V_domain = nodes->GetPrimitive(iPoint); + const su2double* V_domain = nodes->GetPrimitive(iPoint); if (abs(Omega_sw) > 1.0e-1) { - Vn = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + su2double Vn = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { Vn += V_domain[iDim + 1] * UnitNormal[iDim]; } - RPM = abs(Omega_RPM); - rps = RPM / 60.0; + const su2double RPM = abs(Omega_RPM); + const su2double rps = RPM / 60.0; ADBem_J = Vel_FreeStream[0] / (rps * dia); - rho = V_domain[nDim + 2]; - T = V_domain[0]; - blade_angle = config->GetBEM_blade_angle(); - V = config->GetModVel_FreeStream(); - V = fabs(Vn); + const su2double rho = V_domain[nDim + 2]; + const su2double T = V_domain[0]; + const su2double blade_angle = config->GetBEM_blade_angle(); + //const su2double V = config->GetModVel_FreeStream(); + const su2double V = fabs(Vn); /*--- BEM model without parameter 'a' (ref?) ---*/ + su2double Torque = 0.0, dp_av = 0.0, dp_at_r = 0.0; { - DtDr.resize(ADBem_NSection, 0.0); + std::vector DtDr(ADBem_NSection, 0.0); int s_prop_nblades = ADBem_NBlade; int sprop_sec_nalf = ADBem_NAlpha; @@ -4339,9 +4350,9 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double ang_offset = 0.0; radtodeg = 180.0 / M_PI; - dia = ADBem_Diameter; + const su2double dia = ADBem_Diameter; r_hub = ADBem_HubRadius; - r_tip = 0.5 * dia; + const su2double r_tip = 0.5 * dia; ang_offset = blade_angle - ADBem_Angle75R; alpha_corr = 0.0; @@ -4502,25 +4513,25 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con loc_Torque += Torque * Area; tot_tq += dp_av; loc_thrust += dp_at_r * Area; - Target_Press_Jump = dp_at_r; + const su2double Target_Press_Jump = dp_at_r; ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; ActDisk_Torque_r[iMarker][iVertex] = Torque / (2 * M_PI * radius); /*--- Non-dimensionalize the elemental load. ---*/ - dCp_v = Torque * ((Omega_sw * r_tip) / (rho * rps * rps * rps * pow(dia, 5))); + const su2double dCp_v = Torque * ((Omega_sw * r_tip) / (rho * rps * rps * rps * pow(dia, 5))); /*--- Force radial load to 0 as there is no information of radial load from BEM. ---*/ - dCr_v = 0.0; - rad_v = radius / r_tip; - Fa = dp_at_r; - Ft = (dCp_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / - ((ADBem_J * PI_NUMBER * rad_v) * (ADBem_J * PI_NUMBER * rad_v))) / - config->GetPressure_Ref(); - Fr = (dCr_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / (pow(ADBem_J, 2) * PI_NUMBER * rad_v)) / - config->GetPressure_Ref(); - Fx = (Ft + Fr) * (radius_[0] / (radius)); - Fy = (Ft + Fr) * (radius_[2] / (radius)); - Fz = -(Ft + Fr) * (radius_[1] / (radius)); + const su2double dCr_v = 0.0; + const su2double rad_v = radius / r_tip; + const su2double Fa = dp_at_r; + const su2double Ft = (dCp_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / + ((ADBem_J * PI_NUMBER * rad_v) * (ADBem_J * PI_NUMBER * rad_v))) / + config->GetPressure_Ref(); + const su2double Fr = (dCr_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / + (pow(ADBem_J, 2) * PI_NUMBER * rad_v)) / config->GetPressure_Ref(); + const su2double Fx = (Ft + Fr) * (radius_[0] / (radius)); + const su2double Fy = (Ft + Fr) * (radius_[2] / (radius)); + const su2double Fz = -(Ft + Fr) * (radius_[1] / (radius)); ActDisk_Fa_BEM[iMarker][iVertex] = Fa; ActDisk_Fx_BEM[iMarker][iVertex] = Fx; ActDisk_Fy_BEM[iMarker][iVertex] = Fy; @@ -4529,7 +4540,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con } } } - } } void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index c372a22f735..fe548b4e284 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -116,6 +116,8 @@ MARKER_ACTDISK_BEM_AXIS= ( ACTDISK_IN, ACTDISK_OUT, 1.0, 0.0, 0.0, 1.0, 0.0, 0. BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt % Propeller blade angle (Degrees) at 0.75*Radius for the current calculation BEM_PROP_BLADE_ANGLE = 23.9 +% BEM calculation frequency +BEM_FREQ = 40 % % Far-field boundary marker(s) (NONE = no marker) MARKER_FAR= ( Farfield ) diff --git a/config_template.cfg b/config_template.cfg index 7bba2009560..774d55875e8 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -965,6 +965,9 @@ BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt % Propeller blade angle (degrees) at (0.75 * radius) BEM_PROP_BLADE_ANGLE = 25.0 % +% BEM calculation frequency +BEM_FREQ = 40 +% % Supersonic inlet boundary marker(s) (NONE = no marker) % Format: (inlet marker, temperature, static pressure, velocity_x, % velocity_y, velocity_z, ... ), i.e. primitive variables specified. From dda8ca0a6ebd05b4e6f653bb6d0c57ab962e7800 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sat, 4 Nov 2023 08:31:26 +0530 Subject: [PATCH 074/139] comment and indentation cleanup --- SU2_CFD/src/solvers/CEulerSolver.cpp | 531 +++++++++++++-------------- 1 file changed, 256 insertions(+), 275 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 1f9dd8e81db..c0a1b2f853a 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -4118,10 +4118,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con */ /*--- InputFile reading ---*/ -//unsigned short iDim, iMarker; -//unsigned long iVertex, iPoint; -//string Marker_Tag; -//int iSection, iAlpha; static int ADBem_NBlade = 0, ADBem_NSection = 0, ADBem_NAlpha = 0; static su2double ADBem_Diameter = 0.0, ADBem_HubRadius = 0.0, ADBem_Angle75R = 0.0; static std::vector i_v, radius_v, chord_v, angle75r_v; @@ -4134,18 +4130,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- BEM VLAD ---*/ const int BEM_MAX_ITER = 20; -//su2double Omega_sw = 0.0, Omega_RPM = 0.0, Origin[3] = {0.0}, radius_[3] = {0.0}; -//static su2double omega_ref = 0.0, Lref = 0.0; -//static su2double RPM = 0.0, blade_angle = 0.0, dia = 0.0, r_tip = 0.0, rps = 0.0, radius = 0.0; -//static su2double V = 0.0, rho = 0.0, T = 0.0; -//static su2double Torque = 0.0, dp_av = 0.0, dp_at_r = 0.0; -//static std::vector DtDr; -//static su2double Target_Press_Jump = 0.0, Area = 0.0, UnitNormal[3] = {0.0}, Vn = 0.0; -//static su2double Fa = 0.0, Ft = 0.0, Fr = 0.0, Fx = 0.0, Fy = 0.0, Fz = 0.0, dCp_v = 0.0, dCr_v = 0.0, rad_v = 0.0; -//su2double *V_domain = 0, *Coord = 0; -//static su2double loc_Torque = 0.0; -//static su2double loc_thrust = 0.0; -//static su2double tot_area = 0.0, tot_tq = 0.0; unsigned long InnerIter = config->GetInnerIter(); su2double Dens_FreeStream = config->GetDensity_FreeStream(); @@ -4242,304 +4226,301 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con /*--- Update the propeller load according to the modified flow field after every ADBem_Frequency inner iterations. ---*/ if (InnerIter % ADBem_Frequency != 0) return; - const su2double dia = ADBem_Diameter; - const su2double r_tip = 0.5 * dia; - su2double loc_Torque = 0.0; - su2double loc_thrust = 0.0; - su2double tot_area = 0.0, tot_tq = 0.0; + const su2double dia = ADBem_Diameter; + const su2double r_tip = 0.5 * dia; + su2double loc_Torque = 0.0; + su2double loc_thrust = 0.0; + su2double tot_area = 0.0, tot_tq = 0.0; - su2double Normal[MAXNDIM]; - for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || - (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { - for (unsigned long iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - const unsigned long iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + su2double Normal[MAXNDIM]; + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || + (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { + for (unsigned long iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + const unsigned long iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - /*--- Read Swirl params. ---*/ - const su2double Omega_RPM = ADBem_Omega; - const su2double omega_ref = config->GetOmega_Ref(); - const su2double Lref = config->GetLength_Ref(); - const su2double Omega_sw = Omega_RPM * (PI_NUMBER / 30.0) / (omega_ref); // Swirl rate + /*--- Read Swirl params. ---*/ + const su2double Omega_RPM = ADBem_Omega; + const su2double omega_ref = config->GetOmega_Ref(); + const su2double Lref = config->GetLength_Ref(); + const su2double Omega_sw = Omega_RPM * (PI_NUMBER / 30.0) / (omega_ref); // Swirl rate - /*--- Center of the rotor ---*/ - su2double Origin[3] = {0.0, 0.0, 0.0}; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Origin[iDim] = ADBem_CG[iDim] / Lref; - } + /*--- Center of the rotor ---*/ + su2double Origin[3] = {0.0, 0.0, 0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + Origin[iDim] = ADBem_CG[iDim] / Lref; + } - /*--- Compute the distance to the center of the rotor ---*/ - geometry->vertex[iMarker][iVertex]->GetNormal(Normal); - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Normal[iDim] = -Normal[iDim]; - } + /*--- Compute the distance to the center of the rotor ---*/ + geometry->vertex[iMarker][iVertex]->GetNormal(Normal); + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + Normal[iDim] = -Normal[iDim]; + } - /*--- Get propeller axis from config file. ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++){ - ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; - } - su2double Area = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Area += Normal[iDim] * Normal[iDim]; - } - Area = sqrt(Area); + /*--- Get propeller axis from config file. ---*/ + for (unsigned short iDim = 0; iDim < nDim; iDim++){ + ActDisk_Axis(iMarker, iDim) = ADBem_Axis[iDim]; + } + su2double Area = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + Area += Normal[iDim] * Normal[iDim]; + } + Area = sqrt(Area); - su2double UnitNormal[3] = {0.0, 0.0, 0.0}; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - UnitNormal[iDim] = Normal[iDim] / Area; - } + su2double UnitNormal[3] = {0.0, 0.0, 0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + UnitNormal[iDim] = Normal[iDim] / Area; + } - const su2double* Coord = geometry->nodes->GetCoord(iPoint); - //if (geometry->nodes->GetDomain(iPoint)) { - // Coord = geometry->nodes->GetCoord(iPoint); - //} + const su2double* Coord = geometry->nodes->GetCoord(iPoint); - su2double radius = 0.0; - su2double radius_[3] = {0.0, 0.0, 0.0}; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - radius += (Coord[iDim] - Origin[iDim]) * (Coord[iDim] - Origin[iDim]); - radius_[iDim] = (Coord[iDim] - Origin[iDim]); - } - radius = sqrt(radius); + su2double radius = 0.0; + su2double radius_[3] = {0.0, 0.0, 0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + radius += (Coord[iDim] - Origin[iDim]) * (Coord[iDim] - Origin[iDim]); + radius_[iDim] = (Coord[iDim] - Origin[iDim]); + } + radius = sqrt(radius); - /*--- Current solution at this boundary node and jumps values ---*/ - const su2double* V_domain = nodes->GetPrimitive(iPoint); + /*--- Current solution at this boundary node and jumps values ---*/ + const su2double* V_domain = nodes->GetPrimitive(iPoint); - if (abs(Omega_sw) > 1.0e-1) { - su2double Vn = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Vn += V_domain[iDim + 1] * UnitNormal[iDim]; - } + if (abs(Omega_sw) > 1.0e-1) { + su2double Vn = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + Vn += V_domain[iDim + 1] * UnitNormal[iDim]; + } - const su2double RPM = abs(Omega_RPM); - const su2double rps = RPM / 60.0; - ADBem_J = Vel_FreeStream[0] / (rps * dia); - const su2double rho = V_domain[nDim + 2]; - const su2double T = V_domain[0]; - const su2double blade_angle = config->GetBEM_blade_angle(); - //const su2double V = config->GetModVel_FreeStream(); - const su2double V = fabs(Vn); - - /*--- BEM model without parameter 'a' (ref?) ---*/ - su2double Torque = 0.0, dp_av = 0.0, dp_at_r = 0.0; - { - std::vector DtDr(ADBem_NSection, 0.0); - - int s_prop_nblades = ADBem_NBlade; - int sprop_sec_nalf = ADBem_NAlpha; - int sprop_sec_nrad = ADBem_NSection; - std::vector& sprop_sec_r1 = radius_v; - std::vector& sprop_sec_chord = chord_v; - std::vector& sprop_sec_setangle = angle75r_v; - std::vector >& sprop_sec_alf = alpha_m; - std::vector >& sprop_sec_cl_arr = cl_m; - std::vector >& sprop_sec_cd_arr = cd_m; - - su2double rad_p = radius; - - int j, isec, converged, n_iter; - int NR = sprop_sec_nrad; - su2double r_hub, alpha_corr, cl_corr_fac; - su2double base_mach, s_mach, b_num, thrust, torque; - su2double r_dash, t_loss, c_phi, rad, phi, alpha, radtodeg; - su2double bnew, V0, V2, cl = 0.0, cd = 0.0, Vlocal, DqDr = 0.0, tem1, tem2, q; - std::vector delta_r(ADBem_NSection, 0.0); - std::vector b(ADBem_NSection, 0.0); - static std::vector Dtorq(ADBem_NSection, 0.0); - - su2double n, omega, a0, den; - su2double ang_offset = 0.0; - - radtodeg = 180.0 / M_PI; - const su2double dia = ADBem_Diameter; - r_hub = ADBem_HubRadius; - const su2double r_tip = 0.5 * dia; - ang_offset = blade_angle - ADBem_Angle75R; - - alpha_corr = 0.0; - base_mach = 0.22; - b_num = sqrt(1.0 - base_mach * base_mach); - a0 = sqrt(1.4 * 287 * T); - /*--- Change pitch by ang_offset and calculate delta_r for integration by trapezoidal rule. ---*/ - n = RPM / 60.0; - omega = n * 2.0 * M_PI; - - for (j = 0; j < NR; j++) { - if (j < 1) { - delta_r[j] = sprop_sec_r1[j + 1] - r_hub; + const su2double RPM = abs(Omega_RPM); + const su2double rps = RPM / 60.0; + ADBem_J = Vel_FreeStream[0] / (rps * dia); + const su2double rho = V_domain[nDim + 2]; + const su2double T = V_domain[0]; + const su2double blade_angle = config->GetBEM_blade_angle(); + //const su2double V = config->GetModVel_FreeStream(); + const su2double V = fabs(Vn); + + /*--- BEM model without parameter 'a' (ref?) ---*/ + su2double Torque = 0.0, dp_av = 0.0, dp_at_r = 0.0; + { + std::vector DtDr(ADBem_NSection, 0.0); + + int s_prop_nblades = ADBem_NBlade; + int sprop_sec_nalf = ADBem_NAlpha; + int sprop_sec_nrad = ADBem_NSection; + std::vector& sprop_sec_r1 = radius_v; + std::vector& sprop_sec_chord = chord_v; + std::vector& sprop_sec_setangle = angle75r_v; + std::vector >& sprop_sec_alf = alpha_m; + std::vector >& sprop_sec_cl_arr = cl_m; + std::vector >& sprop_sec_cd_arr = cd_m; + + su2double rad_p = radius; + + int j, isec, converged, n_iter; + int NR = sprop_sec_nrad; + su2double r_hub, alpha_corr, cl_corr_fac; + su2double base_mach, s_mach, b_num, thrust, torque; + su2double r_dash, t_loss, c_phi, rad, phi, alpha, radtodeg; + su2double bnew, V0, V2, cl = 0.0, cd = 0.0, Vlocal, DqDr = 0.0, tem1, tem2, q; + std::vector delta_r(ADBem_NSection, 0.0); + std::vector b(ADBem_NSection, 0.0); + static std::vector Dtorq(ADBem_NSection, 0.0); + + su2double n, omega, a0, den; + su2double ang_offset = 0.0; + + radtodeg = 180.0 / M_PI; + const su2double dia = ADBem_Diameter; + r_hub = ADBem_HubRadius; + const su2double r_tip = 0.5 * dia; + ang_offset = blade_angle - ADBem_Angle75R; + + alpha_corr = 0.0; + base_mach = 0.22; + b_num = sqrt(1.0 - base_mach * base_mach); + a0 = sqrt(1.4 * 287 * T); + /*--- Change pitch by ang_offset and calculate delta_r for integration by trapezoidal rule. ---*/ + n = RPM / 60.0; + omega = n * 2.0 * M_PI; + + for (j = 0; j < NR; j++) { + if (j < 1) { + delta_r[j] = sprop_sec_r1[j + 1] - r_hub; + } else { + if (j < NR - 1) { + delta_r[j] = sprop_sec_r1[j + 1] - sprop_sec_r1[j - 1]; } else { - if (j < NR - 1) { - delta_r[j] = sprop_sec_r1[j + 1] - sprop_sec_r1[j - 1]; - } else { - delta_r[j] = r_tip - sprop_sec_r1[j - 1]; - } + delta_r[j] = r_tip - sprop_sec_r1[j - 1]; } - delta_r[j] *= 0.5; } + delta_r[j] *= 0.5; + } - thrust = 0.0; - torque = 0.0; - - for (j = 0; j < NR; j++) { - b[j] = 0.01; - converged = 0; - n_iter = 1; - while (converged == 0) { - V2 = omega * sprop_sec_r1[j] * (1 - b[j]); - V0 = V; - - phi = atan2(V0, V2); - - alpha = sprop_sec_setangle[j] + ang_offset - radtodeg * phi + alpha_corr; - rad = sprop_sec_r1[j]; - - /*--- get cl, cd from lookup table. ---*/ - isec = j + 1; - { - int i, salf = 0; - su2double fact; - - /*--- interpolating values of cl and cd for given alpha. ---*/ - if (alpha >= sprop_sec_alf[salf][isec - 1] && - alpha <= sprop_sec_alf[sprop_sec_nalf - 1][isec - 1]) { - for (i = 0; i < sprop_sec_nalf - 1; i++) { - if (alpha >= sprop_sec_alf[i][isec - 1] && alpha <= sprop_sec_alf[i + 1][isec - 1]) { - fact = (alpha - sprop_sec_alf[i][isec - 1]) - / (sprop_sec_alf[i + 1][isec - 1] - sprop_sec_alf[i][isec - 1]); - cl = sprop_sec_cl_arr[i][isec - 1] - + fact * (sprop_sec_cl_arr[i + 1][isec - 1] - sprop_sec_cl_arr[i][isec - 1]); - cd = sprop_sec_cd_arr[i][isec - 1] - + fact * (sprop_sec_cd_arr[i + 1][isec - 1] - sprop_sec_cd_arr[i][isec - 1]); - } - } - } else { - if (alpha < sprop_sec_alf[salf][isec - 1]) { - cl = sprop_sec_cl_arr[0][isec - 1]; - cd = sprop_sec_cd_arr[0][isec - 1]; - } - if (alpha > sprop_sec_alf[sprop_sec_nalf - 1][isec - 1]) { - cl = sprop_sec_cl_arr[sprop_sec_nalf - 1][isec - 1]; - cd = sprop_sec_cd_arr[sprop_sec_nalf - 1][isec - 1]; + thrust = 0.0; + torque = 0.0; + + for (j = 0; j < NR; j++) { + b[j] = 0.01; + converged = 0; + n_iter = 1; + while (converged == 0) { + V2 = omega * sprop_sec_r1[j] * (1 - b[j]); + V0 = V; + + phi = atan2(V0, V2); + + alpha = sprop_sec_setangle[j] + ang_offset - radtodeg * phi + alpha_corr; + rad = sprop_sec_r1[j]; + + /*--- get cl, cd from lookup table. ---*/ + isec = j + 1; + { + int i, salf = 0; + su2double fact; + + /*--- interpolating values of cl and cd for given alpha. ---*/ + if (alpha >= sprop_sec_alf[salf][isec - 1] && + alpha <= sprop_sec_alf[sprop_sec_nalf - 1][isec - 1]) { + for (i = 0; i < sprop_sec_nalf - 1; i++) { + if (alpha >= sprop_sec_alf[i][isec - 1] && alpha <= sprop_sec_alf[i + 1][isec - 1]) { + fact = (alpha - sprop_sec_alf[i][isec - 1]) + / (sprop_sec_alf[i + 1][isec - 1] - sprop_sec_alf[i][isec - 1]); + cl = sprop_sec_cl_arr[i][isec - 1] + + fact * (sprop_sec_cl_arr[i + 1][isec - 1] - sprop_sec_cl_arr[i][isec - 1]); + cd = sprop_sec_cd_arr[i][isec - 1] + + fact * (sprop_sec_cd_arr[i + 1][isec - 1] - sprop_sec_cd_arr[i][isec - 1]); } } + } else { + if (alpha < sprop_sec_alf[salf][isec - 1]) { + cl = sprop_sec_cl_arr[0][isec - 1]; + cd = sprop_sec_cd_arr[0][isec - 1]; + } + if (alpha > sprop_sec_alf[sprop_sec_nalf - 1][isec - 1]) { + cl = sprop_sec_cl_arr[sprop_sec_nalf - 1][isec - 1]; + cd = sprop_sec_cd_arr[sprop_sec_nalf - 1][isec - 1]; + } } + } - Vlocal = sqrt(V0 * V0 + V2 * V2); - q = 0.5 * rho * Vlocal * Vlocal; - s_mach = Vlocal / a0; - cl_corr_fac = 1.0; - if (s_mach > base_mach) { - den = 1.0 - s_mach * s_mach; - if (den > 0.0) cl_corr_fac = b_num / sqrt(den); - } - cl *= cl_corr_fac; - - /*--- tip loss factor. ---*/ - r_dash = rad / r_tip + 1.0e-5; - c_phi = cos(phi); - t_loss = 1.0; - if (r_dash > 0.90) { - t_loss = (2.0 / M_PI) * acos(exp(-(1.0 * s_prop_nblades * (1 - r_dash) / (r_dash * c_phi)))); - } + Vlocal = sqrt(V0 * V0 + V2 * V2); + q = 0.5 * rho * Vlocal * Vlocal; + s_mach = Vlocal / a0; + cl_corr_fac = 1.0; + if (s_mach > base_mach) { + den = 1.0 - s_mach * s_mach; + if (den > 0.0) cl_corr_fac = b_num / sqrt(den); + } + cl *= cl_corr_fac; + + /*--- tip loss factor. ---*/ + r_dash = rad / r_tip + 1.0e-5; + c_phi = cos(phi); + t_loss = 1.0; + if (r_dash > 0.90) { + t_loss = (2.0 / M_PI) * acos(exp(-(1.0 * s_prop_nblades * (1 - r_dash) / (r_dash * c_phi)))); + } - DtDr[j] = q * s_prop_nblades * sprop_sec_chord[j] * (cl * cos(phi) - cd * sin(phi)); - DqDr = q * s_prop_nblades * sprop_sec_chord[j] * rad * (cd * cos(phi) + cl * sin(phi)); + DtDr[j] = q * s_prop_nblades * sprop_sec_chord[j] * (cl * cos(phi) - cd * sin(phi)); + DqDr = q * s_prop_nblades * sprop_sec_chord[j] * rad * (cd * cos(phi) + cl * sin(phi)); - DtDr[j] *= t_loss; - DqDr *= t_loss; + DtDr[j] *= t_loss; + DqDr *= t_loss; - tem2 = DqDr / (4.0 * M_PI * rad * rad * rad * rho * V * omega); - bnew = 0.6 * b[j] + 0.4 * tem2; - if (bnew > 0.9) bnew = 0.9; - if (fabs(bnew - b[j]) < 1.0e-5) { - converged = 1; - } - if (bnew < 0.1) { - b[j] = bnew; - } - n_iter++; - if (n_iter > BEM_MAX_ITER) { - converged = 1; - } + tem2 = DqDr / (4.0 * M_PI * rad * rad * rad * rho * V * omega); + bnew = 0.6 * b[j] + 0.4 * tem2; + if (bnew > 0.9) bnew = 0.9; + if (fabs(bnew - b[j]) < 1.0e-5) { + converged = 1; + } + if (bnew < 0.1) { + b[j] = bnew; + } + n_iter++; + if (n_iter > BEM_MAX_ITER) { + converged = 1; } - thrust = thrust + DtDr[j] * delta_r[j]; - torque = torque + DqDr * delta_r[j]; - Dtorq[j] = DqDr; } + thrust = thrust + DtDr[j] * delta_r[j]; + torque = torque + DqDr * delta_r[j]; + Dtorq[j] = DqDr; + } - tem1 = rho * n * n * dia * dia * dia * dia; - tem2 = tem1 * dia; + tem1 = rho * n * n * dia * dia * dia * dia; + tem2 = tem1 * dia; - Torque = 2.0 * M_PI * torque; - dp_av = 2.0 * M_PI * torque; + Torque = 2.0 * M_PI * torque; + dp_av = 2.0 * M_PI * torque; - for (j = 0; j < NR; j++) { - DtDr[j] /= (2.0 * M_PI * sprop_sec_r1[j]); - Dtorq[j] = Dtorq[j]; - } + for (j = 0; j < NR; j++) { + DtDr[j] /= (2.0 * M_PI * sprop_sec_r1[j]); + Dtorq[j] = Dtorq[j]; + } - if (rad_p < sprop_sec_r1[0]) { - tem2 = sprop_sec_r1[0] - r_hub; - tem1 = (rad_p - r_hub) / tem2; - tem2 = 1.0 - tem1; - dp_at_r = DtDr[0] * tem1; - Torque = Dtorq[0] * tem1; + if (rad_p < sprop_sec_r1[0]) { + tem2 = sprop_sec_r1[0] - r_hub; + tem1 = (rad_p - r_hub) / tem2; + tem2 = 1.0 - tem1; + dp_at_r = DtDr[0] * tem1; + Torque = Dtorq[0] * tem1; + } else { + if (rad_p > r_tip) { + dp_at_r = 0.0; + Torque = 0.0; } else { - if (rad_p > r_tip) { - dp_at_r = 0.0; - Torque = 0.0; + if (rad_p > sprop_sec_r1[NR - 1]) { + tem2 = r_tip - sprop_sec_r1[NR - 1]; + tem1 = (rad_p - sprop_sec_r1[NR - 1]) / tem2; + tem2 = 1.0 - tem1; + dp_at_r = DtDr[NR - 1] * tem2; + Torque = Dtorq[NR - 1] * tem2; } else { - if (rad_p > sprop_sec_r1[NR - 1]) { - tem2 = r_tip - sprop_sec_r1[NR - 1]; - tem1 = (rad_p - sprop_sec_r1[NR - 1]) / tem2; - tem2 = 1.0 - tem1; - dp_at_r = DtDr[NR - 1] * tem2; - Torque = Dtorq[NR - 1] * tem2; - } else { - for (j = 0; j < NR - 1; j++) { - if ((sprop_sec_r1[j] < rad_p) && (sprop_sec_r1[j + 1] >= rad_p)) { - tem2 = sprop_sec_r1[j + 1] - sprop_sec_r1[j]; - tem1 = (rad_p - sprop_sec_r1[j]) / tem2; - tem2 = 1.0 - tem1; - dp_at_r = DtDr[j] * tem2 + DtDr[j + 1] * tem1; - Torque = Dtorq[j] * tem2 + Dtorq[j + 1] * tem1; - } + for (j = 0; j < NR - 1; j++) { + if ((sprop_sec_r1[j] < rad_p) && (sprop_sec_r1[j + 1] >= rad_p)) { + tem2 = sprop_sec_r1[j + 1] - sprop_sec_r1[j]; + tem1 = (rad_p - sprop_sec_r1[j]) / tem2; + tem2 = 1.0 - tem1; + dp_at_r = DtDr[j] * tem2 + DtDr[j + 1] * tem1; + Torque = Dtorq[j] * tem2 + Dtorq[j + 1] * tem1; } } } } } - - tot_area += Area; - loc_Torque += Torque * Area; - tot_tq += dp_av; - loc_thrust += dp_at_r * Area; - const su2double Target_Press_Jump = dp_at_r; - - ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; - ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; - ActDisk_Torque_r[iMarker][iVertex] = Torque / (2 * M_PI * radius); - /*--- Non-dimensionalize the elemental load. ---*/ - const su2double dCp_v = Torque * ((Omega_sw * r_tip) / (rho * rps * rps * rps * pow(dia, 5))); - /*--- Force radial load to 0 as there is no information of radial load from BEM. ---*/ - const su2double dCr_v = 0.0; - const su2double rad_v = radius / r_tip; - const su2double Fa = dp_at_r; - const su2double Ft = (dCp_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / - ((ADBem_J * PI_NUMBER * rad_v) * (ADBem_J * PI_NUMBER * rad_v))) / - config->GetPressure_Ref(); - const su2double Fr = (dCr_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / - (pow(ADBem_J, 2) * PI_NUMBER * rad_v)) / config->GetPressure_Ref(); - const su2double Fx = (Ft + Fr) * (radius_[0] / (radius)); - const su2double Fy = (Ft + Fr) * (radius_[2] / (radius)); - const su2double Fz = -(Ft + Fr) * (radius_[1] / (radius)); - ActDisk_Fa_BEM[iMarker][iVertex] = Fa; - ActDisk_Fx_BEM[iMarker][iVertex] = Fx; - ActDisk_Fy_BEM[iMarker][iVertex] = Fy; - ActDisk_Fz_BEM[iMarker][iVertex] = Fz; } + + tot_area += Area; + loc_Torque += Torque * Area; + tot_tq += dp_av; + loc_thrust += dp_at_r * Area; + const su2double Target_Press_Jump = dp_at_r; + + ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; + ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; + ActDisk_Torque_r[iMarker][iVertex] = Torque / (2 * M_PI * radius); + /*--- Non-dimensionalize the elemental load. ---*/ + const su2double dCp_v = Torque * ((Omega_sw * r_tip) / (rho * rps * rps * rps * pow(dia, 5))); + /*--- Force radial load to 0 as there is no information of radial load from BEM. ---*/ + const su2double dCr_v = 0.0; + const su2double rad_v = radius / r_tip; + const su2double Fa = dp_at_r; + const su2double Ft = (dCp_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / + ((ADBem_J * PI_NUMBER * rad_v) * (ADBem_J * PI_NUMBER * rad_v))) / + config->GetPressure_Ref(); + const su2double Fr = (dCr_v * (2 * Dens_FreeStream * pow(Vel_FreeStream[0], 2)) / + (pow(ADBem_J, 2) * PI_NUMBER * rad_v)) / config->GetPressure_Ref(); + const su2double Fx = (Ft + Fr) * (radius_[0] / (radius)); + const su2double Fy = (Ft + Fr) * (radius_[2] / (radius)); + const su2double Fz = -(Ft + Fr) * (radius_[1] / (radius)); + ActDisk_Fa_BEM[iMarker][iVertex] = Fa; + ActDisk_Fx_BEM[iMarker][iVertex] = Fx; + ActDisk_Fy_BEM[iMarker][iVertex] = Fy; + ActDisk_Fz_BEM[iMarker][iVertex] = Fz; } } } + } } void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, From c5a4a3880bd74618ab3e2d12ff1213fe37dd0bc8 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sat, 4 Nov 2023 13:43:54 +0530 Subject: [PATCH 075/139] clear github warning --- SU2_CFD/src/solvers/CEulerSolver.cpp | 3 --- externals/codi | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index c0a1b2f853a..e82b1c2c893 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -4297,7 +4297,6 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con const su2double rho = V_domain[nDim + 2]; const su2double T = V_domain[0]; const su2double blade_angle = config->GetBEM_blade_angle(); - //const su2double V = config->GetModVel_FreeStream(); const su2double V = fabs(Vn); /*--- BEM model without parameter 'a' (ref?) ---*/ @@ -4331,9 +4330,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double ang_offset = 0.0; radtodeg = 180.0 / M_PI; - const su2double dia = ADBem_Diameter; r_hub = ADBem_HubRadius; - const su2double r_tip = 0.5 * dia; ang_offset = blade_angle - ADBem_Angle75R; alpha_corr = 0.0; diff --git a/externals/codi b/externals/codi index 0ad036f2c82..eee1b5eea2d 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit 0ad036f2c8254fa7b77180a443d99248c047c877 +Subproject commit eee1b5eea2ded8126c34c1415e3b9cf15a3e70f2 From a7f4e92312a637d27a2b5b1831bab15a81bd9e21 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Sat, 4 Nov 2023 09:49:52 +0100 Subject: [PATCH 076/139] chaged tests to remove numerical noise, remove unused lines, add name to authors --- AUTHORS.md | 1 + TestCases/hybrid_regression.py | 6 +++--- TestCases/parallel_regression.py | 4 ++-- TestCases/py_wrapper/rotating_cylinder/run.py | 8 +------- TestCases/serial_regression.py | 4 ++-- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index f47640de49a..f8c364f411b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -71,6 +71,7 @@ Eduardo Molina Edwin van der Weide Ethan Alan Hereth Florian Dittmann +Filip Hahs Francesco Poli Francisco D. Palacios Gaurav Bansal diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 801ca167f31..11743264640 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -436,7 +436,7 @@ def main(): cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 - cavity.test_vals = [-5.627934, -0.164469, 0.052000, 2.547063] + cavity.test_vals = [-5.627868, -0.164404, 0.053310, 2.545839] test_list.append(cavity) # Spinning cylinder @@ -444,8 +444,8 @@ def main(): spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 - spinning_cylinder.test_vals = [-8.001291, -2.607959, 1.501321, 1.488559] - spinning_cylinder.test_vals_aarch64 = [-8.001291, -2.607959, 1.501321, 1.488559] + spinning_cylinder.test_vals = [-8.006541, -2.609759, 1.495662, 1.486341] + spinning_cylinder.test_vals_aarch64 = [-8.006541, -2.609759, 1.495662, 1.486341] test_list.append(spinning_cylinder) ###################################### diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index f26049592b8..f4f3e4ab7b2 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -915,7 +915,7 @@ def main(): cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 - cavity.test_vals = [-5.611007, -0.146826, 1.113206, 1.491678] + cavity.test_vals = [-5.610928, -0.146749, 1.114461, 1.490381] test_list.append(cavity) # Spinning cylinder @@ -923,7 +923,7 @@ def main(): spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 - spinning_cylinder.test_vals = [-7.802803, -2.362844, 1.687705, 1.519676] + spinning_cylinder.test_vals = [-7.806016, -2.364954, 1.683365, 1.517059] test_list.append(spinning_cylinder) ###################################### diff --git a/TestCases/py_wrapper/rotating_cylinder/run.py b/TestCases/py_wrapper/rotating_cylinder/run.py index 737c3dd74ee..537cdcb696e 100644 --- a/TestCases/py_wrapper/rotating_cylinder/run.py +++ b/TestCases/py_wrapper/rotating_cylinder/run.py @@ -1,16 +1,10 @@ import pysu2 # imports the SU2 wrapped module -from math import * from mpi4py import MPI import numpy as np comm = MPI.COMM_WORLD rank = comm.Get_rank() -ad_com = MPI.COMM_WORLD -rank_ad = ad_com.Get_rank() -n_of_steps = 10 -rotation_vector = np.zeros(n_of_steps)+20 -rotation_vector[5:9] = -rotation_vector[5:9] - +rotation_vector = np.linspace(0,20,10) SU2Driver = pysu2.CSinglezoneDriver("spinning_cylinder.cfg",1, comm) for i, rate in enumerate(rotation_vector): diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index a8486bc11ea..1ad3263d2e3 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -750,7 +750,7 @@ def main(): cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 - cavity.test_vals = [-5.627934, -0.164470, 0.051972, 2.547039] + cavity.test_vals = [ -5.627868, -0.164405, 0.053283, 2.545817] test_list.append(cavity) # Spinning cylinder @@ -758,7 +758,7 @@ def main(): spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 - spinning_cylinder.test_vals = [-7.889994, -2.469385, 1.708162, 1.670039] + spinning_cylinder.test_vals = [-7.892807, -2.467378, 1.702819, 1.669208] test_list.append(spinning_cylinder) ###################################### From d0486c1823ff5bcbe98def4d4cf61fd23a0e14c3 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Sat, 4 Nov 2023 11:46:22 +0100 Subject: [PATCH 077/139] change fsi serial regression test --- TestCases/serial_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 1ad3263d2e3..15d9f544ab4 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1066,7 +1066,7 @@ def main(): airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF" airfoilRBF.cfg_file = "config.cfg" airfoilRBF.test_iter = 1 - airfoilRBF.test_vals = [1.000000, -2.786183, -4.977959] + airfoilRBF.test_vals = [ 1.000000, -2.786186, -4.977944] airfoilRBF.multizone = True test_list.append(airfoilRBF) From 81c1381e562ba03d38d03a21b8e6e7af388abe5c Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Sun, 5 Nov 2023 11:04:42 +0000 Subject: [PATCH 078/139] Update SU2_CFD/src/solvers/CEulerSolver.cpp --- SU2_CFD/src/solvers/CEulerSolver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e82b1c2c893..d10e84b2ea8 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2888,9 +2888,9 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns SU2_MPI::Allreduce(Outlet_Force_Local, Outlet_Force_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(Outlet_Power_Local, Outlet_Power_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(Outlet_Area_Local, Outlet_Area_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Outlet_DeltaP_Local, Outlet_DeltaP_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Thrust_Local, Outlet_Thrust_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(Outlet_Torque_Local, Outlet_Torque_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Outlet_DeltaP_Local, Outlet_DeltaP_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Thrust_Local, Outlet_Thrust_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Outlet_Torque_Local, Outlet_Torque_Total, nMarker_Outlet, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); /*--- Compute the value of the average surface temperature and pressure and set the value in the config structure for future use ---*/ From e6280fb085ed0508520f239d935e51790514dc06 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sun, 5 Nov 2023 20:04:49 +0530 Subject: [PATCH 079/139] following instructions from @pcarruscag to revert accidental change in submodules externals/codi and subprojects/CoolProp --- externals/codi | 2 +- subprojects/CoolProp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/externals/codi b/externals/codi index eee1b5eea2d..0ad036f2c82 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit eee1b5eea2ded8126c34c1415e3b9cf15a3e70f2 +Subproject commit 0ad036f2c8254fa7b77180a443d99248c047c877 diff --git a/subprojects/CoolProp b/subprojects/CoolProp index a14412559e5..bafdea1f39e 160000 --- a/subprojects/CoolProp +++ b/subprojects/CoolProp @@ -1 +1 @@ -Subproject commit a14412559e523e762ddee9dd68b8250343ef941f +Subproject commit bafdea1f39ee873a6bb9833e3a21fe41f90b85e8 From c4e264cf391291d6bfa7b568636dcbee6c4ae2c8 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Sun, 5 Nov 2023 20:31:19 +0530 Subject: [PATCH 080/139] TestCases .cfg file cleanup of all comments. --- .../actuatordisk_bem/actuatordisk_bem.cfg | 181 +++--------------- 1 file changed, 23 insertions(+), 158 deletions(-) diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index fe548b4e284..01cc8c24f76 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -6,251 +6,116 @@ % Institution: Computational and Theoretical Fluid Dynamics (CTFD), % % CSIR - National Aerospace Laboratories, Bangalore % % Academy of Scientific and Innovative Research, Ghaziabad % -% Comments : +% Comments : % % Date: 23/09/2023 % -% File Version 8.0.0 "Harrier" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %----------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION -------------------------% SOLVER= RANS -% -% Specify turbulence model (NONE, SA, SST) KIND_TURB_MODEL= SA -% -% Turbulence intensity at freestream %FREESTREAM_TURBULENCEINTENSITY=0.01 -% -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT) MATH_PROBLEM= DIRECT -% -% Restart solution (NO, YES) RESTART_SOL= NO -% -% System of measurements (SI, US) -% International system of units (SI): ( meters, kilograms, Kelvins, -% Newtons = kg m/s^2, Pascals = N/m^2, -% Density = kg/m^3, Speed = m/s, -% Equiv. Area = m^2 ) SYSTEM_MEASUREMENTS= SI + % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% -% Mach number (non-dimensional, based on the free-stream values) MACH_NUMBER= 0.11617164 -% -% Angle of attack (degrees, only for compressible flows) AOA= 0.0 -% -% Side-slip angle (degrees, only for compressible flows) SIDESLIP_ANGLE= 0.0 -% -% Reynolds number (non-dimensional, based on the free-stream values) REYNOLDS_NUMBER= 0.62E6 -% -% Reynolds length (1 m, 1 inch by default) REYNOLDS_LENGTH= 0.237 -% FREESTREAM_TEMPERATURE= 295 -% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY). VISCOSITY_MODEL= CONSTANT_VISCOSITY -% -% Molecular Viscosity that would be constant (1.716E-5 by default) MU_CONSTANT= 1.84554E-5 -% -% Sutherland Viscosity Ref (1.716E-5 default value for AIR SI) MU_REF= 1.716E-5 -% -% Sutherland Temperature Ref (273.15 K default value for AIR SI) MU_T_REF= 273.15 -% -% Sutherland constant (110.4 default value for AIR SI) SUTHERLAND_CONSTANT= 110.4 % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% -% Reference origin for moment computation (m or in) +% REF_ORIGIN_MOMENT_X = 0.0 REF_ORIGIN_MOMENT_Y = 0.0 REF_ORIGIN_MOMENT_Z = 0.0 -% -% Reference length for moment non-dimensional coefficients (m or in) REF_LENGTH= 1.0 -% -% Reference area for non-dimensional force coefficients (0 implies automatic -% calculation) (m^2 or in^2) REF_AREA= 0.04411429 -% -% Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, -% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE) REF_DIMENSIONALIZATION= DIMENSIONAL -% + % --------------- ENGINE AND ACTUATOR DISK SIMULATION -------------------------% -% Highlite area to compute MFR (1 in by default) -HIGHLITE_AREA= 0.04411429 % -% Engine nu factor (SA model). +HIGHLITE_AREA= 0.04411429 ENGINE_NU_FACTOR= 0.0 -% + % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -ACTDISK_DOUBLE_SURFACE = YES % -% Actuator disk boundary type (VARIABLE_LOAD, VARIABLES_JUMP, BC_THRUST, -% DRAG_MINUS_THRUST) +ACTDISK_DOUBLE_SURFACE = YES ACTDISK_TYPE= BLADE_ELEMENT ACTDISK_JUMP= DIFFERENCE -% -% Actuator disk boundary marker(s) with the following formats (NONE = no marker) -% Variable Load: (inlet face marker, outlet face marker, -% 0.0, 0.0, RPM , 0.0, 0.0, RPM) Markers only effectively used. -% Change the sign of RPM to change the direction of rotation of the propeller MARKER_ACTDISK = ( ACTDISK_IN, ACTDISK_OUT , 0.0, 0.0, 12715.2, 0.0, 0.0, 12715.2) -%Actuator Disk CG -%(inlet face marker, outlet face marker, X_CG of inlet, Y_CG of inlet, Z_CG of inlet , -% X_CG of outlet, Y_CG of outlet, Z_CG of outlet), X_CG, Y_CG, Z_CG of both inlet and -% outlet markers should be same MARKER_ACTDISK_BEM_CG= ( ACTDISK_IN, ACTDISK_OUT, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) -%Actuator Disk Axis -%(inlet face marker, outlet face marker, -% axis_x, axis_y, axis_z of inlet, axis_x, axis_y, axis_z of outlet), -% axis of both inlet and outlet markers should be same MARKER_ACTDISK_BEM_AXIS= ( ACTDISK_IN, ACTDISK_OUT, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 ) -% Input file containing the propeller section data and aerodynamic details of blade sections BEM_PROP_FILENAME = prop_geom_alfclcd_data.txt -% Propeller blade angle (Degrees) at 0.75*Radius for the current calculation BEM_PROP_BLADE_ANGLE = 23.9 -% BEM calculation frequency BEM_FREQ = 40 -% -% Far-field boundary marker(s) (NONE = no marker) MARKER_FAR= ( Farfield ) -% + % ------------------------ SURFACES IDENTIFICATION ----------------------------% -% Marker(s) of the surface in the surface flow solution file -MARKER_PLOTTING = ( ACTDISK_IN, ACTDISK_OUT ) % -% Marker(s) of the surface where the non-dimensional coefficients are evaluated. +MARKER_PLOTTING = ( ACTDISK_IN, ACTDISK_OUT ) MARKER_MONITORING = ( ACTDISK_IN, ACTDISK_OUT ) -% -% Marker(s) of the surface that is going to be analyzed in detail (massflow, average pressure, distortion, etc) MARKER_ANALYZE = ( ACTDISK_IN, ACTDISK_OUT ) -% -% Method to compute the average value in MARKER_ANALYZE (AREA, MASSFLUX). MARKER_ANALYZE_AVERAGE = MASSFLUX -% + % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES) -NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES % -% CFL number (initial value for the adaptive CFL number) +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES CFL_NUMBER= 4.0 -% -% Adaptive CFL number (NO, YES) CFL_ADAPT= NO -% -% Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, -% MOMENT_Y, MOMENT_Z, EFFICIENCY, BUFFET, -% EQUIVALENT_AREA, NEARFIELD_PRESSURE, -% FORCE_X, FORCE_Y, FORCE_Z, THRUST, -% TORQUE, TOTAL_HEATFLUX, -% MAXIMUM_HEATFLUX, INVERSE_DESIGN_PRESSURE, -% INVERSE_DESIGN_HEATFLUX, SURFACE_TOTAL_PRESSURE, -% SURFACE_MASSFLOW, SURFACE_STATIC_PRESSURE, SURFACE_MACH) -% For a weighted sum of objectives: separate by commas, add OBJECTIVE_WEIGHT and MARKER_MONITORING in matching order. OBJECTIVE_FUNCTION= DRAG -% + % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% Linear solver or smoother for implicit formulations: -% BCGSTAB, FGMRES, RESTARTED_FGMRES, CONJUGATE_GRADIENT (self-adjoint problems only), SMOOTHER. -LINEAR_SOLVER= FGMRES % -% Preconditioner of the Krylov linear solver or type of smoother (ILU, LU_SGS, LINELET, JACOBI) +LINEAR_SOLVER= FGMRES LINEAR_SOLVER_PREC= ILU -% -% Minimum error of the linear solver for implicit formulations LINEAR_SOLVER_ERROR= 1E-12 -% -% Max number of iterations of the linear solver for the implicit formulation LINEAR_SOLVER_ITER= 3 -% -% Number of elements to apply the criteria CONV_CAUCHY_ELEMS= 1000 -% -% Epsilon to control the series convergence CONV_CAUCHY_EPS= 1E-10 -% + % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, -% AUSMPLUSUP2, HLLC, TURKEL_PREC, MSW, FDS, SLAU, SLAU2) +% CONV_NUM_METHOD_FLOW= ROE MUSCL_FLOW= YES -% -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT -% + % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% -% Convective numerical method (SCALAR_UPWIND) -CONV_NUM_METHOD_TURB= SCALAR_UPWIND % -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. -% Required for 2nd order upwind schemes (NO, YES) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND MUSCL_TURB= NO -% -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) SLOPE_LIMITER_TURB= VENKATAKRISHNAN -% -% Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT -% + % --------------------------- CONVERGENCE PARAMETERS --------------------------% -% Maximum number of iterations -ITER= 2000 % -% Convergence criteria (CAUCHY, RESIDUAL) -%CONV_CRITERIA= RESIDUAL -% -% Min value of the residual (log10 of the residual) +ITER= 2000 CONV_RESIDUAL_MINVAL= -8 -% -% Start convergence criteria at iteration number CONV_STARTITER= 10 -% + % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% Mesh input file -MESH_FILENAME= actuatordisk_bem.su2 % -% Mesh input file format (SU2, CGNS) +MESH_FILENAME= actuatordisk_bem.su2 MESH_FORMAT= SU2 -% -% Mesh output file MESH_OUT_FILENAME= mesh_out.su2 -% -% Restart flow input file SOLUTION_FILENAME= actuatordisk_bem.dat -% -% Output tabular file format (TECPLOT, CSV) TABULAR_FORMAT= CSV -OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) -% -% Output file convergence history (w/o extension) CONV_FILENAME= history_actuatordisk_bem -% -% Write the forces breakdown file option (NO, YES) +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_PARAVIEW) WRT_FORCES_BREAKDOWN= YES -% -% Output file with the forces breakdown BREAKDOWN_FILENAME= forces_breakdown_actuatordisk_bem.dat -% -% Output file restart flow RESTART_FILENAME= restart_flow_actuatordisk_bem.dat -% -% Output file flow (w/o extension) variables VOLUME_FILENAME= flow_actuatordisk_bem -% -% Output file surface flow coefficient (w/o extension) SURFACE_FILENAME= surface_flow_actuatordisk_bem -% -% Writing solution file frequency OUTPUT_WRT_FREQ= 500 -% -% Screen output fields SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, RMS_NU_TILDE, NONPHYSICAL_POINTS, LIFT, DRAG) HISTORY_OUTPUT= (INNER_ITER, RMS_RES, LIFT, DRAG, AERO_COEFF) From 458b636f3dae87de99df235979146d5995502524 Mon Sep 17 00:00:00 2001 From: Nijso Date: Mon, 6 Nov 2023 11:03:21 +0100 Subject: [PATCH 081/139] Update Common/include/CConfig.hpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- Common/include/CConfig.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 57b58ecf01b..580e4c9329d 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1551,7 +1551,7 @@ class CConfig { * \brief Get the values of subsonic engine. * \return Values of subsonic engine. */ - const su2double *GetSubsonicEngine_Values(void) const { return eng_val; } + const su2double *GetSubsonicEngine_Values(void) const { return eng_val; } /*! * \brief Get the cycle of a subsonic engine. From 1f4dca2ec368b87f964256ccba61a26f94fa475d Mon Sep 17 00:00:00 2001 From: bigfooted Date: Mon, 6 Nov 2023 11:33:25 +0100 Subject: [PATCH 082/139] remove duplicate entries, add deprecation statements --- Common/include/CConfig.hpp | 8 +++--- Common/src/CConfig.cpp | 4 +-- config_template.cfg | 52 +++++--------------------------------- 3 files changed, 13 insertions(+), 51 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 580e4c9329d..ed235fee02c 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -6443,8 +6443,8 @@ class CConfig { su2double GetWeightCd(void) const { return WeightCd; } /*! - * \brief Value of the weight of the CD, CL, CM optimization. - * \return Value of the weight of the CD, CL, CM optimization. + * \brief Value of the damping factor for the Thrust BC (actuator disk). + * \return Value of the damping factor. */ void SetdNetThrust_dBCThrust(su2double val_dnetthrust_dbcthrust); @@ -8560,8 +8560,8 @@ class CConfig { unsigned long GetIter_Fixed_NetThrust(void) const { return Iter_Fixed_NetThrust; } /*! - * \brief Get the value of the damping coefficient for fixed CL mode. - * \return Damping coefficient for fixed CL mode. + * \brief Get the value of NetThrust_dBCThrust. + * \return Value NetThrust_dBCThrust. */ su2double GetdNetThrust_dBCThrust(void) const { return dNetThrust_dBCThrust; } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 45771e6b3a6..696fe17326e 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1415,7 +1415,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("TARGET_CL", Target_CL, 0.0); /* DESCRIPTION: Damping factor for fixed CL mode. */ addDoubleOption("DCL_DALPHA", dCL_dAlpha, 0.2); - /* DESCRIPTION: Damping factor for fixed CL mode. */ + /* DESCRIPTION: dCM/dHi */ addDoubleOption("DCM_DIH", dCM_diH, 0.05); /* DESCRIPTION: Maximum number of iterations between AoA updates for fixed CL problem. */ addUnsignedLongOption("UPDATE_AOA_ITER_LIMIT", Update_AoA_Iter_Limit, 200); @@ -1423,7 +1423,7 @@ void CConfig::SetConfig_Options() { addUnsignedLongOption("UPDATE_IH", Update_iH, 5); /* DESCRIPTION: Number of iterations to evaluate dCL_dAlpha . */ addUnsignedLongOption("ITER_DCL_DALPHA", Iter_dCL_dAlpha, 500); - /* DESCRIPTION: Damping factor for fixed CL mode. */ + /* DESCRIPTION: Value of dNetThrust/dBCThrust */ addDoubleOption("DNETTHRUST_DBCTHRUST", dNetThrust_dBCThrust, 1.0); /* DESCRIPTION: Number of times Alpha is updated in a fix CL problem. */ addUnsignedLongOption("UPDATE_BCTHRUST", Update_BCThrust, 5); diff --git a/config_template.cfg b/config_template.cfg index 19930447b06..0a3daef4450 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -310,7 +310,7 @@ TARGET_CL= 0.80 % Estimation of dCL/dAlpha (0.2 per degree by default) DCL_DALPHA= 0.2 % -% Damping factor for fixed CL mode +% Value of dCm/dHi (0.05 by default) DCM_DIH= 0.05 % % Maximum number of iterations between AoA updates @@ -324,7 +324,8 @@ ITER_DCL_DALPHA= 500 % % Evaluate the dOF_dCL or dOF_dCMy during run time EVAL_DOF_DCX= NO -% Damping factor for fixed CL mode. +% +% Damping factor for thrust BC (actuator disk). NETTHRUST_DBCTHRUST= 1.0 % % parameter for the definition of a complex objective function @@ -448,20 +449,6 @@ VT_RESIDUAL_LIMITING= NO INLET_TEMPERATURE_VE = 288.15 INLET_GAS_COMPOSITION = (0.77, 0.23, 0.0, 0.0, 0.0) -% --------------------------- REFERENCE VALUES FOR DEFORMATION ----------------% -% -% Consider a reference solution for the structure -REFERENCE_GEOMETRY= NO -% -% Penalty weight value for the objective function -REFERENCE_GEOMETRY_PENALTY= 1E6 -% -% Reference geometry filename -REFERENCE_GEOMETRY_FILENAME= reference_geometry.dat -% -% Format of the reference geometry file -REFERENCE_GEOMETRY_FORMAT= - % --------------------------- VISCOSITY MODEL ---------------------------------% % % Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY, FLAMELET). @@ -781,7 +768,7 @@ HB_PRECONDITION= NO % Omega_HB = 2*PI*frequency - frequencies for Harmonic Balance method OMEGA_HB= (0,1.0,-1.0) % -% Determines if the single-zone driver is used. (TEMPORARY) +% Determines if the single-zone driver is used. (deprecated) SINGLEZONE_DRIVER= NO % % Determines if the special output is written out @@ -1964,13 +1951,13 @@ DEAD_LOAD= NO % pseudo static analysis (no density in dynamic analysis) PSEUDO_STATIC= NO % -% Dynamic or static structural analysis +% Dynamic or static structural analysis (deprecated -> use TIME_DOMAIN) DYNAMIC_ANALYSIS= NO % -% Time Step for dynamic analysis (s) +% Time Step for dynamic analysis (s) (deprecated -> use TIME_STEP) DYN_TIMESTEP= 0.0 % -% Total Physical Time for dual time stepping simulations (s) +% Total Physical Time for dual time stepping simulations (s) (deprecated -> use MAX_TIME) DYN_TIME= 1.0 % ---------------- MESH DEFORMATION PARAMETERS (NEW SOLVER) -------------------% @@ -2472,28 +2459,3 @@ PASTIX_VERBOSITY_LEVEL= 0 % % Level of fill for PaStiX incomplete LU factorization PASTIX_FILL_LEVEL= 1 - -% --------------------- PYTHON PARAMETERS -----------------------% -% DESCRIPTION: Gradient method -%GRADIENT_METHOD -% -% DESCRIPTION: Geometrical Parameter -%GEO_PARAM -% -% DESCRIPTION: Current value of the design variables -%DV_VALUE_NEW -% -% DESCRIPTION: Previous value of the design variables -%DV_VALUE_OLD -% -% DESCRIPTION: Number of partitions of the mesh -NUMBER_PART= 1 -% -% DESCRIPTION: Verbosity of the python scripts to Stdout -%CONSOLE -% -% DESCRIPTION: Flag specifying if the mesh was decomposed -%DECOMPOSED -% -% DESCRIPTION: Number of zones of the problem -%NZONES= 1 From 0edd71fa8f69aa5aeaea9f7f5a6c977c55596426 Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 6 Nov 2023 17:18:41 +0100 Subject: [PATCH 083/139] Used MAXNDIM and MAXNVAR to initialize arrays in TurboAverageProcess --- SU2_CFD/src/solvers/CEulerSolver.cpp | 35 +++++++--------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 380b642234e..99709735778 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -8586,14 +8586,11 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC const auto nSpanWiseSections = config->GetnSpanWiseSections(); for (auto iSpan= 0; iSpan < nSpanWiseSections + 1; iSpan++){ - su2double TotalDensity{0}, TotalPressure{0}, TotalNu{0}, TotalOmega{0}, TotalKine{0}, - TotalAreaDensity{0}, TotalAreaPressure{0}, TotalAreaNu{0}, TotalAreaOmega{0}, TotalAreaKine{0}, - TotalMassDensity{0}, TotalMassPressure{0}, TotalMassNu{0}, TotalMassOmega{0}, TotalMassKine{0}; - - su2double *TotalVelocity = new su2double[nDim], - *TotalAreaVelocity = new su2double[nDim], - *TotalMassVelocity = new su2double[nDim], - *TotalFluxes = new su2double[nVar]; + su2double TotalDensity{0}, TotalPressure{0}, TotalNu{0}, TotalOmega{0}, TotalKine{0}, TotalVelocity[MAXNDIM], + TotalAreaDensity{0}, TotalAreaPressure{0}, TotalAreaNu{0}, TotalAreaOmega{0}, TotalAreaKine{0}, TotalAreaVelocity[MAXNDIM], + TotalMassDensity{0}, TotalMassPressure{0}, TotalMassNu{0}, TotalMassOmega{0}, TotalMassKine{0}, TotalMassVelocity[MAXNDIM]; + + su2double TotalFluxes[MAXNVAR]; /*--- Forces initialization for contenitors ---*/ for (auto iVar=0u;iVarGetDensity(iPoint); auto Enthalpy = nodes->GetEnthalpy(iPoint); - su2double *Velocity = new su2double[nDim], - *UnitNormal = new su2double[nDim], - *TurboNormal = new su2double[nDim], - *TurboVelocity = new su2double[nDim]; - + su2double Velocity[MAXNDIM] = {0}, UnitNormal[MAXNDIM] = {0}, TurboNormal[MAXNDIM] = {0}, TurboVelocity[MAXNDIM] = {0}; geometry->turbovertex[iMarker][iSpan][iVertex]->GetNormal(UnitNormal); geometry->turbovertex[iMarker][iSpan][iVertex]->GetTurboNormal(TurboNormal); auto Area = geometry->turbovertex[iMarker][iSpan][iVertex]->GetArea(); @@ -8672,11 +8665,6 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC TotalMassOmega += Area*(Density*TurboVelocity[0] )*Omega; TotalMassNu += Area*(Density*TurboVelocity[0] )*Nu; } - - delete [] Velocity; - delete [] UnitNormal; - delete [] TurboNormal; - delete [] TurboVelocity; }; for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++){ @@ -8764,9 +8752,8 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC /*--- Compute the averaged value for the boundary of interest for the span of interest ---*/ bool belowMachLimit = (abs(MachTest)< config->GetAverageMachLimit()); - su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}; - su2double *avgVelocity = new su2double[nDim], - *avgMixTurboVelocity = new su2double[nDim]; + su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}, + avgVelocity[MAXNDIM] = {0}, avgMixTurboVelocity[MAXNDIM] = {0}; for (auto iVar = 0u; iVarGetKind_TurboMachinery(iZone)); } - delete [] avgVelocity; - delete [] avgMixTurboVelocity; } } } // iMarkerTP } // iMarker - delete [] TotalVelocity; - delete [] TotalMassVelocity; - delete [] TotalAreaVelocity; - delete [] TotalFluxes; } // iSpan /*--- Compute Outlet Static Pressure if Radial equilibrium is imposed ---*/ From 300224d34cbedc4fe52a114ef409bc5372b8814e Mon Sep 17 00:00:00 2001 From: EvertBunschoten Date: Mon, 6 Nov 2023 20:46:23 +0100 Subject: [PATCH 084/139] Added const where possible and replaced auto with su2double when initializing variables to prevent AD breaking --- SU2_CFD/src/solvers/CEulerSolver.cpp | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 99709735778..239573dc85e 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -8603,17 +8603,17 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC auto UpdateTotalQuantities = [&](const size_t iMarker, const size_t iSpan, const size_t iVertex){ /*--- Increment integral quantities for averaging ---*/ - auto iPoint = geometry->turbovertex[iMarker][iSpan][iVertex]->GetNode(); + const auto iPoint = geometry->turbovertex[iMarker][iSpan][iVertex]->GetNode(); /*--- Retrieve local quantities ---*/ - auto Pressure = nodes->GetPressure(iPoint); - auto Density = nodes->GetDensity(iPoint); - auto Enthalpy = nodes->GetEnthalpy(iPoint); + const auto Pressure = nodes->GetPressure(iPoint); + const auto Density = nodes->GetDensity(iPoint); + const auto Enthalpy = nodes->GetEnthalpy(iPoint); su2double Velocity[MAXNDIM] = {0}, UnitNormal[MAXNDIM] = {0}, TurboNormal[MAXNDIM] = {0}, TurboVelocity[MAXNDIM] = {0}; geometry->turbovertex[iMarker][iSpan][iVertex]->GetNormal(UnitNormal); geometry->turbovertex[iMarker][iSpan][iVertex]->GetTurboNormal(TurboNormal); - auto Area = geometry->turbovertex[iMarker][iSpan][iVertex]->GetArea(); + const auto Area = geometry->turbovertex[iMarker][iSpan][iVertex]->GetArea(); for (auto iDim=0u; iDim < nDim; iDim++) Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); @@ -8740,18 +8740,18 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - auto TotalArea = geometry->GetSpanArea(iMarker,iSpan); - auto AverageTurboNormal = geometry->GetAverageTurboNormal(iMarker,iSpan); - auto nVert = geometry->GetnTotVertexSpan(iMarker,iSpan); + const auto TotalArea = geometry->GetSpanArea(iMarker,iSpan); + const auto AverageTurboNormal = geometry->GetAverageTurboNormal(iMarker,iSpan); + const auto nVert = geometry->GetnTotVertexSpan(iMarker,iSpan); /*--- compute normal Mach number as a check for massflow average and mixedout average ---*/ GetFluidModel()->SetTDState_Prho(TotalAreaPressure/TotalArea, TotalAreaDensity / TotalArea); - auto soundSpeed = GetFluidModel()->GetSoundSpeed(); - auto MachTest = TotalFluxes[0]/(TotalAreaDensity*soundSpeed); + const su2double soundSpeed = GetFluidModel()->GetSoundSpeed(), + MachTest = TotalFluxes[0]/(TotalAreaDensity*soundSpeed); /*--- Compute the averaged value for the boundary of interest for the span of interest ---*/ - bool belowMachLimit = (abs(MachTest)< config->GetAverageMachLimit()); + const bool belowMachLimit = (abs(MachTest)< config->GetAverageMachLimit()); su2double avgDensity{0}, avgPressure{0}, avgKine{0}, avgOmega{0}, avgNu{0}, avgVelocity[MAXNDIM] = {0}, avgMixTurboVelocity[MAXNDIM] = {0}; for (auto iVar = 0u; iVarGetTurboRadius(iMarker,iSpan+1); - auto Radius1 = geometry->GetTurboRadius(iMarker,iSpan); - auto Vt2 = AverageTurboVelocity[iMarker][iSpan +1][1]*AverageTurboVelocity[iMarker][iSpan +1][1]; + const auto Radius2 = geometry->GetTurboRadius(iMarker,iSpan+1); + const auto Radius1 = geometry->GetTurboRadius(iMarker,iSpan); + const su2double Vt2 = AverageTurboVelocity[iMarker][iSpan +1][1]*AverageTurboVelocity[iMarker][iSpan +1][1]; RadialEquilibriumPressure[iMarker][iSpan +1] = RadialEquilibriumPressure[iMarker][iSpan] + AverageDensity[iMarker][iSpan +1]*Vt2/Radius2*(Radius2 - Radius1); } for (auto iSpan= nSpanWiseSections/2; iSpan > 0; iSpan--){ - auto Radius2 = geometry->GetTurboRadius(iMarker,iSpan); - auto Radius1 = geometry->GetTurboRadius(iMarker,iSpan-1); - auto Vt2 = AverageTurboVelocity[iMarker][iSpan -1][1]*AverageTurboVelocity[iMarker][iSpan - 1][1]; + const su2double Radius2 = geometry->GetTurboRadius(iMarker,iSpan); + su2double Radius1 = geometry->GetTurboRadius(iMarker,iSpan-1); + const su2double Vt2 = AverageTurboVelocity[iMarker][iSpan -1][1]*AverageTurboVelocity[iMarker][iSpan - 1][1]; Radius1 = (Radius1 > EPS)? Radius1 : Radius2; RadialEquilibriumPressure[iMarker][iSpan -1] = RadialEquilibriumPressure[iMarker][iSpan] - AverageDensity[iMarker][iSpan -1]*Vt2/Radius1*(Radius2 - Radius1); } From 1f02f9604888a5859c5221eabb7ada85ebfea9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 7 Nov 2023 16:28:16 +0100 Subject: [PATCH 085/139] Fix uninitialized mixingplane. --- SU2_CFD/src/drivers/CDriver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index c33977ad33f..d8ba985fafa 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -248,6 +248,8 @@ CDriverBase(confFile, val_nZone, MPICommunicator), StopCalc(false), fsi(false), cout << endl <<"---------------------- Turbomachinery Preprocessing ---------------------" << endl; PreprocessTurbomachinery(config_container, geometry_container, solver_container, interface_container); + } else { + mixingplane = false; } From b85ed3353ddedd801beab85e5219ff47dc6b02e5 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Wed, 8 Nov 2023 05:15:18 +0530 Subject: [PATCH 086/139] regression test fix --- TestCases/parallel_regression.py | 12 ++++++------ TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 8c4203a45e3..51c9671d836 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -487,12 +487,12 @@ def main(): test_list.append(propeller) # Actuator disk BEM method for propeller - propeller = TestCase('actuatordisk_bem') - propeller.cfg_dir = "rans/actuatordisk_bem" - propeller.cfg_file = "actuatordisk_bem.cfg" - propeller.test_iter = 15 - propeller.test_vals = [3.3764e-01, -5.226958, -8.297197, 0, -0.004325, -0.565388] - propeller.timeout = 3200 + actuatordisk_bem = TestCase('actuatordisk_bem') + actuatordisk_bem.cfg_dir = "rans/actuatordisk_bem" + actuatordisk_bem.cfg_file = "actuatordisk_bem.cfg" + actuatordisk_bem.test_iter = 15 + actuatordisk_bem.test_vals = [ -5.226958, -8.297197, -0.004325, -0.565388] + actuatordisk_bem.timeout = 3200 test_list.append(actuatordisk_bem) ####################################### diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index 01cc8c24f76..5a0419797a0 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -117,5 +117,6 @@ RESTART_FILENAME= restart_flow_actuatordisk_bem.dat VOLUME_FILENAME= flow_actuatordisk_bem SURFACE_FILENAME= surface_flow_actuatordisk_bem OUTPUT_WRT_FREQ= 500 -SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, RMS_NU_TILDE, NONPHYSICAL_POINTS, LIFT, DRAG) +%SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, RMS_NU_TILDE, NONPHYSICAL_POINTS, LIFT, DRAG) +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) HISTORY_OUTPUT= (INNER_ITER, RMS_RES, LIFT, DRAG, AERO_COEFF) From 89f72e3c8f55e23322d6639722eafc6bd50cb6b9 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Wed, 8 Nov 2023 05:24:48 +0530 Subject: [PATCH 087/139] codefactor fix --- TestCases/parallel_regression.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 51c9671d836..a5e0684ee33 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -487,12 +487,12 @@ def main(): test_list.append(propeller) # Actuator disk BEM method for propeller - actuatordisk_bem = TestCase('actuatordisk_bem') - actuatordisk_bem.cfg_dir = "rans/actuatordisk_bem" - actuatordisk_bem.cfg_file = "actuatordisk_bem.cfg" + actuatordisk_bem = TestCase('actuatordisk_bem') + actuatordisk_bem.cfg_dir = "rans/actuatordisk_bem" + actuatordisk_bem.cfg_file = "actuatordisk_bem.cfg" actuatordisk_bem.test_iter = 15 - actuatordisk_bem.test_vals = [ -5.226958, -8.297197, -0.004325, -0.565388] - actuatordisk_bem.timeout = 3200 + actuatordisk_bem.test_vals = [-5.226958, -8.297197, -0.004325, -0.565388] + actuatordisk_bem.timeout = 3200 test_list.append(actuatordisk_bem) ####################################### From c48810a84d612b1a1ddf9848a6d3097d0a23e460 Mon Sep 17 00:00:00 2001 From: TripleRider Date: Tue, 7 Nov 2023 22:23:01 -0800 Subject: [PATCH 088/139] Fix cpu arch returned value Modify TestCase.py related to #2159. --- TestCases/TestCase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index 488865bc936..5359154842e 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -111,8 +111,8 @@ def __init__(self,tag_in): self.ntest_vals = 4 self.test_vals = [] self.test_vals_aarch64 = [] - self.cpu_arch = platform.processor() - self.enabled_on_cpu_arch = ["x86_64", "aarch64"] + self.cpu_arch = platform.machine().casefold() + self.enabled_on_cpu_arch = ["x86_64","amd64","aarch64","arm64"] self.enabled_with_tsan = True self.command = self.Command() self.timeout = 0 @@ -957,7 +957,7 @@ def is_enabled(self, running_with_tsan=False): def adjust_test_data(self): - if self.cpu_arch == 'aarch64': + if self.cpu_arch == 'aarch64' or self.cpu_arch == 'arm64': if len(self.test_vals_aarch64) != 0: self.test_vals = self.test_vals_aarch64 From 5fa584f560737f3c8ad6c0af7882425eb45a8945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 8 Nov 2023 16:44:06 +0100 Subject: [PATCH 089/139] Update serial regression test values. --- TestCases/serial_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index a8486bc11ea..2c4e041ce08 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1066,7 +1066,7 @@ def main(): airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF" airfoilRBF.cfg_file = "config.cfg" airfoilRBF.test_iter = 1 - airfoilRBF.test_vals = [1.000000, -2.786183, -4.977959] + airfoilRBF.test_vals = [1.000000, -2.786186, -4.977944] airfoilRBF.multizone = True test_list.append(airfoilRBF) From 85b4fb41a244196e925979bc8c7296299c23b438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 8 Nov 2023 16:49:32 +0100 Subject: [PATCH 090/139] Further relax tolerances of hybrid AD python wrapper tests. --- TestCases/hybrid_regression_AD.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index a2243e14e24..cf419bde4e9 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -242,7 +242,7 @@ def main(): pywrapper_FEA_AD_FlowLoad.test_vals_aarch64 = [-0.131745, -0.553214, -0.000364, -0.003101] pywrapper_FEA_AD_FlowLoad.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_FEA_AD_FlowLoad.timeout = 1600 - pywrapper_FEA_AD_FlowLoad.tol = 1e-4 + pywrapper_FEA_AD_FlowLoad.tol = 1e-3 pywrapper_FEA_AD_FlowLoad.new_output = False pywrapper_FEA_AD_FlowLoad.enabled_with_tsan = False test_list.append(pywrapper_FEA_AD_FlowLoad) @@ -257,7 +257,7 @@ def main(): pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.516536, 1.386443, 0.000000] pywrapper_CFD_AD_MeshDisp.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_CFD_AD_MeshDisp.timeout = 1600 - pywrapper_CFD_AD_MeshDisp.tol = 1e-4 + pywrapper_CFD_AD_MeshDisp.tol = 1e-3 pywrapper_CFD_AD_MeshDisp.new_output = False pywrapper_CFD_AD_MeshDisp.enabled_with_tsan = False test_list.append(pywrapper_CFD_AD_MeshDisp) From 88811d3714efb7a654dc883b756f71d84bf2b501 Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Wed, 8 Nov 2023 07:58:07 -0800 Subject: [PATCH 091/139] Update TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg --- TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg index 5a0419797a0..cb74bf56621 100644 --- a/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg +++ b/TestCases/rans/actuatordisk_bem/actuatordisk_bem.cfg @@ -17,7 +17,7 @@ SOLVER= RANS KIND_TURB_MODEL= SA %FREESTREAM_TURBULENCEINTENSITY=0.01 MATH_PROBLEM= DIRECT -RESTART_SOL= NO +RESTART_SOL= YES SYSTEM_MEASUREMENTS= SI % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% From 470943e7fc91858827cee91305f07ede05982f53 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Wed, 8 Nov 2023 22:48:29 +0530 Subject: [PATCH 092/139] regression test_vals to reflect change RESTART_SOL=YES --- TestCases/parallel_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index a5e0684ee33..6f36ef4d8d5 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -491,7 +491,7 @@ def main(): actuatordisk_bem.cfg_dir = "rans/actuatordisk_bem" actuatordisk_bem.cfg_file = "actuatordisk_bem.cfg" actuatordisk_bem.test_iter = 15 - actuatordisk_bem.test_vals = [-5.226958, -8.297197, -0.004325, -0.565388] + actuatordisk_bem.test_vals = [-5.282249, -10.335140, 0.001383, -0.375718] actuatordisk_bem.timeout = 3200 test_list.append(actuatordisk_bem) From 1a068ae6bbc49143d4d09550428abe8867bf6d05 Mon Sep 17 00:00:00 2001 From: "Josy P. Pullockara" Date: Thu, 9 Nov 2023 05:27:21 +0530 Subject: [PATCH 093/139] higher rms[nu] tolerance --- TestCases/parallel_regression.py | 1 + 1 file changed, 1 insertion(+) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 6f36ef4d8d5..3278b46e737 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -493,6 +493,7 @@ def main(): actuatordisk_bem.test_iter = 15 actuatordisk_bem.test_vals = [-5.282249, -10.335140, 0.001383, -0.375718] actuatordisk_bem.timeout = 3200 + actuatordisk_bem.tol = 0.001 test_list.append(actuatordisk_bem) ####################################### From 4e36eee2f72714fb878ff3ae515a3c8ca7ea3c83 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Fri, 10 Nov 2023 16:08:29 +0100 Subject: [PATCH 094/139] more test changes --- TestCases/hybrid_regression_AD.py | 4 ++-- TestCases/serial_regression.py | 2 +- externals/codi | 2 +- externals/mel | 2 +- subprojects/CoolProp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index a2243e14e24..f333c9ba7a9 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -253,8 +253,8 @@ def main(): pywrapper_CFD_AD_MeshDisp.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" pywrapper_CFD_AD_MeshDisp.cfg_file = "configAD_flow.cfg" pywrapper_CFD_AD_MeshDisp.test_iter = 1000 - pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.520967, 1.375188, 0.000000] #last 4 columns - pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.516536, 1.386443, 0.000000] + pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.521399, 1.372319, 0.000000] #last 4 columns + pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.521399, 1.372319, 0.000000] pywrapper_CFD_AD_MeshDisp.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_CFD_AD_MeshDisp.timeout = 1600 pywrapper_CFD_AD_MeshDisp.tol = 1e-4 diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 15d9f544ab4..b6d107b6a1b 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1066,7 +1066,7 @@ def main(): airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF" airfoilRBF.cfg_file = "config.cfg" airfoilRBF.test_iter = 1 - airfoilRBF.test_vals = [ 1.000000, -2.786186, -4.977944] + airfoilRBF.test_vals = [1.000000, -2.786183, -4.977961] airfoilRBF.multizone = True test_list.append(airfoilRBF) diff --git a/externals/codi b/externals/codi index 0ad036f2c82..17232fed052 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit 0ad036f2c8254fa7b77180a443d99248c047c877 +Subproject commit 17232fed05245dbb8f04a31e274a02d53458c75c diff --git a/externals/mel b/externals/mel index 46205ab019e..2484cd3258e 160000 --- a/externals/mel +++ b/externals/mel @@ -1 +1 @@ -Subproject commit 46205ab019e5224559091375a6d71aabae6bc5b9 +Subproject commit 2484cd3258ef800a10e361016cb341834ee7930b diff --git a/subprojects/CoolProp b/subprojects/CoolProp index bafdea1f39e..0ce42fcf3bb 160000 --- a/subprojects/CoolProp +++ b/subprojects/CoolProp @@ -1 +1 @@ -Subproject commit bafdea1f39ee873a6bb9833e3a21fe41f90b85e8 +Subproject commit 0ce42fcf3bb2c373512bc825a4f0c1973a78f307 From aa815c9041d5385420df2dcdcef858e11bc49dce Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Fri, 10 Nov 2023 07:40:54 -0800 Subject: [PATCH 095/139] fix tests and windows compilations --- SU2_CFD/src/solvers/CEulerSolver.cpp | 16 ++++++++-------- TestCases/TestCase.py | 2 +- TestCases/hybrid_regression.py | 2 ++ TestCases/serial_regression.py | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index d10e84b2ea8..058601e85bd 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -4329,7 +4329,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con su2double n, omega, a0, den; su2double ang_offset = 0.0; - radtodeg = 180.0 / M_PI; + radtodeg = 180.0 / PI_NUMBER; r_hub = ADBem_HubRadius; ang_offset = blade_angle - ADBem_Angle75R; @@ -4339,7 +4339,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con a0 = sqrt(1.4 * 287 * T); /*--- Change pitch by ang_offset and calculate delta_r for integration by trapezoidal rule. ---*/ n = RPM / 60.0; - omega = n * 2.0 * M_PI; + omega = n * 2.0 * PI_NUMBER; for (j = 0; j < NR; j++) { if (j < 1) { @@ -4416,7 +4416,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con c_phi = cos(phi); t_loss = 1.0; if (r_dash > 0.90) { - t_loss = (2.0 / M_PI) * acos(exp(-(1.0 * s_prop_nblades * (1 - r_dash) / (r_dash * c_phi)))); + t_loss = (2.0 / PI_NUMBER) * acos(exp(-(1.0 * s_prop_nblades * (1 - r_dash) / (r_dash * c_phi)))); } DtDr[j] = q * s_prop_nblades * sprop_sec_chord[j] * (cl * cos(phi) - cd * sin(phi)); @@ -4425,7 +4425,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con DtDr[j] *= t_loss; DqDr *= t_loss; - tem2 = DqDr / (4.0 * M_PI * rad * rad * rad * rho * V * omega); + tem2 = DqDr / (4.0 * PI_NUMBER * rad * rad * rad * rho * V * omega); bnew = 0.6 * b[j] + 0.4 * tem2; if (bnew > 0.9) bnew = 0.9; if (fabs(bnew - b[j]) < 1.0e-5) { @@ -4447,11 +4447,11 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con tem1 = rho * n * n * dia * dia * dia * dia; tem2 = tem1 * dia; - Torque = 2.0 * M_PI * torque; - dp_av = 2.0 * M_PI * torque; + Torque = 2.0 * PI_NUMBER * torque; + dp_av = 2.0 * PI_NUMBER * torque; for (j = 0; j < NR; j++) { - DtDr[j] /= (2.0 * M_PI * sprop_sec_r1[j]); + DtDr[j] /= (2.0 * PI_NUMBER * sprop_sec_r1[j]); Dtorq[j] = Dtorq[j]; } @@ -4495,7 +4495,7 @@ void CEulerSolver::SetActDisk_BEM_VLAD(CGeometry *geometry, CSolver **solver_con ActDisk_DeltaP_r[iMarker][iVertex] = Target_Press_Jump; ActDisk_Thrust_r[iMarker][iVertex] = dp_at_r; - ActDisk_Torque_r[iMarker][iVertex] = Torque / (2 * M_PI * radius); + ActDisk_Torque_r[iMarker][iVertex] = Torque / (2 * PI_NUMBER * radius); /*--- Non-dimensionalize the elemental load. ---*/ const su2double dCp_v = Torque * ((Omega_sw * r_tip) / (rho * rps * rps * rps * pow(dia, 5))); /*--- Force radial load to 0 as there is no information of radial load from BEM. ---*/ diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index 488865bc936..1d1a181c8d8 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -361,7 +361,7 @@ def run_filediff(self, running_with_tsan=False): if len(fromlines) != len(tolines): diff = ["ERROR: Number of lines in " + fromfile + " and " + tofile + " differ."] passed = False - + # Loop through all lines for i_line in range(0, len(fromlines)): diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 801ca167f31..1f21bf4a9ad 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -771,6 +771,7 @@ def main(): pywrapper_translating_naca0012.reference_file = "forces_0.csv.ref" pywrapper_translating_naca0012.reference_file_aarch64 = "forces_0_aarch64.csv.ref" pywrapper_translating_naca0012.test_file = "forces_0.csv" + pywrapper_translating_naca0012.tol_file_percent = 0.1 pywrapper_translating_naca0012.enabled_on_cpu_arch = ["x86_64"] pywrapper_translating_naca0012.enabled_with_tsan = False file_diff_list.append(pywrapper_translating_naca0012) @@ -784,6 +785,7 @@ def main(): pywrapper_updated_moving_frame_naca0012.reference_file = "forces_0.csv.ref" pywrapper_updated_moving_frame_naca0012.reference_file_aarch64 = "forces_0_aarch64.csv.ref" pywrapper_updated_moving_frame_naca0012.test_file = "forces_0.csv" + pywrapper_updated_moving_frame_naca0012.tol_file_percent = 0.1 pywrapper_updated_moving_frame_naca0012.enabled_on_cpu_arch = ["x86_64"] pywrapper_updated_moving_frame_naca0012.enabled_with_tsan = False file_diff_list.append(pywrapper_updated_moving_frame_naca0012) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 2c4e041ce08..56d4d46938d 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1067,6 +1067,7 @@ def main(): airfoilRBF.cfg_file = "config.cfg" airfoilRBF.test_iter = 1 airfoilRBF.test_vals = [1.000000, -2.786186, -4.977944] + airfoilRBF.tol = 0.0001 airfoilRBF.multizone = True test_list.append(airfoilRBF) From 8531ae8920b9381d1c8c86c99d8444d3f7bce81b Mon Sep 17 00:00:00 2001 From: bigfooted Date: Sun, 12 Nov 2023 11:18:57 +0100 Subject: [PATCH 096/139] remove dcm_dih --- Common/include/CConfig.hpp | 13 ------------- Common/src/CConfig.cpp | 2 -- config_template.cfg | 3 --- 3 files changed, 18 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index ed235fee02c..cae0d4c82a4 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -655,7 +655,6 @@ class CConfig { su2double Total_CM; /*!< \brief Specify a Total CM instead of AoA (external flow only). */ su2double Total_CD; /*!< \brief Specify a target CD instead of AoA (external flow only). */ su2double dCL_dAlpha; /*!< \brief value of dCl/dAlpha. */ - su2double dCM_diH; /*!< \brief value of dCM/dHi. */ unsigned long Iter_Fixed_CM; /*!< \brief Iterations to re-evaluate the angle of attack (external flow only). */ unsigned long Iter_Fixed_NetThrust; /*!< \brief Iterations to re-evaluate the angle of attack (external flow only). */ unsigned long Iter_dCL_dAlpha; /*!< \brief Number of iterations to evaluate dCL_dAlpha. */ @@ -6508,12 +6507,6 @@ class CConfig { */ void SetdCL_dAlpha(su2double val_dcl_dalpha) { dCL_dAlpha = val_dcl_dalpha; } - /*! - * \brief Value of the weight of the CD, CL, CM optimization. - * \return Value of the weight of the CD, CL, CM optimization. - */ - void SetdCM_diH(su2double val_dcm_dhi) { dCM_diH = val_dcm_dhi; } - /*! * \brief Value of the weight of the CD, CL, CM optimization. * \return Value of the weight of the CD, CL, CM optimization. @@ -8547,12 +8540,6 @@ class CConfig { */ unsigned long GetIter_dCL_dAlpha(void) const { return Iter_dCL_dAlpha; } - /*! - * \brief Get the value of the damping coefficient for fixed CL mode. - * \return Damping coefficient for fixed CL mode. - */ - su2double GetdCM_diH(void) const { return dCM_diH; } - /*! * \brief Get the value of iterations to re-evaluate the angle of attack. * \return Number of iterations. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 696fe17326e..1e44096b1c4 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1415,8 +1415,6 @@ void CConfig::SetConfig_Options() { addDoubleOption("TARGET_CL", Target_CL, 0.0); /* DESCRIPTION: Damping factor for fixed CL mode. */ addDoubleOption("DCL_DALPHA", dCL_dAlpha, 0.2); - /* DESCRIPTION: dCM/dHi */ - addDoubleOption("DCM_DIH", dCM_diH, 0.05); /* DESCRIPTION: Maximum number of iterations between AoA updates for fixed CL problem. */ addUnsignedLongOption("UPDATE_AOA_ITER_LIMIT", Update_AoA_Iter_Limit, 200); /* DESCRIPTION: Number of times Alpha is updated in a fix CL problem. */ diff --git a/config_template.cfg b/config_template.cfg index 0a3daef4450..da912f823a3 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -310,9 +310,6 @@ TARGET_CL= 0.80 % Estimation of dCL/dAlpha (0.2 per degree by default) DCL_DALPHA= 0.2 % -% Value of dCm/dHi (0.05 by default) -DCM_DIH= 0.05 -% % Maximum number of iterations between AoA updates UPDATE_AOA_ITER_LIMIT= 100 % From a009c2e271146fc47dfb5c764a226ed15bb79f43 Mon Sep 17 00:00:00 2001 From: Filip Hahs Date: Sun, 12 Nov 2023 16:15:00 +0100 Subject: [PATCH 097/139] Revert "more test changes" This reverts commit 4e36eee2f72714fb878ff3ae515a3c8ca7ea3c83. --- TestCases/hybrid_regression_AD.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index 8185eaeba8f..cf419bde4e9 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -253,8 +253,8 @@ def main(): pywrapper_CFD_AD_MeshDisp.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" pywrapper_CFD_AD_MeshDisp.cfg_file = "configAD_flow.cfg" pywrapper_CFD_AD_MeshDisp.test_iter = 1000 - pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.521399, 1.372319, 0.000000] #last 4 columns - pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.521399, 1.372319, 0.000000] + pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.520967, 1.375188, 0.000000] #last 4 columns + pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.516536, 1.386443, 0.000000] pywrapper_CFD_AD_MeshDisp.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_CFD_AD_MeshDisp.timeout = 1600 pywrapper_CFD_AD_MeshDisp.tol = 1e-3 From d0a280ca768f99a0a2ecee74bb222f6e8cbe5f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 31 Oct 2023 12:39:57 +0100 Subject: [PATCH 098/139] Allow up to 255 colors. --- Common/include/toolboxes/graph_toolbox.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/include/toolboxes/graph_toolbox.hpp b/Common/include/toolboxes/graph_toolbox.hpp index c5929e8f8da..f1c0854ce27 100644 --- a/Common/include/toolboxes/graph_toolbox.hpp +++ b/Common/include/toolboxes/graph_toolbox.hpp @@ -484,7 +484,7 @@ T createNaturalColoring(Index_t numInnerIndexes) { * \param[out] indexColor - Optional, vector with colors given to the outer indices. * \return Coloring in the same type of the input pattern. */ -template +template T colorSparsePattern(const T& pattern, size_t groupSize = 1, bool balanceColors = false, std::vector* indexColor = nullptr) { static_assert(std::is_integral::value, ""); From 12c63c72133c13e14bf516443b27759ea73d31c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 31 Oct 2023 12:49:58 +0100 Subject: [PATCH 099/139] Report on the number of colors and the efficiency. --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 40af46827be..ccf939f1bf1 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -324,6 +324,9 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi << "\n The memory usage of the discrete adjoint solver is higher when using the fallback." #endif << endl; + } else { + cout << "Rank " << SU2_MPI::GetRank() << " uses " << coloring.getOuterSize() << " colors, " + << parallelEff << "efficiency." << endl; } } From 6d34de3428d8b703232d8a68397e71552010c53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 31 Oct 2023 16:47:53 +0100 Subject: [PATCH 100/139] Add space. --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index ccf939f1bf1..bee63030f7d 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -326,7 +326,7 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi << endl; } else { cout << "Rank " << SU2_MPI::GetRank() << " uses " << coloring.getOuterSize() << " colors, " - << parallelEff << "efficiency." << endl; + << parallelEff << " efficiency." << endl; } } From 766d7b1426ec980f06f84de25989073b1b3aa62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 27 Oct 2023 12:07:46 +0200 Subject: [PATCH 101/139] Maximize color group size per rank. --- Common/src/geometry/CGeometry.cpp | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 9ed1804186a..e912c5aa68f 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3637,6 +3637,42 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- Color the edges. ---*/ constexpr bool balanceColors = true; + + /* find an efficient coloring with maximum possible color group size */ + auto upperEdgeColorGroupSize = edgeColorGroupSize + 1; /* upper bound that does not work */ + auto nextEdgeColorGroupSize = edgeColorGroupSize; /* next value that we are going to try */ + auto lowerEdgeColorGroupSize = 1; /* lower bound that is known to work */ + + while (true) { + auto currentEdgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); + + /* if the coloring fails, reduce the color group size */ + if (currentEdgeColoring.empty()) { + upperEdgeColorGroupSize = nextEdgeColorGroupSize; + nextEdgeColorGroupSize = lowerEdgeColorGroupSize + (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; + continue; + } + + auto currentEfficiency = coloringEfficiency(currentEdgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); + + /* if the coloring is not efficient, reduce the color group size */ + if (currentEfficiency < COLORING_EFF_THRESH) { + upperEdgeColorGroupSize = nextEdgeColorGroupSize; + } + /* otherwise, try to enlarge the color group size */ + else { + lowerEdgeColorGroupSize = nextEdgeColorGroupSize; + } + auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; + + if (increment == 0) { + break; + } + + nextEdgeColorGroupSize = lowerEdgeColorGroupSize + increment; + } + + edgeColorGroupSize = lowerEdgeColorGroupSize; edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); /*--- If the coloring fails use the natural coloring. This is a From c454bd84eedbb7101de50fdf8bfd62f4c59b7119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 31 Oct 2023 19:27:12 +0100 Subject: [PATCH 102/139] Add output about chosen color group size. --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index bee63030f7d..83eda476613 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -325,8 +325,10 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi #endif << endl; } else { - cout << "Rank " << SU2_MPI::GetRank() << " uses " << coloring.getOuterSize() << " colors, " - << parallelEff << " efficiency." << endl; + cout << "Rank " << SU2_MPI::GetRank() << endl + << "\tnumber of colors " << coloring.getOuterSize() << endl + << "\tcolor group size " << geometry.GetEdgeColorGroupSize() << endl + << "\tefficiency " << parallelEff << endl; } } From 70bf19f28a541374563b0d72d67345f9ef995c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Mon, 13 Nov 2023 17:04:43 +0100 Subject: [PATCH 103/139] Aggregated output of coloring properties on master rank. --- .../include/solvers/CFVMFlowSolverBase.inl | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 83eda476613..14368a547d6 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -325,10 +325,28 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi #endif << endl; } else { - cout << "Rank " << SU2_MPI::GetRank() << endl - << "\tnumber of colors " << coloring.getOuterSize() << endl - << "\tcolor group size " << geometry.GetEdgeColorGroupSize() << endl - << "\tefficiency " << parallelEff << endl; + if (SU2_MPI::GetRank() == MASTER_NODE) { + cout << "All ranks use edge coloring." << endl; + } + } + + su2double coloredParallelEff = ReducerStrategy ? 1.0 : parallelEff; + su2double minColoredParallelEff = 1.0; + SU2_MPI::Reduce(&coloredParallelEff, &minColoredParallelEff, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + + unsigned long coloredNumColors = ReducerStrategy ? 0 : coloring.getOuterSize(); + unsigned long maxColoredNumColors = 0; + SU2_MPI::Reduce(&coloredNumColors, &maxColoredNumColors, 1, MPI_UNSIGNED_LONG, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); + + unsigned long coloredEdgeColorGroupSize = ReducerStrategy ? 1 << 30 : geometry.GetEdgeColorGroupSize(); + unsigned long minColoredEdgeColorGroupSize = 1 << 30; + SU2_MPI::Reduce(&coloredEdgeColorGroupSize, &minColoredEdgeColorGroupSize, 1, MPI_UNSIGNED_LONG, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); + + if (SU2_MPI::GetRank() == MASTER_NODE) { + cout << "Among the ranks that use edge coloring,\n" + << " the minimum efficiency is " << minColoredParallelEff << ",\n" + << " the maximum number of colors is " << maxColoredNumColors << ",\n" + << " the minimum edge color group size is " << minColoredEdgeColorGroupSize << "." << endl; } } From 8a155914c7065efc8cf70c84284b63f92213db91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 14 Nov 2023 13:32:13 +0100 Subject: [PATCH 104/139] Make adaptive edge color group sizes optional. --- Common/include/geometry/CGeometry.hpp | 6 ++- Common/src/geometry/CGeometry.cpp | 58 ++++++++++++++------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index f8111060725..4af65411cc2 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -1720,10 +1720,14 @@ class CGeometry { /*! * \brief Get the edge coloring. * \note This method computes the coloring if that has not been done yet. + * \note Can be instructed to determine and use the maximum edge color group size between 1 and + * CGeometry::edgeColorGroupSize that yields a coloring that is at least as efficient as #COLORING_EFF_THRESH. * \param[out] efficiency - optional output of the coloring efficiency. + * \param[in] maximizeEdgeColorGroupSize - use the maximum edge color group size that gives an efficient coloring. * \return Reference to the coloring. */ - const CCompressedSparsePatternUL& GetEdgeColoring(su2double* efficiency = nullptr); + const CCompressedSparsePatternUL& GetEdgeColoring(su2double* efficiency = nullptr, + bool maximizeEdgeColorGroupSize = false); /*! * \brief Force the natural (sequential) edge coloring. diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index e912c5aa68f..ffa6a37585c 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3609,7 +3609,7 @@ const su2vector& CGeometry::GetTransposeSparsePatternMap(Connecti return pattern.transposePtr(); } -const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency) { +const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency, bool maximizeEdgeColorGroupSize) { /*--- Check for dry run mode with dummy geometry. ---*/ if (nEdge == 0) return edgeColoring; @@ -3638,41 +3638,45 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- Color the edges. ---*/ constexpr bool balanceColors = true; - /* find an efficient coloring with maximum possible color group size */ - auto upperEdgeColorGroupSize = edgeColorGroupSize + 1; /* upper bound that does not work */ - auto nextEdgeColorGroupSize = edgeColorGroupSize; /* next value that we are going to try */ - auto lowerEdgeColorGroupSize = 1; /* lower bound that is known to work */ + /*--- if requested, find an efficient coloring with maximum color group size (up to edgeColorGroupSize) ---*/ + if (maximizeEdgeColorGroupSize) { + auto upperEdgeColorGroupSize = edgeColorGroupSize + 1; /* upper bound that is deemed too large */ + auto nextEdgeColorGroupSize = edgeColorGroupSize; /* next value that we are going to try */ + auto lowerEdgeColorGroupSize = 1ul; /* lower bound that is known to work */ - while (true) { - auto currentEdgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); + while (true) { + auto currentEdgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); - /* if the coloring fails, reduce the color group size */ - if (currentEdgeColoring.empty()) { - upperEdgeColorGroupSize = nextEdgeColorGroupSize; - nextEdgeColorGroupSize = lowerEdgeColorGroupSize + (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; - continue; - } + /*--- if the coloring fails, reduce the color group size ---*/ + if (currentEdgeColoring.empty()) { + upperEdgeColorGroupSize = nextEdgeColorGroupSize; + nextEdgeColorGroupSize = lowerEdgeColorGroupSize + (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; + continue; + } - auto currentEfficiency = coloringEfficiency(currentEdgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); + su2double currentEfficiency = + coloringEfficiency(currentEdgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); - /* if the coloring is not efficient, reduce the color group size */ - if (currentEfficiency < COLORING_EFF_THRESH) { - upperEdgeColorGroupSize = nextEdgeColorGroupSize; - } - /* otherwise, try to enlarge the color group size */ - else { - lowerEdgeColorGroupSize = nextEdgeColorGroupSize; - } - auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; + /*--- if the coloring is not efficient, reduce the color group size ---*/ + if (currentEfficiency < COLORING_EFF_THRESH) { + upperEdgeColorGroupSize = nextEdgeColorGroupSize; + } + /*--- otherwise, try to enlarge the color group size ---*/ + else { + lowerEdgeColorGroupSize = nextEdgeColorGroupSize; + } + auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; - if (increment == 0) { - break; + nextEdgeColorGroupSize = lowerEdgeColorGroupSize + increment; + + if (increment == 0) { + break; + } } - nextEdgeColorGroupSize = lowerEdgeColorGroupSize + increment; + edgeColorGroupSize = nextEdgeColorGroupSize; } - edgeColorGroupSize = lowerEdgeColorGroupSize; edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); /*--- If the coloring fails use the natural coloring. This is a From 21a0e4a52d399b7ae43b6eaf8d05b401eeb63cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 14 Nov 2023 13:54:38 +0100 Subject: [PATCH 105/139] Use adaptive edge color group sizes for the discrete adjoint. --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 7 +++++++ SU2_CFD/include/solvers/CScalarSolver.inl | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 14368a547d6..9d701789afc 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -288,7 +288,14 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi * sum the fluxes for each cell and set the diagonal of the system matrix. ---*/ su2double parallelEff = 1.0; + +#ifdef CODI_REVERSE_TYPE + /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color + * group size. Find the maximum edge color group size that yields an efficient coloring. ---*/ + const auto& coloring = geometry.GetEdgeColoring(¶llelEff, true); +#else const auto& coloring = geometry.GetEdgeColoring(¶llelEff); +#endif /*--- The decision to use the strategy is local to each rank. ---*/ ReducerStrategy = parallelEff < COLORING_EFF_THRESH; diff --git a/SU2_CFD/include/solvers/CScalarSolver.inl b/SU2_CFD/include/solvers/CScalarSolver.inl index 5b6415d65b0..21eac22ead8 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.inl +++ b/SU2_CFD/include/solvers/CScalarSolver.inl @@ -46,7 +46,13 @@ CScalarSolver::CScalarSolver(CGeometry* geometry, CConfig* config, #ifdef HAVE_OMP /*--- Get the edge coloring, see notes in CEulerSolver's constructor. ---*/ su2double parallelEff = 1.0; +#ifdef CODI_REVERSE_TYPE + /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color + * group size. Find the maximum edge color group size that yields an efficient coloring. ---*/ + const auto& coloring = geometry->GetEdgeColoring(¶llelEff, true); +#else const auto& coloring = geometry->GetEdgeColoring(¶llelEff); +#endif ReducerStrategy = parallelEff < COLORING_EFF_THRESH; From d45447ada250c23ef700cf62c920c5e91c031f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 14 Nov 2023 13:56:19 +0100 Subject: [PATCH 106/139] Larger number of colors for the discrete adjoint. --- Common/include/toolboxes/graph_toolbox.hpp | 2 +- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 5 +++-- SU2_CFD/include/solvers/CScalarSolver.inl | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Common/include/toolboxes/graph_toolbox.hpp b/Common/include/toolboxes/graph_toolbox.hpp index f1c0854ce27..c5929e8f8da 100644 --- a/Common/include/toolboxes/graph_toolbox.hpp +++ b/Common/include/toolboxes/graph_toolbox.hpp @@ -484,7 +484,7 @@ T createNaturalColoring(Index_t numInnerIndexes) { * \param[out] indexColor - Optional, vector with colors given to the outer indices. * \return Coloring in the same type of the input pattern. */ -template +template T colorSparsePattern(const T& pattern, size_t groupSize = 1, bool balanceColors = false, std::vector* indexColor = nullptr) { static_assert(std::is_integral::value, ""); diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 9d701789afc..6d6a76f4ba4 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -291,8 +291,9 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi #ifdef CODI_REVERSE_TYPE /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color - * group size. Find the maximum edge color group size that yields an efficient coloring. ---*/ - const auto& coloring = geometry.GetEdgeColoring(¶llelEff, true); + * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers + * of colors. ---*/ + const auto& coloring = geometry.GetEdgeColoring(¶llelEff, true); #else const auto& coloring = geometry.GetEdgeColoring(¶llelEff); #endif diff --git a/SU2_CFD/include/solvers/CScalarSolver.inl b/SU2_CFD/include/solvers/CScalarSolver.inl index 21eac22ead8..3f68ff8d793 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.inl +++ b/SU2_CFD/include/solvers/CScalarSolver.inl @@ -48,8 +48,9 @@ CScalarSolver::CScalarSolver(CGeometry* geometry, CConfig* config, su2double parallelEff = 1.0; #ifdef CODI_REVERSE_TYPE /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color - * group size. Find the maximum edge color group size that yields an efficient coloring. ---*/ - const auto& coloring = geometry->GetEdgeColoring(¶llelEff, true); + * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers + * of colors. ---*/ + const auto& coloring = geometry->GetEdgeColoring(¶llelEff, true); #else const auto& coloring = geometry->GetEdgeColoring(¶llelEff); #endif From f73946b4d7f91d919087f046e95bda933265520c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 15 Nov 2023 14:27:50 +0100 Subject: [PATCH 107/139] Switch between different numbers of colors. --- Common/include/geometry/CGeometry.hpp | 4 +++- Common/src/geometry/CGeometry.cpp | 16 +++++++++++++--- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 2 +- SU2_CFD/include/solvers/CScalarSolver.inl | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index 4af65411cc2..fc5c2931075 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -1724,10 +1724,12 @@ class CGeometry { * CGeometry::edgeColorGroupSize that yields a coloring that is at least as efficient as #COLORING_EFF_THRESH. * \param[out] efficiency - optional output of the coloring efficiency. * \param[in] maximizeEdgeColorGroupSize - use the maximum edge color group size that gives an efficient coloring. + * \param[in] largeNumberOfColors - allow up to 255 colors instead of 64 (default) * \return Reference to the coloring. */ const CCompressedSparsePatternUL& GetEdgeColoring(su2double* efficiency = nullptr, - bool maximizeEdgeColorGroupSize = false); + bool maximizeEdgeColorGroupSize = false, + bool largeNumberOfColors = false); /*! * \brief Force the natural (sequential) edge coloring. diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index ffa6a37585c..b88ef3d2198 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3609,7 +3609,8 @@ const su2vector& CGeometry::GetTransposeSparsePatternMap(Connecti return pattern.transposePtr(); } -const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency, bool maximizeEdgeColorGroupSize) { +const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency, bool maximizeEdgeColorGroupSize, + bool largeNumberOfColors) { /*--- Check for dry run mode with dummy geometry. ---*/ if (nEdge == 0) return edgeColoring; @@ -3638,6 +3639,15 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- Color the edges. ---*/ constexpr bool balanceColors = true; + /*--- lambda to account for different numbers of colors ---*/ + auto getColorSparsePattern = [&](unsigned long edgeColorGroupSize) { + if (largeNumberOfColors) { + return colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); + } else { + return colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); + } + }; + /*--- if requested, find an efficient coloring with maximum color group size (up to edgeColorGroupSize) ---*/ if (maximizeEdgeColorGroupSize) { auto upperEdgeColorGroupSize = edgeColorGroupSize + 1; /* upper bound that is deemed too large */ @@ -3645,7 +3655,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien auto lowerEdgeColorGroupSize = 1ul; /* lower bound that is known to work */ while (true) { - auto currentEdgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); + auto currentEdgeColoring = getColorSparsePattern(nextEdgeColorGroupSize); /*--- if the coloring fails, reduce the color group size ---*/ if (currentEdgeColoring.empty()) { @@ -3677,7 +3687,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien edgeColorGroupSize = nextEdgeColorGroupSize; } - edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); + edgeColoring = getColorSparsePattern(edgeColorGroupSize); /*--- If the coloring fails use the natural coloring. This is a * "soft" failure as this "bad" coloring should be detected diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 6d6a76f4ba4..3710340d0a7 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -293,7 +293,7 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers * of colors. ---*/ - const auto& coloring = geometry.GetEdgeColoring(¶llelEff, true); + const auto& coloring = geometry.GetEdgeColoring(¶llelEff, true, true); #else const auto& coloring = geometry.GetEdgeColoring(¶llelEff); #endif diff --git a/SU2_CFD/include/solvers/CScalarSolver.inl b/SU2_CFD/include/solvers/CScalarSolver.inl index 3f68ff8d793..ea2d6925066 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.inl +++ b/SU2_CFD/include/solvers/CScalarSolver.inl @@ -50,7 +50,7 @@ CScalarSolver::CScalarSolver(CGeometry* geometry, CConfig* config, /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers * of colors. ---*/ - const auto& coloring = geometry->GetEdgeColoring(¶llelEff, true); + const auto& coloring = geometry->GetEdgeColoring(¶llelEff, true, true); #else const auto& coloring = geometry->GetEdgeColoring(¶llelEff); #endif From 3cc21215140d4be6d29d472101c82940e4acabaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 15 Nov 2023 16:21:56 +0100 Subject: [PATCH 108/139] Further relax hybrid AD python wrapper test tolerances. --- TestCases/hybrid_regression_AD.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index cf419bde4e9..5ffeb5d71f0 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -242,7 +242,7 @@ def main(): pywrapper_FEA_AD_FlowLoad.test_vals_aarch64 = [-0.131745, -0.553214, -0.000364, -0.003101] pywrapper_FEA_AD_FlowLoad.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_FEA_AD_FlowLoad.timeout = 1600 - pywrapper_FEA_AD_FlowLoad.tol = 1e-3 + pywrapper_FEA_AD_FlowLoad.tol = 1e-2 pywrapper_FEA_AD_FlowLoad.new_output = False pywrapper_FEA_AD_FlowLoad.enabled_with_tsan = False test_list.append(pywrapper_FEA_AD_FlowLoad) @@ -257,7 +257,7 @@ def main(): pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.516536, 1.386443, 0.000000] pywrapper_CFD_AD_MeshDisp.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_CFD_AD_MeshDisp.timeout = 1600 - pywrapper_CFD_AD_MeshDisp.tol = 1e-3 + pywrapper_CFD_AD_MeshDisp.tol = 1e-2 pywrapper_CFD_AD_MeshDisp.new_output = False pywrapper_CFD_AD_MeshDisp.enabled_with_tsan = False test_list.append(pywrapper_CFD_AD_MeshDisp) From db1ef8bd4c917ca29305219cc4a647671c4ac46a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 16 Nov 2023 15:46:25 +0100 Subject: [PATCH 109/139] Add config option for discrete adjoint coloring relaxation. --- Common/include/CConfig.hpp | 6 ++++++ Common/src/CConfig.cpp | 3 +++ SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 3 ++- SU2_CFD/include/solvers/CScalarSolver.inl | 3 ++- config_template.cfg | 8 ++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index da11f902606..c5999023515 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1188,6 +1188,7 @@ class CConfig { string caseName; /*!< \brief Name of the current case */ unsigned long edgeColorGroupSize; /*!< \brief Size of the edge groups colored for OpenMP parallelization of edge loops. */ + bool edgeColoringRelaxDiscAdj; /*!< \brief Allow fallback to smaller edge color group sizes and use more colors for the discrete adjoint. */ INLET_SPANWISE_INTERP Kind_InletInterpolationFunction; /*!brief type of spanwise interpolation function to use for the inlet face. */ INLET_INTERP_TYPE Kind_Inlet_InterpolationType; /*!brief type of spanwise interpolation data to use for the inlet face. */ @@ -9738,6 +9739,11 @@ class CConfig { */ unsigned long GetEdgeColoringGroupSize(void) const { return edgeColorGroupSize; } + /*! + * \brief Check if the discrete adjoint is allowed to relax the coloring, that is, allow smaller edge color group sizes and allow more colors. + */ + bool GetEdgeColoringRelaxDiscAdj(void) const { return edgeColoringRelaxDiscAdj; } + /*! * \brief Get the ParMETIS load balancing tolerance. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index a34902142cf..2a82d959af7 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2952,6 +2952,9 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Size of the edge groups colored for thread parallel edge loops (0 forces the reducer strategy). */ addUnsignedLongOption("EDGE_COLORING_GROUP_SIZE", edgeColorGroupSize, 512); + /* DESCRIPTION: Allow fallback to smaller edge color group sizes for the discrete adjoint and allow more colors. */ + addBoolOption("EDGE_COLORING_RELAX_DISC_ADJ", edgeColoringRelaxDiscAdj, true); + /*--- options that are used for libROM ---*/ /*!\par CONFIG_CATEGORY:libROM options \ingroup Config*/ diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 3710340d0a7..db39cde78c0 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -293,7 +293,8 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers * of colors. ---*/ - const auto& coloring = geometry.GetEdgeColoring(¶llelEff, true, true); + const bool relax = config.GetEdgeColoringRelaxDiscAdj(); + const auto& coloring = geometry.GetEdgeColoring(¶llelEff, relax, relax); #else const auto& coloring = geometry.GetEdgeColoring(¶llelEff); #endif diff --git a/SU2_CFD/include/solvers/CScalarSolver.inl b/SU2_CFD/include/solvers/CScalarSolver.inl index ea2d6925066..d9f17d17e7b 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.inl +++ b/SU2_CFD/include/solvers/CScalarSolver.inl @@ -50,7 +50,8 @@ CScalarSolver::CScalarSolver(CGeometry* geometry, CConfig* config, /*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers * of colors. ---*/ - const auto& coloring = geometry->GetEdgeColoring(¶llelEff, true, true); + const bool relax = config->GetEdgeColoringRelaxDiscAdj(); + const auto& coloring = geometry->GetEdgeColoring(¶llelEff, relax, relax); #else const auto& coloring = geometry->GetEdgeColoring(¶llelEff); #endif diff --git a/config_template.cfg b/config_template.cfg index 774d55875e8..ff2862f3924 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1680,6 +1680,14 @@ UQ_DELTA_B= 1.0 % The optimum value/strategy is case-dependent. EDGE_COLORING_GROUP_SIZE= 512 % +% Coloring tends to perform better for the discrete adjoint than reductions because +% it uses less memory and enables the shared reading optimization for color loops. +% This option allows an automatic fallback to smaller edge color group sizes on ranks +% where the requested edge color group size is not efficient. Specifically, the largest +% edge color group size up to EDGE_COLORING_GROUP_SIZE is chosen that is at least +% 0.875 efficient. Also, this option allows using more colors, up to 255 instead of up to 64. +EDGE_COLORING_RELAX_DISC_ADJ= yes +% % Independent "threads per MPI rank" setting for LU-SGS and ILU preconditioners. % For problems where time is spend mostly in the solution of linear systems (e.g. elasticity, % very high CFL central schemes), AND, if the memory bandwidth of the machine is saturated From 18bb23bae978729c0db87e89dbee8d94d0d3a17c Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 17 Nov 2023 07:39:26 +0100 Subject: [PATCH 110/139] remove comment --- Common/src/CConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index d57e688df28..35c66022926 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2658,7 +2658,7 @@ void CConfig::SetConfig_Options() { /*!\par CONFIG_CATEGORY: Visualize Control Volumes \ingroup Config*/ /*--- options related to visualizing control volumes ---*/ - /* DESCRIPTION: Node number for the CV to be visualized (tecplot) (nijso: delete?) */ + /* DESCRIPTION: Node number for the CV to be visualized (tecplot) */ addLongOption("VISUALIZE_CV", Visualize_CV, -1); /*!\par CONFIG_CATEGORY: Inverse design problem \ingroup Config*/ From 063379375320b09909e4a39e500f18e3951bee0c Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 17 Nov 2023 13:04:44 +0100 Subject: [PATCH 111/139] update regression test --- TestCases/hybrid_regression_AD.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index cf419bde4e9..bf9db115aec 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -238,7 +238,7 @@ def main(): pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_fea/flow_load_sens" pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_fem.cfg" pywrapper_FEA_AD_FlowLoad.test_iter = 100 - pywrapper_FEA_AD_FlowLoad.test_vals = [-0.131742, -0.553318, -0.000364, -0.003101] #last 4 columns + pywrapper_FEA_AD_FlowLoad.test_vals = [-0.132159, -0.554968, -0.000364, -0.003101] #last 4 columns pywrapper_FEA_AD_FlowLoad.test_vals_aarch64 = [-0.131745, -0.553214, -0.000364, -0.003101] pywrapper_FEA_AD_FlowLoad.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_FEA_AD_FlowLoad.timeout = 1600 @@ -253,7 +253,7 @@ def main(): pywrapper_CFD_AD_MeshDisp.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" pywrapper_CFD_AD_MeshDisp.cfg_file = "configAD_flow.cfg" pywrapper_CFD_AD_MeshDisp.test_iter = 1000 - pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.520967, 1.375188, 0.000000] #last 4 columns + pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.521422, 1.372295, 0.000000] #last 4 columns pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.516536, 1.386443, 0.000000] pywrapper_CFD_AD_MeshDisp.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_CFD_AD_MeshDisp.timeout = 1600 From 88b127224064d6578d17b456a6f98aa2337ea9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 17 Nov 2023 13:43:15 +0100 Subject: [PATCH 112/139] Avoid void. --- Common/include/CConfig.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index c5999023515..2cb959fc3fc 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -9742,7 +9742,7 @@ class CConfig { /*! * \brief Check if the discrete adjoint is allowed to relax the coloring, that is, allow smaller edge color group sizes and allow more colors. */ - bool GetEdgeColoringRelaxDiscAdj(void) const { return edgeColoringRelaxDiscAdj; } + bool GetEdgeColoringRelaxDiscAdj() const { return edgeColoringRelaxDiscAdj; } /*! * \brief Get the ParMETIS load balancing tolerance. From 0cd77ae9e07e6f35bb1e087bc678040213df8082 Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 17 Nov 2023 15:44:51 +0100 Subject: [PATCH 113/139] update regression test --- TestCases/hybrid_regression_AD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index bf9db115aec..d763888fe99 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -238,7 +238,7 @@ def main(): pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_fea/flow_load_sens" pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_fem.cfg" pywrapper_FEA_AD_FlowLoad.test_iter = 100 - pywrapper_FEA_AD_FlowLoad.test_vals = [-0.132159, -0.554968, -0.000364, -0.003101] #last 4 columns + pywrapper_FEA_AD_FlowLoad.test_vals = [-0.131415, -0.551701, -0.000364, -0.003101] #last 4 columns pywrapper_FEA_AD_FlowLoad.test_vals_aarch64 = [-0.131745, -0.553214, -0.000364, -0.003101] pywrapper_FEA_AD_FlowLoad.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_FEA_AD_FlowLoad.timeout = 1600 From c3d8b9c170711ce4505e11aa188b8d20f1d2446d Mon Sep 17 00:00:00 2001 From: bigfooted Date: Fri, 17 Nov 2023 16:06:01 +0100 Subject: [PATCH 114/139] update regression test --- TestCases/hybrid_regression_AD.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index d763888fe99..7205140ad4c 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -242,7 +242,7 @@ def main(): pywrapper_FEA_AD_FlowLoad.test_vals_aarch64 = [-0.131745, -0.553214, -0.000364, -0.003101] pywrapper_FEA_AD_FlowLoad.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") pywrapper_FEA_AD_FlowLoad.timeout = 1600 - pywrapper_FEA_AD_FlowLoad.tol = 1e-3 + pywrapper_FEA_AD_FlowLoad.tol = 5e-3 pywrapper_FEA_AD_FlowLoad.new_output = False pywrapper_FEA_AD_FlowLoad.enabled_with_tsan = False test_list.append(pywrapper_FEA_AD_FlowLoad) From c6681e4e4a2cdfe9186916e2750dae65fa797dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 22 Nov 2023 14:10:22 +0100 Subject: [PATCH 115/139] Capitalization. --- config_template.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_template.cfg b/config_template.cfg index de4cf72416e..ea621b85e7e 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -2146,7 +2146,7 @@ EDGE_COLORING_GROUP_SIZE= 512 % where the requested edge color group size is not efficient. Specifically, the largest % edge color group size up to EDGE_COLORING_GROUP_SIZE is chosen that is at least % 0.875 efficient. Also, this option allows using more colors, up to 255 instead of up to 64. -EDGE_COLORING_RELAX_DISC_ADJ= yes +EDGE_COLORING_RELAX_DISC_ADJ= YES % % Independent "threads per MPI rank" setting for LU-SGS and ILU preconditioners. % For problems where time is spend mostly in the solution of linear systems (e.g. elasticity, From 843606a4b99f233eeaf6c1b64f3893db678f2bce Mon Sep 17 00:00:00 2001 From: TripleRider Date: Wed, 22 Nov 2023 22:57:58 -0800 Subject: [PATCH 116/139] Remove 'U' mode from open() (#2171) --- TestCases/TestCase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index fad7d560766..e46e1367425 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -340,10 +340,10 @@ def run_filediff(self, running_with_tsan=False): diff = '' try: fromdate = time.ctime(os.stat(fromfile).st_mtime) - fromlines = open(fromfile, 'U').readlines() + fromlines = open(fromfile, 'r').readlines() try: todate = time.ctime(os.stat(tofile).st_mtime) - tolines = open(tofile, 'U').readlines() + tolines = open(tofile, 'r').readlines() # If file tolerance is set to 0, make regular diff if self.tol_file_percent == 0.0: From 2fd31fce9c8e7fdd655b0305a2b218296ca731c4 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 30 Nov 2023 18:08:29 +0100 Subject: [PATCH 117/139] - Fixed CGNS writing --- .../src/output/filewriter/CCGNSFileWriter.cpp | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp index 34f75473b61..6e370d02a68 100644 --- a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp @@ -38,7 +38,7 @@ void CCGNSFileWriter::WriteData(string val_filename) { /*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/ val_filename.append(fileExt); - + /*--- Open the CGNS file for writing. ---*/ InitializeMeshFile(val_filename); @@ -132,15 +132,16 @@ void CCGNSFileWriter::WriteField(int iField, const string& FieldName) { /*--- Coordinate vector is written in blocks, one for each process. ---*/ cgsize_t nodeBegin = 1; auto nodeEnd = static_cast(nLocalPoints); - - if (isCoord) { - int CoordinateNumber; - CallCGNS(cg_coord_partial_write(cgnsFileID, cgnsBase, cgnsZone, dataType, FieldName.c_str(), &nodeBegin, &nodeEnd, - sendBufferField.data(), &CoordinateNumber)); - } else { - int fieldNumber; - CallCGNS(cg_field_partial_write(cgnsFileID, cgnsBase, cgnsZone, cgnsFields, dataType, FieldName.c_str(), &nodeBegin, - &nodeEnd, sendBufferField.data(), &fieldNumber)); + if(nLocalPoints > 0){ + if (isCoord) { + int CoordinateNumber; + CallCGNS(cg_coord_partial_write(cgnsFileID, cgnsBase, cgnsZone, dataType, FieldName.c_str(), &nodeBegin, &nodeEnd, + sendBufferField.data(), &CoordinateNumber)); + } else { + int fieldNumber; + CallCGNS(cg_field_partial_write(cgnsFileID, cgnsBase, cgnsZone, cgnsFields, dataType, FieldName.c_str(), &nodeBegin, + &nodeEnd, sendBufferField.data(), &fieldNumber)); + } } for (int i = 0; i < size; ++i) { From 35fb9d2f9ee6dfc06c4a06d782a5cade1c954ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Thu, 30 Nov 2023 19:22:27 +0100 Subject: [PATCH 118/139] No output if all ranks use the reducer strategy. --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index db39cde78c0..fd2eb13328f 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -351,7 +351,7 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi unsigned long minColoredEdgeColorGroupSize = 1 << 30; SU2_MPI::Reduce(&coloredEdgeColorGroupSize, &minColoredEdgeColorGroupSize, 1, MPI_UNSIGNED_LONG, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); - if (SU2_MPI::GetRank() == MASTER_NODE) { + if (SU2_MPI::GetRank() == MASTER_NODE && numRanksUsingReducer != SU2_MPI::GetSize()) { cout << "Among the ranks that use edge coloring,\n" << " the minimum efficiency is " << minColoredParallelEff << ",\n" << " the maximum number of colors is " << maxColoredNumColors << ",\n" From a84f9caa435882e8382a6251b3302df92d1613a9 Mon Sep 17 00:00:00 2001 From: Nijso Date: Thu, 30 Nov 2023 21:05:24 +0100 Subject: [PATCH 119/139] Update SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp --- SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp index 6e370d02a68..4399586c86b 100644 --- a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp @@ -38,7 +38,6 @@ void CCGNSFileWriter::WriteData(string val_filename) { /*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/ val_filename.append(fileExt); - /*--- Open the CGNS file for writing. ---*/ InitializeMeshFile(val_filename); From f25a4f2c86329b36ffa16ffb1dfe5f9377892f8a Mon Sep 17 00:00:00 2001 From: Nijso Date: Thu, 30 Nov 2023 21:07:12 +0100 Subject: [PATCH 120/139] Update SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp --- SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp index 4399586c86b..a4b89f39551 100644 --- a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp @@ -131,7 +131,7 @@ void CCGNSFileWriter::WriteField(int iField, const string& FieldName) { /*--- Coordinate vector is written in blocks, one for each process. ---*/ cgsize_t nodeBegin = 1; auto nodeEnd = static_cast(nLocalPoints); - if(nLocalPoints > 0){ + if (nLocalPoints > 0) { if (isCoord) { int CoordinateNumber; CallCGNS(cg_coord_partial_write(cgnsFileID, cgnsBase, cgnsZone, dataType, FieldName.c_str(), &nodeBegin, &nodeEnd, From 619b21c8f2712759039b31ee7a95f284674c2c32 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 1 Dec 2023 11:40:34 +0100 Subject: [PATCH 121/139] - Added regression test for CGNS writer --- TestCases/CGNSWrite/config.cfg | 187 +++++++++++++++++++++++++++++++ TestCases/parallel_regression.py | 14 +++ 2 files changed, 201 insertions(+) create mode 100644 TestCases/CGNSWrite/config.cfg diff --git a/TestCases/CGNSWrite/config.cfg b/TestCases/CGNSWrite/config.cfg new file mode 100644 index 00000000000..faeeea3f4f8 --- /dev/null +++ b/TestCases/CGNSWrite/config.cfg @@ -0,0 +1,187 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Transonic simulation RAE2822 (RANS) % +% Author: Francisco Palacios % +% Institution: Stanford University % +% Date: 5/15/2013 % +% File Version 7.4.0 "Blackbird" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +% Physical governing equations (EULER, NAVIER_STOKES, +% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, +% POISSON_EQUATION) +SOLVER= RANS +% +% Specify turbulent model (NONE, SA, SA_NEG, SST) +KIND_TURB_MODEL= SST +% +% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) +MATH_PROBLEM= DIRECT +% +% Restart solution (NO, YES) +RESTART_SOL= NO + +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 0.2 +% AirSpeed = 279.9663 +% Density = 1.225 +% +% Angle of attack (degrees, only for compressible flows) +AOA= 0.0 +% Free-stream temperature (288.15 K by default) +FREESTREAM_TEMPERATURE= 270.0 +% +% Reynolds number (non-dimensional, based on the free-stream values) +REYNOLDS_NUMBER= 3.28E6 +% +% Reynolds length (1 m by default) +REYNOLDS_LENGTH= 1 +REF_DIMENSIONALIZATION= FREESTREAM_VEL_EQ_MACH + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +% Reference origin for moment computation +REF_ORIGIN_MOMENT_X = -0.2473 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +% +% Reference length for pitching, rolling, and yawing non-dimensional moment +REF_LENGTH= 1 +% +% Reference area for force coefficients (0 implies automatic calculation) +% Body tube cross-area +REF_AREA= 1 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +% Navier-Stokes wall boundary marker(s) (NONE = no marker) +MARKER_HEATFLUX= ( OuterWall, 0.0, InnerWall, 0.0 ) +% +% Farfield boundary marker(s) (NONE = no marker) +MARKER_FAR= ( Inlet, Outlet ) + +% +% +% Marker(s) of the surface to be plotted or designed +MARKER_PLOTTING= ( InnerWall ) +% +% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated +MARKER_MONITORING= ( InnerWall ) + + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1.0e-6 +% lower memory consumption: +LINEAR_SOLVER_ITER= 15 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% + +NEWTON_KRYLOV= NO +NEWTON_KRYLOV_IPARAM= (10, 5, 2) % n0, np, ft +NEWTON_KRYLOV_DPARAM= (1.0, 0.01, -6, 1e-5) % r0, tp, rf, e +CFL_ADAPT= YES +CFL_NUMBER= 1 +CFL_REDUCTION_TURB= 1.0 +% +CFL_ADAPT_PARAM= ( 0.5, 1.01, 1.0, 5, 0.0001) + +ITER= 1 + +MGLEVEL= 0 +% +MGCYCLE= V_CYCLE +MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) +MG_POST_SMOOTH= ( 1, 1, 1, 1 ) +MG_CORRECTION_SMOOTH= ( 1, 1, 1, 1 ) +MG_DAMP_RESTRICTION= 0.5 +MG_DAMP_PROLONGATION= 0.5 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, +% TURKEL_PREC, MSW) +CONV_NUM_METHOD_FLOW= ROE +USE_VECTORIZATION= YES +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_FLOW= NO +% +% Slope limiter (VENKATAKRISHNAN, MINMOD) +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +% +% Coefficient for the limiter (smooth regions) +VENKAT_LIMITER_COEFF= 0.03 +% +% 2nd and 4th order artificial dissipation coefficients +JST_SENSOR_COEFF= ( 0.5, 0.02 ) +% +% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +% +% Convective numerical method (SCALAR_UPWIND) +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_TURB= NO +% +% Time discretization (EULER_IMPLICIT) +TIME_DISCRE_TURB= EULER_IMPLICIT + + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= MOMENT_X +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 +% + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +MESH_FILENAME= mesh.cgns +% +% Mesh input file format (SU2, CGNS, NETCDF_ASCII) +MESH_FORMAT= CGNS +% +% Restart flow input file +SOLUTION_FILENAME= restart_flow +% +TABULAR_FORMAT= CSV +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history_First +% +% Output file restart flow +RESTART_FILENAME= restart_flow +% +% Output file flow (w/o extension) variables +VOLUME_FILENAME= flow +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FILENAME= surface_flow +% +% Writing solution file frequency +OUTPUT_WRT_FREQ= 100 +% +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, LIFT, DRAG, MOMENT_Z) +OUTPUT_FILES= (SURFACE_CGNS) +WRT_FORCES_BREAKDOWN= NO +VOLUME_OUTPUT= (COORDINATES) +HISTORY_OUTPUT= (ITER) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 3278b46e737..481f355e9eb 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1555,6 +1555,20 @@ def main(): species3_multizone_restart.multizone = True test_list.append(species3_multizone_restart) + ##################### + ## CGNS writer ### + ##################### + + # CGNS writer + CGNSWrite = TestCase('CGNSWrite') + CGNSWrite.cfg_dir = "CGNSWrite" + CGNSWrite.cfg_file = "config.cfg" + CGNSWrite.test_iter = 1 + CGNSWrite.test_vals = [-2.974473, 0.665204, 5.068846, -7.003873] + CGNSWrite.command = TestCase.Command("mpirun -n 2", "SU2_CFD") + CGNSWrite.new_output = True + test_list.append(CGNSWrite) + ###################################### ### RUN TESTS ### ###################################### From 6124e0fe836f8257df94881d1de24707ccacd970 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 1 Dec 2023 12:47:01 +0100 Subject: [PATCH 122/139] - changed mesh for regression case --- TestCases/CGNSWrite/config.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestCases/CGNSWrite/config.cfg b/TestCases/CGNSWrite/config.cfg index faeeea3f4f8..bfad06bafd9 100644 --- a/TestCases/CGNSWrite/config.cfg +++ b/TestCases/CGNSWrite/config.cfg @@ -153,10 +153,10 @@ CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % % Mesh input file -MESH_FILENAME= mesh.cgns +MESH_FILENAME= mesh.su2 % % Mesh input file format (SU2, CGNS, NETCDF_ASCII) -MESH_FORMAT= CGNS +MESH_FORMAT= SU2 % % Restart flow input file SOLUTION_FILENAME= restart_flow From 90bc63b15fffa0b64903891d82fcdcdd8ec640d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= <55186095+jblueh@users.noreply.github.com> Date: Fri, 1 Dec 2023 16:28:19 +0100 Subject: [PATCH 123/139] Update Common/src/geometry/CGeometry.cpp Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- Common/src/geometry/CGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index b88ef3d2198..fd6b2c92bd4 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3639,7 +3639,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- Color the edges. ---*/ constexpr bool balanceColors = true; - /*--- lambda to account for different numbers of colors ---*/ + /*--- Lambda to account for different numbers of colors. ---*/ auto getColorSparsePattern = [&](unsigned long edgeColorGroupSize) { if (largeNumberOfColors) { return colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); From 39168b58e021e25b29ff148762389d8af3913df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 1 Dec 2023 16:36:33 +0100 Subject: [PATCH 124/139] Add const. --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index fd2eb13328f..2f86931ac2b 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -339,15 +339,15 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi } } - su2double coloredParallelEff = ReducerStrategy ? 1.0 : parallelEff; + const su2double coloredParallelEff = ReducerStrategy ? 1.0 : parallelEff; su2double minColoredParallelEff = 1.0; SU2_MPI::Reduce(&coloredParallelEff, &minColoredParallelEff, 1, MPI_DOUBLE, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); - unsigned long coloredNumColors = ReducerStrategy ? 0 : coloring.getOuterSize(); + const unsigned long coloredNumColors = ReducerStrategy ? 0 : coloring.getOuterSize(); unsigned long maxColoredNumColors = 0; SU2_MPI::Reduce(&coloredNumColors, &maxColoredNumColors, 1, MPI_UNSIGNED_LONG, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); - unsigned long coloredEdgeColorGroupSize = ReducerStrategy ? 1 << 30 : geometry.GetEdgeColorGroupSize(); + const unsigned long coloredEdgeColorGroupSize = ReducerStrategy ? 1 << 30 : geometry.GetEdgeColorGroupSize(); unsigned long minColoredEdgeColorGroupSize = 1 << 30; SU2_MPI::Reduce(&coloredEdgeColorGroupSize, &minColoredEdgeColorGroupSize, 1, MPI_UNSIGNED_LONG, MPI_MIN, MASTER_NODE, SU2_MPI::GetComm()); From e6ac3dbb06a6ca80ba81ef4f11be8f809b9b7e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 1 Dec 2023 16:43:52 +0100 Subject: [PATCH 125/139] More const. --- Common/src/geometry/CGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index fd6b2c92bd4..eaafe9d49b5 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3664,7 +3664,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien continue; } - su2double currentEfficiency = + const su2double currentEfficiency = coloringEfficiency(currentEdgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); /*--- if the coloring is not efficient, reduce the color group size ---*/ From 09efb1ae7614fd988ddc83e9c8dd8c6b3fc39863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Fri, 1 Dec 2023 18:06:32 +0100 Subject: [PATCH 126/139] Increase the default number of colors. --- Common/include/geometry/CGeometry.hpp | 4 +--- Common/include/toolboxes/graph_toolbox.hpp | 2 +- Common/src/geometry/CGeometry.cpp | 18 ++++-------------- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 2 +- SU2_CFD/include/solvers/CScalarSolver.inl | 2 +- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index fc5c2931075..4af65411cc2 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -1724,12 +1724,10 @@ class CGeometry { * CGeometry::edgeColorGroupSize that yields a coloring that is at least as efficient as #COLORING_EFF_THRESH. * \param[out] efficiency - optional output of the coloring efficiency. * \param[in] maximizeEdgeColorGroupSize - use the maximum edge color group size that gives an efficient coloring. - * \param[in] largeNumberOfColors - allow up to 255 colors instead of 64 (default) * \return Reference to the coloring. */ const CCompressedSparsePatternUL& GetEdgeColoring(su2double* efficiency = nullptr, - bool maximizeEdgeColorGroupSize = false, - bool largeNumberOfColors = false); + bool maximizeEdgeColorGroupSize = false); /*! * \brief Force the natural (sequential) edge coloring. diff --git a/Common/include/toolboxes/graph_toolbox.hpp b/Common/include/toolboxes/graph_toolbox.hpp index c5929e8f8da..f1c0854ce27 100644 --- a/Common/include/toolboxes/graph_toolbox.hpp +++ b/Common/include/toolboxes/graph_toolbox.hpp @@ -484,7 +484,7 @@ T createNaturalColoring(Index_t numInnerIndexes) { * \param[out] indexColor - Optional, vector with colors given to the outer indices. * \return Coloring in the same type of the input pattern. */ -template +template T colorSparsePattern(const T& pattern, size_t groupSize = 1, bool balanceColors = false, std::vector* indexColor = nullptr) { static_assert(std::is_integral::value, ""); diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index eaafe9d49b5..08d81daf59f 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3609,8 +3609,7 @@ const su2vector& CGeometry::GetTransposeSparsePatternMap(Connecti return pattern.transposePtr(); } -const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency, bool maximizeEdgeColorGroupSize, - bool largeNumberOfColors) { +const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency, bool maximizeEdgeColorGroupSize) { /*--- Check for dry run mode with dummy geometry. ---*/ if (nEdge == 0) return edgeColoring; @@ -3639,15 +3638,6 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- Color the edges. ---*/ constexpr bool balanceColors = true; - /*--- Lambda to account for different numbers of colors. ---*/ - auto getColorSparsePattern = [&](unsigned long edgeColorGroupSize) { - if (largeNumberOfColors) { - return colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); - } else { - return colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); - } - }; - /*--- if requested, find an efficient coloring with maximum color group size (up to edgeColorGroupSize) ---*/ if (maximizeEdgeColorGroupSize) { auto upperEdgeColorGroupSize = edgeColorGroupSize + 1; /* upper bound that is deemed too large */ @@ -3655,7 +3645,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien auto lowerEdgeColorGroupSize = 1ul; /* lower bound that is known to work */ while (true) { - auto currentEdgeColoring = getColorSparsePattern(nextEdgeColorGroupSize); + const auto currentEdgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); /*--- if the coloring fails, reduce the color group size ---*/ if (currentEdgeColoring.empty()) { @@ -3675,7 +3665,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien else { lowerEdgeColorGroupSize = nextEdgeColorGroupSize; } - auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; + const auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; nextEdgeColorGroupSize = lowerEdgeColorGroupSize + increment; @@ -3687,7 +3677,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien edgeColorGroupSize = nextEdgeColorGroupSize; } - edgeColoring = getColorSparsePattern(edgeColorGroupSize); + edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); /*--- If the coloring fails use the natural coloring. This is a * "soft" failure as this "bad" coloring should be detected diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 2f86931ac2b..c2af5a18d82 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -294,7 +294,7 @@ void CFVMFlowSolverBase::HybridParallelInitialization(const CConfig& confi * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers * of colors. ---*/ const bool relax = config.GetEdgeColoringRelaxDiscAdj(); - const auto& coloring = geometry.GetEdgeColoring(¶llelEff, relax, relax); + const auto& coloring = geometry.GetEdgeColoring(¶llelEff, relax); #else const auto& coloring = geometry.GetEdgeColoring(¶llelEff); #endif diff --git a/SU2_CFD/include/solvers/CScalarSolver.inl b/SU2_CFD/include/solvers/CScalarSolver.inl index d9f17d17e7b..343944ebd6c 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.inl +++ b/SU2_CFD/include/solvers/CScalarSolver.inl @@ -51,7 +51,7 @@ CScalarSolver::CScalarSolver(CGeometry* geometry, CConfig* config, * group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers * of colors. ---*/ const bool relax = config->GetEdgeColoringRelaxDiscAdj(); - const auto& coloring = geometry->GetEdgeColoring(¶llelEff, relax, relax); + const auto& coloring = geometry->GetEdgeColoring(¶llelEff, relax); #else const auto& coloring = geometry->GetEdgeColoring(¶llelEff); #endif From 3ee6027398458ef732ec6cf8888d50bddca594bc Mon Sep 17 00:00:00 2001 From: Mickael PHILIT Date: Sat, 2 Dec 2023 10:18:26 +0100 Subject: [PATCH 127/139] Upgrade external CGNS library to 4.4 release. --- externals/cgns/adf/ADF_interface.c | 6 +- externals/cgns/adf/ADF_internals.c | 4 +- externals/cgns/adfh/ADFH.c | 312 +- externals/cgns/adfh/ADFH.h | 4 +- externals/cgns/cg_hashmap.c | 11 +- externals/cgns/cgns_error.c | 4 +- externals/cgns/cgns_header.h | 10 +- externals/cgns/cgns_internals.c | 39 +- externals/cgns/cgns_io.h | 2 +- externals/cgns/cgnslib.c | 4575 ++++++++++++++++++++++++---- externals/cgns/cgnslib.h | 26 +- externals/cgns/pcgnslib.c | 1063 +++++-- externals/cgns/pcgnslib.h | 19 +- 13 files changed, 5143 insertions(+), 932 deletions(-) diff --git a/externals/cgns/adf/ADF_interface.c b/externals/cgns/adf/ADF_interface.c index 11c3502069a..59bd59d5466 100644 --- a/externals/cgns/adf/ADF_interface.c +++ b/externals/cgns/adf/ADF_interface.c @@ -1209,7 +1209,7 @@ else { /** this node is NOT a link **/ CHECK_ADF_ABORT( *error_return ) ; for( i=0; i 0 && lenfilename == strlen( link_data ) ) +else if ( lenfilename == strlen( link_data ) ) { strcpy( file, link_data) ; /** no link ? **/ } @@ -1688,7 +1688,7 @@ if ( lenfilename == 0 ) /** no filename **/ { *len_name = (int)strlen(link_data) - 1; } -else if ( lenfilename > 0 && lenfilename == strlen( link_data ) ) +else if ( lenfilename == strlen( link_data ) ) { *len_file = (int)lenfilename; } diff --git a/externals/cgns/adf/ADF_internals.c b/externals/cgns/adf/ADF_internals.c index a52878e13d6..27c673df9b8 100644 --- a/externals/cgns/adf/ADF_internals.c +++ b/externals/cgns/adf/ADF_internals.c @@ -155,7 +155,7 @@ bytes start end description range / format Variable: min 32 Data-chunks -(Minimum is 32 bytes, which cooresponds to the size required for a free-chunk) +(Minimum is 32 bytes, which corresponds to the size required for a free-chunk) bytes start end description range / format 4 0 3 "DaTa" boundary tag Tag 12 4 15 Pointer to End-of-Data-Tag @@ -7187,7 +7187,7 @@ NULL_STRING_POINTER ADF_FILE_NOT_OPENED PRISTK_NOT_FOUND Note: errors are only important for GET mode since you must then go ahead - and read the data fom the file. The stack is only meant to speed things + and read the data from the file. The stack is only meant to speed things up, not stop the process !!! ***********************************************************************/ int ADFI_stack_control( const unsigned int file_index, diff --git a/externals/cgns/adfh/ADFH.c b/externals/cgns/adfh/ADFH.c index 703cd0b62f6..94ec80cc491 100644 --- a/externals/cgns/adfh/ADFH.c +++ b/externals/cgns/adfh/ADFH.c @@ -61,6 +61,18 @@ static int CompressData = -1; #define ADFH_CONFIG_DEFAULT 0 +#if H5_VERSION_GE(1,10,3) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) +#define ADFH_HDF5_HAVE_110_API 1 +#else +#define ADFH_HDF5_HAVE_110_API 0 +#endif + +#if H5_VERSION_GE(1,12,0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API) +#define ADFH_HDF5_HAVE_112_API 1 +#else +#define ADFH_HDF5_HAVE_112_API 0 +#endif + /*** HDF5's CORE FILE DRIVER PARAMETERS ****/ /* Enables using the core file driver */ @@ -72,11 +84,12 @@ static size_t core_vfd_increment = 10L*1024L*1024L; static hbool_t core_vfd_backing_store = ADFH_CONFIG_DEFAULT; /** MISC. HDF5 OPTIMIZATION TUNING PARAMETERS */ -static hsize_t h5pset_alignment_threshold = ADFH_CONFIG_DEFAULT; -static hsize_t h5pset_alignment_alignment = ADFH_CONFIG_DEFAULT; -static hsize_t h5pset_meta_block_size_size = ADFH_CONFIG_DEFAULT; -static hsize_t h5pset_buffer_size_size = ADFH_CONFIG_DEFAULT; -static hsize_t h5pset_sieve_buf_size_size = ADFH_CONFIG_DEFAULT; +static hsize_t h5pset_alignment_threshold = ADFH_CONFIG_DEFAULT; +static hsize_t h5pset_alignment_alignment = ADFH_CONFIG_DEFAULT; +static hsize_t h5pset_meta_block_size_size = ADFH_CONFIG_DEFAULT; +static hsize_t h5pset_buffer_size_size = ADFH_CONFIG_DEFAULT; +static hsize_t h5pset_sieve_buf_size_size = ADFH_CONFIG_DEFAULT; +static unsigned h5pset_elink_file_cache_size_size = ADFH_CONFIG_DEFAULT; #define TO_UPPER( c ) ((islower(c))?(toupper(c)):(c)) @@ -155,10 +168,9 @@ printf aaa ; printf("\n"); fflush(stdout); #define ADFH_MODE_RDO 3 /* the following keeps track of open and mounted files */ +#define ADFH_MAXIMUM_FILES 1024 -#define ADFH_MAXIMUM_FILES 128 - -/* Start to prepare re-entrance into lib, gather statics in one global struct */ +/* Start to prepare re-entrance into lib, gather static variables in one global struct */ /* Then, you'll just have to handle struct with something else but a static... */ /* MTA stands for... Multi-Threads-Aware */ typedef struct _ADFH_MTA { @@ -179,6 +191,9 @@ typedef struct _ADFH_MTA { int g_flags; hid_t g_files[ADFH_MAXIMUM_FILES]; + /* tracking and indexing settings for link creation order */ + unsigned int link_create_order; + #ifndef ADFH_FORCE_ID_CLOSE /* object ids returned to API user that should be closed */ hid_t *g_extids[ADFH_MAXIMUM_FILES]; @@ -289,7 +304,7 @@ if (mta_root == NULL){set_error(ADFH_ERR_ROOTNULL, err);return 1;} static herr_t gfind_by_name(hid_t, const char *, const H5L_info_t*, void *); static herr_t find_by_name(hid_t, const char *, const H5A_info_t*, void *); -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API #define has_child(ID,NAME) H5Literate2(ID, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, NULL, gfind_by_name, (void *)NAME) #define has_data(ID) H5Literate2(ID, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, NULL, gfind_by_name, (void *)D_DATA) #else @@ -366,7 +381,7 @@ static hid_t get_file_id (hid_t id) int token_cmp; /* find the file ID from the root ID */ -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API if (H5Oget_info_by_name3(id, "/", &gstat, H5O_INFO_BASIC, H5P_DEFAULT) >=0) { #else if (H5Oget_info_by_name(id, "/", &gstat, H5P_DEFAULT) >=0) { @@ -377,7 +392,7 @@ static hid_t get_file_id (hid_t id) if (objs == NULL) return fid; H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_FILE, -1, objs); for (n = 0; n < nobj; n++) { -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API H5Oget_info_by_name3(objs[n], "/", &rstat, H5O_INFO_BASIC, H5P_DEFAULT); token_cmp = 1; if(gstat.fileno == rstat.fileno){ @@ -1053,7 +1068,7 @@ static herr_t compare_children(hid_t id, const char *name, const H5L_info_t *lin if (*name != D_PREFIX) { pstat = (H5O_info_t *)data; -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API if (H5Oget_info_by_name3(id, name, &stat, H5O_INFO_BASIC, H5P_DEFAULT) >= 0){ token_cmp = 1; if(pstat->fileno == stat.fileno){ @@ -1160,7 +1175,7 @@ static hid_t open_link(hid_t id, int *err) } } #ifdef ADFH_DEBUG_ON -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API H5Oget_info3(lid, &oinfo, H5O_INFO_BASIC); #else H5Oget_info(lid, &oinfo); @@ -1268,7 +1283,7 @@ static herr_t delete_children(hid_t id, const char *name, const H5L_info_t* linf } else { ADFH_DEBUG(("delete_children loop")); -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API if (! is_link(id)) H5Literate_by_name2(id, name, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, delete_children, data, H5P_DEFAULT); #else if (! is_link(id)) H5Literate_by_name(id, name, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, delete_children, data, H5P_DEFAULT); @@ -1428,7 +1443,7 @@ static herr_t fix_dimensions(hid_t id, const char *name, const H5L_info_t* linfo if (*name != D_PREFIX && (gid = H5Gopen2(id, name, H5P_DEFAULT)) >= 0 && !get_str_att(gid, A_TYPE, type, &err) && strcmp(type, ADFH_LK)) { -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API H5Literate2(gid, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, NULL, fix_dimensions, NULL); #else H5Literate(gid, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, NULL, fix_dimensions, NULL); @@ -1448,12 +1463,14 @@ static herr_t fix_dimensions(hid_t id, const char *name, const H5L_info_t* linfo void ADFH_Configure(const int option, const void *value, int *err) { if (option == ADFH_CONFIG_RESET && (int)((size_t)value == ADFH_CONFIG_RESET_HDF5)) { - core_vfd = ADFH_CONFIG_DEFAULT; - h5pset_alignment_threshold = ADFH_CONFIG_DEFAULT; - h5pset_alignment_alignment = ADFH_CONFIG_DEFAULT; - h5pset_meta_block_size_size = ADFH_CONFIG_DEFAULT; - h5pset_buffer_size_size = ADFH_CONFIG_DEFAULT; - h5pset_sieve_buf_size_size = ADFH_CONFIG_DEFAULT; + core_vfd = ADFH_CONFIG_DEFAULT; + h5pset_alignment_threshold = ADFH_CONFIG_DEFAULT; + h5pset_alignment_alignment = ADFH_CONFIG_DEFAULT; + h5pset_meta_block_size_size = ADFH_CONFIG_DEFAULT; + h5pset_buffer_size_size = ADFH_CONFIG_DEFAULT; + h5pset_sieve_buf_size_size = ADFH_CONFIG_DEFAULT; + h5pset_elink_file_cache_size_size = ADFH_CONFIG_DEFAULT; + set_error(NO_ERROR, err); return; } @@ -1498,6 +1515,10 @@ void ADFH_Configure(const int option, const void *value, int *err) h5pset_sieve_buf_size_size = (hsize_t)value; set_error(NO_ERROR, err); } + else if (option == ADFH_CONFIG_ELINK_FILE_CACHE_SIZE) { + h5pset_elink_file_cache_size_size = (unsigned)((size_t)value); + set_error(NO_ERROR, err); + } #if CG_BUILD_PARALLEL else if (option == ADFH_CONFIG_MPI_COMM) { MPI_Comm* comm = (MPI_Comm*)value; @@ -1550,7 +1571,7 @@ void ADFH_Move_Child(const double pid, /* check that node is actually child of the parent */ -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API if (H5Oget_info_by_name3(hid, ".", &stat, H5O_INFO_BASIC, H5P_DEFAULT) < 0 || !H5Literate2(hpid, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, NULL, compare_children, (void *)&stat)) { #else @@ -1606,7 +1627,7 @@ void ADFH_Move_Child(const double pid, set_int_att(hid, A_ORDER, new_order, err)) return; /*see if we need to decrement any node _orders under the old parent*/ -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API *err = H5Literate2(hpid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, fix_order, (void *)&old_order); #else *err = H5Literate(hpid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, fix_order, (void *)&old_order); @@ -1717,7 +1738,7 @@ void ADFH_Get_Label(const double id, { hid_t hid; char bufflabel[ADF_LABEL_LENGTH+1] = ""; - ADFH_DEBUG((">ADFH_Get_Label [%d]",id)); + ADFH_DEBUG((">ADFH_Get_Label [%f]",id)); if (label == NULL) { set_error(NULL_STRING_POINTER, err); @@ -1792,7 +1813,7 @@ void ADFH_Create(const double pid, new_int_att(gid, A_FLAGS, mta_root->g_flags, err)) return; #else int order = 0; -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API H5Literate2(hpid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, count_children, (void *)&order); #else H5Literate(hpid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, count_children, (void *)&order); @@ -1838,7 +1859,7 @@ void ADFH_Delete(const double pid, /* check that node is actually child of the parent */ -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API if (H5Oget_info_by_name3(hid, ".", &stat, H5O_INFO_BASIC, H5P_DEFAULT) < 0 || !H5Literate2(hpid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, compare_children, (void *)&stat)){ #else @@ -1862,7 +1883,7 @@ void ADFH_Delete(const double pid, if (! is_link(hid)) { -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API H5Literate2(hid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, delete_children, NULL); #else H5Literate(hid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, delete_children, NULL); @@ -1877,7 +1898,7 @@ void ADFH_Delete(const double pid, /* decrement node orders */ #ifndef ADFH_NO_ORDER -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API *err = H5Literate2(hpid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, fix_order, (void *)&old_order); #else *err = H5Literate(hpid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, fix_order, (void *)&old_order); @@ -1906,10 +1927,10 @@ void ADFH_Number_of_Children(const double id, *number = 0; if ((hid = open_node(id, err)) >= 0) { -#if H5_VERSION_GE(1,12,0) - H5Literate2(hid, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, &gskip, count_children, (void *)number); +#if ADFH_HDF5_HAVE_112_API + H5Literate2(hid, mta_root->link_create_order, H5_ITER_NATIVE, &gskip, count_children, (void *)number); #else - H5Literate(hid, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, &gskip, count_children, (void *)number); + H5Literate(hid, mta_root->link_create_order, H5_ITER_NATIVE, &gskip, count_children, (void *)number); #endif H5Gclose(hid); } @@ -1928,8 +1949,6 @@ void ADFH_Get_Node_ID(const double pid, hid_t sid, hpid; to_HDF_ID(pid,hpid); - ADFH_DEBUG((">ADFH_Get_Node_ID [%s][%d]",name,hpid)); - if (name == NULL) { set_error(NULL_STRING_POINTER, err); return; @@ -1939,6 +1958,8 @@ void ADFH_Get_Node_ID(const double pid, return; } + ADFH_DEBUG((">ADFH_Get_Node_ID [%s][%d]",name,hpid)); + *id = 0; set_error(NO_ERROR, err); if (*name == '/') { @@ -2011,11 +2032,10 @@ void ADFH_Children_Names(const double pid, #ifdef ADFH_NO_ORDER mta_root->i_count = 0; #endif - /*initialize names to null*/ - memset(names, 0, ilen*name_length); + memset(names, 0, (size_t)ilen*(size_t)name_length); if ((hpid = open_node(pid, err)) >= 0) { -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API H5Literate2(hpid,H5_INDEX_CRT_ORDER,H5_ITER_INC, NULL,children_names,(void *)names); #else @@ -2024,7 +2044,7 @@ void ADFH_Children_Names(const double pid, #endif if (names[0]==0) { -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API H5Literate2(hpid,H5_INDEX_NAME,H5_ITER_INC, NULL,children_names,(void *)names); #else @@ -2065,22 +2085,17 @@ void ADFH_Children_IDs(const double pid, mta_root->i_count = 0; #endif if ((hpid = open_node(pid, err)) >= 0) { -#if H5_VERSION_GE(1,12,0) - H5Literate2(hpid,H5_INDEX_CRT_ORDER,H5_ITER_INC, +#if ADFH_HDF5_HAVE_112_API + H5Literate2(hpid,mta_root->link_create_order,H5_ITER_INC, NULL,children_ids,(void *)IDs); #else - H5Literate(hpid,H5_INDEX_CRT_ORDER,H5_ITER_INC, + H5Literate(hpid,mta_root->link_create_order,H5_ITER_INC, NULL,children_ids,(void *)IDs); #endif if (IDs[0]==-1) { -#if H5_VERSION_GE(1,12,0) - H5Literate2(hpid,H5_INDEX_NAME,H5_ITER_INC, - NULL,children_ids,(void *)IDs); -#else - H5Literate(hpid,H5_INDEX_NAME,H5_ITER_INC, - NULL,children_ids,(void *)IDs); -#endif + set_error(CHILDREN_IDS_NOT_FOUND, err); + return; } H5Gclose(hpid); } @@ -2114,8 +2129,6 @@ void ADFH_Database_Open(const char *name, int i, pos, mode; hid_t g_propfileopen; - ADFH_DEBUG(("ADFH_Database_Open [%s]",name)); - /* to be thread safe, should have critical section here */ if (mta_root==NULL) { @@ -2128,6 +2141,8 @@ void ADFH_Database_Open(const char *name, */ mta_root->g_flags = 1; + mta_root->link_create_order = H5_INDEX_CRT_ORDER; + #ifndef ADFH_DEBUG_ON H5Eset_auto2(H5E_DEFAULT, NULL, NULL); #endif @@ -2156,6 +2171,8 @@ void ADFH_Database_Open(const char *name, return; } + ADFH_DEBUG(("ADFH_Database_Open [%s]",name)); + /* get open mode */ strncpy(buff, stat, 9); @@ -2230,14 +2247,17 @@ void ADFH_Database_Open(const char *name, /* HDF5 tuning parameters */ - /* http://www.hdfgroup.org/HDF5/doc/RM/H5P/H5Pset_meta_block_size.htm - * default setting is 2048 bytes + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title72 + * 'Sets the minimum metadata block size.' + * Default setting is 2048 bytes. */ if ( h5pset_meta_block_size_size != ADFH_CONFIG_DEFAULT ) { H5Pset_meta_block_size(g_propfileopen, h5pset_meta_block_size_size); } - /* http://hdfgroup.org/HDF5/doc/RM/H5P/H5Pset_alignment.htm - * attention: this can increase filesize dramatically if lots of small datasets + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title41 + * 'Sets alignment properties of a file access property list.' + * Default is no alignment. + * ATTENTION: this can increase filesize dramatically if lots of small datasets */ if ( h5pset_alignment_alignment != ADFH_CONFIG_DEFAULT ) { H5Pset_alignment(g_propfileopen, @@ -2245,42 +2265,36 @@ void ADFH_Database_Open(const char *name, h5pset_alignment_alignment); } - /* http://www.hdfgroup.org/HDF5/doc/RM/H5P/H5Pset_buffer.htm - * 1 MByte is default of hdf5 + /* https://docs.hdfgroup.org/hdf5/develop/group___d_x_p_l.html#title16 + * 'Sets type conversion and background buffers. + * 1 MByte is default. */ if ( h5pset_buffer_size_size != ADFH_CONFIG_DEFAULT ) { void *tconv=NULL; void *bkg=NULL; H5Pset_buffer(g_propfileopen, h5pset_buffer_size_size, tconv, bkg); } - /* http://hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize - * '.. used by file drivers that are capable of using data sieving' - * 1 MByte is default of hdf5 + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title78 + * 'Used by file drivers that are capable of using data sieving.' + * 1 MByte is default. */ if ( h5pset_sieve_buf_size_size != ADFH_CONFIG_DEFAULT ) { H5Pset_sieve_buf_size(g_propfileopen, h5pset_sieve_buf_size_size); } + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title48 + * 'Sets the number of files that can be held open in an external link open file cache.' + * 0 size is default. + */ + if ( h5pset_elink_file_cache_size_size != ADFH_CONFIG_DEFAULT ) { + H5Pset_elink_file_cache_size(g_propfileopen, h5pset_elink_file_cache_size_size); + } + #ifdef ADFH_H5F_CLOSE_STRONG /* set access property to close all open accesses when file closed */ H5Pset_fclose_degree(g_propfileopen, H5F_CLOSE_STRONG); #endif - /* Patch to read file created with CGNS 3.3 and hdf5 > 1.8 */ - if (mode == ADFH_MODE_RDO) { - H5Pset_libver_bounds(g_propfileopen, - H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - } - else { - /* Compatibility with V1.8 */ - H5Pset_libver_bounds(g_propfileopen, -#if H5_VERSION_GE(1,10,3) - H5F_LIBVER_V18, H5F_LIBVER_V18); -#else - H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); -#endif - } - /* open the file */ #if CG_BUILD_PARALLEL @@ -2314,41 +2328,61 @@ void ADFH_Database_Open(const char *name, set_error(NO_ERROR, err); if (mode == ADFH_MODE_NEW) { + + /* Compatibility with V1.8 */ + H5Pset_libver_bounds(g_propfileopen, +#if ADFH_HDF5_HAVE_110_API + H5F_LIBVER_V18, H5F_LIBVER_V18); +#else + H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); +#endif + hid_t g_propfilecreate = H5Pcreate(H5P_FILE_CREATE); - /* HDF5 tuning parameters */ + /* HDF5 tuning parameters */ - /* http://www.hdfgroup.org/HDF5/doc/RM/H5P/H5Pset_meta_block_size.htm - * default setting is 2048 bytes - */ - if ( h5pset_meta_block_size_size != ADFH_CONFIG_DEFAULT ) { - H5Pset_meta_block_size(g_propfileopen, h5pset_meta_block_size_size); - } + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title72 + * 'Sets the minimum metadata block size.' + * Default setting is 2048 bytes. + */ + if ( h5pset_meta_block_size_size != ADFH_CONFIG_DEFAULT ) { + H5Pset_meta_block_size(g_propfileopen, h5pset_meta_block_size_size); + } + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title41 + * 'Sets alignment properties of a file access property list.' + * Default is no alignment. + * ATTENTION: this can increase filesize dramatically if lots of small datasets + */ + if ( h5pset_alignment_alignment != ADFH_CONFIG_DEFAULT ) { + H5Pset_alignment(g_propfileopen, + h5pset_alignment_threshold, + h5pset_alignment_alignment); + } - /* http://hdfgroup.org/HDF5/doc/RM/H5P/H5Pset_alignment.htm - * attention: this can increase filesize dramatically if lots of small datasets - */ - if ( h5pset_alignment_alignment != ADFH_CONFIG_DEFAULT ) { - H5Pset_alignment(g_propfileopen, - h5pset_alignment_threshold, - h5pset_alignment_alignment); - } + /* https://docs.hdfgroup.org/hdf5/develop/group___d_x_p_l.html#title16 + * 'Sets type conversion and background buffers. + * 1 MByte is default. + */ + if ( h5pset_buffer_size_size != ADFH_CONFIG_DEFAULT ) { + void *tconv=NULL; void *bkg=NULL; + H5Pset_buffer(g_propfileopen, h5pset_buffer_size_size, tconv, bkg); + } - /* http://www.hdfgroup.org/HDF5/doc/RM/H5P/H5Pset_buffer.htm - * 1 MByte is default of hdf5 - */ - if ( h5pset_buffer_size_size != ADFH_CONFIG_DEFAULT) { - void *tconv=NULL; void *bkg=NULL; - H5Pset_buffer(g_propfileopen, h5pset_buffer_size_size, tconv, bkg); - } + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title78 + * 'Used by file drivers that are capable of using data sieving.' + * 1 MByte is default. + */ + if ( h5pset_sieve_buf_size_size != ADFH_CONFIG_DEFAULT ) { + H5Pset_sieve_buf_size(g_propfileopen, h5pset_sieve_buf_size_size); + } - /* http://hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize - * '.. used by file drivers that are capable of using data sieving' - * 1 MByte is default of hdf5 - */ - if ( h5pset_sieve_buf_size_size != ADFH_CONFIG_DEFAULT) { - H5Pset_sieve_buf_size(g_propfileopen, h5pset_sieve_buf_size_size); - } + /* https://docs.hdfgroup.org/hdf5/develop/group___f_a_p_l.html#title48 + * 'Sets the number of files that can be held open in an external link open file cache.' + * 0 size is default. + */ + if ( h5pset_elink_file_cache_size_size != ADFH_CONFIG_DEFAULT ) { + H5Pset_elink_file_cache_size(g_propfileopen, h5pset_elink_file_cache_size_size); + } #if 0 /* MSB -- DISABLED as it is not compatible with HDF5 1.8 file format, need to resolve this CGNS-166 */ #if HDF5_HAVE_FILE_SPACE_STRATEGY @@ -2360,6 +2394,7 @@ void ADFH_Database_Open(const char *name, (prop set to file creation )*/ H5Pset_link_creation_order(g_propfilecreate, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED); + fid = H5Fcreate(name, H5F_ACC_TRUNC, g_propfilecreate, g_propfileopen); H5Pclose(g_propfilecreate); H5Pclose(g_propfileopen); @@ -2381,7 +2416,7 @@ void ADFH_Database_Open(const char *name, } } else { -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API if (H5Fis_accessible(name, H5P_DEFAULT) <= 0) { #else if (H5Fis_hdf5(name) <= 0) { @@ -2390,29 +2425,80 @@ void ADFH_Database_Open(const char *name, set_error(ADFH_ERR_NOT_HDF5_FILE, err); return; } + #if CG_BUILD_PARALLEL #if HDF5_HAVE_COLL_METADATA H5Pset_all_coll_metadata_ops( g_propfileopen, 1 ); #endif #endif if (mode == ADFH_MODE_RDO) { + /* Patch to read file created with CGNS 3.3 and hdf5 > 1.8 */ + H5Pset_libver_bounds(g_propfileopen, + H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); fid = H5Fopen(name, H5F_ACC_RDONLY, g_propfileopen); } else { + +#if !ADFH_HDF5_HAVE_110_API + H5Pset_libver_bounds(g_propfileopen, + H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); +#endif + fid = H5Fopen(name, H5F_ACC_RDWR, g_propfileopen); + +#if ADFH_HDF5_HAVE_110_API + hid_t access_fapl = H5Fget_access_plist(fid); + + H5F_libver_t low, high; /* File format bounds */ + H5Pget_libver_bounds(access_fapl, &low, &high); + + if(low > H5F_LIBVER_V18) { + /* NOTE: HDF5 can not downgrade to a lower version bound (which can be done with h5repack), so + the best that can be done is not to use a version higher than the lower bound. */ + H5Fset_libver_bounds(fid, low, low); + } else { + H5Fset_libver_bounds(fid, H5F_LIBVER_V18, H5F_LIBVER_V18); + } + + H5Pclose(access_fapl); +#endif + } H5Pclose(g_propfileopen); if (fid < 0) { set_error(FILE_OPEN_ERROR, err); return; } + + /* + NOTE: Creation order was set by default in CGNS 3.1.3, so a + CGNS file created by earlier versions will not have this set. + Therefore, it should not be automatically assumed to be set in + H5Literate. + */ + gid = H5Gopen2(fid, "/", H5P_DEFAULT); + + /* Obtain the group creation flags and check for link creation ordering. */ + { + hid_t pid; + unsigned int crt_order_flags; + pid = H5Gget_create_plist(gid); + H5Pget_link_creation_order(pid, &crt_order_flags); + if (crt_order_flags == 0) { + mta_root->link_create_order = H5_INDEX_NAME; + } else { + mta_root->link_create_order = H5_INDEX_CRT_ORDER; + } + H5Pclose(pid); + } + #ifdef ADFH_FORTRAN_INDEXING if (mode != ADFH_MODE_RDO && child_exists(gid, D_OLDVERS)) { -#if H5_VERSION_GE(1,12,0) - H5Literate2(gid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, fix_dimensions, NULL); +#if ADFH_HDF5_HAVE_112_API + H5Literate2(gid, mta_root->link_create_order, H5_ITER_INC, NULL, fix_dimensions, NULL); #else - H5Literate(gid, H5_INDEX_CRT_ORDER, H5_ITER_INC, NULL, fix_dimensions, NULL); + H5Literate(gid, mta_root->link_create_order, H5_ITER_INC, NULL, fix_dimensions, NULL); #endif H5Lmove(gid, D_OLDVERS, gid, D_VERSION, H5P_DEFAULT, H5P_DEFAULT); } @@ -2437,7 +2523,7 @@ void ADFH_Database_Valid(const char *name, if (NULL == name || 0 == *name) *err = NULL_STRING_POINTER; else -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API *err = H5Fis_accessible(name, H5P_DEFAULT); #else *err = H5Fis_hdf5(name); @@ -2510,7 +2596,7 @@ void ADFH_Database_Delete(const char *name, { ADFH_DEBUG(("ADFH_Database_Delete [%s]",name)); -#if H5_VERSION_GE(1,12,0) +#if ADFH_HDF5_HAVE_112_API if (H5Fis_accessible(name, H5P_DEFAULT) <=0) #else if (H5Fis_hdf5(name) <= 0) @@ -2572,7 +2658,7 @@ void ADFH_Database_Close(const double root, nobj = H5Fget_obj_count(fid, H5F_OBJ_DATATYPE|H5F_OBJ_LOCAL); #ifdef ADFH_DEBUG_ON - printf("%s close DataType [%d] HIDs\n",ADFH_PREFIX,nobj); + printf("%s close DataType [%zd] HIDs\n",ADFH_PREFIX,nobj); #endif if (nobj) { H5Fget_obj_ids(fid, H5F_OBJ_DATATYPE|H5F_OBJ_LOCAL, -1, objs); @@ -2584,7 +2670,7 @@ void ADFH_Database_Close(const double root, nobj = H5Fget_obj_count(fid, H5F_OBJ_DATASET|H5F_OBJ_LOCAL); #ifdef ADFH_DEBUG_ON - printf("%s close DataSet [%d] HIDs\n",ADFH_PREFIX,nobj); + printf("%s close DataSet [%zd] HIDs\n",ADFH_PREFIX,nobj); #endif if (nobj) { H5Fget_obj_ids(fid, H5F_OBJ_DATASET|H5F_OBJ_LOCAL, -1, objs); @@ -2596,7 +2682,7 @@ void ADFH_Database_Close(const double root, nobj = H5Fget_obj_count(fid, H5F_OBJ_ATTR|H5F_OBJ_LOCAL); #ifdef ADFH_DEBUG_ON - printf("%s close Attr [%d] HIDs\n",ADFH_PREFIX,nobj); + printf("%s close Attr [%zd] HIDs\n",ADFH_PREFIX,nobj); #endif if (nobj) { H5Fget_obj_ids(fid, H5F_OBJ_ATTR|H5F_OBJ_LOCAL, -1, objs); @@ -2608,7 +2694,7 @@ void ADFH_Database_Close(const double root, nobj = H5Fget_obj_count(fid, H5F_OBJ_GROUP|H5F_OBJ_LOCAL); #ifdef ADFH_DEBUG_ON - printf("%s close Group [%d] HIDs\n",ADFH_PREFIX,nobj); + printf("%s close Group [%zd] HIDs\n",ADFH_PREFIX,nobj); #endif if (nobj) { H5Fget_obj_ids(fid, H5F_OBJ_GROUP|H5F_OBJ_LOCAL, -1, objs); @@ -3229,7 +3315,7 @@ void ADFH_Library_Version(char *version, return; } H5get_libversion(&maj, &min, &rel); - sprintf(version, "HDF5 Version %d.%d.%d", maj, min, rel); + sprintf(version, "HDF5 Version %u.%u.%u", maj, min, rel); set_error(NO_ERROR, err); } diff --git a/externals/cgns/adfh/ADFH.h b/externals/cgns/adfh/ADFH.h index 2dbd200f33b..d2a07d03b8f 100644 --- a/externals/cgns/adfh/ADFH.h +++ b/externals/cgns/adfh/ADFH.h @@ -117,6 +117,7 @@ #define NULL_NODEID_POINTER 62 #define MAX_FILE_SIZE_EXCEEDED 63 #define MAX_INT32_SIZE_EXCEEDED 64 +#define CHILDREN_IDS_NOT_FOUND 65 #endif /* ADF_INCLUDE */ @@ -175,7 +176,8 @@ #define ADFH_CONFIG_ALIGNMENT 6 #define ADFH_CONFIG_MD_BLOCK_SIZE 7 #define ADFH_CONFIG_HDF5_BUFFER 8 -#define ADFH_CONFIG_HDF5_SIEVE_BUF_SIZE 9 +#define ADFH_CONFIG_HDF5_SIEVE_BUF_SIZE 9 +#define ADFH_CONFIG_ELINK_FILE_CACHE_SIZE 10 #define ADFH_CONFIG_RESET 800 #define ADFH_CONFIG_RESET_HDF5 1 diff --git a/externals/cgns/cg_hashmap.c b/externals/cgns/cg_hashmap.c index 5b47a7978ba..ade13c4dca3 100644 --- a/externals/cgns/cg_hashmap.c +++ b/externals/cgns/cg_hashmap.c @@ -204,10 +204,17 @@ cgi_estimate_keysize(map_ssize_t n) */ #define GROWTH_RATE(d) ((d)->ma_used*2) +/* Dirty trick for unsupported flexible array init */ +struct _static_hashmapobject { + map_ssize_t table_size; + map_ssize_t map_usable; + map_ssize_t map_nentries; + char map_indices[8]; /* we define the size of the array to have a known struct at compile time */ +}; /* This immutable, empty cgns_hashmap_keyobject is used for HashMap_Clear() * (which cannot fail and thus can do no allocation). */ -static cgns_hashmap_keyobject empty_keys_struct = { +static struct _static_hashmapobject empty_keys_struct = { 1, /* table_size */ 0, /* map_usable (immutable) */ 0, /* map_nentries */ @@ -215,7 +222,7 @@ static cgns_hashmap_keyobject empty_keys_struct = { MAPIX_EMPTY, MAPIX_EMPTY, MAPIX_EMPTY, MAPIX_EMPTY}, /* map_indices */ }; -#define MAP_EMPTY_KEYS &empty_keys_struct +#define MAP_EMPTY_KEYS (cgns_hashmap_keyobject *)&empty_keys_struct static cgns_hashmap_keyobject* cgi_new_keys_object(map_ssize_t size) diff --git a/externals/cgns/cgns_error.c b/externals/cgns/cgns_error.c index e5d01d5e632..232a978f6fc 100644 --- a/externals/cgns/cgns_error.c +++ b/externals/cgns/cgns_error.c @@ -32,7 +32,7 @@ char cgns_error_mess[200] = "no CGNS error reported"; CGNSDLL void cgi_error(const char *format, ...) { va_list arg; va_start(arg, format); - vsprintf(cgns_error_mess,format, arg); + vsnprintf(cgns_error_mess, 200, format, arg); va_end(arg); if (cgns_error_handler) (*cgns_error_handler)(1, cgns_error_mess); @@ -43,7 +43,7 @@ CGNSDLL void cgi_warning(const char *format, ...) { va_start(arg, format); if (cgns_error_handler) { char warning_msg[200]; - vsprintf(warning_msg, format, arg); + vsnprintf(warning_msg, 200, format, arg); (*cgns_error_handler)(0, warning_msg); } else { diff --git a/externals/cgns/cgns_header.h b/externals/cgns/cgns_header.h index 140321b6b14..46e4b5e883c 100644 --- a/externals/cgns/cgns_header.h +++ b/externals/cgns/cgns_header.h @@ -1034,8 +1034,8 @@ CGNSDLL cgns_subreg *cgi_get_subreg (cgns_file *cg, int B, int Z, int S); CGNSDLL int cgi_update_posit(int cnt, int *index, char **label); CGNSDLL int cgi_set_posit(int fn, int B, int n, int *index, char **label); CGNSDLL int cgi_posit_id(double *posit_id); -CGNSDLL cgns_posit *cgi_get_posit(); -CGNSDLL int cgi_posit_index_dim(); +CGNSDLL cgns_posit *cgi_get_posit(void); +CGNSDLL int cgi_posit_index_dim(void); /* retrieve memory address of multiple patch children knowing their parent label (posit_label) and their parent memory address (posit) */ @@ -1067,7 +1067,7 @@ cgns_dataset * cgi_bcdataset_address(int local_mode, int given_no, char const *given_name, int *ier); /* read CGNS file into internal database */ -int cgi_read(); +int cgi_read(void); int cgi_read_base(cgns_base *base); int cgi_read_zone(cgns_zone *zone); int cgi_read_zonetype(double parent_id, char_33 parent_name, CGNS_ENUMT(ZoneType_t) *type); @@ -1157,7 +1157,7 @@ int cgi_write_zboco(double parent_id, cgns_zboco *zboco); int cgi_write_boco(double parent_id, cgns_boco *boco); int cgi_write_dataset(double parent_id, const char *label, cgns_dataset *dataset); int cgi_write_bcdata(double bcdata_id, cgns_bcdata *bcdata); -int cgi_write_ptset(double id, char_33 name, cgns_ptset *ptset, +int cgi_write_ptset(double id, char *name, cgns_ptset *ptset, int ndim, void *ptset_ptr); int cgi_write_equations(double parent_id, cgns_equations *equations); int cgi_write_model(double parent_id, cgns_model *model); @@ -1261,7 +1261,7 @@ int cgi_check_strlen(char const * string); int cgi_check_strlen_x2(char const *string); int cgi_check_mode(char const * filename, int file_mode, int mode_wanted); const char *cgi_adf_datatype(CGNS_ENUMT(DataType_t) type); -CGNSDLL CGNS_ENUMT(DataType_t) cgi_datatype(cchar_33 adf_type); +CGNSDLL CGNS_ENUMT(DataType_t) cgi_datatype(const char *adf_type); int cgi_check_dimensions(int ndims, cglong_t *dims); int cgi_check_location(int dim, CGNS_ENUMT(ZoneType_t) type, CGNS_ENUMT(GridLocation_t) loc); diff --git a/externals/cgns/cgns_internals.c b/externals/cgns/cgns_internals.c index 1077afd3bb8..0fd77e829bd 100644 --- a/externals/cgns/cgns_internals.c +++ b/externals/cgns/cgns_internals.c @@ -2126,7 +2126,7 @@ int cgi_read_conn(cgns_conn *conn) /* check */ if (cg->filetype == CGIO_FILE_ADF || cg->filetype == CGIO_FILE_ADF2) { if (conn->ptset.id==0) { - cgi_error("Niether PointRange nor PointList defined for GridConnectivity_t '%s'", + cgi_error("Neither PointRange nor PointList defined for GridConnectivity_t '%s'", conn->name); return CG_ERROR; } @@ -2136,7 +2136,7 @@ int cgi_read_conn(cgns_conn *conn) hid_t hid; to_HDF_ID(conn->ptset.id, hid); if (hid==0) { - cgi_error("Niether PointRange nor PointList defined for GridConnectivity_t '%s'", + cgi_error("Neither PointRange nor PointList defined for GridConnectivity_t '%s'", conn->name); return CG_ERROR; } @@ -8282,12 +8282,13 @@ int cgi_write_bcdata(double bcdata_id, cgns_bcdata *bcdata) return CG_OK; } -int cgi_write_ptset(double parent_id, char_33 name, cgns_ptset *ptset, +int cgi_write_ptset(double parent_id, char *name, cgns_ptset *ptset, int ndim, void *ptset_ptr) { cgsize_t dim_vals[12]; int num_dim; char_33 label; + int HDF5storage_type_original = HDF5storage_type; if (ptset->link) { return cgi_write_link(parent_id, name, ptset->link, &ptset->id); @@ -8305,10 +8306,19 @@ int cgi_write_ptset(double parent_id, char_33 name, cgns_ptset *ptset, dim_vals[1]=ptset->npts; num_dim = 2; + // PointLists should be contiguous for parallel reading/writing + if (ptset->type == CGNS_ENUMV(PointList) || + ptset->type == CGNS_ENUMV(PointListDonor) || + ptset->type == CGNS_ENUMV(ElementList) || + ptset->type == CGNS_ENUMV(CellListDonor)) { + HDF5storage_type = CG_CONTIGUOUS; + } + /* Create the node */ if (cgi_new_node(parent_id, name, label, &ptset->id, ptset->data_type, num_dim, dim_vals, ptset_ptr)) return CG_ERROR; + HDF5storage_type = HDF5storage_type_original; return CG_OK; } @@ -9945,15 +9955,15 @@ const char *cgi_adf_datatype(CGNS_ENUMV(DataType_t) type) return "NULL"; } -CGNS_ENUMT(DataType_t) cgi_datatype(cchar_33 adf_type) +CGNS_ENUMT(DataType_t) cgi_datatype(char const *adf_type) { - if (strcmp(adf_type, "I4") == 0) return CGNS_ENUMV(Integer); - if (strcmp(adf_type, "I8") == 0) return CGNS_ENUMV(LongInteger); - if (strcmp(adf_type, "R4") == 0) return CGNS_ENUMV(RealSingle); - if (strcmp(adf_type, "R8") == 0) return CGNS_ENUMV(RealDouble); - if (strcmp(adf_type, "C1") == 0) return CGNS_ENUMV(Character); - if (strcmp(adf_type, "X4") == 0) return CGNS_ENUMV(ComplexSingle); - if (strcmp(adf_type, "X8") == 0) return CGNS_ENUMV(ComplexDouble); + if (strncmp(adf_type, "I4", 33) == 0) return CGNS_ENUMV(Integer); + if (strncmp(adf_type, "I8", 33) == 0) return CGNS_ENUMV(LongInteger); + if (strncmp(adf_type, "R4", 33) == 0) return CGNS_ENUMV(RealSingle); + if (strncmp(adf_type, "R8", 33) == 0) return CGNS_ENUMV(RealDouble); + if (strncmp(adf_type, "C1", 33) == 0) return CGNS_ENUMV(Character); + if (strncmp(adf_type, "X4", 33) == 0) return CGNS_ENUMV(ComplexSingle); + if (strncmp(adf_type, "X8", 33) == 0) return CGNS_ENUMV(ComplexDouble); return CGNS_ENUMV(DataTypeNull); } @@ -11421,6 +11431,13 @@ static int cgi_next_posit(char *label, int index, char *name) label, index + 1, b->user_data[index].id); } } + else if (0 == strcmp (label, "IndexArray_t")) { + if (b->ptset && + (index == 1 || 0 == strcmp (b->ptset->name, name))) { + return cgi_add_posit((void *)b->ptset, + label, 1, b->ptset->id); + } + } else return CG_INCORRECT_PATH; } diff --git a/externals/cgns/cgns_io.h b/externals/cgns/cgns_io.h index e62c0d185e1..d9d49a8aa02 100644 --- a/externals/cgns/cgns_io.h +++ b/externals/cgns/cgns_io.h @@ -121,7 +121,7 @@ CGEXTERN int cgio_configure ( void *value ); -CGEXTERN void cgio_cleanup (); +CGEXTERN void cgio_cleanup (void); CGEXTERN int cgio_check_file ( const char *filename, diff --git a/externals/cgns/cgnslib.c b/externals/cgns/cgnslib.c index 387d0e3de75..6aa344c5e91 100644 --- a/externals/cgns/cgnslib.c +++ b/externals/cgns/cgnslib.c @@ -22,6 +22,64 @@ freely, subject to the following restrictions: * Revisions: * ***********************************************************************/ +/** + * \defgroup AccessingANode Accessing a node + * \defgroup ArbitraryGridMotion Arbitrary Grid Motion + * \defgroup AuxiliaryModel Auxiliary Model + * \defgroup Axisymmetry Axisymmetry + * \defgroup BCData Boundary Condition Data + * \defgroup BCDataset Boundary Condition Datasets + * \defgroup BaseIterativeData Base Iterative Data + * \defgroup BoundaryConditionDatasets Boundary Condition Datasets + * \defgroup BoundaryConditionType Boundary Condition Type and Location + * \defgroup CGNSBaseInformation CGNS Base Information + * \defgroup CGNSFamilyBoundaryDefinition Family Boundary Condition + * \defgroup CGNSFamilyDefinition Family Definition + * \defgroup CGNSFamilyHierarchyTreeDefinition Family Hierarchy Tree + * \defgroup CGNSFile File Operations + * \defgroup CGNSGeometryReference Geometry Reference + * \defgroup CGNSInterfaceCGIO Interfacing with CGIO + * \defgroup CGNSInternals Configuring CGNS Internals + * \defgroup CGNSZoneInformation CGNS Zone Information + * \defgroup ConvergenceHistory Convergence History + * \defgroup DataArrays Data Arrays + * \defgroup DataClass Data Class + * \defgroup DataConversionFactors Data Conversion Factors + * \defgroup DeletingANode Deleting a node + * \defgroup DescriptiveText Descriptive Text + * \defgroup DimensionalExponents Dimensional Exponents + * \defgroup DimensionalUnits Dimensional Units + * \defgroup DiscreteData Discrete Data + * \defgroup ElementConnectivity Element Connectivity + * \defgroup FamilyName Family Name + * \defgroup FlowEquationSet Flow Equation Set + * \defgroup FlowSolution Flow Solution + * \defgroup FlowSolutionData Flow Solution Data + * \defgroup FreeingMemory Freeing Memory + * \defgroup GeneralizedConnectivity Generalized Connectivity + * \defgroup GoverningEquations Governing Equations + * \defgroup Gravity Gravity + * \defgroup GridLocation Grid Location + * \defgroup IntegralData Integral Data + * \defgroup Links Links + * \defgroup OneToOneConnectivity One-to-One Connectivity + * \defgroup OrdinalValue Ordinal Value + * \defgroup OversetHoles Overset Holes + * \defgroup PointSets Point Sets + * \defgroup ReferenceState Reference State + * \defgroup RigidGridMotion Rigid Grid Motion + * \defgroup RindLayers Rind Layers + * \defgroup RotatingCoordinates Rotating Coordinates + * \defgroup SimulationType Simulation Type + * \defgroup SpecialBoundaryConditionProperty Special Boundary Condition Property + * \defgroup SpecialGridConnectivityProperty Special Grid Connectivity Property + * \defgroup UserDefinedData User Defined Data + * \defgroup ZoneGridConnectivity Zone Grid Connectivity + * \defgroup ZoneGridCoordinates Zone Grid Coordinates + * \defgroup ZoneIterativeData Zone Iterative Data + * \defgroup ZoneSubregions Zone Subregions + * + **/ #include #include @@ -259,7 +317,7 @@ const char * AverageInterfaceTypeName[NofValidAverageInterfaceTypes] = int n_open = 0; int cgns_file_size = 0; int file_number_offset = 0; -int VersionList[] = {4200, +int VersionList[] = {4500, 4400, 4300, 4200, 4110, 4100, 4000, 3210, 3200, 3140, 3130, 3110, 3100, @@ -317,7 +375,21 @@ void objlist_status(char *tag) * library functions ***********************************************************************/ -/* check for a valid CGNS file */ + +/** + * \ingroup CGNSFile + * + * \brief Check for a valid CGNS file. + * + * \param[in] filename \FILE_filename + * \param[in] file_type \FILE_file_type + * \return \ier + * + * \details For existing files, the function /e cg_is_cgns may be used to determine if a file is a CGNS file or not, and + * the type of file (\p CG_FILE_ADF or \p CG_FILE_HDF5). If the file is a CGNS file, \e cg_is_cgns returns \p CG_OK, + * otherwise \p CG_ERROR is returned and file_type is set to \p CG_FILE_NONE. + * + */ int cg_is_cgns(const char *filename, int *file_type) { @@ -334,12 +406,42 @@ int cg_is_cgns(const char *filename, int *file_type) return ierr ? CG_ERROR : CG_OK; } -/*********************************************************************** - * cg_open(char *filename, int mode, int *file_number) +/** + * \ingroup CGNSFile * - ***********************************************************************/ + * \brief Open a CGNS file. + * + * \param[in] filename \FILE_filename + * \param[in] mode \FILE_mode + * \param[out] fn \FILE_fn + * \return \ier + * + * \details The function \e cg_open must always be the first one called. It opens a CGNS file for reading and/or writing and returns + * an index number \e file_number. + * The index number serves to identify the CGNS file in subsequent function calls. Several CGNS files can be opened simultaneously. The current + * limit on the number of files opened at once depends on the platform. On an SGI workstation, this limit is set at 100 (parameter FOPEN_MAX in stdio.h). + * The file can be opened in one of the following modes: + * + *| | | + *|---|---| + *|__CG_MODE_READ__ | Read only mode. | + *|__CG_MODE_WRITE__| Write only mode. | + *|__CG_MODE_MODIFY__| Reading and/or writing is allowed.| + * + * When the file is opened, if no \e CGNSLibraryVersion_t node is found, a default value of 1.05 is assumed for the CGNS version number. Note that this + * corresponds to an old version of the CGNS standard, that doesn't include many data structures supported by the current standard. + * + * In order to reduce memory usage and improve execution speed, large arrays such as grid coordinates or flow solutions are not actually + * stored in memory. Instead, only basic information about the node is kept, while reads and writes of the data is directly to and from + * the application's memory. An attempt is also made to do the same with unstructured mesh element data. + * + * \note CGNS maintains one-way forward compatibility insofar as any file open and modified by, for example, version major.minor.patch + * will be readable with major.minor.patch< b>+< /b>. It can't be guaranteed the reverse major.minor.patch< b>-< /b> + * compatibility for that file will be true. + * + */ -int cg_open(const char *filename, int mode, int *file_number) +int cg_open(const char *filename, int mode, int *fn) { int cgio, filetype; cgsize_t dim_vals; @@ -385,7 +487,7 @@ int cg_open(const char *filename, int mode, int *file_number) } cg = &(cgns_files[n_cgns_files]); n_cgns_files++; - (*file_number) = n_cgns_files + file_number_offset; + (*fn) = n_cgns_files + file_number_offset; if (cgio_get_file_type(cgio, &filetype)) { cg_io_error("cgio_get_file_type"); @@ -399,7 +501,7 @@ int cg_open(const char *filename, int mode, int *file_number) cg->filetype = filetype; cg->cgio = cgio; cgio_get_root_id(cgio, &cg->rootid); - cg->file_number = (*file_number); + cg->file_number = (*fn); cg->version = 0; cg->deleted = 0; cg->added = 0; @@ -434,7 +536,7 @@ int cg_open(const char *filename, int mode, int *file_number) /* This code allows reading version newer than the lib, as long as the 1st digit of the versions are equal */ if ((cg->version / 1000) > (CGNSLibVersion / 1000)) { - cgi_error("The file %s was written with a more recent version of the CGNS library. You must update your CGNS library before trying to read this file.",filename); + cgi_error("A more recent version of the CGNS library created the file. Therefore, the CGNS library needs updating before reading the file '%s'.",filename); return CG_ERROR; } /* warn only if different in second digit */ @@ -511,17 +613,30 @@ int cg_open(const char *filename, int mode, int *file_number) return CG_OK; } -int cg_version(int file_number, float *FileVersion) +/** + * \ingroup CGNSFile + * + * \brief Get CGNS file version. + * + * \param[in] fn \FILE_fn + * \param[out] version \FILE_version + * \return \ier + * + * \details The function \e cg_version returns the CGNS version number. + * + */ + +int cg_version(int fn, float *version) { int nnod; double *id; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* if open in CG_MODE_WRITE */ if (cg->version) { - (*FileVersion)=(float)(cg->version)/1000; + (*version)=(float)(cg->version)/1000; return CG_OK; } @@ -531,7 +646,7 @@ int cg_version(int file_number, float *FileVersion) return CG_ERROR; if (nnod==0) { cg->version=3200; - *FileVersion= (float) 3.20; + *version= (float) 3.20; } else if (nnod!=1) { cgi_error("More then one CGNSLibraryVersion_t node found under ROOT."); return CG_ERROR; @@ -558,9 +673,9 @@ int cg_version(int file_number, float *FileVersion) return CG_ERROR; } /* save data */ - *FileVersion = *((float *)data); + *version = *((float *)data); free(data); - cg->version = (int)(1000.0*(*FileVersion)+0.5); + cg->version = (int)(1000.0*(*version)+0.5); /* To prevent round off error in version number for file of older or current version */ temp_version = cg->version; @@ -580,20 +695,32 @@ int cg_version(int file_number, float *FileVersion) free(id); } #if DEBUG_VERSION - printf("FileVersion=%f\n",*FileVersion); + printf("version=%f\n",*version); printf("cg->version=%d\n",cg->version); #endif return CG_OK; } +/** + * \ingroup CGNSFile + * + * \brief Get CGNS file precision. + * + * \param[in] fn \FILE_fn + * \param[out] precision \FILE_precision + * \return \ier + * + * \details Precision used to write the CGNS file. The \e precision value will be one of 32 (32-bit), 64 (64-bit), or 0 if not known. + * + */ -int cg_precision(int file_number, int *precision) +int cg_precision(int fn, int *precision) { int nb, nz; char_33 data_type; *precision = 0; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* if open in CG_MODE_WRITE */ @@ -615,10 +742,24 @@ int cg_precision(int file_number, int *precision) return CG_OK; } -int cg_close(int file_number) +/** + * \ingroup CGNSFile + * + * \brief Close a CGNS file. + * + * \param[in] fn \FILE_fn + * \return \ier + * + * \details The function \e cg_close must always be the last one called. It closes the CGNS file designated by the index number \e fn + * and frees the memory where the CGNS data was kept. When a file is opened for writing, \e cg_close writes all the CGNS data in + * memory onto disk prior to closing the file. Consequently, if is omitted, the CGNS file is not written properly. + * + */ + +int cg_close(int fn) { - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; #ifdef __CG_MALLOC_H__ @@ -667,12 +808,31 @@ int cg_close(int file_number) return CG_OK; } -int cg_save_as(int file_number, const char *filename, int file_type, +/** + * \ingroup CGNSFile + * + * \brief Save the open CGNS file. + * + * \param[in] fn \FILE_fn + * \param[in] filename \FILE_filename + * \param[in] file_type \FILE_file_type + * \param[in] follow_links \FILE_follow_links + * \return \ier + * + * \details The CGNS file identified by \e fn may be saved to a different filename and type using cg_save_as(). + * In order to save as an HDF5 file, the library must have been built with HDF5 support. ADF support is always built. + * The function cg_set_file_type() sets the default file type for newly created CGNS files. The function + * cg_get_file_type() returns the file type for the CGNS file identified by \e fn. If the CGNS library is built + * as 32-bit, the additional file type, \p CG_FILE_ADF2, is available. This allows creation of a 2.5 compatible CGNS file. + * + */ + +int cg_save_as(int fn, const char *filename, int file_type, int follow_links) { int output; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (file_type == CG_FILE_NONE) @@ -695,6 +855,22 @@ int cg_save_as(int file_number, const char *filename, int file_type, } return CG_OK; } +/** + * \ingroup CGNSFile + * + * \brief Set default file type. + * + * \param[in] file_type \FILE_file_type + * \return \ier + * + * \details When a CGNS file is newly created using \p CG_MODE_WRITE, the default type of database manager used is determined + * at compile time. If the CGNS library was built with HDF5 version 1.8 or later support, the file type will be \p CG_FILE_HDF5, + * otherwise \p CG_FILE_ADF is used. This may be changed either by setting an environment variable, \p CGNS_FILETYPE, to one + * of \e adf, \e hdf5, or \e adf2, or by calling the routine cg_set_file_type() prior to the cg_open() call. Calling + * cg_set_file_type() with the argument \p CG_FILE_NONE will reset the library to use the default file type. + * \b Note: If the environment variable \p CGNS_FILETYPE is set, it takes precedence. + * + */ int cg_set_file_type(int file_type) { @@ -734,9 +910,22 @@ int cg_set_file_type(int file_type) return CG_OK; } -int cg_get_file_type(int file_number, int *file_type) +/** + * \ingroup CGNSFile + * + * \brief Get file type for open CGNS file. + * + * \param[in] fn \FILE_fn + * \param[out] file_type \FILE_file_type + * \return \ier + * + * \details The function \p cg_get_file_type gets the file type (\e adf, \e hdf5, or \e adf2) for an open CGNS file. + * + */ + +int cg_get_file_type(int fn, int *file_type) { - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgio_get_file_type(cg->cgio, file_type)) { cg_io_error("cgio_get_file_type"); @@ -745,58 +934,115 @@ int cg_get_file_type(int file_number, int *file_type) return CG_OK; } -int cg_root_id(int file_number, double *root_id) +/** + * \ingroup CGNSInterfaceCGIO + * + * \brief Get the CGIO root node identifier for the CGNS file. + * + * \param[in] fn \FILE_fn + * \param[out] rootid Root node identifier for the CGNS file + * \return \ier + * + * \details The function \p cg_root_id allow the use of the low-level CGIO function + * in conjunction with the Mid Level Library. It returns the root node identifier for the CGNS file. + * + */ +int cg_root_id(int fn, double *rootid) { - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; - if (cgio_get_root_id(cg->cgio, root_id)) { + if (cgio_get_root_id(cg->cgio, rootid)) { cg_io_error("cgio_get_root_id"); return CG_ERROR; } return CG_OK; } -int cg_get_cgio(int file_number, int *cgio_num) +/** + * \ingroup CGNSInterfaceCGIO + * + * \brief Get the CGIO database identifier for the specified CGNS file. + * + * \param[in] fn \FILE_fn + * \param[out] cgio_num CGIO identifier for the CGNS file + * \return \ier + * + * \details The function \p cg_get_cgio allow the use of the low-level CGIO function + * in conjunction with the Mid Level Library. It returns the CGIO database identifier for the CGNS file. + * + */ +int cg_get_cgio(int fn, int *cgio_num) { - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; *cgio_num = cg->cgio; return CG_OK; } /* configure stuff */ - -int cg_configure(int what, void *value) +/** + * \ingroup CGNSInternals + * + * \brief Configure CGNS library internal options. + * + * \param[in] option The option to configure, currently one of \p CG_CONFIG_ERROR, \p CG_CONFIG_COMPRESS, \p CG_CONFIG_SET_PATH, \p CG_CONFIG_ADD_PATH, \p CG_CONFIG_FILE_TYPE, \p CG_CONFIG_RIND_INDEX, \p CG_CONFIG_HDF5_DISKLESS, \p CG_CONFIG_HDF5_DISKLESS_INCR, \p CG_CONFIG_HDF5_DISKLESS_WRITE, \p CG_CONFIG_HDF5_COMPRESS, or \p CG_CONFIG_HDF5_MPI_COMM as defined in cgnslib.h. + * \param[in] value The value to set, type cast as \e void * . In Fortran the type is \e TYPE(C_PTR). + * \return \ier + * + * + * \details The function \p cg_configure allows particular CGNS library internal options to be configured. The currently supported options and expected values are: + * + *| | | + *|---|---| + *|__CG_CONFIG_ERROR__| This allows an error call-back function to be defined by the user. The value should be a pointer to a function to receive the error. The function is defined as `void err_callback(int is_error, char *errmsg)`, and will be called for errors and warnings. The first argument, is_error, will be 0 for warning messages, 1 for error messages, and −1 if the program is going to terminate (i.e., a call to `cg_error_exit()`). The second argument is the error or warning message. If this is defined, warning and error messages will go to the function, rather than the terminal. A value of `NULL` will remove the call-back function. + *|__CG_CONFIG_COMPRESS__| This is the rewrite-upon-close setting. Note: Prior versions of the library would automatically rewrite the CGNS file when it was closed after being opened in modify mode if there was unused space. This is no longer done, due to possible conflicts when using parallel I/O. The previous behavior may be recovered by setting value to a positive integer. In this case the file will be rewritten if the number of node deletions or modifications are equal to or exceed this number. Setting value to a negative number will force the rewrite when the file is closed. The default value is 0 (no rewrite). + *|__CG_CONFIG_SET_PATH__| Sets the search path for locating linked-to files. The argument value should be a character string containing one or more directories, formatted the same as for the `PATH` environment variable. This will replace any current settings. Setting value to `NULL` will remove all paths. + *|__CG_CONFIG_ADD_PATH__| Adds a directory, or list of directories, to the linked-to file search path. This is the same as `CG_CONFIG_SET_PATH`, but adds to the path instead of replacing it. + *|__CG_CONFIG_FILE_TYPE__| Sets the default file type for newly created CGNS files. The argument, value should be set to one of `CG_FILE_NONE`, `CG_FILE_ADF`, `CG_FILE_HDF5`, or `CG_FILE_ADF2`. See the discussion above for `cg_set_file_type`. + *|__CG_CONFIG_RIND_INDEX__| This option affects index bounds on structured arrays with rind planes. By default (`CG_CONFIG_RIND_CORE`), the core array locations always begin at index 1. Lower rind planes, if present, would have an index less than 1. For backward compatibility, `CG_CONFIG_RIND_ZERO` is provided and the index 1 will then locate the start of the array and not necessarily the start the core array. Note: Use of this option does not change the cgns file in any way; it only modifies the API to the library. The API changed for versions of the Mid-Level Library greater than 3.4. Before, it did not produce this behavior. Index 1 always represented the start of an array: in an array with no rind planes, the core location would have index 1; in an array with 1 rind plane, the core location would have index 2. In version 3.4 of the Mid-Level Library, the behavior of the API was fixed to match that specified in the SIDS: core array locations always begin at index 1. This option allows for configuring the library to pre-3.4 indexing behavior (set value to `CG_CONFIG_RIND_ZERO`) or the new default behavior (set value to `CG_CONFIG_RIND_CORE`). Note that using `CG_CONFIG_RIND_ZERO` is considered obsolete, but is provided for backwards compatibility. Most users should not set this option and use the default. Values used for this option do not need to be explicitly cast as `void*`. + *|__CG_CONFIG_HDF5_COMPRESS__| Sets the compression level for data written from HDF5. The default is no compression. Setting value to -1, will use the default compression level of 6. The acceptable values are 0 to 9, corresponding to gzip compression levels. + *|__CG_CONFIG_HDF5_MPI_COMM__| Sets the MPI communicator for parallel I/O. The default is `MPI_COMM_WORLD`. The new communicator is given by typecasting it to a `void *`. This is generally used internally - see `cgp_mpi_comm` instead. + *|__CG_CONFIG_HDF5_DISKLESS_INCR__| Value specifies the increment by which allocated memory is to be increased each time more memory is required, in bytes. The default is 10MiB. Ideally, value should be set large enough to minimize repeated increases. The type of value is size_t in C and C_SIZE_T in Fortran. Due to a bug with gfortran, it is advisable to use C_LOC or C_FUNLOC in-line of the call instead of using a variable. + *|__CG_CONFIG_HDF5_DISKLESS_WRITE__| Value indicates whether to write (value=1) the memory contents to disk when the file is closed. Otherwise, value=0 does not persist the memory to disk. + *|__CG_CONFIG_HDF5_ALIGNMENT__| Configures HDF5's H5Pset_alignment and sets the alignment, value[1], properties of a file access property list so that any file object greater than or equal in size to a threshold, value[0], bytes will be aligned on an address which is a multiple of alignment. + *|__CG_CONFIG_HDF5_MD_BLOCK_SIZE__| Configures HDF5's H5Pset_meta_block_size and sets the minimum size, value (in bytes), of metadata block allocations. + *|__CG_CONFIG_HDF5_BUFFER__| Configures HDF5's H5Pset_buffer and sets the maximum size, value (in bytes), for the type conversion buffer and background buffer. + *|__CG_CONFIG_HDF5_SIEVE_BUF_SIZE__| Configures HDF5's H5Pset_sieve_buf_size and sets the maximum size, value (in bytes), of the data sieve buffer. + *|__CG_CONFIG_RESET__| Value indicates the configuration values to reset to their default values. Currently, only CG_CONFIG_RESET_HDF5 is a valid value and will reset all the CG_CONFIG_HDF5_* parameters, excluding CG_CONFIG_HDF5_MPI_COMM and CG_CONFIG_HDF5_DISKLESS, to their default values. + * + * + */ +int cg_configure(int option, void *value) { /* cgio options */ - if (what > 100) { - if( cgio_configure(what, value) != CG_OK) { + if (option > 100) { + if( cgio_configure(option, value) != CG_OK) { cg_io_error("cgio_configure"); return CG_ERROR; } } /* error message handler */ - else if (what == CG_CONFIG_ERROR) { + else if (option == CG_CONFIG_ERROR) { cgns_error_handler = (void (*)(int, char *))value; } /* file compression */ - else if (what == CG_CONFIG_COMPRESS) { + else if (option == CG_CONFIG_COMPRESS) { cgns_compress = (int)((size_t)value); } /* initialize link search path */ - else if (what == CG_CONFIG_SET_PATH) { + else if (option == CG_CONFIG_SET_PATH) { return cg_set_path((const char *)value); } /* add to link search path */ - else if (what == CG_CONFIG_ADD_PATH) { + else if (option == CG_CONFIG_ADD_PATH) { return cg_set_path((const char *)value); } /* default file type */ - else if (what == CG_CONFIG_FILE_TYPE) { + else if (option == CG_CONFIG_FILE_TYPE) { return cg_set_file_type((int)((size_t)value)); } /* allow pre v3.4 rind-plane indexing */ - else if (what == CG_CONFIG_RIND_INDEX) { + else if (option == CG_CONFIG_RIND_INDEX) { if (value != CG_CONFIG_RIND_ZERO && value != CG_CONFIG_RIND_CORE) { cgi_error("unknown config setting"); @@ -811,24 +1057,56 @@ int cg_configure(int what, void *value) return CG_OK; } +/** + * \ingroup CGNSInternals + * + * \brief Set CGNS error handler + * + * \param[in] func error handler function + * \return \ier + */ int cg_error_handler(void (*func)(int, char *)) { cgns_error_handler = func; return CG_OK; } +/** + * \ingroup CGNSInternals + * + * \brief Set CGNS compression mode + * + * \param[in] compress CGNS compress (rewrite) setting + * \return \ier + */ int cg_set_compress(int compress) { cgns_compress = compress; return CG_OK; } +/** + * \ingroup CGNSInternals + * + * \brief Get CGNS compression mode + * + * \param[out] compress CGNS compress (rewrite) setting + * \return \ier + */ int cg_get_compress(int *compress) { *compress = cgns_compress; return CG_OK; } +/** + * \ingroup CGNSInternals + * + * \brief Set the CGNS link search path + * + * \param[in] path to search for linked to files when opening a file with external links. + * \return \ier + */ int cg_set_path(const char *path) { cgio_path_delete(NULL); @@ -841,6 +1119,14 @@ int cg_set_path(const char *path) return CG_OK; } +/** + * \ingroup CGNSInternals + * + * \brief Add to the CGNS link search path + * + * \param[in] path to search for linked to files when opening a file with external links. + * \return \ier + */ int cg_add_path(const char *path) { if (cgio_path_add(path)) { @@ -966,11 +1252,20 @@ const char *cg_AverageInterfaceTypeName(CGNS_ENUMT( AverageInterfaceType_t ) ty /*****************************************************************************\ * Read and Write CGNSBase_t Nodes \*****************************************************************************/ - -int cg_nbases(int file_number, int *nbases) +/** + * \ingroup CGNSBaseInformation + * + * \brief Get number of CGNS base nodes in file + * + * \param[in] fn \FILE_fn + * \param[out] nbases Number of bases present in the CGNS file fn. + * \return \ier + * + */ +int cg_nbases(int fn, int *nbases) { - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -979,12 +1274,25 @@ int cg_nbases(int file_number, int *nbases) return CG_OK; } -int cg_base_read(int file_number, int B, char *basename, int *cell_dim, +/** + * \ingroup CGNSBaseInformation + * + * \brief Read CGNS base information + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] basename Name of the base + * \param[out] cell_dim Dimension of the cells; 3 for volume cells, 2 for surface cells and 1 for line cells. + * \param[out] phys_dim Number of coordinates required to define a vector in the field. + * \return \ier + * + */ +int cg_base_read(int fn, int B, char *basename, int *cell_dim, int *phys_dim) { cgns_base *base; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -999,11 +1307,23 @@ int cg_base_read(int file_number, int B, char *basename, int *cell_dim, return CG_OK; } -int cg_base_id(int file_number, int B, double *base_id) + +/** + * \ingroup CGNSBaseInformation + * + * \brief Get the CGIO identifier of the CGNS base + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] base_id CGIO node identifier for the base + * \return \ier + * + */ +int cg_base_id(int fn, int B, double *base_id) { cgns_base *base; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -1015,11 +1335,22 @@ int cg_base_id(int file_number, int B, double *base_id) return CG_OK; } -int cg_cell_dim(int file_number, int B, int *cell_dim) +/** + * \ingroup CGNSBaseInformation + * + * \brief Get the cell dimension for the CGNS base + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] cell_dim Dimension of the cells; 3 for volume cells, 2 for surface cells and 1 for line cells. + * \return \ier + * + */ +int cg_cell_dim(int fn, int B, int *cell_dim) { cgns_base *base; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; base = cgi_get_base(cg, B); if (base==0) return CG_ERROR; @@ -1028,7 +1359,20 @@ int cg_cell_dim(int file_number, int B, int *cell_dim) return CG_OK; } -int cg_base_write(int file_number, const char * basename, int cell_dim, +/** + * \ingroup CGNSBaseInformation + * + * \brief Create and/or write to a CGNS base node + * + * \param[in] fn \FILE_fn + * \param[in] basename Name of the base. + * \param[in] cell_dim Dimension of the cells; 3 for volume cells, 2 for surface cells and 1 for line cells. + * \param[in] phys_dim Number of coordinates required to define a vector in the field. + * \param[out] B \B_Base + * \return \ier + * + */ +int cg_base_write(int fn, const char * basename, int cell_dim, int phys_dim, int *B) { cgns_base *base = NULL; @@ -1043,7 +1387,7 @@ int cg_base_write(int file_number, const char * basename, int cell_dim, return CG_ERROR; } /* get memory address for base */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -1101,11 +1445,22 @@ int cg_base_write(int file_number, const char * basename, int cell_dim, * Read and Write Zone_t Nodes \*****************************************************************************/ -int cg_nzones(int file_number, int B, int *nzones) +/** + * \ingroup CGNSZoneInformation + * + * \brief Get number of zone in base + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] nzones Number of zones present in base B. + * \return \ier + * + */ +int cg_nzones(int fn, int B, int *nzones) { cgns_base *base; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -1117,11 +1472,23 @@ int cg_nzones(int file_number, int B, int *nzones) return CG_OK; } -int cg_zone_type(int file_number, int B, int Z, CGNS_ENUMT(ZoneType_t) *type) +/** + * \ingroup CGNSZoneInformation + * + * \brief Get type of zone (structured or unstructured) + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] zonetype Type of the zone. The admissible types are Structured and Unstructured. + * \return \ier + * + */ +int cg_zone_type(int fn, int B, int Z, CGNS_ENUMT(ZoneType_t) *zonetype) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -1129,16 +1496,43 @@ int cg_zone_type(int file_number, int B, int Z, CGNS_ENUMT(ZoneType_t) *type) zone = cgi_get_zone(cg, B, Z); if (zone==0) return CG_ERROR; - *type = zone->type; + *zonetype = zone->type; return CG_OK; } -int cg_zone_read(int file_number, int B, int Z, char *zonename, cgsize_t *nijk) + +/** + * \ingroup CGNSZoneInformation + * + * \brief Read zone information + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] zonename Name of the zone + * \param[out] size Number of vertices, cells, and boundary vertices in each (index)-dimension. For structured grids, the dimensions have unit stride in the array (e.g., `[NVertexI, NVertexJ, NVertexK, NCellI, NCellJ, NCellK, NBoundVertexI, NBoundVertexJ, NBoundVertexK]`). +Note that for unstructured grids, the number of cells is the number of highest order elements. Thus, in three dimensions it's the number of 3-D cells, and in two dimensions it's the number of 2-D cells. +Also for unstructured grids, if the nodes are sorted between internal nodes and boundary nodes, the optional parameter `NBoundVertex` must be set equal to the number of boundary nodes. By default, `NBoundVertex` equals zero, meaning that the nodes are unsorted. +Note that a non-zero value for `NBoundVertex` only applies to unstructured grids. For structured grids, the `NBoundVertex` parameter always equals 0 in all directions. + *|Mesh Type | Size| + *|---------------|-----| + *| 3D structured | `NVertexI`, `NVertexJ`, `NVertexK` + *| ^ | `NCellI`, `NCellJ`, `NCellK` + *| ^ | `NBoundVertexI = 0`, `NBoundVertexJ = 0`, `NBoundVertexK = 0` + *| 2D structured | `NVertexI`, `NVertexJ` + *| ^ | `NCellI`, `NCellJ` + *| ^ | `NBoundVertexI = 0`, `NBoundVertexJ = 0` + *|3D unstructured| `NVertex`, `NCell3D`, `NBoundVertex` + *|2D unstructured| `NVertex`, `NCell2D`, `NBoundVertex` + * \return \ier + * + */ +int cg_zone_read(int fn, int B, int Z, char *zonename, cgsize_t *size) { cgns_zone *zone; int i; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -1148,16 +1542,17 @@ int cg_zone_read(int file_number, int B, int Z, char *zonename, cgsize_t *nijk) strcpy(zonename, zone->name); - for (i=0; i<3*(zone->index_dim); i++) nijk[i] = zone->nijk[i]; + for (i=0; i<3*(zone->index_dim); i++) size[i] = zone->nijk[i]; return CG_OK; } -int cg_zone_id(int file_number, int B, int Z, double *zone_id) + +int cg_zone_id(int fn, int B, int Z, double *zone_id) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -1169,11 +1564,22 @@ int cg_zone_id(int file_number, int B, int Z, double *zone_id) return CG_OK; } -int cg_index_dim(int file_number, int B, int Z, int *index_dim) +/** + * \ingroup CGNSZoneInformation + * + * \brief Get the index dimension of the CGNS zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] index_dim Index dimension for the zone. For Structured zones, this will be the base cell dimension and for Unstructured zones it will be 1 + * \return \ier + */ +int cg_index_dim(int fn, int B, int Z, int *index_dim) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; zone = cgi_get_zone(cg, B, Z); if (zone==0) return CG_ERROR; @@ -1182,8 +1588,34 @@ int cg_index_dim(int file_number, int B, int Z, int *index_dim) return CG_OK; } -int cg_zone_write(int file_number, int B, const char *zonename, const cgsize_t * nijk, - CGNS_ENUMT( ZoneType_t ) type, int *Z) +/** + * \ingroup CGNSZoneInformation + * + * \brief Create and/or write to a CGNS zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] zonename Name of the zone. + * \param[in] size Number of vertices, cells, and boundary vertices in each (index)-dimension. For structured grids, the dimensions have unit stride in the array (e.g., [NVertexI, NVertexJ, NVertexK, NCellI, NCellJ, NCellK, NBoundVertexI, NBoundVertexJ, NBoundVertexK]). + *Note that for unstructured grids, the number of cells is the number of highest order elements. Thus, in three dimensions it's the number of 3-D cells, and in two dimensions it's the number of 2-D cells. + *Also for unstructured grids, if the nodes are sorted between internal nodes and boundary nodes, the optional parameter NBoundVertex must be set equal to the number of boundary nodes. By default, NBoundVertex equals zero, meaning that the nodes are unsorted. + *Note that a non-zero value for NBoundVertex only applies to unstructured grids. For structured grids, the NBoundVertex parameter always equals 0 in all directions. + *|Mesh Type | Size| + *|---------------|-----| + *| 3D structured | NVertexI, NVertexJ, NVertexK + *| | NCellI, NCellJ, NCellK + *| | NBoundVertexI = 0, NBoundVertexJ = 0, NBoundVertexK = 0 + *|2D structured | NVertexI, NVertexJ + *| | NCellI, NCellJ + *| | NBoundVertexI = 0, NBoundVertexJ = 0 + *|3D unstructured| NVertex, NCell3D, NBoundVertex + *|2D unstructured| NVertex, NCell2D, NBoundVertex + * \param[in] zonetype Type of the zone. The admissible types are Structured and Unstructured. + * \param[out] Z \Z_Zone + * \return \ier + */ +int cg_zone_write(int fn, int B, const char *zonename, const cgsize_t * size, + CGNS_ENUMT( ZoneType_t ) zonetype, int *Z) { cgns_base *base; cgns_zone *zone = NULL; @@ -1195,7 +1627,7 @@ int cg_zone_write(int file_number, int B, const char *zonename, const cgsize_t * if (cgi_check_strlen(zonename)) return CG_ERROR; /* get memory address file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -1206,9 +1638,9 @@ int cg_zone_write(int file_number, int B, const char *zonename, const cgsize_t * if (base==0) return CG_ERROR; /* Set index dimension */ - if (type == CGNS_ENUMV( Structured )) + if (zonetype == CGNS_ENUMV( Structured )) index_dim = base->cell_dim; - else if (type == CGNS_ENUMV( Unstructured )) + else if (zonetype == CGNS_ENUMV( Unstructured )) index_dim = 1; else { cgi_error("Invalid zone type - not Structured or Unstructured"); @@ -1216,13 +1648,13 @@ int cg_zone_write(int file_number, int B, const char *zonename, const cgsize_t * } for (i=0; inijk"); return CG_ERROR; } - for (i=0; i<3*index_dim; i++) zone->nijk[i] = nijk[i]; + for (i=0; i<3*index_dim; i++) zone->nijk[i] = size[i]; zone->index_dim = index_dim; - zone->type = type; + zone->type = zonetype; /* save data in file */ dim_vals[0]=zone->index_dim; @@ -1294,9 +1726,9 @@ int cg_zone_write(int file_number, int B, const char *zonename, const cgsize_t * if (cgi_new_node(base->id, zone->name, "Zone_t", &zone->id, CG_SIZE_DATATYPE, 2, dim_vals, (void *)zone->nijk)) return CG_ERROR; - dim_vals[0] = (cgsize_t)strlen(ZoneTypeName[type]); + dim_vals[0] = (cgsize_t)strlen(ZoneTypeName[zonetype]); if (cgi_new_node(zone->id, "ZoneType", "ZoneType_t", &dummy_id, - "C1", 1, dim_vals, ZoneTypeName[type])) return CG_ERROR; + "C1", 1, dim_vals, ZoneTypeName[zonetype])) return CG_ERROR; return CG_OK; } @@ -1305,11 +1737,22 @@ int cg_zone_write(int file_number, int B, const char *zonename, const cgsize_t * * Read and Write Family_t Nodes \*****************************************************************************/ -int cg_nfamilies(int file_number, int B, int *nfamilies) +/** + * \ingroup CGNSFamilyDefinition + * + * \brief Get number of Family_t node at CGNSBase_t level + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] nfamilies Number of families in base B + * \return \ier + * + */ +int cg_nfamilies(int fn, int B, int *nfamilies) { cgns_base *base; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -1321,17 +1764,31 @@ int cg_nfamilies(int file_number, int B, int *nfamilies) return CG_OK; } -int cg_family_read(int file_number, int B, int F, char *family_name, +/** + * \ingroup CGNSFamilyDefinition + * + * \brief Read family information (CGNSBase_t level) + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[out] family_name Name of the family + * \param[out] nboco Number of boundary conditions for this family. This should be either 0 or 1. + * \param[out] ngeos Number of geometry references for this family. + * \return \ier + * + */ +int cg_family_read(int fn, int B, int Fam, char *family_name, int *nboco, int *ngeos) { cgns_family *family; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - family = cgi_get_family(cg, B, F); + family = cgi_get_family(cg, B, Fam); if (family==0) return CG_ERROR; strcpy(family_name, family->name); @@ -1342,7 +1799,20 @@ int cg_family_read(int file_number, int B, int F, char *family_name, } /* ** FAMILY TREE ** */ -int cg_family_write(int file_number, int B, const char * family_name, int *F) + +/** + * \ingroup CGNSFamilyDefinition + * + * \brief Read family information (CGNSBase_t level) + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] family_name Name of the family + * \param[out] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \return \ier + * + */ +int cg_family_write(int fn, int B, const char * family_name, int *Fam) { int index; cgns_base *base; @@ -1353,7 +1823,7 @@ int cg_family_write(int file_number, int B, const char * family_name, int *F) int skip = 0; /* Check file access */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -1467,7 +1937,7 @@ int cg_family_write(int file_number, int B, const char * family_name, int *F) (*nfamilies_p)++; } - (*F) = index+1; + (*Fam) = index+1; if( ! skip ) { /* If not an existing intermediate family node */ memset( family, 0, sizeof(cgns_family) ); @@ -1491,45 +1961,86 @@ int cg_family_write(int file_number, int B, const char * family_name, int *F) /*----------------------------------------------------------------------*/ -int cg_nfamily_names(int file_number, int B, int F, int *nnames) +/** + * \ingroup CGNSFamilyDefinition + * + * \brief Get number of family names under Family_t (CGNSBase_t level) + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[out] nnames Number of FamilyName_t nodes for this family. + * \return \ier + * + */ +int cg_nfamily_names(int fn, int B, int Fam, int *nnames) { cgns_family *fam; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - fam = cgi_get_family(cg, B, F); + fam = cgi_get_family(cg, B, Fam); if (fam == 0) return CG_ERROR; *nnames = fam->nfamname; return CG_OK; } -int cg_family_name_read(int file_number, int B, int F, int N, char *name, char *family) +/** + * \ingroup CGNSFamilyDefinition + * + * \brief Read multiple family names under Family_t (CGNSBase_t level) + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[in] N Family name index number, where 1 ≤ N ≤ nNames. + * \param[out] node_name Name of the FamilyName_t node. FamilyParent is used to refer to the parent family of the Family_t node. + * \param[out] family_name Name of the family + * \return \ier + * + */ +int cg_family_name_read(int fn, int B, int Fam, int N, char *node_name, char *family_name) { cgns_family *fam; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - fam = cgi_get_family(cg, B, F); + fam = cgi_get_family(cg, B, Fam); if (fam == 0) return CG_ERROR; if (N < 1 || N > fam->nfamname) { cgi_error("family name index out of range\n"); return CG_ERROR; } - strcpy(name, fam->famname[N-1].name); - strcpy(family, fam->famname[N-1].family); + strcpy(node_name, fam->famname[N-1].name); + strcpy(family_name, fam->famname[N-1].family); return CG_OK; } + /* ** FAMILY TREE ** */ -int cg_family_name_write(int file_number, int B, int F, - const char *name, const char *family) + +/** + * \ingroup CGNSFamilyDefinition + * + * \brief Write multiple family names under Family_t (CGNSBase_t level) + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[out] node_name Name of the FamilyName_t node. FamilyParent is used to refer to the parent family of the Family_t node. + * \param[out] family_name Name of the family + * \return \ier + * + */ +int cg_family_name_write(int fn, int B, int Fam, + const char *node_name, const char *family_name) { int index; cgsize_t dim; @@ -1537,25 +2048,25 @@ int cg_family_name_write(int file_number, int B, int F, cgns_famname *famname = 0; /* verify input */ - if (cgi_check_strlen(name)) return CG_ERROR; + if (cgi_check_strlen(node_name)) return CG_ERROR; - if ( strlen(family) > (CGIO_MAX_NAME_LENGTH+1)*CG_MAX_GOTO_DEPTH ) { - cgi_error( "Family path too long (%s, size %ld)", family, strlen(family) ); + if ( strlen(family_name) > (CGIO_MAX_NAME_LENGTH+1)*CG_MAX_GOTO_DEPTH ) { + cgi_error( "Family path too long (%s, size %ld)", family_name, strlen(family_name) ); return CG_ERROR; } - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; - fam = cgi_get_family(cg, B, F); + fam = cgi_get_family(cg, B, Fam); if (fam == 0) return CG_ERROR; for (index = 0; index < fam->nfamname; index++) { - if (0 == strcmp(name, fam->famname[index].name)) { + if (0 == strcmp(node_name, fam->famname[index].name)) { if (cg->mode == CG_MODE_WRITE) { - cgi_error("Duplicate child name found: %s", name); + cgi_error("Duplicate child name found: %s", node_name); return CG_ERROR; } if (cgi_delete_node(fam->id, fam->famname[index].id)) @@ -1574,8 +2085,8 @@ int cg_family_name_write(int file_number, int B, int F, fam->nfamname++; } - strcpy(famname->name, name); - strcpy(famname->family, family); + strcpy(famname->name, node_name); + strcpy(famname->family, family_name); dim = (cgsize_t)strlen(famname->family); if (cgi_new_node(fam->id, famname->name, "FamilyName_t", &famname->id, @@ -1584,9 +2095,18 @@ int cg_family_name_write(int file_number, int B, int F, return CG_OK; } -/* ** FAMILY TREE ** */ -/* FamilyTree extension */ -int cg_node_family_write( const char* family_name, int* F) + +/** + * \ingroup CGNSFamilyHierarchyTreeDefinition + * + * \brief Create a Family_t node (Family_t level) + * + * \param[in] family_name Name of the family + * \param[out] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \return \ier + * + */ +int cg_node_family_write( const char* family_name, int* Fam) { int ier=0, n, nfamilies; cgns_family* family; @@ -1604,7 +2124,7 @@ int cg_node_family_write( const char* family_name, int* F) /* check for valid posit */ if (posit == 0) { cgi_error("No current position set by cg_goto\n"); - (*F) = 0; + (*Fam) = 0; return CG_ERROR; } @@ -1631,7 +2151,7 @@ int cg_node_family_write( const char* family_name, int* F) } else { cgi_error("Family_t node not supported under '%s' type node",posit->label); - (*F) = -1; + (*Fam) = -1; return CG_INCORRECT_PATH; } @@ -1645,7 +2165,7 @@ int cg_node_family_write( const char* family_name, int* F) cgi_error( "Could not find Family_t node %s\n" , family_name ); return CG_ERROR; } - *F = n + 1; + *Fam = n + 1; } else { cgi_error( "No Family_t container \n"); @@ -1655,7 +2175,15 @@ int cg_node_family_write( const char* family_name, int* F) return CG_OK; } -/* ** FAMILY TREE ** */ +/** + * \ingroup CGNSFamilyHierarchyTreeDefinition + * + * \brief Get number of families (Family_t level) + * + * \param[out] nfamilies Number of families in current node (CGNSBase_t or Family_t). + * \return \ier + * + */ int cg_node_nfamilies( int* nfamilies ) { /* This is valid and used during write as well as read mode. */ @@ -1682,8 +2210,19 @@ int cg_node_nfamilies( int* nfamilies ) return CG_OK; } -/* ** FAMILY TREE ** */ -int cg_node_family_read( int F, char* family_name, int* nFamBC, int *nGeo ) +/** + * \ingroup CGNSFamilyHierarchyTreeDefinition + * + * \brief Read family info (Family_t level) + * + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[out] family_name Name of the family. + * \param[out] nFamBC Number of boundary conditions for this family. This should be either 0 or 1. + * \param[out] nGeo Number of geometry references for this family. + * \return \ier + * + */ +int cg_node_family_read( int Fam, char* family_name, int* nFamBC, int *nGeo ) { int ier = 0; cgns_family* family; @@ -1693,7 +2232,7 @@ int cg_node_family_read( int F, char* family_name, int* nFamBC, int *nGeo ) /* verify input */ if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - family = cgi_family_address( CG_MODE_READ, F, "dummy", &ier ); + family = cgi_family_address( CG_MODE_READ, Fam, "dummy", &ier ); if( family == 0 ) return ier; strcpy( family_name, family->name ); @@ -1703,7 +2242,16 @@ int cg_node_family_read( int F, char* family_name, int* nFamBC, int *nGeo ) return CG_OK; } -/* ** FAMILY TREE ** */ +/** + * \ingroup CGNSFamilyHierarchyTreeDefinition + * + * \brief Write multiple family names under Family_t (Family_t level) + * + * \param[in] node_name Name of the FamilyName_t node. FamilyParent is used to refer to the parent family of the Family_t node. + * \param[in] family_name Name of the family. + * \return \ier + * + */ int cg_node_family_name_write( const char* node_name, const char* family_name ) { int index; @@ -1767,7 +2315,15 @@ int cg_node_family_name_write( const char* node_name, const char* family_name ) return CG_OK; } -/* ** FAMILY TREE ** */ +/** + * \ingroup CGNSFamilyHierarchyTreeDefinition + * + * \brief Get number of family names under Family_t (Family_t level) + * + * \param[out] nnames Number of FamilyName_t nodes for this family. + * \return \ier + * + */ int cg_node_nfamily_names( int* nnames ) { /* This is valid and used during write as well as read mode. */ @@ -1792,7 +2348,17 @@ int cg_node_nfamily_names( int* nnames ) return CG_OK; } -/* ** FAMILY TREE ** */ +/** + * \ingroup CGNSFamilyHierarchyTreeDefinition + * + * \brief Read family info (Family_t level) + * + * \param[in] N Family name index number, where 1 ≤ N ≤ nNames. + * \param[out] node_name Name of the FamilyName_t node. FamilyParent is used to refer to the parent family of the Family_t node. + * \param[out] family_name Name of the family. + * \return \ier + * + */ int cg_node_family_name_read(int N, char* node_name, char* family_name ) { cgns_famname *famname; @@ -1815,17 +2381,31 @@ int cg_node_family_name_read(int N, char* node_name, char* family_name ) /*----------------------------------------------------------------------*/ -int cg_fambc_read(int file_number, int B, int F, int BC, +/** + * \ingroup CGNSFamilyBoundaryDefinition + * + * \brief Read boundary condition type for a family + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[in] BC Family boundary condition index number. This must be equal to 1. + * \param[out] fambc_name Name of the FamilyBC_t node. + * \param[out] bocotype Boundary condition type for the family. See the eligible types for BCType_t in the Typedefs section. + * \return \ier + */ + +int cg_fambc_read(int fn, int B, int Fam, int BC, char *fambc_name, CGNS_ENUMT(BCType_t) *bocotype) { cgns_family *family; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - family = cgi_get_family(cg, B, F); + family = cgi_get_family(cg, B, Fam); if (family==0) return CG_ERROR; if (BC<=0 || BC>family->nfambc) { @@ -1838,7 +2418,21 @@ int cg_fambc_read(int file_number, int B, int F, int BC, return CG_OK; } -int cg_fambc_write(int file_number, int B, int F, const char * fambc_name, +/** + * \ingroup CGNSFamilyBoundaryDefinition + * + * \brief Write boundary condition type for a family + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[in] fambc_name Name of the FamilyBC_t node. + * \param[in] bocotype Boundary condition type for the family. See the eligible types for BCType_t in the Typedefs section. + * \param[out] BC Family boundary condition index number. This must be equal to 1. + * \return \ier + * + */ +int cg_fambc_write(int fn, int B, int Fam, const char * fambc_name, CGNS_ENUMT( BCType_t ) bocotype, int *BC) { int index; @@ -1853,13 +2447,13 @@ int cg_fambc_write(int file_number, int B, int F, const char * fambc_name, return CG_ERROR; } - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; /* get memory address for family */ - family = cgi_get_family(cg, B, F); + family = cgi_get_family(cg, B, Fam); if (family==0) return CG_ERROR; /* Overwrite a FamilyBC_t Node: */ @@ -1906,9 +2500,19 @@ int cg_fambc_write(int file_number, int B, int F, const char * fambc_name, return CG_OK; } -/* FamilyTree extension */ /* ** FAMILY TREE ** */ /*----------------------------------------------------------------------*/ +/** + * \ingroup CGNSFamilyBoundaryDefinition + * + * \brief Read boundary condition information (Family_t level) + * + * \param[in] BC Family boundary condition index number. This must be equal to 1. + * \param[out] fambc_name Name of the FamilyBC_t node. + * \param[out] bocotype Boundary condition type for the family. See the eligible types for BCType_t in the Typedefs section. + * \return \ier + * + */ int cg_node_fambc_read( int BC, char* fambc_name, CGNS_ENUMT(BCType_t) *bocotype) { @@ -1946,6 +2550,17 @@ int cg_node_fambc_read( int BC, char* fambc_name, } /*----------------------------------------------------------------------*/ +/** + * \ingroup CGNSFamilyBoundaryDefinition + * + * \brief Write boundary condition information (Family_t level) + * + * \param[in] fambc_name Name of the FamilyBC_t node. + * \param[in] bocotype Boundary condition type for the family. See the eligible types for BCType_t in the Typedefs section. + * \param[out] BC Family boundary condition index number. This must be equal to 1. + * \return \ier + * + */ int cg_node_fambc_write( const char* fambc_name, CGNS_ENUMT(BCType_t) bocotype, int *BC ) { @@ -2030,18 +2645,33 @@ int cg_node_fambc_write( const char* fambc_name, /*----------------------------------------------------------------------*/ - -int cg_geo_read(int file_number, int B, int F, int G, char *geo_name, +/** + * \ingroup CGNSGeometryReference + * + * \brief Read geometry reference information + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[in] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * \param[out] geo_name Name of GeometryReference_t node. + * \param[out] geo_file Name of geometry file + * \param[out] CAD_name Geometry format + * \param[out] npart Number of geometry entities + * \return \ier + * + */ +int cg_geo_read(int fn, int B, int Fam, int G, char *geo_name, char **geo_file, char *CAD_name, int *npart) { cgns_family *family; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - family = cgi_get_family(cg, B, F); + family = cgi_get_family(cg, B, Fam); if (family==0) return CG_ERROR; if (G<=0 || G>family->ngeos) { @@ -2061,8 +2691,23 @@ int cg_geo_read(int file_number, int B, int F, int G, char *geo_name, return CG_OK; } -int cg_geo_write(int file_number, int B, int F, const char * geo_name, - const char * filename, const char * CADname, int *G) +/** + * \ingroup CGNSGeometryReference + * + * \brief Create a GeometryReference_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[in] geo_name Name of GeometryReference_t node. + * \param[in] geo_file Name of geometry file + * \param[in] CAD_name Geometry format + * \param[out] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * \return \ier + * + */ +int cg_geo_write(int fn, int B, int Fam, const char * geo_name, + const char *geo_file, const char * CAD_name, int *G) { int index; cgsize_t length; @@ -2072,15 +2717,15 @@ int cg_geo_write(int file_number, int B, int F, const char * geo_name, /* verify input */ if (cgi_check_strlen(geo_name)) return CG_ERROR; - if (cgi_check_strlen(CADname)) return CG_ERROR; + if (cgi_check_strlen(CAD_name)) return CG_ERROR; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; /* get memory address for family */ - family = cgi_get_family(cg, B, F); + family = cgi_get_family(cg, B, Fam); if (family==0) return CG_ERROR; /* Overwrite a GeometryReference_t Node: */ @@ -2119,9 +2764,9 @@ int cg_geo_write(int file_number, int B, int F, const char * geo_name, memset(geo, 0, sizeof(cgns_geo)); strcpy(geo->name, geo_name); - strcpy(geo->format, CADname); + strcpy(geo->format, CAD_name); - length = (int)strlen(filename); + length = (int)strlen(geo_file); if (length<=0) { cgi_error("filename undefined for GeometryReference node!"); return CG_ERROR; @@ -2131,7 +2776,7 @@ int cg_geo_write(int file_number, int B, int F, const char * geo_name, cgi_error("Error allocation geo->file"); return CG_ERROR; } - strcpy(geo->file, filename); + strcpy(geo->file, geo_file); /* save data in file */ if (cgi_new_node(family->id, geo->name, "GeometryReference_t", &geo->id, @@ -2148,6 +2793,19 @@ int cg_geo_write(int file_number, int B, int F, const char * geo_name, /* FamilyTree extension */ /* ** FAMILY TREE ** */ /*----------------------------------------------------------------------*/ +/** + * \ingroup CGNSGeometryReference + * + * \brief Read geometry reference information (Family_t level) + * + * \param[in] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * \param[out] geo_name Name of GeometryReference_t node. + * \param[out] geo_file Name of geometry file + * \param[out] CAD_name Geometry format + * \param[out] npart Number of geometry entities + * \return \ier + * + */ int cg_node_geo_read( int G, char *geo_name, char **geo_file, char *CAD_name, int *npart ) { @@ -2192,8 +2850,21 @@ int cg_node_geo_read( int G, char *geo_name, } /*----------------------------------------------------------------------*/ +/** + * \ingroup CGNSGeometryReference + * + * \brief Create GeometryReference_t node (Family_t level) + * + * \param[in] geo_name Name of GeometryReference_t node. + * \param[in] geo_file Name of geometry file + * \param[in] CAD_name Geometry format + * \param[out] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * + * \return \ier + * + */ int cg_node_geo_write( const char *geo_name, - const char *filename, const char *CADname, int *G) + const char *geo_file, const char *CAD_name, int *G) { int index; cgsize_t length; @@ -2203,7 +2874,7 @@ int cg_node_geo_write( const char *geo_name, /* verify input */ if (cgi_check_strlen(geo_name)) return CG_ERROR; - if (cgi_check_strlen(CADname)) return CG_ERROR; + if (cgi_check_strlen(CAD_name)) return CG_ERROR; CHECK_FILE_OPEN @@ -2261,9 +2932,9 @@ int cg_node_geo_write( const char *geo_name, memset(geo, 0, sizeof(cgns_geo)); strcpy(geo->name, geo_name); - strcpy(geo->format, CADname); + strcpy(geo->format, CAD_name); - length = (int)strlen(filename); + length = (int)strlen(geo_file); if (length<=0) { cgi_error("filename undefined for GeometryReference node!"); return CG_ERROR; @@ -2273,7 +2944,7 @@ int cg_node_geo_write( const char *geo_name, cgi_error("Error allocation geo->file"); return CG_ERROR; } - strcpy(geo->file, filename); + strcpy(geo->file, geo_file); /* save data in file */ if (cgi_new_node(family->id, geo->name, "GeometryReference_t", &geo->id, @@ -2291,17 +2962,30 @@ int cg_node_geo_write( const char *geo_name, /*----------------------------------------------------------------------*/ - -int cg_part_read(int file_number, int B, int F, int G, int P, char *part_name) +/** + * \ingroup CGNSGeometryReference + * + * \brief Get geometry entity name + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[in] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * \param[in] P Geometry entity index number, where 1 ≤ P ≤ nparts + * \param[out] part_name Name of a geometry entity in the file FileName. + * \return \ier + * + */ +int cg_part_read(int fn, int B, int Fam, int G, int P, char *part_name) { cgns_family *family; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - family = cgi_get_family(cg, B, F); + family = cgi_get_family(cg, B, Fam); if (family==0) return CG_ERROR; if (P<=0 || P>family->geo[G-1].npart) { @@ -2312,7 +2996,21 @@ int cg_part_read(int file_number, int B, int F, int G, int P, char *part_name) return CG_OK; } -int cg_part_write(int file_number, int B, int F, int G, const char * part_name, +/** + * \ingroup CGNSGeometryReference + * + * \brief Write geometry entity name + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Fam Family index number, where 1 ≤ Fam ≤ nfamilies. + * \param[in] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * \param[in] part_name Name of a geometry entity in the file FileName. + * \param[out] P Geometry entity index number, where 1 ≤ P ≤ nparts + * \return \ier + * + */ +int cg_part_write(int fn, int B, int Fam, int G, const char * part_name, int *P) { int index; @@ -2323,13 +3021,13 @@ int cg_part_write(int file_number, int B, int F, int G, const char * part_name, /* verify input */ if (cgi_check_strlen(part_name)) return CG_ERROR; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; /* get memory address for geo */ - family = cgi_get_family(cg, B, F); + family = cgi_get_family(cg, B, Fam); if (family==0) return CG_ERROR; if (G > family->ngeos || G <=0) { cgi_error("Invalid index for GeometryEntity_t node"); @@ -2382,6 +3080,17 @@ int cg_part_write(int file_number, int B, int F, int G, const char * part_name, /* FamilyTree extension */ /* ** FAMILY TREE ** */ /*----------------------------------------------------------------------*/ +/** + * \ingroup CGNSGeometryReference + * + * \brief Get geometry entity name (Family_t level) + * + * \param[in] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * \param[in] P Geometry entity index number, where 1 ≤ P ≤ nparts + * \param[out] part_name Name of a geometry entity in the file FileName. + * \return \ier + * + */ int cg_node_part_read(int G, int P, char *part_name) { cgns_family* family = 0; @@ -2416,6 +3125,17 @@ int cg_node_part_read(int G, int P, char *part_name) } /*----------------------------------------------------------------------*/ +/** + * \ingroup CGNSGeometryReference + * + * \brief Write geometry entity name (Family_t level) + * + * \param[in] G Geometry reference index number, where 1 ≤ G ≤ nGeo. + * \param[in] part_name Name of a geometry entity in the file FileName. + * \param[out] P Geometry entity index number, where 1 ≤ P ≤ nparts + * \return \ier + * + */ int cg_node_part_write(int G, const char * part_name, int *P) { int index; @@ -2498,11 +3218,23 @@ int cg_node_part_write(int G, const char * part_name, int *P) * Read and Write DiscreteData_t Nodes \*****************************************************************************/ -int cg_ndiscrete(int file_number, int B, int Z, int *ndiscrete) +/** + * \ingroup DiscreteData + * + * \brief Get number of `DiscreteData_t` nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] ndiscrete Number of `DiscreteData_t` data structures under zone Z. + * \return \ier + * + */ +int cg_ndiscrete(int fn, int B, int Z, int *ndiscrete) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2514,11 +3246,24 @@ int cg_ndiscrete(int file_number, int B, int Z, int *ndiscrete) return CG_OK; } -int cg_discrete_read(int file_number, int B, int Z, int D, char *discrete_name) +/** + * \ingroup DiscreteData + * + * \brief Get name of `DiscreteData_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] D Discrete data index number, where 1 ≤ D ≤ ndiscrete. + * \param[out] discrete_name Name of `DiscreteData_t` data structures. + * \return \ier + * + */ +int cg_discrete_read(int fn, int B, int Z, int D, char *discrete_name) { cgns_discrete *discrete; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2531,7 +3276,20 @@ int cg_discrete_read(int file_number, int B, int Z, int D, char *discrete_name) return CG_OK; } -int cg_discrete_write(int file_number, int B, int Z, const char * discrete_name, +/** + * \ingroup DiscreteData + * + * \brief Create a `DiscreteData_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] discrete_name Name of `DiscreteData_t` data structures. + * \param[out] D Discrete data index number, where 1 ≤ D ≤ ndiscrete. + * \return \ier + * + */ +int cg_discrete_write(int fn, int B, int Z, const char * discrete_name, int *D) { cgns_zone *zone; @@ -2541,7 +3299,7 @@ int cg_discrete_write(int file_number, int B, int Z, const char * discrete_name /* verify input */ if (cgi_check_strlen(discrete_name)) return CG_ERROR; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -2593,12 +3351,28 @@ int cg_discrete_write(int file_number, int B, int Z, const char * discrete_name return CG_OK; } -int cg_discrete_size(int file_number, int B, int Z, int D, + + +/** + * \ingroup DiscreteData + * + * \brief Get the dimensions of `DiscreteData_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] D Discrete data index number, where 1 ≤ D ≤ ndiscrete. + * \param[out] data_dim Number of dimensions defining the discrete data. If a point set has been defined, this will be 1, otherwise this will be the current zone index dimension. + * \param[out] dim_vals The array of data_dim dimensions for the discrete data. + * \return \ier + * + */ +int cg_discrete_size(int fn, int B, int Z, int D, int *data_dim, cgsize_t *dim_vals) { cgns_discrete *discrete; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2621,6 +3395,20 @@ int cg_discrete_size(int file_number, int B, int Z, int D, /*----------------------------------------------------------------------*/ +/** + * \ingroup DiscreteData + * + * \brief Get info about a point set `DiscreteData_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] D Discrete data index number, where 1 ≤ D ≤ ndiscrete. + * \param[out] ptset_type Type of point set defining the interface for the discrete data; either PointRange or PointList. + * \param[out] npnts Number of points defining the interface for the discrete data. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the list. + * \return \ier + * + */ int cg_discrete_ptset_info(int fn, int B, int Z, int D, CGNS_ENUMT(PointSetType_t) *ptset_type, cgsize_t *npnts) { @@ -2644,6 +3432,19 @@ int cg_discrete_ptset_info(int fn, int B, int Z, int D, return CG_OK; } +/** + * \ingroup DiscreteData + * + * \brief Read a point set `DiscreteData_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] D Discrete data index number, where 1 ≤ D ≤ ndiscrete. + * \param[out] pnts Array of points defining the interface for the discrete data. + * \return \ier + * + */ int cg_discrete_ptset_read(int fn, int B, int Z, int D, cgsize_t *pnts) { int dim = 0; @@ -2667,6 +3468,23 @@ int cg_discrete_ptset_read(int fn, int B, int Z, int D, cgsize_t *pnts) return CG_OK; } +/** + * \ingroup DiscreteData + * + * \brief Create a point set `DiscreteData_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] discrete_name Name of `DiscreteData_t` data structures. + * \param[in] location Grid location where the discrete data is recorded. The current admissible locations are Vertex, CellCenter, IFaceCenter, JFaceCenter, and KFaceCenter. + * \param[in] ptset_type Type of point set defining the interface for the discrete data; either PointRange or PointList. + * \param[in] npnts Number of points defining the interface for the discrete data. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the list. + * \param[in] pnts Array of points defining the interface for the discrete data. + * \param[out] D Discrete data index number, where 1 ≤ D ≤ ndiscrete. + * \return \ier + * + */ int cg_discrete_ptset_write(int fn, int B, int Z, const char *discrete_name, CGNS_ENUMT(GridLocation_t) location, CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, @@ -2728,11 +3546,23 @@ int cg_discrete_ptset_write(int fn, int B, int Z, * Read and Write GridCoordinates_t Nodes \*****************************************************************************/ -int cg_ngrids(int file_number, int B, int Z, int *ngrids) +/** + * \ingroup ZoneGridCoordinates + * + * \brief Get number of `GridCoordinates_t` nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] ngrids Number of `GridCoordinates_t` nodes for zone Z. + * \return \ier + * + */ +int cg_ngrids(int fn, int B, int Z, int *ngrids) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2745,11 +3575,24 @@ int cg_ngrids(int file_number, int B, int Z, int *ngrids) return CG_OK; } -int cg_grid_read(int file_number, int B, int Z, int G, char *gridname) +/** + * \ingroup ZoneGridCoordinates + * + * \brief Get Name of a `GridCoordinates_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] G \G_Grid + * \param[out] grid_coord_name Name of the GridCoordinates_t node. Note that the name "GridCoordinates" is reserved for the original grid and must be the first GridCoordinates_t node to be defined. + * \return \ier + * + */ +int cg_grid_read(int fn, int B, int Z, int G, char *grid_coord_name) { cgns_zcoor *zcoor; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2759,21 +3602,34 @@ int cg_grid_read(int file_number, int B, int Z, int G, char *gridname) if (zcoor==0) return CG_ERROR; /* Return ADF name for the GridCoordinates_t node */ - strcpy(gridname,zcoor->name); + strcpy(grid_coord_name,zcoor->name); return CG_OK; } -int cg_grid_write(int file_number, int B, int Z, const char * zcoorname, int *G) +/** + * \ingroup ZoneGridCoordinates + * + * \brief Create a `GridCoordinates_t` nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] grid_coord_name Name of the GridCoordinates_t node. Note that the name "GridCoordinates" is reserved for the original grid and must be the first GridCoordinates_t node to be defined. + * \param[out] G \G_Grid + * \return \ier + * + */ +int cg_grid_write(int fn, int B, int Z, const char * grid_coord_name, int *G) { cgns_zone *zone; cgns_zcoor *zcoor = NULL; int index, n, index_dim; /* verify input */ - if (cgi_check_strlen(zcoorname)) return CG_ERROR; + if (cgi_check_strlen(grid_coord_name)) return CG_ERROR; /* get memory address */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -2783,11 +3639,11 @@ int cg_grid_write(int file_number, int B, int Z, const char * zcoorname, int *G) /* Overwrite a GridCoordinates_t Node: */ for (index=0; indexnzcoor; index++) { - if (strcmp(zcoorname, zone->zcoor[index].name)==0) { + if (strcmp(grid_coord_name, zone->zcoor[index].name)==0) { /* in CG_MODE_WRITE, children names must be unique */ if (cg->mode==CG_MODE_WRITE) { - cgi_error("Duplicate child name found: %s",zcoorname); + cgi_error("Duplicate child name found: %s",grid_coord_name); return CG_ERROR; } @@ -2816,7 +3672,7 @@ int cg_grid_write(int file_number, int B, int Z, const char * zcoorname, int *G) /* save data in memory */ memset(zcoor, 0, sizeof(cgns_zcoor)); - strcpy(zcoor->name,zcoorname); + strcpy(zcoor->name,grid_coord_name); index_dim = zone->index_dim; zcoor->rind_planes = (int *)malloc(index_dim*2*sizeof(int)); @@ -2838,7 +3694,23 @@ int cg_grid_write(int file_number, int B, int Z, const char * zcoorname, int *G) * Read and Write GridCoordinates_t bounding box \*****************************************************************************/ -int cg_grid_bounding_box_read(int file_number, int B, int Z, int G, CGNS_ENUMT(DataType_t) type, void* boundingbox) +/** + * \ingroup ZoneGridCoordinates + * + * \brief Get bounding box associated with a `GridCoordinates_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] G \G_Grid + * \param[in] datatype Data type of the bounding box array written to the file or read. Admissible data types for a coordinate bounding box are RealSingle and RealDouble. + * \param[out] boundingbox Data Array with bounding box values. + * \return \ier + * + * \details When reading a bounding box, if the information is missing from the file, the boundingbox array will remain untouched, and the CG_NODE_NOT_FOUND status is returned. The CGNS MLL relies on the user to compute the bounding box and ensure that the bounding box being stored is coherent with the coordinates under GridCoordinates_t node. + * + */ +int cg_grid_bounding_box_read(int fn, int B, int Z, int G, CGNS_ENUMT(DataType_t) datatype, void* boundingbox) { cgns_zcoor *zcoor; cgns_base *base; @@ -2849,7 +3721,7 @@ int cg_grid_bounding_box_read(int file_number, int B, int Z, int G, CGNS_ENUMT(D cgsize_t dim_vals[12]; cgsize_t num; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2866,8 +3738,8 @@ int cg_grid_bounding_box_read(int file_number, int B, int Z, int G, CGNS_ENUMT(D /* check bounding box is not an empty array*/ if (strcmp(data_type,"MT")==0) { - cgi_warning("No bounding box read"); - return CG_OK; + cgi_error("No bounding box found for reading"); + return CG_NODE_NOT_FOUND; } if (strcmp(data_type,"R4") && @@ -2891,25 +3763,41 @@ int cg_grid_bounding_box_read(int file_number, int B, int Z, int G, CGNS_ENUMT(D } /* verify input */ - if (type != CGNS_ENUMV(RealSingle) && type != CGNS_ENUMV(RealDouble)) { - cgi_error("Invalid data type for bounding box array: %d", type); + if (datatype != CGNS_ENUMV(RealSingle) && datatype != CGNS_ENUMV(RealDouble)) { + cgi_error("Invalid data type for bounding box array: %d", datatype); return CG_ERROR; } /* transfer small bounding box data to user with correct data type */ - cgi_convert_data(num, cgi_datatype(data_type), vdata, type, boundingbox); + cgi_convert_data(num, cgi_datatype(data_type), vdata, datatype, boundingbox); CGNS_FREE(vdata); return CG_OK; } -int cg_grid_bounding_box_write(int file_number, int B, int Z, int G, CGNS_ENUMT(DataType_t) type, void* boundingbox) +/** + * \ingroup ZoneGridCoordinates + * + * \brief Write bounding box associated with a `GridCoordinates_t` node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] G \G_Grid + * \param[in] datatype Data type of the bounding box array written to the file or read. Admissible data types for a coordinate bounding box are RealSingle and RealDouble. + * \param[in] boundingbox Data Array with bounding box values. + * \return \ier + * + * \details The CGNS MLL relies on the user to compute the bounding box and ensure that the bounding box being stored is coherent with the coordinates under GridCoordinates_t node. + + */ +int cg_grid_bounding_box_write(int fn, int B, int Z, int G, CGNS_ENUMT(DataType_t) datatype, void* boundingbox) { cgns_base *base; cgns_zcoor *zcoor; cgsize_t dim_vals[2]; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -2940,13 +3828,13 @@ int cg_grid_bounding_box_write(int file_number, int B, int Z, int G, CGNS_ENUMT( /* Check input */ if (boundingbox == NULL) return CG_OK; - if (type != CGNS_ENUMV(RealSingle) && type != CGNS_ENUMV(RealDouble)) { - cgi_error("Invalid data type for bounding box array: %d", type); + if (datatype != CGNS_ENUMV(RealSingle) && datatype != CGNS_ENUMV(RealDouble)) { + cgi_error("Invalid data type for bounding box array: %d", datatype); return CG_ERROR; } /* Write Bounding box into existing GridCoordinates_t node */ - if (cgio_set_dimensions(cg->cgio, zcoor->id, cgi_adf_datatype(type), 2, dim_vals)) { + if (cgio_set_dimensions(cg->cgio, zcoor->id, cgi_adf_datatype(datatype), 2, dim_vals)) { cg_io_error("cgio_set_dimensions"); return CG_ERROR; } @@ -2962,11 +3850,23 @@ int cg_grid_bounding_box_write(int file_number, int B, int Z, int G, CGNS_ENUMT( * Read and Write GridCoordinates_t/DataArray_t Nodes \*****************************************************************************/ -int cg_ncoords(int file_number, int B, int Z, int *ncoords) +/** + * \ingroup ZoneGridCoordinates + * + * \brief Get number of coordinate arrays + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] ncoords Number of coordinate arrays for zone Z. + * \return \ier + * + */ +int cg_ncoords(int fn, int B, int Z, int *ncoords) { cgns_zcoor *zcoor; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2978,12 +3878,26 @@ int cg_ncoords(int file_number, int B, int Z, int *ncoords) return CG_OK; } -int cg_coord_info(int file_number, int B, int Z, int C, CGNS_ENUMT(DataType_t) *type, +/** + * \ingroup ZoneGridCoordinates + * + * \brief Get info about a coordinate array + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] C \C_Coordinate + * \param[out] datatype Data type of the coordinate array written to the file. Admissible data types for a coordinate array are RealSingle and RealDouble. + * \param[out] coordname Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility. + * \return \ier + * + */ +int cg_coord_info(int fn, int B, int Z, int C, CGNS_ENUMT(DataType_t) *datatype, char *coordname) { cgns_zcoor *zcoor; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -2996,21 +3910,37 @@ int cg_coord_info(int file_number, int B, int Z, int C, CGNS_ENUMT(DataType_t) cgi_error("coord number %d invalid",C); return CG_ERROR; } - *type = cgi_datatype(zcoor->coord[C-1].data_type); + *datatype = cgi_datatype(zcoor->coord[C-1].data_type); strcpy(coordname, zcoor->coord[C-1].name); return CG_OK; } -int cg_coord_read(int file_number, int B, int Z, const char *coordname, - CGNS_ENUMT(DataType_t) type, const cgsize_t *s_rmin, - const cgsize_t *s_rmax, void *coord_ptr) +/** + * \ingroup ZoneGridCoordinates + * + * \brief Read grid coordinate array + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] coordname Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility. + * \param[in] mem_datatype Data type of an array in memory. Admissible data types for a coordinate array are RealSingle and RealDouble. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[out] coord_array Array of coordinate values. + * \return \ier + * + */ +int cg_coord_read(int fn, int B, int Z, const char *coordname, + CGNS_ENUMT(DataType_t) mem_datatype, const cgsize_t *s_rmin, + const cgsize_t *s_rmax, void *coord_array) { cgns_zone *zone; int n, m_numdim; /* get memory addresses */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; zone = cgi_get_zone(cg, B, Z); @@ -3032,12 +3962,32 @@ int cg_coord_read(int file_number, int B, int Z, const char *coordname, m_dimvals[n] = m_rmax[n]; } - return cg_coord_general_read(file_number, B, Z, coordname, - s_rmin, s_rmax, type, + return cg_coord_general_read(fn, B, Z, coordname, + s_rmin, s_rmax, mem_datatype, m_numdim, m_dimvals, m_rmin, m_rmax, - coord_ptr); + coord_array); } +/** + * \ingroup ZoneGridCoordinates + * + * \brief Read subset of grid coordinates to a shaped array + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] coordname Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility. + * \param[in] m_type Data type of an array in memory. Admissible data types for a coordinate array are RealSingle and RealDouble. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[in] m_numdim Number of dimensions of array in memory. + * \param[in] m_dimvals Dimensions of array in memory. + * \param[in] m_rmin Lower range index in memory (eg., imin, jmin, kmin). + * \param[in] m_rmax Upper range index in memory (eg., imax, jmax, kmax). + * \param[out] coord_ptr Array of coordinate values. + * \return \ier + * + */ int cg_coord_general_read(int fn, int B, int Z, const char *coordname, const cgsize_t *s_rmin, const cgsize_t *s_rmax, CGNS_ENUMT(DataType_t) m_type, @@ -3087,11 +4037,11 @@ int cg_coord_general_read(int fn, int B, int Z, const char *coordname, coord_ptr); } -int cg_coord_id(int file_number, int B, int Z, int C, double *coord_id) +int cg_coord_id(int fn, int B, int Z, int C, double *coord_id) { cgns_zcoor *zcoor; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -3109,7 +4059,22 @@ int cg_coord_id(int file_number, int B, int Z, int C, double *coord_id) return CG_OK; } -int cg_coord_write(int file_number, int B, int Z, CGNS_ENUMT(DataType_t) type, +/** + * \ingroup ZoneGridCoordinates + * + * \brief Write grid coordinates + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] datatype Data type of the coordinate array written to the file. Admissible data types for a coordinate array are RealSingle and RealDouble. + * \param[in] coordname Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility. + * \param[in] coord_ptr Array of coordinate values. + * \param[out] C \C_Coordinate + * \return \ier + * + */ +int cg_coord_write(int fn, int B, int Z, CGNS_ENUMT(DataType_t) datatype, const char *coordname, const void *coord_ptr, int *C) { cgns_zone *zone; @@ -3121,12 +4086,12 @@ int cg_coord_write(int file_number, int B, int Z, CGNS_ENUMT(DataType_t) type, /* verify input */ if (cgi_check_strlen(coordname)) return CG_ERROR; - if (type!=CGNS_ENUMV( RealSingle ) && type!=CGNS_ENUMV( RealDouble )) { - cgi_error("Invalid datatype for coord. array: %d", type); + if (datatype!=CGNS_ENUMV( RealSingle ) && datatype!=CGNS_ENUMV( RealDouble )) { + cgi_error("Invalid datatype for coord. array: %d", datatype); return CG_ERROR; } /* get memory addresses */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; zone = cgi_get_zone(cg, B, Z); @@ -3157,17 +4122,34 @@ int cg_coord_write(int file_number, int B, int Z, CGNS_ENUMT(DataType_t) type, m_rmax[n] = m_dimvals[n]; } - status = cg_coord_general_write(file_number, B, Z, coordname, - type, s_rmin, s_rmax, - type, m_numdim, m_dimvals, m_rmin, m_rmax, + status = cg_coord_general_write(fn, B, Z, coordname, + datatype, s_rmin, s_rmax, + datatype, m_numdim, m_dimvals, m_rmin, m_rmax, coord_ptr, C); HDF5storage_type = CG_COMPACT; return status; } -int cg_coord_partial_write(int file_number, int B, int Z, - CGNS_ENUMT(DataType_t) type, +/** + * \ingroup ZoneGridCoordinates + * + * \brief Write subset of grid coordinates + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] datatype Data type of the coordinate array written to the file. Admissible data types for a coordinate array are RealSingle and RealDouble. + * \param[in] coordname Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[in] coord_ptr Array of coordinate values. + * \param[out] C \C_Coordinate + * \return \ier + * + */ +int cg_coord_partial_write(int fn, int B, int Z, + CGNS_ENUMT(DataType_t) datatype, const char *coordname, const cgsize_t *s_rmin, const cgsize_t *s_rmax, const void *coord_ptr, int *C) @@ -3177,7 +4159,7 @@ int cg_coord_partial_write(int file_number, int B, int Z, int status; /* get memory addresses */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; zone = cgi_get_zone(cg, B, Z); @@ -3198,13 +4180,35 @@ int cg_coord_partial_write(int file_number, int B, int Z, m_dimvals[n] = m_rmax[n]; } - status = cg_coord_general_write(file_number, B, Z, coordname, - type, s_rmin, s_rmax, - type, m_numdim, m_dimvals, m_rmin, m_rmax, + status = cg_coord_general_write(fn, B, Z, coordname, + datatype, s_rmin, s_rmax, + datatype, m_numdim, m_dimvals, m_rmin, m_rmax, coord_ptr, C); return status; } +/** + * \ingroup ZoneGridCoordinates + * + * \brief Write shaped array to a subset of grid coordinates + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] coordname Name of the coordinate array. It is strongly advised to use the SIDS nomenclature conventions when naming the coordinate arrays to insure file compatibility. + * \param[in] s_type Data type of the coordinate array written to the file. Admissible data types for a coordinate array are RealSingle and RealDouble. + * \param[in] m_type Data type of an array in memory. Admissible data types for a coordinate array are RealSingle and RealDouble. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[in] m_numdim Number of dimensions of array in memory. + * \param[in] m_dimvals Dimensions of array in memory. + * \param[in] m_rmin Lower range index in memory (eg., imin, jmin, kmin). + * \param[in] m_rmax Upper range index in memory (eg., imax, jmax, kmax). + * \param[in] coord_ptr Array of coordinate values. + * \param[out] C \C_Coordinate + * \return \ier + * + */ int cg_coord_general_write(int fn, int B, int Z, const char *coordname, CGNS_ENUMT(DataType_t) s_type, const cgsize_t *s_rmin, const cgsize_t *s_rmax, @@ -3435,11 +4439,23 @@ static int read_parent_data(cgns_section *section) /*----------------------------------------------------------------------*/ -int cg_nsections(int file_number, int B, int Z, int *nsections) +/** + * \ingroup ElementConnectivity + * + * \brief Get number of element sections + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] nsections Number of element sections. + * \return \ier + * + */ +int cg_nsections(int fn, int B, int Z, int *nsections) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -3452,13 +4468,31 @@ int cg_nsections(int file_number, int B, int Z, int *nsections) return CG_OK; } -int cg_section_read(int file_number, int B, int Z, int S, char *SectionName, +/** + * \ingroup ElementConnectivity + * + * \brief Get info for an element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] type Type of element. See the eligible types for ElementType_t in the Typedefs section. + * \param[out] SectionName Name of the Elements_t node. + * \param[out] start Index of first element in the section. + * \param[out] end Index of last element in the section. + * \param[out] nbndry Index of last boundary element in the section. Set to zero if the elements are unsorted. + * \param[out] parent_flag Flag indicating if the parent data are defined. If the parent data exist, parent_flag is set to 1; otherwise it is set to 0. + * \return \ier + * + */ +int cg_section_read(int fn, int B, int Z, int S, char *SectionName, CGNS_ENUMT(ElementType_t) *type, cgsize_t *start, cgsize_t *end, int *nbndry, int *parent_flag) { cgns_section *section; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -3478,7 +4512,27 @@ int cg_section_read(int file_number, int B, int Z, int S, char *SectionName, return CG_OK; } -int cg_section_write(int file_number, int B, int Z, const char * SectionName, +/** + * \ingroup ElementConnectivity + * + * \brief Write fixed size element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] type Type of element. See the eligible types for ElementType_t in the Typedefs section. + * \param[in] SectionName Name of the Elements_t node. + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] nbndry Index of last boundary element in the section. Set to zero if the elements are unsorted. + * \param[in] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[out] S \CONN_S + * \return \ier + * + * \details This writing function only works with fixed size elements. + * + */ +int cg_section_write(int fn, int B, int Z, const char * SectionName, CGNS_ENUMT(ElementType_t)type, cgsize_t start, cgsize_t end, int nbndry, const cgsize_t * elements, int *S) @@ -3491,7 +4545,7 @@ int cg_section_write(int file_number, int B, int Z, const char * SectionName, return CG_ERROR; } - if (cg_section_general_write(file_number, B, Z, SectionName, type, + if (cg_section_general_write(fn, B, Z, SectionName, type, cgi_datatype(CG_SIZE_DATATYPE), start, end, 0, nbndry, S)){ return CG_ERROR; @@ -3510,7 +4564,26 @@ int cg_section_write(int file_number, int B, int Z, const char * SectionName, return CG_OK; } -int cg_poly_section_write(int file_number, int B, int Z, const char * SectionName, +/** + * \ingroup ElementConnectivity + * + * \brief Write element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] type Type of element. See the eligible types for ElementType_t in the Typedefs section. + * \param[in] SectionName Name of the Elements_t node. + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] nbndry Index of last boundary element in the section. Set to zero if the elements are unsorted. + * \param[in] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[in] connect_offset Element connectivity offset data. This is required for NGON_n, NFACE_n and MIXED according to Elements_t Structure Definition. + * \param[out] S \CONN_S + * \return \ier + * + */ +int cg_poly_section_write(int fn, int B, int Z, const char * SectionName, CGNS_ENUMT(ElementType_t)type, cgsize_t start, cgsize_t end, int nbndry, const cgsize_t * elements, const cgsize_t * connect_offset, int *S) @@ -3520,7 +4593,7 @@ int cg_poly_section_write(int file_number, int B, int Z, const char * SectionNam cgsize_t num, ElementDataSize=0; /* get file and check mode */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; num = end - start + 1; @@ -3537,7 +4610,7 @@ int cg_poly_section_write(int file_number, int B, int Z, const char * SectionNam if (ElementDataSize < 0) return CG_ERROR; /* Create empty section */ - if (cg_section_general_write(file_number, B, Z, SectionName, type, + if (cg_section_general_write(fn, B, Z, SectionName, type, cgi_datatype(CG_SIZE_DATATYPE), start, end, ElementDataSize, nbndry, S)){ return CG_ERROR; @@ -3567,7 +4640,24 @@ int cg_poly_section_write(int file_number, int B, int Z, const char * SectionNam return CG_OK; } -int cg_section_partial_write(int file_number, int B, int Z, const char * SectionName, +/** + * \ingroup ElementConnectivity + * + * \brief Write subset of element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] type Type of element. See the eligible types for ElementType_t in the Typedefs section. + * \param[in] SectionName Name of the Elements_t node. + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] nbndry Index of last boundary element in the section. Set to zero if the elements are unsorted. + * \param[out] S \CONN_S + * \return \ier + * + */ +int cg_section_partial_write(int fn, int B, int Z, const char * SectionName, CGNS_ENUMT(ElementType_t) type, cgsize_t start, cgsize_t end, int nbndry, int *S) { @@ -3580,20 +4670,39 @@ int cg_section_partial_write(int file_number, int B, int Z, const char * Section ElementDataSize = num * elemsize; /* create empty section */ - if (cg_section_general_write(file_number, B, Z, SectionName, type, + if (cg_section_general_write(fn, B, Z, SectionName, type, cgi_datatype(CG_SIZE_DATATYPE), start, end, ElementDataSize, nbndry, S)){ return CG_ERROR; } /* if not fixed element size, need to create valid data for sizing */ - if (cg_section_initialize(file_number, B, Z, *S)) { + if (cg_section_initialize(fn, B, Z, *S)) { return CG_ERROR; } return CG_OK; } -int cg_section_general_write(int file_number, int B, int Z, const char * SectionName, +/** + * \ingroup ElementConnectivity + * + * \brief Write section data without element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] type Type of element. See the eligible types for ElementType_t in the Typedefs section. + * \param[in] elementDataType Data type of an array. Admissible data types are Integer and LongInteger. + * \param[in] SectionName Name of the Elements_t node. + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] elementDataSize Number of element connectivity data values. + * \param[in] nbndry Index of last boundary element in the section. Set to zero if the elements are unsorted. + * \param[out] S \CONN_S + * \return \ier + * + */ +int cg_section_general_write(int fn, int B, int Z, const char * SectionName, const CGNS_ENUMT(ElementType_t) type, const CGNS_ENUMT(DataType_t) elementDataType, cgsize_t start, cgsize_t end, cgsize_t elementDataSize, int nbndry, int *S) @@ -3650,7 +4759,7 @@ int cg_section_general_write(int file_number, int B, int Z, const char * Section } /* get file and check mode */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) @@ -3771,12 +4880,11 @@ int cg_section_general_write(int file_number, int B, int Z, const char * Section /* Do not write I8 in library that is not 64bit */ return CG_ERROR; } + HDF5storage_type = CG_CONTIGUOUS; /* ElementRange */ if (cgi_new_node(section->id, "ElementRange", "IndexRange_t", &dummy_id, data_type, 1, &dim_vals, prange)) return CG_ERROR; - HDF5storage_type = CG_CONTIGUOUS; - /* ElementStartOffset */ if (section->connect_offset && cgi_new_node(section->id, section->connect_offset->name, "DataArray_t", @@ -3793,11 +4901,22 @@ int cg_section_general_write(int file_number, int B, int Z, const char * Section return CG_OK; } -/* This function is a kind of helper to be used after a cg_section_general_write +/** + * \ingroup ElementConnectivity + * + * \brief Initialize element data for not fixed size elements + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] S \CONN_S + * \return \ier + * + * \details This function is a kind of helper to be used after a cg_section_general_write * cg_section_general_write reserve enough space while this function put * coherent init data. Then cg_poly_elements_partial_write would run safely. */ -int cg_section_initialize(int file_number, int B, int Z, int S) +int cg_section_initialize(int fn, int B, int Z, int S) { cgsize_t nm, nn, num, val; cgsize_t s_start, s_end, s_stride; @@ -3807,7 +4926,7 @@ int cg_section_initialize(int file_number, int B, int Z, int S) cgns_section *section = NULL; /* get file and check mode */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4010,17 +5129,28 @@ int cg_section_initialize(int file_number, int B, int Z, int S) return CG_OK; } - /*----------------------------------------------------------------------*/ -/* This function was created for revision 1.2 to return the size of the - connectivity vector, which can't be known without it *when type=MIXED */ - -int cg_ElementDataSize(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Get size of element connectivity data array + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[out] ElementDataSize Number of element connectivity data values. + * \return \ier + * + * \details This function was created for revision 1.2 to return the size of the + * connectivity vector, which can't be known without it *when type=MIXED* + */ +int cg_ElementDataSize(int fn, int B, int Z, int S, cgsize_t *ElementDataSize) { cgns_section *section; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4033,13 +5163,30 @@ int cg_ElementDataSize(int file_number, int B, int Z, int S, return CG_OK; } -int cg_ElementPartialSize(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Get size of element connectivity data array for partial read + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[out] ElementDataSize Number of element connectivity data values. + * \return \ier + * + * \details This function was created for revision 1.2 to return the size of the + * connectivity vector, which can't be known without it *when type=MIXED* + */ +int cg_ElementPartialSize(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *ElementDataSize) { cgns_section *section; cgsize_t size, cnt, *offset_data; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4131,14 +5278,27 @@ int cg_ElementPartialSize(int file_number, int B, int Z, int S, } /*----------------------------------------------------------------------*/ - -int cg_elements_read(int file_number, int B, int Z, int S, cgsize_t *elements, +/** + * \ingroup ElementConnectivity + * + * \brief Read fixed size element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[out] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[out] parent_data For boundary or interface elements, this array contains information on the cell(s) and cell face(s) sharing the element. If you do not need to read the ParentData when reading the ElementData, you may set the value to NULL. + * \return \ier + * + */ +int cg_elements_read(int fn, int B, int Z, int S, cgsize_t *elements, cgsize_t *parent_data) { cgns_section *section; cgsize_t count, num, ElementDataSize=0; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4191,15 +5351,29 @@ int cg_elements_read(int file_number, int B, int Z, int S, cgsize_t *elements, } /*----------------------------------------------------------------------*/ - -int cg_poly_elements_read(int file_number, int B, int Z, int S, cgsize_t *elements, +/** + * \ingroup ElementConnectivity + * + * \brief Read element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[out] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[out] connect_offset Element connectivity offset data. This is required for NGON_n, NFACE_n and MIXED according to Elements_t Structure Definition. + * \param[out] parent_data For boundary or interface elements, this array contains information on the cell(s) and cell face(s) sharing the element. If you do not need to read the ParentData when reading the ElementData, you may set the value to NULL. + * \return \ier + * + */ +int cg_poly_elements_read(int fn, int B, int Z, int S, cgsize_t *elements, cgsize_t *connect_offset, cgsize_t *parent_data) { cgns_section *section; cgsize_t count, num, ElementDataSize=0, ConnectOffsetSize=0; cgsize_t *offset_data=0; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4264,7 +5438,24 @@ int cg_poly_elements_read(int file_number, int B, int Z, int S, cgsize_t *elemen } /*----------------------------------------------------------------------*/ -int cg_elements_partial_read(int file_number, int B, int Z, int S, + +/** + * \ingroup ElementConnectivity + * + * \brief Read subset of fixed size element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[out] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[out] parent_data For boundary or interface elements, this array contains information on the cell(s) and cell face(s) sharing the element. If you do not need to read the ParentData when reading the ElementData, you may set the value to NULL. + * \return \ier + * + */ +int cg_elements_partial_read(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *elements, cgsize_t *parent_data) { @@ -4274,7 +5465,7 @@ int cg_elements_partial_read(int file_number, int B, int Z, int S, cgsize_t s_start[2], s_end[2], s_stride[2]; cgsize_t m_start[2], m_end[2], m_stride[2], m_dim[2]; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4437,19 +5628,34 @@ int cg_elements_partial_read(int file_number, int B, int Z, int S, return CG_OK; } - /*----------------------------------------------------------------------*/ -int cg_elements_general_read(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Read subset of fixed size element data to a typed array + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] m_type Data type of an array in memory. Admissible data types are Integer and LongInteger. + * \param[out] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \return \ier + * + */ +int cg_elements_general_read(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, CGNS_ENUMT(DataType_t) m_type, void* elements) { cgns_section* section; - cgsize_t size; + cgsize_t size = 0; cgsize_t s_start[1], s_end[1], s_stride[1]; cgsize_t m_start[1], m_end[1], m_stride[1], m_dim[1]; CGNS_ENUMT(DataType_t) s_type; int ier = CG_OK; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4563,8 +5769,24 @@ int cg_elements_general_read(int file_number, int B, int Z, int S, /*----------------------------------------------------------------------*/ -int cg_parent_elements_general_read(int file_number, int B, int Z, int S, - cgsize_t start, cgsize_t end, CGNS_ENUMT(DataType_t) m_type, void* parelem) +/** + * \ingroup ElementConnectivity + * + * \brief Read parent info for an element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] m_type Data type of an array in memory. Admissible data types are Integer and LongInteger. + * \param[out] ParentElement For boundary or interface elements, this array contains information on the cell(s) sharing the element. + * \return \ier + * + */ +int cg_parent_elements_general_read(int fn, int B, int Z, int S, + cgsize_t start, cgsize_t end, CGNS_ENUMT(DataType_t) m_type, void* ParentElement) { cgns_section* section; cgsize_t s_start[2], s_end[2], s_stride[2]; @@ -4572,7 +5794,7 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, CGNS_ENUMT(DataType_t) s_type; int ier = CG_OK; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4596,7 +5818,7 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, return CG_ERROR; } - if (parelem == NULL || section->parelem == NULL) { + if (ParentElement == NULL || section->parelem == NULL) { cgi_error("Error reading ParentElementsPosition."); return CG_ERROR; } @@ -4623,7 +5845,7 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, if (section->connect->dim_vals[0] == m_end[0] && section->connect->dim_vals[1] == 2) { if (cgio_read_all_data_type(cg->cgio, section->parelem->id, - cgi_adf_datatype(m_type), parelem)) { + cgi_adf_datatype(m_type), ParentElement)) { cg_io_error("cgio_read_all_data_type"); return CG_ERROR; } @@ -4631,7 +5853,7 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, else { if (cgio_read_data_type(cg->cgio, section->parelem->id, s_start, s_end, s_stride, cgi_adf_datatype(m_type), 2, m_dim, - m_start, m_end, m_stride, parelem)) { + m_start, m_end, m_stride, ParentElement)) { cg_io_error("cgio_read_data_type"); return CG_ERROR; } @@ -4663,7 +5885,7 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, return CG_ERROR; } } - ier = cgi_convert_data(2*m_dim[0], s_type, conv_data, m_type, parelem); + ier = cgi_convert_data(2*m_dim[0], s_type, conv_data, m_type, ParentElement); free(conv_data); if (ier) return CG_ERROR; } @@ -4672,7 +5894,7 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, if (section->parelem->dim_vals[0] == m_dim[0] && section->parelem->dim_vals[1] == 2) { if (cgio_read_all_data_type(cg->cgio, section->parelem->id, - cgi_adf_datatype(m_type), parelem)) { + cgi_adf_datatype(m_type), ParentElement)) { cg_io_error("cgio_read_all_data_type"); return CG_ERROR; } @@ -4680,7 +5902,7 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, else { if (cgio_read_data_type(cg->cgio, section->parelem->id, s_start, s_end, s_stride, cgi_adf_datatype(m_type), 2, m_dim, - m_start, m_end, m_stride, parelem)) { + m_start, m_end, m_stride, ParentElement)) { cg_io_error("cgio_read_data_type"); return CG_ERROR; } @@ -4690,8 +5912,25 @@ int cg_parent_elements_general_read(int file_number, int B, int Z, int S, } /*----------------------------------------------------------------------*/ -int cg_parent_elements_position_general_read(int file_number, int B, int Z, int S, - cgsize_t start, cgsize_t end, CGNS_ENUMT(DataType_t) m_type, void* parface) + +/** + * \ingroup ElementConnectivity + * + * \brief Read parent position info for an element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] m_type Data type of an array in memory. Admissible data types are Integer and LongInteger. + * \param[out] ParentFace For boundary or interface elements, this array contains information on the cell face(s) sharing the element. + * \return \ier + * + */ +int cg_parent_elements_position_general_read(int fn, int B, int Z, int S, + cgsize_t start, cgsize_t end, CGNS_ENUMT(DataType_t) m_type, void* ParentFace) { cgns_section* section; cgsize_t s_start[2], s_end[2], s_stride[2]; @@ -4699,7 +5938,7 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int CGNS_ENUMT(DataType_t) s_type; int ier = CG_OK; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4723,7 +5962,7 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int return CG_ERROR; } - if (parface == NULL || section->parface == NULL) { + if (ParentFace == NULL || section->parface == NULL) { cgi_error("Error reading ParentElementsPosition."); return CG_ERROR; } @@ -4750,7 +5989,7 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int if (section->connect->dim_vals[0] == m_end[0] && section->connect->dim_vals[1] == 2) { if (cgio_read_all_data_type(cg->cgio, section->parface->id, - cgi_adf_datatype(m_type), parface)) { + cgi_adf_datatype(m_type), ParentFace)) { cg_io_error("cgio_read_all_data_type"); return CG_ERROR; } @@ -4758,7 +5997,7 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int else { if (cgio_read_data_type(cg->cgio, section->parface->id, s_start, s_end, s_stride, cgi_adf_datatype(m_type), 2, m_dim, - m_start, m_end, m_stride, parface)) { + m_start, m_end, m_stride, ParentFace)) { cg_io_error("cgio_read_data_type"); return CG_ERROR; } @@ -4790,7 +6029,7 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int return CG_ERROR; } } - ier = cgi_convert_data(m_dim[0]*2, s_type, conv_data, m_type, parface); + ier = cgi_convert_data(m_dim[0]*2, s_type, conv_data, m_type, ParentFace); free(conv_data); if (ier) return CG_ERROR; } @@ -4799,7 +6038,7 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int if (section->connect->dim_vals[0] == m_dim[0] && section->connect->dim_vals[1] == 2) { if (cgio_read_all_data_type(cg->cgio, section->parface->id, - cgi_adf_datatype(m_type), parface)) { + cgi_adf_datatype(m_type), ParentFace)) { cg_io_error("cgio_read_all_data_type"); return CG_ERROR; } @@ -4807,7 +6046,7 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int else { if (cgio_read_data_type(cg->cgio, section->parface->id, s_start, s_end, s_stride, cgi_adf_datatype(m_type), 2, m_dim, - m_start, m_end, m_stride, parface)) { + m_start, m_end, m_stride, ParentFace)) { cg_io_error("cgio_read_data_type"); return CG_ERROR; } @@ -4817,7 +6056,24 @@ int cg_parent_elements_position_general_read(int file_number, int B, int Z, int } /*----------------------------------------------------------------------*/ -int cg_poly_elements_partial_read(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Read subset of element data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[out] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[out] connect_offset Element connectivity offset data. This is required for NGON_n, NFACE_n and MIXED according to Elements_t Structure Definition. + * \param[out] parent_data For boundary or interface elements, this array contains information on the cell(s) and cell face(s) sharing the element. If you do not need to read the ParentData when reading the ElementData, you may set the value to NULL. + * \return \ier + * + */ +int cg_poly_elements_partial_read(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *elements, cgsize_t *connect_offset, cgsize_t *parent_data) { @@ -4827,7 +6083,7 @@ int cg_poly_elements_partial_read(int file_number, int B, int Z, int S, cgsize_t s_start[2], s_end[2], s_stride[2]; cgsize_t m_start[2], m_end[2], m_stride[2], m_dim[2]; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -4996,7 +6252,24 @@ int cg_poly_elements_partial_read(int file_number, int B, int Z, int S, } /*----------------------------------------------------------------------*/ -int cg_poly_elements_general_read(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Read subset of element data to typed arrays + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] m_type Data type of an array in memory. Admissible data types are Integer and LongInteger. + * \param[out] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[out] connect_offset Element connectivity offset data. This is required for NGON_n, NFACE_n and MIXED according to Elements_t Structure Definition. + * \return \ier + * + */ +int cg_poly_elements_general_read(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, CGNS_ENUMT(DataType_t) m_type, void* elements, void* connect_offset) { @@ -5007,7 +6280,7 @@ int cg_poly_elements_general_read(int file_number, int B, int Z, int S, CGNS_ENUMT(DataType_t) s_type; int ier = CG_OK; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* verify input */ @@ -5130,12 +6403,26 @@ int cg_poly_elements_general_read(int file_number, int B, int Z, int S, } /*----------------------------------------------------------------------*/ - -int cg_elements_partial_write(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Write element data for a fixed size element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \return \ier + * + */ +int cg_elements_partial_write(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *elements) { - if (cg_elements_general_write(file_number, B, Z, S, + if (cg_elements_general_write(fn, B, Z, S, start, end, cgi_datatype(CG_SIZE_DATATYPE), elements)) { return CG_ERROR; } @@ -5302,7 +6589,23 @@ int cg_elements_partial_write(int file_number, int B, int Z, int S, } \ } -int cg_elements_general_write(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Write element data for a fixed size element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] m_type Data type of an array in memory. Admissible data types are Integer and LongInteger. + * \param[in] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \return \ier + * + */ +int cg_elements_general_write(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const CGNS_ENUMT(DataType_t) m_type, const void *elements) { @@ -5318,7 +6621,7 @@ int cg_elements_general_write(int file_number, int B, int Z, int S, int ier = CG_OK; /* get file and check mode */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) @@ -5601,11 +6904,27 @@ int cg_elements_general_write(int file_number, int B, int Z, int S, return CG_OK; } -int cg_poly_elements_partial_write(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Write element data for an element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[in] connect_offset Element connectivity offset data. This is required for NGON_n, NFACE_n and MIXED according to Elements_t Structure Definition. + * \return \ier + * + */ +int cg_poly_elements_partial_write(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *elements, const cgsize_t *connect_offset) { - if (cg_poly_elements_general_write(file_number, B, Z, S, + if (cg_poly_elements_general_write(fn, B, Z, S, start, end, cgi_datatype(CG_SIZE_DATATYPE), elements, connect_offset)) { return CG_ERROR; @@ -5613,7 +6932,24 @@ int cg_poly_elements_partial_write(int file_number, int B, int Z, int S, return CG_OK; } -int cg_poly_elements_general_write(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Write element data for an element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] m_type Data type of an array in memory. Admissible data types are Integer and LongInteger. + * \param[in] elements Element connectivity data. The element connectivity order is given in Element Numbering Conventions. + * \param[in] input_connect_offset Element connectivity offset data. This is required for NGON_n, NFACE_n and MIXED according to Elements_t Structure Definition. + * \return \ier + * + */ +int cg_poly_elements_general_write(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const CGNS_ENUMT(DataType_t) m_type, const void *elements, const void *input_connect_offset) { @@ -5634,7 +6970,7 @@ int cg_poly_elements_general_write(int file_number, int B, int Z, int S, CGNS_ENUMT(DataType_t) s_type; /* get file and check mode */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) @@ -6198,15 +7534,27 @@ int cg_poly_elements_general_write(int file_number, int B, int Z, int S, } /*----------------------------------------------------------------------*/ - -int cg_parent_data_write(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Write parent info for an element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] parent_data For boundary or interface elements, this array contains information on the cell(s) and cell face(s) sharing the element. If you do not need to read the ParentData when reading the ElementData, you may set the value to NULL. + * \return \ier + * + */ +int cg_parent_data_write(int fn, int B, int Z, int S, const cgsize_t * parent_data) { cgns_section *section; cgsize_t num; /* get file and check mode */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) @@ -6289,9 +7637,22 @@ int cg_parent_data_write(int file_number, int B, int Z, int S, return CG_OK; } - - -int cg_parent_data_partial_write(int file_number, int B, int Z, int S, +/** + * \ingroup ElementConnectivity + * + * \brief Write subset of parent info for an element section + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start Index of first element in the section. + * \param[in] end Index of last element in the section. + * \param[in] parent_data For boundary or interface elements, this array contains information on the cell(s) and cell face(s) sharing the element. If you do not need to read the ParentData when reading the ElementData, you may set the value to NULL. + * \return \ier + * + */ +int cg_parent_data_partial_write(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *parent_data) { @@ -6299,7 +7660,7 @@ int cg_parent_data_partial_write(int file_number, int B, int Z, int S, cgsize_t size; /* get file and check mode */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -6414,11 +7775,23 @@ int cg_parent_data_partial_write(int file_number, int B, int Z, int S, * Read and Write FlowSolution_t Nodes \*****************************************************************************/ -int cg_nsols(int file_number, int B, int Z, int *nsols) +/** + * \ingroup FlowSolution + * + * \brief Get number of FlowSolution_t nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] nsols Number of flow solutions for zone Z. + * \return \ier + * + */ +int cg_nsols(int fn, int B, int Z, int *nsols) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -6430,12 +7803,26 @@ int cg_nsols(int file_number, int B, int Z, int *nsols) return CG_OK; } -int cg_sol_info(int file_number, int B, int Z, int S, char *solname, +/** + * \ingroup FlowSolution + * + * \brief Get information about a FlowSolution_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[out] solname Name of the flow solution. + * \param[out] location Grid location where the solution is recorded. The current admissible locations are Vertex, CellCenter, IFaceCenter, JFaceCenter, and KFaceCenter. + * \return \ier + * + */ +int cg_sol_info(int fn, int B, int Z, int S, char *solname, CGNS_ENUMT(GridLocation_t) *location) { cgns_sol *sol; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -6448,11 +7835,11 @@ int cg_sol_info(int file_number, int B, int Z, int S, char *solname, return CG_OK; } -int cg_sol_id(int file_number, int B, int Z, int S, double *sol_id) +int cg_sol_id(int fn, int B, int Z, int S, double *sol_id) { cgns_sol *sol; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -6464,7 +7851,21 @@ int cg_sol_id(int file_number, int B, int Z, int S, double *sol_id) return CG_OK; } -int cg_sol_write(int file_number, int B, int Z, const char * solname, +/** + * \ingroup FlowSolution + * + * \brief Create and/or write to a FlowSolution_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] solname Name of the flow solution. + * \param[in] location Grid location where the solution is recorded. The current admissible locations are Vertex, CellCenter, IFaceCenter, JFaceCenter, and KFaceCenter. + * \param[out] S \SOL_S + * \return \ier + * + */ +int cg_sol_write(int fn, int B, int Z, const char * solname, CGNS_ENUMT(GridLocation_t) location, int *S) { cgns_zone *zone; @@ -6487,7 +7888,7 @@ int cg_sol_write(int file_number, int B, int Z, const char * solname, } */ /* get memory address for FlowSolution node */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -6562,12 +7963,26 @@ int cg_sol_write(int file_number, int B, int Z, const char * solname, return CG_OK; } -int cg_sol_size(int file_number, int B, int Z, int S, +/** + * \ingroup FlowSolution + * + * \brief Get the dimensions of a FlowSolution_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[out] data_dim Number of dimensions defining the solution data. If a point set has been defined, this will be 1, otherwise this will be the current zone index dimension. + * \param[out] dim_vals The array of data_dim dimensions for the solution data. + * \return \ier + * + */ +int cg_sol_size(int fn, int B, int Z, int S, int *data_dim, cgsize_t *dim_vals) { cgns_sol *sol; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -6589,7 +8004,20 @@ int cg_sol_size(int file_number, int B, int Z, int S, } /*----------------------------------------------------------------------*/ - +/** + * \ingroup FlowSolution + * + * \brief Get info about a point set FlowSolution_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[out] ptset_type Type of point set defining the interface in the current solution; either PointRange or PointList. + * \param[out] npnts Number of points defining the interface in the current solution. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the PointList. + * \return \ier + * + */ int cg_sol_ptset_info(int fn, int B, int Z, int S, CGNS_ENUMT(PointSetType_t) *ptset_type, cgsize_t *npnts) { @@ -6613,6 +8041,19 @@ int cg_sol_ptset_info(int fn, int B, int Z, int S, return CG_OK; } +/** + * \ingroup FlowSolution + * + * \brief Read a point set FlowSolution_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[out] pnts Array of points defining the interface in the current solution. + * \return \ier + * + */ int cg_sol_ptset_read(int fn, int B, int Z, int S, cgsize_t *pnts) { int dim = 0; @@ -6636,6 +8077,23 @@ int cg_sol_ptset_read(int fn, int B, int Z, int S, cgsize_t *pnts) return CG_OK; } +/** + * \ingroup FlowSolution + * + * \brief Create a point set FlowSolution_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] solname Name of the flow solution. + * \param[in] location Grid location where the solution is recorded. The current admissible locations are Vertex, CellCenter, IFaceCenter, JFaceCenter, and KFaceCenter. + * \param[in] ptset_type Type of point set defining the interface in the current solution; either PointRange or PointList. + * \param[in] npnts Number of points defining the interface in the current solution. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the PointList. + * \param[in] pnts Array of points defining the interface in the current solution. + * \param[out] S \SOL_S + * \return \ier + * + */ int cg_sol_ptset_write(int fn, int B, int Z, const char *solname, CGNS_ENUMT(GridLocation_t) location, CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, @@ -6696,12 +8154,24 @@ int cg_sol_ptset_write(int fn, int B, int Z, const char *solname, /*****************************************************************************\ * Read and Write flow field DataArray_t Nodes \*****************************************************************************/ - -int cg_nfields(int file_number, int B, int Z, int S, int *nfields) +/** + * \ingroup FlowSolutionData + * + * \brief Get number of flow solution arrays + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[out] nfields Number of data arrays in flow solution S. + * \return \ier + * + */ +int cg_nfields(int fn, int B, int Z, int S, int *nfields) { cgns_sol *sol; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -6713,12 +8183,27 @@ int cg_nfields(int file_number, int B, int Z, int S, int *nfields) return CG_OK; } -int cg_field_info(int file_number, int B, int Z, int S, int F, - CGNS_ENUMT(DataType_t) *type, char *fieldname) +/** + * \ingroup FlowSolutionData + * + * \brief Get info about a flow solution array + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[in] F Solution array index number, where 1 ≤ F ≤ nfields. + * \param[out] datatype Data type of the solution array written to the file. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble. + * \param[out] fieldname Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility. + * \return \ier + * + */ +int cg_field_info(int fn, int B, int Z, int S, int F, + CGNS_ENUMT(DataType_t) *datatype, char *fieldname) { cgns_array *field; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -6727,20 +8212,37 @@ int cg_field_info(int file_number, int B, int Z, int S, int F, if (field==0) return CG_ERROR; strcpy(fieldname, field->name); - *type = cgi_datatype(field->data_type); + *datatype = cgi_datatype(field->data_type); return CG_OK; } -int cg_field_read(int file_number, int B, int Z, int S, const char *fieldname, - CGNS_ENUMT(DataType_t) type, const cgsize_t *s_rmin, +/** + * \ingroup FlowSolutionData + * + * \brief Read flow solution + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[in] fieldname Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility. + * \param[in] mem_datatype Data type of an array in memory. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[out] field_ptr Array of solution values. + * \return \ier + * + */ +int cg_field_read(int fn, int B, int Z, int S, const char *fieldname, + CGNS_ENUMT(DataType_t) mem_datatype, const cgsize_t *s_rmin, const cgsize_t *s_rmax, void *field_ptr) { cgns_sol *sol; int n, m_numdim; /* get memory addresses */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* get memory address for solution */ @@ -6767,12 +8269,33 @@ int cg_field_read(int file_number, int B, int Z, int S, const char *fieldname, m_dimvals[n] = m_rmax[n]; } - return cg_field_general_read(file_number, B, Z, S, fieldname, - s_rmin, s_rmax, type, + return cg_field_general_read(fn, B, Z, S, fieldname, + s_rmin, s_rmax, mem_datatype, m_numdim, m_dimvals, m_rmin, m_rmax, field_ptr); } +/** + * \ingroup FlowSolutionData + * + * \brief Read subset of flow solution to a shaped array + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[in] fieldname Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[in] m_type Data type of an array in memory. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble. + * \param[in] m_numdim Number of dimensions of array in memory. + * \param[in] m_dimvals Dimensions of array in memory. + * \param[in] m_rmin Lower range index in memory (eg., imin, jmin, kmin). + * \param[in] m_rmax Upper range index in memory (eg., imax, jmax, kmax). + * \param[out] field_ptr Array of solution values. + * \return \ier + * + */ int cg_field_general_read(int fn, int B, int Z, int S, const char *fieldname, const cgsize_t *s_rmin, const cgsize_t *s_rmax, CGNS_ENUMT(DataType_t) m_type, @@ -6826,11 +8349,11 @@ int cg_field_general_read(int fn, int B, int Z, int S, const char *fieldname, field_ptr); } -int cg_field_id(int file_number, int B, int Z, int S, int F, double *field_id) +int cg_field_id(int fn, int B, int Z, int S, int F, double *field_id) { cgns_array *field; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -6842,7 +8365,23 @@ int cg_field_id(int file_number, int B, int Z, int S, int F, double *field_id) return CG_OK; } -int cg_field_write(int file_number, int B, int Z, int S, +/** + * \ingroup FlowSolutionData + * + * \brief Write flow solution + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[in] fieldname Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility. + * \param[in] type Data type of the solution array written to the file. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble. + * \param[in] field_ptr Array of solution values. + * \param[out] F \SOL_F + * \return \ier + * + */ +int cg_field_write(int fn, int B, int Z, int S, CGNS_ENUMT(DataType_t) type, const char *fieldname, const void *field_ptr, int *F) { @@ -6862,7 +8401,7 @@ int cg_field_write(int file_number, int B, int Z, int S, } /* get memory addresses */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; zone = cgi_get_zone(cg, B, Z); @@ -6900,13 +8439,31 @@ int cg_field_write(int file_number, int B, int Z, int S, m_rmax[n] = m_dimvals[n]; } - return cg_field_general_write(file_number, B, Z, S, fieldname, + return cg_field_general_write(fn, B, Z, S, fieldname, type, s_rmin, s_rmax, type, m_numdim, m_dimvals, m_rmin, m_rmax, field_ptr, F); } -int cg_field_partial_write(int file_number, int B, int Z, int S, +/** + * \ingroup FlowSolutionData + * + * \brief Write subset of flow solution + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[in] fieldname Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility. + * \param[in] type Data type of the solution array written to the file. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[in] field_ptr Array of solution values. + * \param[out] F \SOL_F + * \return \ier + * + */ +int cg_field_partial_write(int fn, int B, int Z, int S, CGNS_ENUMT( DataType_t ) type, const char *fieldname, const cgsize_t *s_rmin, const cgsize_t *s_rmax, const void *field_ptr, int *F) @@ -6917,7 +8474,7 @@ int cg_field_partial_write(int file_number, int B, int Z, int S, int status; /* get memory addresses */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; zone = cgi_get_zone(cg, B, Z); @@ -6948,7 +8505,7 @@ int cg_field_partial_write(int file_number, int B, int Z, int S, m_dimvals[n] = m_rmax[n]; } - status = cg_field_general_write(file_number, B, Z, S, fieldname, + status = cg_field_general_write(fn, B, Z, S, fieldname, type, s_rmin, s_rmax, type, m_numdim, m_dimvals, m_rmin, m_rmax, field_ptr, F); @@ -6958,6 +8515,30 @@ int cg_field_partial_write(int file_number, int B, int Z, int S, } +/** + * \ingroup FlowSolutionData + * + * \brief Write shaped array to a subset of flow solution + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \SOL_S + * \param[in] fieldname Name of the solution array. It is strongly advised to use the SIDS nomenclature conventions when naming the solution arrays to insure file compatibility. + * \param[in] s_type Data type of the solution array written to the file. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * + * \param[in] m_type Data type of an array in memory. Admissible data types for a solution array are Integer, LongInteger, RealSingle, and RealDouble. + * \param[in] m_numdim Number of dimensions of array in memory. + * \param[in] m_dimvals Dimensions of array in memory. + * \param[in] m_rmin Lower range index in memory (eg., imin, jmin, kmin). + * \param[in] m_rmax Upper range index in memory (eg., imax, jmax, kmax). + * \param[in] field_ptr Array of solution values. + * \param[out] F \SOL_F + * \return \ier + * + */ int cg_field_general_write(int fn, int B, int Z, int S, const char *fieldname, CGNS_ENUMT(DataType_t) s_type, const cgsize_t *s_rmin, const cgsize_t *s_rmax, @@ -7030,7 +8611,19 @@ int cg_field_general_write(int fn, int B, int Z, int S, const char *fieldname, * Read and write ZoneSubRegion_t Nodes * \*************************************************************************/ -int cg_nsubregs(int fn, int B, int Z, int *nsubreg) +/** + * \ingroup ZoneSubregions + * + * \brief Get number of ZoneSubRegion_t nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] nsubregs Number of ZoneSubRegion_t nodes under Zone Z. + * \return \ier + * + */ +int cg_nsubregs(int fn, int B, int Z, int *nsubregs) { cgns_zone *zone; @@ -7042,7 +8635,7 @@ int cg_nsubregs(int fn, int B, int Z, int *nsubreg) zone = cgi_get_zone(cg, B, Z); if (zone==0) return CG_ERROR; - (*nsubreg) = zone->nsubreg; + (*nsubregs) = zone->nsubreg; return CG_OK; } @@ -7056,7 +8649,26 @@ static cgns_subreg *cg_subreg_read(int fn, int B, int Z, int S) return cgi_get_subreg(cg, B, Z, S); } -int cg_subreg_info(int fn, int B, int Z, int S, char *name, int *dimension, +/** + * \ingroup ZoneSubregions + * + * \brief Get info about a ZoneSubRegion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S ZoneSubRegion index number, where 1 ≤ S ≤ nsubregs. + * \param[out] regname Name of the ZoneSubRegion_t node. + * \param[out] dimension Dimensionality of the subregion, 1 for lines, 2 for faces, 3 for volumes. + * \param[out] location Grid location used in the definition of the point set. The currently admissible locations are Vertex and CellCenter. + * \param[out] ptset_type Type of point set defining the interface for the subregion data; either PointRange or PointList. + * \param[out] npnts Number of points defining the interface for the subregion data. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the PointList. + * \param[out] bcname_len String length of bcname. + * \param[out] gcname_len String length of gcname. + * \return \ier + * + */ +int cg_subreg_info(int fn, int B, int Z, int S, char *regname, int *dimension, CGNS_ENUMT(GridLocation_t) *location, CGNS_ENUMT(PointSetType_t) *ptset_type, cgsize_t *npnts, int *bcname_len, int *gcname_len) @@ -7065,7 +8677,7 @@ int cg_subreg_info(int fn, int B, int Z, int S, char *name, int *dimension, if (subreg == NULL) return CG_ERROR; - strcpy(name,subreg->name); + strcpy(regname,subreg->name); *dimension = subreg->reg_dim; *location = subreg->location; if (subreg->ptset) { @@ -7088,6 +8700,19 @@ int cg_subreg_info(int fn, int B, int Z, int S, char *name, int *dimension, return CG_OK; } +/** + * \ingroup ZoneSubregions + * + * \brief Read point set data for a ZoneSubRegion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S ZoneSubRegion index number, where 1 ≤ S ≤ nsubregs. + * \param[out] pnts Array of points defining the interface for the subregion data. + * \return \ier + * + */ int cg_subreg_ptset_read(int fn, int B, int Z, int S, cgsize_t *pnts) { int dim = 0; @@ -7105,6 +8730,19 @@ int cg_subreg_ptset_read(int fn, int B, int Z, int S, cgsize_t *pnts) return CG_OK; } +/** + * \ingroup ZoneSubregions + * + * \brief Read the BC_t node name for a ZoneSubRegion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S ZoneSubRegion index number, where 1 ≤ S ≤ nsubregs. + * \param[out] bcname The name of a BC_t node which defines the subregion. + * \return \ier + * + */ int cg_subreg_bcname_read(int fn, int B, int Z, int S, char *bcname) { cgns_subreg *subreg = cg_subreg_read(fn, B, Z, S); @@ -7119,6 +8757,19 @@ int cg_subreg_bcname_read(int fn, int B, int Z, int S, char *bcname) return CG_OK; } +/** + * \ingroup ZoneSubregions + * + * \brief Read the GridConnectivity_t node name for a ZoneSubRegion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S ZoneSubRegion index number, where 1 ≤ S ≤ nsubregs. + * \param[out] gcname The name of a GridConnectivity_t or GridConnectivity1to1_t node which defines the subregion. + * \return \ier + * + */ int cg_subreg_gcname_read(int fn, int B, int Z, int S, char *gcname) { cgns_subreg *subreg = cg_subreg_read(fn, B, Z, S); @@ -7198,7 +8849,25 @@ static cgns_subreg *cg_subreg_write(int fn, int B, int Z, const char *name, return subreg; } -int cg_subreg_ptset_write(int fn, int B, int Z, const char *name, +/** + * \ingroup ZoneSubregions + * + * \brief Create a point set ZoneSubRegion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] regname Name of the ZoneSubRegion_t node. + * \param[in] dimension Dimensionality of the subregion, 1 for lines, 2 for faces, 3 for volumes. + * \param[in] location Grid location used in the definition of the point set. The currently admissible locations are Vertex and CellCenter. + * \param[in] ptset_type Type of point set defining the interface for the subregion data; either PointRange or PointList. + * \param[in] npnts Number of points defining the interface for the subregion data. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the PointList. + * \param[in] pnts Array of points defining the interface for the subregion data. + * \param[out] S ZoneSubRegion index number, where 1 ≤ S ≤ nsubregs. + * \return \ier + * + */ +int cg_subreg_ptset_write(int fn, int B, int Z, const char *regname, int dimension, CGNS_ENUMT(GridLocation_t) location, CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, const cgsize_t *pnts, int *S) @@ -7221,7 +8890,7 @@ int cg_subreg_ptset_write(int fn, int B, int Z, const char *name, if (cgi_check_location(dimension+1, cg->base[B-1].zone[Z-1].type, location)) return CG_ERROR; - subreg = cg_subreg_write(fn, B, Z, name, dimension, S); + subreg = cg_subreg_write(fn, B, Z, regname, dimension, S); if (subreg == NULL) return CG_ERROR; subreg->location = location; @@ -7261,7 +8930,22 @@ int cg_subreg_ptset_write(int fn, int B, int Z, const char *name, return CG_OK; } -int cg_subreg_bcname_write(int fn, int B, int Z, const char *name, int dimension, +/** + * \ingroup ZoneSubregions + * + * \brief Create a ZoneSubRegion_t node that references a BC_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] regname Name of the ZoneSubRegion_t node. + * \param[in] dimension Dimensionality of the subregion, 1 for lines, 2 for faces, 3 for volumes. + * \param[in] bcname The name of a BC_t node which defines the subregion. + * \param[out] S ZoneSubRegion index number, where 1 ≤ S ≤ nsubregs. + * \return \ier + * + */ +int cg_subreg_bcname_write(int fn, int B, int Z, const char *regname, int dimension, const char *bcname, int *S) { cgsize_t dim_vals = 1; @@ -7273,7 +8957,7 @@ int cg_subreg_bcname_write(int fn, int B, int Z, const char *name, int dimension return CG_ERROR; } - subreg = cg_subreg_write(fn, B, Z, name, dimension, S); + subreg = cg_subreg_write(fn, B, Z, regname, dimension, S); if (subreg == NULL) return CG_ERROR; subreg->bcname = CGNS_NEW(cgns_descr, 1); @@ -7296,7 +8980,22 @@ int cg_subreg_bcname_write(int fn, int B, int Z, const char *name, int dimension return CG_OK; } -int cg_subreg_gcname_write(int fn, int B, int Z, const char *name, int dimension, +/** + * \ingroup ZoneSubregions + * + * \brief Create a ZoneSubRegion_t node that references a GridConnectivity_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] regname Name of the ZoneSubRegion_t node. + * \param[in] dimension Dimensionality of the subregion, 1 for lines, 2 for faces, 3 for volumes. + * \param[in] gcname The name of a GridConnectivity_t or GridConnectivity1to1_t node which defines the subregion. + * \param[out] S ZoneSubRegion index number, where 1 ≤ S ≤ nsubregs. + * \return \ier + * + */ +int cg_subreg_gcname_write(int fn, int B, int Z, const char *regname, int dimension, const char *gcname, int *S) { cgsize_t dim_vals = 1; @@ -7308,7 +9007,7 @@ int cg_subreg_gcname_write(int fn, int B, int Z, const char *name, int dimension return CG_ERROR; } - subreg = cg_subreg_write(fn, B, Z, name, dimension, S); + subreg = cg_subreg_write(fn, B, Z, regname, dimension, S); if (subreg == NULL) return CG_ERROR; subreg->gcname = CGNS_NEW(cgns_descr, 1); @@ -7335,6 +9034,18 @@ int cg_subreg_gcname_write(int fn, int B, int Z, const char *name, int dimension * Read and write ZoneGridConnectivity_t Nodes * \*************************************************************************/ +/** + * \ingroup ZoneGridConnectivity + * + * \brief Get number of ZoneGridConnectivity_t nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] nzconns Number of ZoneGridConnectivity_t nodes under Zone Z. + * \return \ier + * + */ int cg_nzconns(int fn, int B, int Z, int *nzconns) { cgns_zone *zone; @@ -7352,7 +9063,20 @@ int cg_nzconns(int fn, int B, int Z, int *nzconns) return CG_OK; } -int cg_zconn_read(int fn, int B, int Z, int C, char *name) +/** + * \ingroup ZoneGridConnectivity + * + * \brief Read ZoneGridConnectivity_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] ZC Zone grid connectivity index number, where 1 ≤ ZC ≤ nzconns. + * \param[out] zcname Name of the ZoneGridConnectivity_t node + * \return \ier + * + */ +int cg_zconn_read(int fn, int B, int Z, int ZC, char *zcname) { cgns_zconn *zconn; @@ -7363,22 +9087,35 @@ int cg_zconn_read(int fn, int B, int Z, int C, char *name) /* Get memory address for ZoneGridConnectivity_t node */ /* cgi_get_zconnZC() also sets active ZoneGridConnectivity_t node */ - zconn = cgi_get_zconnZC(cg, B, Z, C); + zconn = cgi_get_zconnZC(cg, B, Z, ZC); if (zconn==0) return CG_ERROR; /* Return name for the ZoneGridConnectivity_t node */ - strcpy(name,zconn->name); + strcpy(zcname,zconn->name); return CG_OK; } -int cg_zconn_write(int fn, int B, int Z, const char *name, int *C) +/** + * \ingroup ZoneGridConnectivity + * + * \brief Create ZoneGridConnectivity_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] zcname Name of the ZoneGridConnectivity_t node + * \param[out] ZC Zone grid connectivity index number, where 1 ≤ ZC ≤ nzconns. + * \return \ier + * + */ +int cg_zconn_write(int fn, int B, int Z, const char *zcname, int *ZC) { cgns_zone *zone; cgns_zconn *zconn = NULL; int index; /* verify input */ - if (cgi_check_strlen(name)) return CG_ERROR; + if (cgi_check_strlen(zcname)) return CG_ERROR; /* get memory address */ cg = cgi_get_file(fn); @@ -7391,11 +9128,11 @@ int cg_zconn_write(int fn, int B, int Z, const char *name, int *C) /* Overwrite a ZoneGridConnectivity_t Node: */ for (index = 0; index < zone->nzconn; index++) { - if (0 == strcmp(name, zone->zconn[index].name)) { + if (0 == strcmp(zcname, zone->zconn[index].name)) { /* in CG_MODE_WRITE, children names must be unique */ if (cg->mode == CG_MODE_WRITE) { - cgi_error("Duplicate child name found: %s",name); + cgi_error("Duplicate child name found: %s",zcname); return CG_ERROR; } @@ -7421,11 +9158,11 @@ int cg_zconn_write(int fn, int B, int Z, const char *name, int *C) zconn = &(zone->zconn[zone->nzconn]); zone->nzconn++; } - (*C) = index+1; - zone->active_zconn = *C; + (*ZC) = index+1; + zone->active_zconn = *ZC; memset(zconn, 0, sizeof(cgns_zconn)); - strcpy(zconn->name,name); + strcpy(zconn->name,zcname); /* save data in file */ if (cgi_new_node(zone->id, zconn->name, "ZoneGridConnectivity_t", @@ -7434,7 +9171,19 @@ int cg_zconn_write(int fn, int B, int Z, const char *name, int *C) return CG_OK; } -int cg_zconn_get(int fn, int B, int Z, int *C) +/** + * \ingroup ZoneGridConnectivity + * + * \brief Get the current ZoneGridConnectivity_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] ZC Zone grid connectivity index number, where 1 ≤ ZC ≤ nzconns. + * \return \ier + * + */ +int cg_zconn_get(int fn, int B, int Z, int *ZC) { cgns_zone *zone; @@ -7446,18 +9195,30 @@ int cg_zconn_get(int fn, int B, int Z, int *C) if (zone==0) return CG_ERROR; if (zone->nzconn <= 0) { - *C = 0; + *ZC = 0; cgi_error("no ZoneGridConnectivity_t node found."); return CG_NODE_NOT_FOUND; } if (zone->active_zconn <= 0 || zone->active_zconn > zone->nzconn) zone->active_zconn = 1; - *C = zone->active_zconn; + *ZC = zone->active_zconn; return CG_OK; } -int cg_zconn_set(int fn, int B, int Z, int C) +/** + * \ingroup ZoneGridConnectivity + * + * \brief Set the current ZoneGridConnectivity_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] ZC Zone grid connectivity index number, where 1 ≤ ZC ≤ nzconns. + * \return \ier + * + */ +int cg_zconn_set(int fn, int B, int Z, int ZC) { cgns_zconn *zconn; @@ -7466,7 +9227,7 @@ int cg_zconn_set(int fn, int B, int Z, int C) /* Get memory address for ZoneGridConnectivity_t node */ /* cgi_get_zconnZC() also sets active ZoneGridConnectivity_t node */ - zconn = cgi_get_zconnZC(cg, B, Z, C); + zconn = cgi_get_zconnZC(cg, B, Z, ZC); if (zconn==0) return CG_ERROR; return CG_OK; } @@ -7475,11 +9236,23 @@ int cg_zconn_set(int fn, int B, int Z, int C) * Read and Write OversetHoles_t Nodes \*****************************************************************************/ -int cg_nholes(int file_number, int B, int Z, int *nholes) +/** + * \ingroup OversetHoles + * + * \brief Get number of overset holes in a zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] nholes Number of overset holes in zone Z. + * \return \ier + * + */ +int cg_nholes(int fn, int B, int Z, int *nholes) { cgns_zconn *zconn; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7490,14 +9263,31 @@ int cg_nholes(int file_number, int B, int Z, int *nholes) return CG_OK; } -int cg_hole_info(int file_number, int B, int Z, int J, char *holename, +/** + * \ingroup OversetHoles + * + * \brief Get info about an overset hole + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Overset hole index number, where 1 ≤ J ≤ nholes. + * \param[out] holename Name of the overset hole. + * \param[out] location Grid location used in the definition of the point set. The currently admissible locations are Vertex and CellCenter. + * \param[out] ptset_type The extent of the overset hole may be defined using a range of points or cells, or using a discrete list of all points or cells in the overset hole. If a range of points or cells is used, ptset_type is set to PointRange. When a discrete list of points or cells is used, ptset_type equals PointList. + * \param[out] nptsets Number of point sets used to define the hole. If ptset_type is PointRange, several point sets may be used. If ptset_type is PointList, only one point set is allowed. + * \param[out] npnts Number of points (or cells) in the point set. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points or cells in the PointList. + * \return \ier + * + */ +int cg_hole_info(int fn, int B, int Z, int J, char *holename, CGNS_ENUMT(GridLocation_t) *location, CGNS_ENUMT(PointSetType_t) *ptset_type, int *nptsets, cgsize_t *npnts) { cgns_hole *hole; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7515,12 +9305,25 @@ int cg_hole_info(int file_number, int B, int Z, int J, char *holename, return CG_OK; } -int cg_hole_read(int file_number, int B, int Z, int J, cgsize_t *pnts) +/** + * \ingroup OversetHoles + * + * \brief Read overset hole data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Overset hole index number, where 1 ≤ J ≤ nholes. + * \param[out] pnts Array of points or cells in the point set. + * \return \ier + * + */ +int cg_hole_read(int fn, int B, int Z, int J, cgsize_t *pnts) { cgns_hole *hole; int set, index_dim; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7561,11 +9364,11 @@ int cg_hole_read(int file_number, int B, int Z, int J, cgsize_t *pnts) return CG_OK; } -int cg_hole_id(int file_number, int B, int Z, int J, double *hole_id) +int cg_hole_id(int fn, int B, int Z, int J, double *hole_id) { cgns_hole *hole; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7577,7 +9380,25 @@ int cg_hole_id(int file_number, int B, int Z, int J, double *hole_id) return CG_OK; } -int cg_hole_write(int file_number, int B, int Z, const char * holename, +/** + * \ingroup OversetHoles + * + * \brief Write overset hole data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] holename Name of the overset hole. + * \param[in] location Grid location used in the definition of the point set. The currently admissible locations are Vertex and CellCenter. + * \param[in] ptset_type The extent of the overset hole may be defined using a range of points or cells, or using a discrete list of all points or cells in the overset hole. If a range of points or cells is used, ptset_type is set to PointRange. When a discrete list of points or cells is used, ptset_type equals PointList. + * \param[in] nptsets Number of point sets used to define the hole. If ptset_type is PointRange, several point sets may be used. If ptset_type is PointList, only one point set is allowed. + * \param[in] npnts Number of points (or cells) in the point set. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points or cells in the PointList. + * \param[in] pnts Array of points or cells in the point set. + * \param[out] J Overset hole index number, where 1 ≤ J ≤ nholes. + * \return \ier + * + */ +int cg_hole_write(int fn, int B, int Z, const char * holename, CGNS_ENUMT(GridLocation_t) location, CGNS_ENUMT(PointSetType_t) ptset_type, int nptsets, cgsize_t npnts, const cgsize_t * pnts, int *J) @@ -7611,7 +9432,7 @@ int cg_hole_write(int file_number, int B, int Z, const char * holename, return CG_ERROR; } /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -7740,11 +9561,23 @@ int cg_hole_write(int file_number, int B, int Z, const char * holename, * Read and Write GridConnectivity_t Nodes \*****************************************************************************/ -int cg_nconns(int file_number, int B, int Z, int *nconns) +/** + * \ingroup GeneralizedConnectivity + * + * \brief Get number of generalized connectivity interfaces in a zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] nconns Number of interfaces for zone Z. + * \return \ier + * + */ +int cg_nconns(int fn, int B, int Z, int *nconns) { cgns_zconn *zconn; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7755,21 +9588,46 @@ int cg_nconns(int file_number, int B, int Z, int *nconns) return CG_OK; } -/* in cg_conn_info, donor_datatype is useless starting with version 1.27, because - it's always I4. However this arg. is left for backward compatibility of API - and to be able to read old files */ -int cg_conn_info(int file_number, int B, int Z, int J, char *connectname, +/** + * \ingroup GeneralizedConnectivity + * + * \brief Get info about a generalized connectivity interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Interface index number, where 1 ≤ J ≤ nconns. + * \param[out] connectname Name of the interface. + * \param[out] location Grid location used in the definition of the point set. The currently admissible locations are Vertex and CellCenter. + * \param[out] connect_type Type of interface being defined. The admissible types are Overset, Abutting, and Abutting1to1. + * \param[out] ptset_type Type of point set defining the interface in the current zone; either PointRange or PointList. + * \param[out] npnts Number of points defining the interface in the current zone. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the PointList. + * \param[out] donorname Name of the zone interfacing with the current zone. + * \param[out] donor_zonetype Type of the donor zone. The admissible types are Structured and Unstructured. + * \param[out] donor_ptset_type Type of point set defining the interface in the donor zone; either PointListDonor or CellListDonor. + * \param[out] donor_datatype Data type in which the donor points are stored in the file. As of Version 3.0, this value is ignored when writing, and on reading it will return either Integer or LongInteger depending on whether the file was written using 32 or 64-bit. The donor_datatype argument was left in these functions only for backward compatibility. The donor data is always read as cgsize_t. + * \param[out] ndata_donor Number of points or cells in the current zone. These are paired with points, cells, or fractions thereof in the donor zone. + * \return \ier + * + * \details In cg_conn_info, donor_datatype is useless starting with version 1.27, because + * it's always I4. However this arg. is left for backward compatibility of API + * and to be able to read old files + * + */ +int cg_conn_info(int fn, int B, int Z, int J, char *connectname, CGNS_ENUMT(GridLocation_t) *location, - CGNS_ENUMT(GridConnectivityType_t) *type, + CGNS_ENUMT(GridConnectivityType_t) *connect_type, CGNS_ENUMT(PointSetType_t) *ptset_type, cgsize_t *npnts, char *donorname, CGNS_ENUMT(ZoneType_t) *donor_zonetype, CGNS_ENUMT(PointSetType_t) *donor_ptset_type, CGNS_ENUMT(DataType_t) *donor_datatype, cgsize_t *ndata_donor) { - int dZ; + int dZ, dB; cgns_conn *conn; + char_33 basedonorname, zonedonorname; + char *separator; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7778,7 +9636,7 @@ int cg_conn_info(int file_number, int B, int Z, int J, char *connectname, if (conn==0) return CG_ERROR; strcpy(connectname, conn->name); - *type = conn->type; + *connect_type = conn->type; *location = conn->location; *ptset_type = conn->ptset.type; *npnts = conn->ptset.npts; @@ -7789,12 +9647,34 @@ int cg_conn_info(int file_number, int B, int Z, int J, char *connectname, *ndata_donor = conn->dptset.npts; *donor_ptset_type = conn->dptset.type; + /* Split donorname into BaseName + zoneName */ + separator = strchr(donorname, '/'); + if (separator != NULL) { + /* get ending zoneName */ + strcpy(zonedonorname, separator + sizeof(char)); + /* get base but do not use path syntax */ + memcpy(basedonorname, donorname, (separator - donorname)*sizeof(char)); + basedonorname[separator - donorname] = '\0'; + /* Find donor base index */ + for (dB=0;dBnbases; dB++) { + if (strcmp(cg->base[dB].name,basedonorname)==0) { + break; + } + } + } + else { + /* zoneName is in current base */ + strcpy(basedonorname, cg->base[B-1].name); + strcpy(zonedonorname, donorname); + dB = B-1; + } + /* Find ZoneType_t of DonorZone given its name */ *donor_zonetype = CGNS_ENUMV( ZoneTypeNull ); - for (dZ=0; dZbase[B-1].nzones; dZ++) { - if (strcmp(cg->base[B-1].zone[dZ].name,donorname)==0) { - *donor_zonetype = cg->base[B-1].zone[dZ].type; + for (dZ=0; dZbase[dB].nzones; dZ++) { + if (strcmp(cg->base[dB].zone[dZ].name,zonedonorname)==0) { + *donor_zonetype = cg->base[dB].zone[dZ].type; break; } } @@ -7805,10 +9685,25 @@ int cg_conn_info(int file_number, int B, int Z, int J, char *connectname, return CG_OK; } -/* in cg_conn_read, donor_datatype is useless starting with version 1.27, because - it's always I4. However this arg. is left for backward compatibility of API - and to be able to read old files */ -int cg_conn_read(int file_number, int B, int Z, int J, cgsize_t *pnts, +/** + * \ingroup GeneralizedConnectivity + * + * \brief Read generalized connectivity data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Interface index number, where 1 ≤ J ≤ nconns. + * \param[out] pnts Array of points defining the interface in the current zone. + * \param[out] donor_datatype Data type in which the donor points are stored in the file. As of Version 3.0, this value is ignored when writing, and on reading it will return either Integer or LongInteger depending on whether the file was written using 32 or 64-bit. The donor_datatype argument was left in these functions only for backward compatibility. The donor data is always read as cgsize_t. + * \param[out] donor_data Array of donor points or cells corresponding to ndata_donor. Note that it is possible that the same donor point or cell may be used multiple times. + * \return \ier + * + * \details in cg_conn_read, donor_datatype is useless starting with version 1.27, because + * it's always I4. However this arg. is left for backward compatibility of API + * and to be able to read old files + */ +int cg_conn_read(int fn, int B, int Z, int J, cgsize_t *pnts, CGNS_ENUMT(DataType_t) donor_datatype, cgsize_t *donor_data) { cgns_conn *conn; @@ -7824,7 +9719,7 @@ int cg_conn_read(int file_number, int B, int Z, int J, cgsize_t *pnts, #endif /* Find address */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7872,16 +9767,29 @@ int cg_conn_read(int file_number, int B, int Z, int J, cgsize_t *pnts, return CG_OK; } -int cg_conn_read_short(int file_number, int B, int Z, int J, cgsize_t *pnts) +/** + * \ingroup GeneralizedConnectivity + * + * \brief Read generalized connectivity data without donor information + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Interface index number, where 1 ≤ J ≤ nconns. + * \param[out] pnts Array of points defining the interface in the current zone. + * \return \ier + * + */ +int cg_conn_read_short(int fn, int B, int Z, int J, cgsize_t *pnts) { - return cg_conn_read(file_number, B, Z, J, pnts, CGNS_ENUMV(DataTypeNull), NULL); + return cg_conn_read(fn, B, Z, J, pnts, CGNS_ENUMV(DataTypeNull), NULL); } -int cg_conn_id(int file_number, int B, int Z, int J, double *conn_id) +int cg_conn_id(int fn, int B, int Z, int J, double *conn_id) { cgns_conn *conn; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -7893,9 +9801,33 @@ int cg_conn_id(int file_number, int B, int Z, int J, double *conn_id) return CG_OK; } -int cg_conn_write(int file_number, int B, int Z, const char * connectname, +/** + * \ingroup GeneralizedConnectivity + * + * \brief Write generalized connectivity data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] connectname Name of the interface. + * \param[in] location Grid location used in the definition of the point set. The currently admissible locations are Vertex and CellCenter. + * \param[in] connect_type Type of interface being defined. The admissible types are Overset, Abutting, and Abutting1to1. + * \param[in] ptset_type Type of point set defining the interface in the current zone; either PointRange or PointList. + * \param[in] npnts Number of points defining the interface in the current zone. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the PointList. + * \param[in] pnts Array of points defining the interface in the current zone. + * \param[in] donorname Name of the zone interfacing with the current zone. + * \param[in] donor_zonetype Type of the donor zone. The admissible types are Structured and Unstructured. + * \param[in] donor_ptset_type Type of point set defining the interface in the donor zone; either PointListDonor or CellListDonor. + * \param[in] donor_datatype Data type in which the donor points are stored in the file. As of Version 3.0, this value is ignored when writing, and on reading it will return either Integer or LongInteger depending on whether the file was written using 32 or 64-bit. The donor_datatype argument was left in these functions only for backward compatibility. The donor data is always read as cgsize_t. + * \param[in] ndata_donor Number of points or cells in the current zone. These are paired with points, cells, or fractions thereof in the donor zone. + * \param[in] donor_data Array of donor points or cells corresponding to ndata_donor. Note that it is possible that the same donor point or cell may be used multiple times. + * \param[out] J Interface index number, where 1 ≤ J ≤ nconns. + * \return \ier + * + */ +int cg_conn_write(int fn, int B, int Z, const char * connectname, CGNS_ENUMT(GridLocation_t) location, - CGNS_ENUMT(GridConnectivityType_t) type, + CGNS_ENUMT(GridConnectivityType_t) connect_type, CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, const cgsize_t * pnts, const char * donorname, CGNS_ENUMT(ZoneType_t) donor_zonetype, @@ -7917,8 +9849,8 @@ int cg_conn_write(int file_number, int B, int Z, const char * connectname, /* verify input */ if (cgi_check_strlen(connectname)) return CG_ERROR; if (cgi_check_strlen(donorname)) return CG_ERROR; - if (INVALID_ENUM(type,NofValidGridConnectivityTypes)) { - cgi_error("Invalid input: GridConnectivityType=%d ?",type); + if (INVALID_ENUM(connect_type,NofValidGridConnectivityTypes)) { + cgi_error("Invalid input: GridConnectivityType=%d ?",connect_type); return CG_ERROR; } if (location != CGNS_ENUMV(Vertex) && @@ -7930,7 +9862,7 @@ int cg_conn_write(int file_number, int B, int Z, const char * connectname, cgi_error("Invalid input: GridLocation=%d ?",location); return CG_ERROR; } - if (type == CGNS_ENUMV(Overset) && + if (connect_type == CGNS_ENUMV(Overset) && location != CGNS_ENUMV(Vertex) && location != CGNS_ENUMV(CellCenter)) { cgi_error("GridLocation must be Vertex or CellCenter for Overset"); @@ -7986,7 +9918,7 @@ int cg_conn_write(int file_number, int B, int Z, const char * connectname, } /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -8060,7 +9992,7 @@ int cg_conn_write(int file_number, int B, int Z, const char * connectname, } } else PointListSize=npnts; - if (ndata_donor && type == CGNS_ENUMV(Abutting1to1) && PointListSize != ndata_donor) { + if (ndata_donor && connect_type == CGNS_ENUMV(Abutting1to1) && PointListSize != ndata_donor) { cgi_error("Invalid input for ndata_donor in cg_conn_write"); return CG_ERROR; } @@ -8100,7 +10032,7 @@ int cg_conn_write(int file_number, int B, int Z, const char * connectname, /* write conn info to internal memory */ memset(conn, 0, sizeof(cgns_conn)); strcpy(conn->name,connectname); - conn->type = type; + conn->type = connect_type; conn->location = location; conn->ptset.id = 0; conn->ptset.link = 0; @@ -8180,15 +10112,34 @@ int cg_conn_write(int file_number, int B, int Z, const char * connectname, return CG_OK; } -int cg_conn_write_short(int file_number, int B, int Z, const char * connectname, +/** + * \ingroup GeneralizedConnectivity + * + * \brief Write generalized connectivity data without donor information + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] connectname Name of the interface. + * \param[in] location Grid location used in the definition of the point set. The currently admissible locations are Vertex and CellCenter. + * \param[in] connect_type Type of interface being defined. The admissible types are Overset, Abutting, and Abutting1to1. + * \param[in] ptset_type Type of point set defining the interface in the current zone; either PointRange or PointList. + * \param[in] npnts Number of points defining the interface in the current zone. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points in the PointList. + * \param[in] pnts Array of points defining the interface in the current zone. + * \param[in] donorname Name of the zone interfacing with the current zone. + * \param[out] J Interface index number, where 1 ≤ J ≤ nconns. + * \return \ier + * + */ +int cg_conn_write_short(int fn, int B, int Z, const char * connectname, CGNS_ENUMT(GridLocation_t) location, - CGNS_ENUMT(GridConnectivityType_t) type, + CGNS_ENUMT(GridConnectivityType_t) connect_type, CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, const cgsize_t * pnts, const char * donorname, int *J) { - return cg_conn_write (file_number, B, Z, connectname, location, - type, ptset_type, npnts, pnts, donorname, + return cg_conn_write (fn, B, Z, connectname, location, + connect_type, ptset_type, npnts, pnts, donorname, CGNS_ENUMV(ZoneTypeNull), CGNS_ENUMV(PointSetTypeNull), CGNS_ENUMV(DataTypeNull), 0, NULL, J); } @@ -8197,11 +10148,23 @@ int cg_conn_write_short(int file_number, int B, int Z, const char * connectname * Read and write GridConnectivity1to1_t Nodes \*****************************************************************************/ -int cg_n1to1(int file_number, int B, int Z, int *n1to1) +/** + * \ingroup OneToOneConnectivity + * + * \brief Get number of 1-to-1 interfaces in a zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] n1to1 Number of one-to-one interfaces in zone Z, stored under GridConnectivity1to1_t nodes. (I.e., this does not include one-to-one interfaces that may be stored under GridConnectivity_t nodes, used for generalized zone interfaces.) + * \return \ier + * + */ +int cg_n1to1(int fn, int B, int Z, int *n1to1) { cgns_zconn *zconn; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8212,7 +10175,18 @@ int cg_n1to1(int file_number, int B, int Z, int *n1to1) return CG_OK; } -int cg_n1to1_global(int file_number, int B, int *n1to1_global) +/** + * \ingroup OneToOneConnectivity + * + * \brief Get total number of 1-to-1 interfaces in a database + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] n1to1_global Total number of one-to-one interfaces in base B, stored under GridConnectivity1to1_t nodes. (I.e., this does not include one-to-one interfaces that may be stored under GridConnectivity_t nodes, used for generalized zone interfaces.) Note that the function cg_n1to1 (described below) may be used to get the number of one-to-one interfaces in a specific zone. + * \return \ier + * + */ +int cg_n1to1_global(int fn, int B, int *n1to1_global) { cgns_base *base; cgns_zone *zone; @@ -8227,7 +10201,7 @@ int cg_n1to1_global(int file_number, int B, int *n1to1_global) cgsize6_t *Drange = 0, *Ddonor_range = 0; int index_dim; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8244,7 +10218,7 @@ int cg_n1to1_global(int file_number, int B, int *n1to1_global) if (zconn==0) continue; /* if ZoneGridConnectivity_t is undefined */ if (zconn->n1to1 ==0) continue; for (J=1; J<=zconn->n1to1; J++) { - if (cg_1to1_read(file_number, B, Z, J, connectname, donorname, + if (cg_1to1_read(fn, B, Z, J, connectname, donorname, range, donor_range, transform)) return CG_ERROR; if (cgi_zone_no(base, donorname, &D)) return CG_ERROR; @@ -8268,7 +10242,24 @@ int cg_n1to1_global(int file_number, int B, int *n1to1_global) return CG_OK; } -int cg_1to1_read(int file_number, int B, int Z, int J, char *connectname, +/** + * \ingroup OneToOneConnectivity + * + * \brief Read 1-to-1 connectivity data for a zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Interface index number, where 1 ≤ J ≤ n1to1. + * \param[out] connectname Name of the interface. + * \param[out] donorname Name of the zone interfacing with the current zone. + * \param[out] range Range of points for the current zone. + * \param[out] donor_range Range of points for the donor zone. + * \param[out] transform Short hand notation for the transformation matrix defining the relative orientation of the two zones. + * \return \ier + * + */ +int cg_1to1_read(int fn, int B, int Z, int J, char *connectname, char *donorname, cgsize_t *range, cgsize_t *donor_range, int *transform) { @@ -8280,7 +10271,7 @@ int cg_1to1_read(int file_number, int B, int Z, int J, char *connectname, in 3D, range[0], range[1], range[2] = imin, jmin, kmin range[3], range[4], range[5] = imax, jmax, kmax */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8315,7 +10306,23 @@ int cg_1to1_read(int file_number, int B, int Z, int J, char *connectname, return CG_OK; } -int cg_1to1_read_global(int file_number, int B, char **connectname, char **zonename, +/** + * \ingroup OneToOneConnectivity + * + * \brief Read data for all 1-to-1 interfaces in a database + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] connectname Name of the interface. + * \param[out] zonename Name of the first zone, for all one-to-one interfaces in base B. + * \param[out] donorname Name of the second zone, for all one-to-one interfaces in base B. + * \param[out] range Range of points for the first zone, for all one-to-one interfaces in base B. + * \param[out] donor_range Range of points for the current zone, for all one-to-one interfaces in base B. + * \param[out] transform Short hand notation for the transformation matrix defining the relative orientation of the two zones. This transformation is given for all one-to-one interfaces in base B. + * \return \ier + * + */ +int cg_1to1_read_global(int fn, int B, char **connectname, char **zonename, char **donorname, cgsize_t **range, cgsize_t **donor_range, int **transform) { @@ -8331,7 +10338,7 @@ int cg_1to1_read_global(int file_number, int B, char **connectname, char **zonen char_33 *Dzonename = 0; cgsize6_t *Drange = 0, *Ddonor_range = 0; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8350,7 +10357,7 @@ int cg_1to1_read_global(int file_number, int B, char **connectname, char **zonen if (zconn==0) continue; /* if ZoneGridConnectivity_t is undefined */ if (zconn->n1to1 ==0) continue; for (J=1; J<=zconn->n1to1; J++) { - if (cg_1to1_read(file_number, B, Z, J, connect, donor, rang, + if (cg_1to1_read(fn, B, Z, J, connect, donor, rang, drang, trans)) return CG_ERROR; if (cgi_zone_no(base, donor, &D)) return CG_ERROR; /* count each interface only once */ @@ -8376,11 +10383,11 @@ int cg_1to1_read_global(int file_number, int B, char **connectname, char **zonen return CG_OK; } -int cg_1to1_id(int file_number, int B, int Z, int J, double *one21_id) +int cg_1to1_id(int fn, int B, int Z, int J, double *one21_id) { cgns_1to1 *one21; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8392,7 +10399,24 @@ int cg_1to1_id(int file_number, int B, int Z, int J, double *one21_id) return CG_OK; } -int cg_1to1_write(int file_number, int B, int Z, const char * connectname, +/** + * \ingroup OneToOneConnectivity + * + * \brief Write 1-to-1 connectivity data for a zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] connectname Name of the interface. + * \param[in] donorname Name of the zone interfacing with the current zone. + * \param[in] range Range of points for the current zone. + * \param[in] donor_range Range of points for the donor zone. + * \param[in] transform Short hand notation for the transformation matrix defining the relative orientation of the two zones. + * \param[out] J Interface index number, where 1 ≤ J ≤ n1to1. + * \return \ier + * + */ +int cg_1to1_write(int fn, int B, int Z, const char * connectname, const char * donorname, const cgsize_t * range, const cgsize_t * donor_range, const int * transform, int *J) { @@ -8412,7 +10436,7 @@ int cg_1to1_write(int file_number, int B, int Z, const char * connectname, #endif /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -8554,12 +10578,23 @@ int cg_1to1_write(int file_number, int B, int Z, const char * connectname, /*****************************************************************************\ * Read and write BC_t Nodes \*****************************************************************************/ - -int cg_nbocos(int file_number, int B, int Z, int *nbocos) +/** + * \ingroup BoundaryConditionType + * + * \brief Get number of boundary condition in zone + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] nbocos Number of boundary conditions in zone Z. + * \return \ier + * + */ +int cg_nbocos(int fn, int B, int Z, int *nbocos) { cgns_zboco *zboco; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8570,7 +10605,27 @@ int cg_nbocos(int file_number, int B, int Z, int *nbocos) return CG_OK; } -int cg_boco_info(int file_number, int B, int Z, int BC, char *boconame, +/** + * \ingroup BoundaryConditionType + * + * \brief Get boundary condition info + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[out] boconame Name of the boundary condition. + * \param[out] bocotype Type of boundary condition defined. See the eligible types for BCType_t in the Typedefs section. Note that if bocotype is FamilySpecified the boundary condition type is being specified for the family to which the boundary belongs. The boundary condition type for the family may be read and written using cg_fambc_read and cg_fambc_write. + * \param[out] ptset_type The extent of the boundary condition may be defined using a range of points or elements using PointRange, or using a discrete list of all points or elements at which the boundary condition is applied using PointList. When the boundary condition is to be applied anywhere other than points, then GridLocation_t under the BC_t node must be used to indicate this. The value of GridLocation_t may be read or written by cg_boco_gridlocation_read and cg_boco_gridlocation_write. As in previous versions of the library, this may also be done by first using cg_goto to access the BC_t node, then using cg_gridlocation_read or cg_gridlocation_write. + * \param[out] npnts Number of points or elements defining the boundary condition region. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points or elements in the list. + * \param[out] NormalIndex Index vector indicating the computational coordinate direction of the boundary condition patch normal. + * \param[out] NormalListSize If the normals are defined in NormalList, NormalListSize is the number of points in the patch times phys_dim, the number of coordinates required to define a vector in the field. If the normals are not defined in NormalList, NormalListSize is 0. + * \param[out] NormalDataType Data type used in the definition of the normals. Admissible data types for the normals are RealSingle and RealDouble. + * \param[out] ndataset Number of boundary condition datasets for the current boundary condition. + * \return \ier + * + */ +int cg_boco_info(int fn, int B, int Z, int BC, char *boconame, CGNS_ENUMT(BCType_t) *bocotype, CGNS_ENUMT(PointSetType_t) *ptset_type, cgsize_t *npnts, int *NormalIndex, cgsize_t *NormalListSize, CGNS_ENUMT(DataType_t) *NormalDataType, int *ndataset) @@ -8578,7 +10633,7 @@ int cg_boco_info(int file_number, int B, int Z, int BC, char *boconame, cgns_boco *boco; int n, index_dim; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8619,12 +10674,26 @@ int cg_boco_info(int file_number, int B, int Z, int BC, char *boconame, return CG_OK; } -int cg_boco_read(int file_number, int B, int Z, int BC, cgsize_t *pnts, void *NormalList) +/** + * \ingroup BoundaryConditionType + * + * \brief Read boundary condition data and normals + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[out] pnts Array of point or element indices defining the boundary condition region. There should be npnts values, each of dimension IndexDimension (i.e., 1 for unstructured grids, and 2 or 3 for structured grids with 2-D or 3-D elements, respectively). + * \param[out] NormalList List of vectors normal to the boundary condition patch pointing into the interior of the zone. + * \return \ier + * + */ +int cg_boco_read(int fn, int B, int Z, int BC, cgsize_t *pnts, void *NormalList) { cgns_boco *boco; int dim = 0; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8634,7 +10703,7 @@ int cg_boco_read(int file_number, int B, int Z, int BC, cgsize_t *pnts, void *No /* Read point-set directly from ADF-file */ if (boco->ptset && boco->ptset->npts > 0) { - cg_index_dim(file_number, B, Z, &dim); + cg_index_dim(fn, B, Z, &dim); if (cgi_read_int_data(boco->ptset->id, boco->ptset->data_type, boco->ptset->npts * dim, pnts)) return CG_ERROR; } else { @@ -8652,11 +10721,11 @@ int cg_boco_read(int file_number, int B, int Z, int BC, cgsize_t *pnts, void *No return CG_OK; } -int cg_boco_id(int file_number, int B, int Z, int BC, double *boco_id) +int cg_boco_id(int fn, int B, int Z, int BC, double *boco_id) { cgns_boco *boco; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8668,12 +10737,25 @@ int cg_boco_id(int file_number, int B, int Z, int BC, double *boco_id) return CG_OK; } -int cg_boco_gridlocation_read(int file_number, int B, int Z, +/** + * \ingroup BoundaryConditionType + * + * \brief Read boundary condition location + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[out] location Grid location used in the definition of the point set. The currently admissible locations are Vertex (the default if not given), and CellCenter. Interpretation of CellCenter, and additional allowable values of grid location depends on the base cell dimension. For CellDim=1, CellCenter refers to line elements. For CellDim=2, CellCenter refers to area elements, and the additional value EdgeCenter is allowed. For CellDim=3, CellCenter refers to volume elements, and in addition to EdgeCenter, the values of FaceCenter, IFaceCenter, JFaceCenter, and KFaceCenter may be used. + * \return \ier + * + */ +int cg_boco_gridlocation_read(int fn, int B, int Z, int BC, CGNS_ENUMT(GridLocation_t) *location) { cgns_boco *boco; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8685,7 +10767,24 @@ int cg_boco_gridlocation_read(int file_number, int B, int Z, return CG_OK; } -int cg_boco_write(int file_number, int B, int Z, const char * boconame, +/** + * \ingroup BoundaryConditionType + * + * \brief Write boundary condition type and data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] boconame Name of the boundary condition. + * \param[in] bocotype Type of boundary condition defined. See the eligible types for BCType_t in the Typedefs section. Note that if bocotype is FamilySpecified the boundary condition type is being specified for the family to which the boundary belongs. The boundary condition type for the family may be read and written using cg_fambc_read and cg_fambc_write. + * \param[in] ptset_type The extent of the boundary condition may be defined using a range of points or elements using PointRange, or using a discrete list of all points or elements at which the boundary condition is applied using PointList. When the boundary condition is to be applied anywhere other than points, then GridLocation_t under the BC_t node must be used to indicate this. The value of GridLocation_t may be read or written by cg_boco_gridlocation_read and cg_boco_gridlocation_write. As in previous versions of the library, this may also be done by first using cg_goto to access the BC_t node, then using cg_gridlocation_read or cg_gridlocation_write. + * \param[in] npnts Number of points or elements defining the boundary condition region. For a ptset_type of PointRange, npnts is always two. For a ptset_type of PointList, npnts is the number of points or elements in the list. + * \param[in] pnts Array of point or element indices defining the boundary condition region. There should be npnts values, each of dimension IndexDimension (i.e., 1 for unstructured grids, and 2 or 3 for structured grids with 2-D or 3-D elements, respectively). + * \param[out] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \return \ier + * + */ +int cg_boco_write(int fn, int B, int Z, const char * boconame, CGNS_ENUMT(BCType_t) bocotype, CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, const cgsize_t * pnts, int *BC) @@ -8699,7 +10798,7 @@ int cg_boco_write(int file_number, int B, int Z, const char * boconame, cgsize_t length; /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) @@ -8804,6 +10903,7 @@ int cg_boco_write(int file_number, int B, int Z, const char * boconame, boco->location = location; boco->ptset = CGNS_NEW(cgns_ptset,1); boco->ptset->type = ptype; + strcpy(boco->ptset->name, PointSetTypeName[boco->ptset->type]); strcpy(boco->ptset->data_type,CG_SIZE_DATATYPE); boco->ptset->npts = npnts; @@ -8844,9 +10944,7 @@ int cg_boco_write(int file_number, int B, int Z, const char * boconame, /* Save Point-Set on Disk */ if (npnts > 0) { - char_33 PointSetName; - strcpy(PointSetName, PointSetTypeName[boco->ptset->type]); - if (cgi_write_ptset(boco->id, PointSetName, boco->ptset, index_dim, + if (cgi_write_ptset(boco->id, boco->ptset->name, boco->ptset, index_dim, (void *)pnts)) return CG_ERROR; } if (boco->location != CGNS_ENUMV(Vertex)) { @@ -8860,14 +10958,27 @@ int cg_boco_write(int file_number, int B, int Z, const char * boconame, return CG_OK; } -int cg_boco_gridlocation_write(int file_number, int B, int Z, +/** + * \ingroup BoundaryConditionType + * + * \brief Write boundary condition location + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[in] location Grid location used in the definition of the point set. The currently admissible locations are Vertex (the default if not given), and CellCenter. Interpretation of CellCenter, and additional allowable values of grid location depends on the base cell dimension. For CellDim=1, CellCenter refers to line elements. For CellDim=2, CellCenter refers to area elements, and the additional value EdgeCenter is allowed. For CellDim=3, CellCenter refers to volume elements, and in addition to EdgeCenter, the values of FaceCenter, IFaceCenter, JFaceCenter, and KFaceCenter may be used. + * \return \ier + * + */ +int cg_boco_gridlocation_write(int fn, int B, int Z, int BC, CGNS_ENUMT(GridLocation_t) location) { cgns_boco *boco; cgsize_t dim_vals; double dummy_id; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -8892,7 +11003,23 @@ int cg_boco_gridlocation_write(int file_number, int B, int Z, return CG_OK; } -int cg_boco_normal_write(int file_number, int B, int Z, int BC, const int * NormalIndex, +/** + * \ingroup BoundaryConditionType + * + * \brief Write boundary condition normals + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[in] NormalIndex Index vector indicating the computational coordinate direction of the boundary condition patch normal. + * \param[in] NormalListFlag Flag indicating if the normals are defined in NormalList and are to be written out; 1 if they are defined, 0 if they're not. + * \param[in] NormalDataType Data type used in the definition of the normals. Admissible data types for the normals are RealSingle and RealDouble. + * \param[in] NormalList List of vectors normal to the boundary condition patch pointing into the interior of the zone. + * \return \ier + * + */ +int cg_boco_normal_write(int fn, int B, int Z, int BC, const int * NormalIndex, int NormalListFlag, CGNS_ENUMT(DataType_t) NormalDataType, const void * NormalList) { @@ -8901,7 +11028,7 @@ int cg_boco_normal_write(int file_number, int B, int Z, int BC, const int * Norm cgsize_t npnts, index_dim; /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -8975,13 +11102,30 @@ int cg_boco_normal_write(int file_number, int B, int Z, int BC, const int * Norm * Read and write BCDataSet_t Nodes \*****************************************************************************/ -int cg_dataset_read(int file_number, int B, int Z, int BC, int DSet, char *name, +/** + * \ingroup BCDataset + * + * \brief Read boundary condition dataset info + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[in] DSet Dataset index number, where 1 ≤ Dset ≤ ndataset. + * \param[out] DatasetName Name of dataset. + * \param[out] BCType Simple boundary condition type for the dataset. The supported types are listed in the table of Simple Boundary Condition Types in the SIDS manual, but note that FamilySpecified does not apply here. + * \param[out] DirichletFlag Flag indicating if the dataset contains Dirichlet data. + * \param[out] NeumannFlag Flag indicating if the dataset contains Neumann data. + * \return \ier + * + */ +int cg_dataset_read(int fn, int B, int Z, int BC, int DSet, char *DatasetName, CGNS_ENUMT(BCType_t) *BCType, int *DirichletFlag, int *NeumannFlag) { cgns_dataset *dataset; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -8989,7 +11133,7 @@ int cg_dataset_read(int file_number, int B, int Z, int BC, int DSet, char *name, dataset = cgi_get_dataset(cg, B, Z, BC, DSet); if (dataset==0) return CG_ERROR; - strcpy(name, dataset->name); + strcpy(DatasetName, dataset->name); *BCType = dataset->type; if (dataset->dirichlet) *DirichletFlag=1; else *DirichletFlag=0; @@ -8999,7 +11143,22 @@ int cg_dataset_read(int file_number, int B, int Z, int BC, int DSet, char *name, return CG_OK; } -int cg_dataset_write(int file_number, int B, int Z, int BC, const char * name, +/** + * \ingroup BCDataset + * + * \brief Write boundary condition dataset info + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[in] DatasetName Name of dataset. + * \param[in] BCType Simple boundary condition type for the dataset. The supported types are listed in the table of Simple Boundary Condition Types in the SIDS manual, but note that FamilySpecified does not apply here. + * \param[out] Dset Dataset index number, where 1 ≤ Dset ≤ ndataset. + * \return \ier + * + */ +int cg_dataset_write(int fn, int B, int Z, int BC, const char * DatasetName, CGNS_ENUMT( BCType_t ) BCType, int *Dset) { cgns_boco *boco; @@ -9012,10 +11171,10 @@ int cg_dataset_write(int file_number, int B, int Z, int BC, const char * name, cgi_error("Invalid BCType: %d",BCType); return CG_ERROR; } - if (cgi_check_strlen(name)) return CG_ERROR; + if (cgi_check_strlen(DatasetName)) return CG_ERROR; /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9025,11 +11184,11 @@ int cg_dataset_write(int file_number, int B, int Z, int BC, const char * name, /* Overwrite a BCDataSet_t node : */ for (index=0; indexndataset; index++) { - if (strcmp(name, boco->dataset[index].name)==0) { + if (strcmp(DatasetName, boco->dataset[index].name)==0) { /* in CG_MODE_WRITE, children names must be unique */ if (cg->mode==CG_MODE_WRITE) { - cgi_error("Duplicate child name found: %s",name); + cgi_error("Duplicate child name found: %s",DatasetName); return CG_ERROR; } @@ -9058,7 +11217,7 @@ int cg_dataset_write(int file_number, int B, int Z, int BC, const char * name, /* save data in memory */ memset(dataset, 0, sizeof(cgns_dataset)); dataset->type = BCType; - strcpy(dataset->name, name); + strcpy(dataset->name, DatasetName); dataset->location = CGNS_ENUMV(Vertex); /* save data in file */ @@ -9072,7 +11231,23 @@ int cg_dataset_write(int file_number, int B, int Z, int BC, const char * name, * write BCdata_t Nodes \*****************************************************************************/ -int cg_bcdata_write(int file_number, int B, int Z, int BC, int Dset, +/** + * \ingroup BCData + * + * \brief Write boundary condition data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[in] Dset Dataset index number, where 1 ≤ Dset ≤ ndataset. + * \param[in] BCDataType Type of boundary condition in the dataset. Admissible boundary condition types are Dirichlet and Neumann. + * \return \ier + * + * \details To write the boundary condition data itself, after creating the BCData_t node using the function cg_bcdata_write, use cg_goto to access the node, then cg_array_write to write the data. Note that when using cg_goto to access a BCData_t node, the node index should be specified as either Dirichlet or Neumann, depending on the type of boundary condition. See the description of cg_goto for details. + * + */ +int cg_bcdata_write(int fn, int B, int Z, int BC, int Dset, CGNS_ENUMT(BCDataType_t) BCDataType) { cgns_dataset *dataset; @@ -9085,7 +11260,7 @@ int cg_bcdata_write(int file_number, int B, int Z, int BC, int Dset, } /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9136,11 +11311,23 @@ int cg_bcdata_write(int file_number, int B, int Z, int BC, int Dset, * Read and write RigidGridMotion_t Nodes \*****************************************************************************/ -int cg_n_rigid_motions(int file_number, int B, int Z, int *n_rigid_motions) +/** + * \ingroup RigidGridMotion + * + * \brief Get number of RigidGridMotion_t nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] n_rigid_motions Number of RigidGridMotion_t nodes under zone Z. + * \return \ier + * + */ +int cg_n_rigid_motions(int fn, int B, int Z, int *n_rigid_motions) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9153,13 +11340,27 @@ int cg_n_rigid_motions(int file_number, int B, int Z, int *n_rigid_motions) return CG_OK; } -int cg_rigid_motion_read(int file_number, int B, int Z, int R, char *name, +/** + * \ingroup RigidGridMotion + * + * \brief Read RigidGridMotion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] R Rigid rotation index number, where 1 ≤ R ≤ n_rigid_motions. + * \param[out] name Name of the RigidGridMotion_t node. + * \param[out] type Type of rigid grid motion. The admissible types are CG_Null, CG_UserDefined, ConstantRate, and VariableRate. + * \return \ier + * + */ +int cg_rigid_motion_read(int fn, int B, int Z, int R, char *name, CGNS_ENUMT(RigidGridMotionType_t) *type) { cgns_rmotion *rmotion; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9173,7 +11374,21 @@ int cg_rigid_motion_read(int file_number, int B, int Z, int R, char *name, return CG_OK; } -int cg_rigid_motion_write(int file_number, int B, int Z, const char * rmotionname, +/** + * \ingroup RigidGridMotion + * + * \brief Create RigidGridMotion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] rmotionname Name of the RigidGridMotion_t node. + * \param[in] type Type of rigid grid motion. The admissible types are CG_Null, CG_UserDefined, ConstantRate, and VariableRate. + * \param[out] R Rigid rotation index number, where 1 ≤ R ≤ n_rigid_motions. + * \return \ier + * + */ +int cg_rigid_motion_write(int fn, int B, int Z, const char * rmotionname, CGNS_ENUMT(RigidGridMotionType_t) type, int *R) { cgns_zone *zone; @@ -9190,7 +11405,7 @@ int cg_rigid_motion_write(int file_number, int B, int Z, const char * rmotionnam } /* get memory address for RigidGridMotion_t node */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9248,11 +11463,23 @@ int cg_rigid_motion_write(int file_number, int B, int Z, const char * rmotionnam * Read and write ArbitraryGridMotion_t Nodes \*****************************************************************************/ -int cg_n_arbitrary_motions(int file_number, int B, int Z, int *n_arbitrary_motions) +/** + * \ingroup ArbitraryGridMotion + * + * \brief Get number of ArbitraryGridMotion_t nodes + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] n_arbitrary_motions Number of ArbitraryGridMotion_t nodes under zone Z. + * \return \ier + * + */ +int cg_n_arbitrary_motions(int fn, int B, int Z, int *n_arbitrary_motions) { cgns_zone *zone; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9265,13 +11492,27 @@ int cg_n_arbitrary_motions(int file_number, int B, int Z, int *n_arbitrary_motio return CG_OK; } -int cg_arbitrary_motion_read(int file_number, int B, int Z, int A, char *name, +/** + * \ingroup ArbitraryGridMotion + * + * \brief Read ArbitraryGridMotion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] A Arbitrary grid motion index number, where 1 ≤ A ≤ n_arbitrary_motions. + * \param[out] name Name of the ArbitraryGridMotion_t node. + * \param[out] type Type of arbitrary grid motion. The admissible types are CG_Null, CG_UserDefined, NonDeformingGrid, and DeformingGrid. + * \return \ier + * + */ +int cg_arbitrary_motion_read(int fn, int B, int Z, int A, char *name, CGNS_ENUMT(ArbitraryGridMotionType_t) *type) { cgns_amotion *amotion; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9285,7 +11526,21 @@ int cg_arbitrary_motion_read(int file_number, int B, int Z, int A, char *name, return CG_OK; } -int cg_arbitrary_motion_write(int file_number, int B, int Z, const char * amotionname, +/** + * \ingroup ArbitraryGridMotion + * + * \brief Write ArbitraryGridMotion_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] amotionname Name of the ArbitraryGridMotion_t node. + * \param[in] type Type of arbitrary grid motion. The admissible types are CG_Null, CG_UserDefined, NonDeformingGrid, and DeformingGrid. + * \param[out] A Arbitrary grid motion index number, where 1 ≤ A ≤ n_arbitrary_motions. + * \return \ier + * + */ +int cg_arbitrary_motion_write(int fn, int B, int Z, const char * amotionname, CGNS_ENUMT(ArbitraryGridMotionType_t) type, int *A) { cgns_zone *zone; @@ -9302,7 +11557,7 @@ int cg_arbitrary_motion_write(int file_number, int B, int Z, const char * amotio } /* get memory address for ArbitraryGridMotion_t node */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9360,11 +11615,22 @@ int cg_arbitrary_motion_write(int file_number, int B, int Z, const char * amotio * Read and write SimulationType_t Node \*****************************************************************************/ -int cg_simulation_type_read(int file_number, int B, CGNS_ENUMT(SimulationType_t) *type) +/** + * \ingroup SimulationType + * + * \brief Read simulation type + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] SimulationType Type of simulation. Valid types are CG_Null, CG_UserDefined, TimeAccurate, and NonTimeAccurate. + * \return \ier + * + */ +int cg_simulation_type_read(int fn, int B, CGNS_ENUMT(SimulationType_t) *SimulationType) { cgns_base *base; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9372,24 +11638,35 @@ int cg_simulation_type_read(int file_number, int B, CGNS_ENUMT(SimulationType_t) base = cgi_get_base(cg, B); if (base==0) return CG_ERROR; - *type = base->type; + *SimulationType = base->type; return CG_OK; } -int cg_simulation_type_write(int file_number, int B, CGNS_ENUMT(SimulationType_t) type) +/** + * \ingroup SimulationType + * + * \brief Write simulation type + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] SimulationType Type of simulation. Valid types are CG_Null, CG_UserDefined, TimeAccurate, and NonTimeAccurate. + * \return \ier + * + */ +int cg_simulation_type_write(int fn, int B, CGNS_ENUMT(SimulationType_t) SimulationType) { cgns_base *base; cgsize_t length; /* check input */ - if (INVALID_ENUM(type,NofValidSimulationTypes)) { - cgi_error("Invalid input: SimulationType=%d ?",type); + if (INVALID_ENUM(SimulationType,NofValidSimulationTypes)) { + cgi_error("Invalid input: SimulationType=%d ?", SimulationType); return CG_ERROR; } /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9408,13 +11685,13 @@ int cg_simulation_type_write(int file_number, int B, CGNS_ENUMT(SimulationType_t if (cgi_delete_node(base->id, base->type_id)) return CG_ERROR; } - base->type = type; + base->type = SimulationType; base->type_id = 0; /* save data in file */ - length = (cgsize_t)strlen(SimulationTypeName[type]); + length = (cgsize_t)strlen(SimulationTypeName[SimulationType]); if (cgi_new_node(base->id, "SimulationType", "SimulationType_t", &base->type_id, - "C1", 1, &length, (void *)SimulationTypeName[type])) return CG_ERROR; + "C1", 1, &length, (void *)SimulationTypeName[SimulationType])) return CG_ERROR; return CG_OK; } @@ -9423,11 +11700,23 @@ int cg_simulation_type_write(int file_number, int B, CGNS_ENUMT(SimulationType_t * read and write BaseIterativeData_t Node \*****************************************************************************/ -int cg_biter_read(int file_number, int B, char *bitername, int *nsteps) +/** + * \ingroup BaseIterativeData + * + * \brief Read BaseIterativeData_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] bitername Name of the BaseIterativeData_t node. + * \param[out] nsteps Number of time steps or iterations. + * \return \ier + * + */ +int cg_biter_read(int fn, int B, char *bitername, int *nsteps) { cgns_biter *biter; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9441,7 +11730,19 @@ int cg_biter_read(int file_number, int B, char *bitername, int *nsteps) return CG_OK; } -int cg_biter_write(int file_number, int B, const char * bitername, int nsteps) +/** + * \ingroup BaseIterativeData + * + * \brief Write BaseIterativeData_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] bitername Name of the BaseIterativeData_t node. + * \param[in] nsteps Number of time steps or iterations. + * \return \ier + * + */ +int cg_biter_write(int fn, int B, const char * bitername, int nsteps) { cgns_base *base; cgns_biter *biter; @@ -9454,7 +11755,7 @@ int cg_biter_write(int file_number, int B, const char * bitername, int nsteps) } /* get memory address for BaseIterativeData_t node */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9498,11 +11799,23 @@ int cg_biter_write(int file_number, int B, const char * bitername, int nsteps) * read and write ZoneIterativeData_t Node \*****************************************************************************/ -int cg_ziter_read(int file_number, int B, int Z, char *zitername) +/** + * \ingroup ZoneIterativeData + * + * \brief Read ZontIterativeData_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[out] zitername Name of the ZoneIterativeData_t node. + * \return \ier + * + */ +int cg_ziter_read(int fn, int B, int Z, char *zitername) { cgns_ziter *ziter; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9515,7 +11828,19 @@ int cg_ziter_read(int file_number, int B, int Z, char *zitername) return CG_OK; } -int cg_ziter_write(int file_number, int B, int Z, const char * zitername) +/** + * \ingroup ZoneIterativeData + * + * \brief Write ZontIterativeData_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] zitername Name of the ZoneIterativeData_t node. + * \return \ier + * + */ +int cg_ziter_write(int fn, int B, int Z, const char * zitername) { cgns_zone *zone; cgns_ziter *ziter; @@ -9524,7 +11849,7 @@ int cg_ziter_write(int file_number, int B, int Z, const char * zitername) if (cgi_check_strlen(zitername)) return CG_ERROR; /* get memory address for ZoneIterativeData_t node */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9565,13 +11890,24 @@ int cg_ziter_write(int file_number, int B, int Z, const char * zitername) * read and write Gravity_t Node \*****************************************************************************/ -int cg_gravity_read(int file_number, int B, float *gravity_vector) +/** + * \ingroup Gravity + * + * \brief Read Gravity_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] gravity_vector Components of the gravity vector. The number of components must equal PhysicalDimension. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + */ +int cg_gravity_read(int fn, int B, float *gravity_vector) { cgns_base *base; cgns_gravity *gravity; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9588,13 +11924,24 @@ int cg_gravity_read(int file_number, int B, float *gravity_vector) return CG_OK; } -int cg_gravity_write(int file_number, int B, float const *gravity_vector) +/** + * \ingroup Gravity + * + * \brief Write Gravity_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] gravity_vector Components of the gravity vector. The number of components must equal PhysicalDimension. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + */ +int cg_gravity_write(int fn, int B, float const *gravity_vector) { cgns_base *base; cgns_gravity *gravity; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9644,14 +11991,28 @@ int cg_gravity_write(int file_number, int B, float const *gravity_vector) * read and write Axisymmetry_t Node \*****************************************************************************/ -int cg_axisym_read(int file_number, int B, float *ref_point, float *axis) +/** + * \ingroup Axisymmetry + * + * \brief Read Axisymmetry_t node + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[out] ref_point Origin used for defining the axis of rotation. (In Fortran, this is an array of Real*4 values.) + * \param[out] axis Direction cosines of the axis of rotation, through the reference point. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + * \details This node can only be used for a bi-dimensional model, i.e., PhysicalDimension must equal two. + * + */ +int cg_axisym_read(int fn, int B, float *ref_point, float *axis) { int n; cgns_base *base; cgns_axisym *axisym; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9673,14 +12034,28 @@ int cg_axisym_read(int file_number, int B, float *ref_point, float *axis) return CG_OK; } -int cg_axisym_write(int file_number, int B, float const *ref_point, float const *axis) +/** + * \ingroup Axisymmetry + * + * \brief Create axisymmetry data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] ref_point Origin used for defining the axis of rotation. (In Fortran, this is an array of Real*4 values.) + * \param[in] axis Direction cosines of the axis of rotation, through the reference point. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + * \details Axisymmetry_t node can only be used for a bi-dimensional model, i.e., PhysicalDimension must equal two. + * + */ +int cg_axisym_write(int fn, int B, float const *ref_point, float const *axis) { int n; cgns_base *base; cgns_axisym *axisym; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9739,14 +12114,28 @@ int cg_axisym_write(int file_number, int B, float const *ref_point, float const /*****************************************************************************\ * read and write BCProperty_t Node \*****************************************************************************/ - -int cg_bc_wallfunction_read(int file_number, int B, int Z, int BC, +/** + * \ingroup SpecialBoundaryConditionProperty + * + * \brief Read wall function data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[out] WallFunctionType The wall function type. Valid types are CG_Null, CG_UserDefined, and Generic. + * \return \ier + * + * \details The "read" functions will return with ier = 2 = CG_NODE_NOT_FOUND if the requested boundary condition property, or the BCProperty_t node itself, doesn't exist. + * + */ +int cg_bc_wallfunction_read(int fn, int B, int Z, int BC, CGNS_ENUMT(WallFunctionType_t) *WallFunctionType) { cgns_bprop *bprop; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9764,7 +12153,22 @@ int cg_bc_wallfunction_read(int file_number, int B, int Z, int BC, return CG_OK; } -int cg_bc_wallfunction_write(int file_number, int B, int Z, int BC, +/** + * \ingroup SpecialBoundaryConditionProperty + * + * \brief Write wall function data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[in] WallFunctionType The wall function type. Valid types are CG_Null, CG_UserDefined, and Generic. + * \return \ier + * + * \details The "write" functions will create the BCProperty_t node if it doesn't already exist, then add the appropriate boundary condition property. Multiple boundary condition properties may be recorded under the same BCProperty_t node. + * + */ +int cg_bc_wallfunction_write(int fn, int B, int Z, int BC, CGNS_ENUMT(WallFunctionType_t) WallFunctionType) { cgns_bprop *bprop; @@ -9780,7 +12184,7 @@ int cg_bc_wallfunction_write(int file_number, int B, int Z, int BC, } /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -9853,8 +12257,24 @@ int cg_bc_wallfunction_write(int file_number, int B, int Z, int BC, } /*----------------------------------------------------------------------*/ - -int cg_bc_area_read(int file_number, int B, int Z, int BC, +/** + * \ingroup SpecialBoundaryConditionProperty + * + * \brief Read area related data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[out] AreaType The type of area. Valid types are CG_Null, CG_UserDefined, BleedArea, and CaptureArea. + * \param[out] SurfaceArea The size of the area. (In Fortran, this is a Real*4 value.) + * \param[out] RegionName The name of the region, 32 characters max. + * \return \ier + * + * \details The "read" functions will return with ier = 2 = CG_NODE_NOT_FOUND if the requested boundary condition property, or the BCProperty_t node itself, doesn't exist. + * + */ +int cg_bc_area_read(int fn, int B, int Z, int BC, CGNS_ENUMT(AreaType_t) *AreaType, float *SurfaceArea, char *RegionName) { @@ -9862,7 +12282,7 @@ int cg_bc_area_read(int file_number, int B, int Z, int BC, cgns_bprop *bprop; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -9888,7 +12308,24 @@ int cg_bc_area_read(int file_number, int B, int Z, int BC, return CG_OK; } -int cg_bc_area_write(int file_number, int B, int Z, int BC, +/** + * \ingroup SpecialBoundaryConditionProperty + * + * \brief Write area related data + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] BC Boundary condition index number, where 1 ≤ BC ≤ nbocos. + * \param[in] AreaType The type of area. Valid types are CG_Null, CG_UserDefined, BleedArea, and CaptureArea. + * \param[in] SurfaceArea The size of the area. (In Fortran, this is a Real*4 value.) + * \param[in] RegionName The name of the region, 32 characters max. + * \return \ier + * + * \details The "write" functions will create the BCProperty_t node if it doesn't already exist, then add the appropriate boundary condition property. Multiple boundary condition properties may be recorded under the same BCProperty_t node. + * + */ +int cg_bc_area_write(int fn, int B, int Z, int BC, CGNS_ENUMT( AreaType_t ) AreaType, float SurfaceArea, const char *RegionName) { @@ -9907,7 +12344,7 @@ int cg_bc_area_write(int file_number, int B, int Z, int BC, } /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -10018,8 +12455,24 @@ int cg_bc_area_write(int file_number, int B, int Z, int BC, /*****************************************************************************\ * read and write GridConnectivityProperty_t Node \*****************************************************************************/ - -int cg_conn_periodic_read(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Read data for periodic interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[out] RotationCenter An array of size phys_dim defining the coordinates of the origin for defining the rotation angle between the periodic interfaces. (phys_dim is the number of coordinates required to define a vector in the field.) (In Fortran, this is an array of Real*4 values.) + * \param[out] RotationAngle An array of size phys_dim defining the rotation angle from the current interface to the connecting interface. If rotating about more than one axis, the rotation is performed first about the x-axis, then the y-axis, then the z-axis. (In Fortran, this is an array of Real*4 values.) + * \param[out] Translation An array of size phys_dim defining the translation from the current interface to the connecting interface. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + * \details The "read" functions will return with ier = 2 = CG_NODE_NOT_FOUND if the requested connectivity property, or the GridConnectivityProperty_t node itself, doesn't exist. + * + */ +int cg_conn_periodic_read(int fn, int B, int Z, int J, float *RotationCenter, float *RotationAngle, float *Translation) { @@ -10029,7 +12482,7 @@ int cg_conn_periodic_read(int file_number, int B, int Z, int J, cgns_cperio *cperio; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -10061,7 +12514,24 @@ int cg_conn_periodic_read(int file_number, int B, int Z, int J, return CG_OK; } -int cg_conn_periodic_write(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Write data for periodic interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[in] RotationCenter An array of size phys_dim defining the coordinates of the origin for defining the rotation angle between the periodic interfaces. (phys_dim is the number of coordinates required to define a vector in the field.) (In Fortran, this is an array of Real*4 values.) + * \param[in] RotationAngle An array of size phys_dim defining the rotation angle from the current interface to the connecting interface. If rotating about more than one axis, the rotation is performed first about the x-axis, then the y-axis, then the z-axis. (In Fortran, this is an array of Real*4 values.) + * \param[in] Translation An array of size phys_dim defining the translation from the current interface to the connecting interface. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + * \details The "write" functions will create the GridConnectivityProperty_t node if it doesn't already exist, then add the appropriate connectivity property. Multiple grid connectivity properties may be recorded under the same GridConnectivityProperty_t node. + * + */ +int cg_conn_periodic_write(int fn, int B, int Z, int J, float const *RotationCenter, float const *RotationAngle, float const *Translation) { @@ -10072,7 +12542,7 @@ int cg_conn_periodic_write(int file_number, int B, int Z, int J, int n; /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -10166,14 +12636,28 @@ int cg_conn_periodic_write(int file_number, int B, int Z, int J, } /*----------------------------------------------------------------------*/ - -int cg_conn_average_read(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Read data for averaging interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[out] AverageInterfaceType The type of averaging to be done. Valid types are CG_Null, CG_UserDefined, AverageAll, AverageCircumferential, AverageRadial, AverageI, AverageJ, and AverageK. + * \return \ier + * + * \details The "read" functions will return with ier = 2 = CG_NODE_NOT_FOUND if the requested connectivity property, or the GridConnectivityProperty_t node itself, doesn't exist. + * + */ +int cg_conn_average_read(int fn, int B, int Z, int J, CGNS_ENUMT(AverageInterfaceType_t) *AverageInterfaceType) { cgns_cprop *cprop; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -10191,7 +12675,22 @@ int cg_conn_average_read(int file_number, int B, int Z, int J, return CG_OK; } -int cg_conn_average_write(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Write data for averaging interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[in] AverageInterfaceType The type of averaging to be done. Valid types are CG_Null, CG_UserDefined, AverageAll, AverageCircumferential, AverageRadial, AverageI, AverageJ, and AverageK. + * \return \ier + * + * \details The "write" functions will create the GridConnectivityProperty_t node if it doesn't already exist, then add the appropriate connectivity property. Multiple grid connectivity properties may be recorded under the same GridConnectivityProperty_t node. + * + */ +int cg_conn_average_write(int fn, int B, int Z, int J, CGNS_ENUMT(AverageInterfaceType_t) AverageInterfaceType) { cgns_cprop *cprop; @@ -10207,7 +12706,7 @@ int cg_conn_average_write(int file_number, int B, int Z, int J, } /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -10278,8 +12777,24 @@ int cg_conn_average_write(int file_number, int B, int Z, int J, } /*----------------------------------------------------------------------*/ - -int cg_1to1_periodic_read(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Read data for periodic interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[out] RotationCenter An array of size phys_dim defining the coordinates of the origin for defining the rotation angle between the periodic interfaces. (phys_dim is the number of coordinates required to define a vector in the field.) (In Fortran, this is an array of Real*4 values.) + * \param[out] RotationAngle An array of size phys_dim defining the rotation angle from the current interface to the connecting interface. If rotating about more than one axis, the rotation is performed first about the x-axis, then the y-axis, then the z-axis. (In Fortran, this is an array of Real*4 values.) + * \param[out] Translation An array of size phys_dim defining the translation from the current interface to the connecting interface. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + * \details The "read" functions will return with ier = 2 = CG_NODE_NOT_FOUND if the requested connectivity property, or the GridConnectivityProperty_t node itself, doesn't exist. + * + */ +int cg_1to1_periodic_read(int fn, int B, int Z, int J, float *RotationCenter, float *RotationAngle, float *Translation) { @@ -10290,7 +12805,7 @@ int cg_1to1_periodic_read(int file_number, int B, int Z, int J, cgns_1to1 *one21; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -10324,7 +12839,24 @@ int cg_1to1_periodic_read(int file_number, int B, int Z, int J, return CG_OK; } -int cg_1to1_periodic_write(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Write data for periodic interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[in] RotationCenter An array of size phys_dim defining the coordinates of the origin for defining the rotation angle between the periodic interfaces. (phys_dim is the number of coordinates required to define a vector in the field.) (In Fortran, this is an array of Real*4 values.) + * \param[in] RotationAngle An array of size phys_dim defining the rotation angle from the current interface to the connecting interface. If rotating about more than one axis, the rotation is performed first about the x-axis, then the y-axis, then the z-axis. (In Fortran, this is an array of Real*4 values.) + * \param[in] Translation An array of size phys_dim defining the translation from the current interface to the connecting interface. (In Fortran, this is an array of Real*4 values.) + * \return \ier + * + * \details The "write" functions will create the GridConnectivityProperty_t node if it doesn't already exist, then add the appropriate connectivity property. Multiple grid connectivity properties may be recorded under the same GridConnectivityProperty_t node. + * + */ +int cg_1to1_periodic_write(int fn, int B, int Z, int J, float const *RotationCenter, float const *RotationAngle, float const *Translation) @@ -10336,7 +12868,7 @@ int cg_1to1_periodic_write(int file_number, int B, int Z, int J, int n; /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -10432,15 +12964,29 @@ int cg_1to1_periodic_write(int file_number, int B, int Z, int J, } /*----------------------------------------------------------------------*/ - -int cg_1to1_average_read(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Read data for averaging interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[out] AverageInterfaceType The type of averaging to be done. Valid types are CG_Null, CG_UserDefined, AverageAll, AverageCircumferential, AverageRadial, AverageI, AverageJ, and AverageK. + * \return \ier + * + * \details The "read" functions will return with ier = 2 = CG_NODE_NOT_FOUND if the requested connectivity property, or the GridConnectivityProperty_t node itself, doesn't exist. + * + */ +int cg_1to1_average_read(int fn, int B, int Z, int J, CGNS_ENUMT(AverageInterfaceType_t) *AverageInterfaceType) { cgns_cprop *cprop; cgns_1to1 *one21; /* get memory address for file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; @@ -10460,7 +13006,22 @@ int cg_1to1_average_read(int file_number, int B, int Z, int J, return CG_OK; } -int cg_1to1_average_write(int file_number, int B, int Z, int J, +/** + * \ingroup SpecialGridConnectivityProperty + * + * \brief Write data for averaging interface + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] J Grid connectivity index number, where 1 ≤ J ≤ nconns for the "cg_conn" functions, and 1 ≤ J ≤ n1to1 for the "cg_1to1" functions. + * \param[in] AverageInterfaceType The type of averaging to be done. Valid types are CG_Null, CG_UserDefined, AverageAll, AverageCircumferential, AverageRadial, AverageI, AverageJ, and AverageK. + * \return \ier + * + * \details The "write" functions will create the GridConnectivityProperty_t node if it doesn't already exist, then add the appropriate connectivity property. Multiple grid connectivity properties may be recorded under the same GridConnectivityProperty_t node. + * + */ +int cg_1to1_average_write(int fn, int B, int Z, int J, CGNS_ENUMT(AverageInterfaceType_t) AverageInterfaceType) { cgns_cprop *cprop; @@ -10476,7 +13037,7 @@ int cg_1to1_average_write(int file_number, int B, int Z, int J, } /* get memory address of file */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; @@ -10555,7 +13116,7 @@ int cg_1to1_average_write(int file_number, int B, int Z, int J, * Go - To Function \*****************************************************************************/ -int vcg_goto(int file_number, int B, va_list ap) +int vcg_goto(int fn, int B, va_list ap) { int n; int index[CG_MAX_GOTO_DEPTH]; @@ -10565,7 +13126,7 @@ int vcg_goto(int file_number, int B, va_list ap) posit = 0; /* set global variable cg */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; /* read variable argument list */ @@ -10575,15 +13136,41 @@ int vcg_goto(int file_number, int B, va_list ap) if (strcmp("end",label[n])==0 || strcmp("END",label[n])==0) break; index[n] = va_arg(ap, int); } - return cgi_set_posit(file_number, B, n, index, label); + return cgi_set_posit(fn, B, n, index, label); } -int cg_goto(int file_number, int B, ...) +/** + * \ingroup AccessingANode + * + * \brief Access a node via label/name, index pairs + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] ... Variable argument list used to specify the path to a node. It is composed of an unlimited list of pair-arguments identifying each node in the path. Nodes may be identified by their label or name. Thus, a pair-argument may be of the form + + "CGNS_NodeLabel", NodeIndex + +where CGNS_NodeLabel is the node label and NodeIndex is the node index, or + + "CGNS_NodeName", 0 + +where CGNS_NodeName is the node name. The 0 in the second form is required, to indicate that a node name is being specified rather than a node label. In addition, a pair-argument may be specified as + + "..", 0 + +indicating the parent of the current node. The different pair-argument forms may be intermixed in the same function call. + +There is one exception to this rule. When accessing a BCData_t node, the index must be set to either Dirichlet or Neumann since only these two types are allowed. (Note that Dirichlet and Neumann are defined in the include files cgnslib.h and cgnslib_f.h). Since "Dirichlet" and "Neuman" are also the names for these nodes, you may also use the "Dirichlet", 0 or "Neuman", 0 to access the node. See the example below. + * \return \ier + * + * \details The character string "end" (or 'end' for the Fortran function) must be the last argument. It is used to indicate the end of the argument list. You may also use the empty string, "" ('' for Fortran), or the NULL string in C, to terminate the list. + */ +int cg_goto(int fn, int B, ...) { va_list ap; int status; va_start(ap, B); - status = vcg_goto(file_number, B, ap); + status = vcg_goto(fn, B, ap); va_end(ap); return status; } @@ -10599,7 +13186,7 @@ int cg_goto(int file_number, int B, ...) * */ -int cg_goto_f08(int file_number, int B, ...) +int cg_goto_f08(int fn, int B, ...) { int n; @@ -10611,7 +13198,7 @@ int cg_goto_f08(int file_number, int B, ...) posit = 0; /* set global variable cg */ - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; va_start(ap, B); @@ -10625,12 +13212,12 @@ int cg_goto_f08(int file_number, int B, ...) } va_end(ap); - return cgi_set_posit(file_number, B, n, index, label); + return cgi_set_posit(fn, B, n, index, label); } /*-----------------------------------------------------------------------*/ -int vcg_gorel(int file_number, va_list ap) +int vcg_gorel(int fn, va_list ap) { int n = 0; int index[CG_MAX_GOTO_DEPTH]; @@ -10640,7 +13227,7 @@ int vcg_gorel(int file_number, va_list ap) cgi_error ("position not set with cg_goto"); return CG_ERROR; } - if (file_number != posit_file) { + if (fn != posit_file) { cgi_error("current position is in the wrong file"); return CG_ERROR; } @@ -10655,12 +13242,37 @@ int vcg_gorel(int file_number, va_list ap) return cgi_update_posit(n, index, label); } -int cg_gorel(int file_number, ...) +/** + * \ingroup AccessingANode + * + * \brief Access a node via relative path + * + * \param[in] fn \FILE_fn + * \param[in] ... Variable argument list used to specify the path to a node. It is composed of an unlimited list of pair-arguments identifying each node in the path. Nodes may be identified by their label or name. Thus, a pair-argument may be of the form + + "CGNS_NodeLabel", NodeIndex + +where CGNS_NodeLabel is the node label and NodeIndex is the node index, or + + "CGNS_NodeName", 0 + +where CGNS_NodeName is the node name. The 0 in the second form is required, to indicate that a node name is being specified rather than a node label. In addition, a pair-argument may be specified as + + "..", 0 + +indicating the parent of the current node. The different pair-argument forms may be intermixed in the same function call. + +There is one exception to this rule. When accessing a BCData_t node, the index must be set to either Dirichlet or Neumann since only these two types are allowed. (Note that Dirichlet and Neumann are defined in the include files cgnslib.h and cgnslib_f.h). Since "Dirichlet" and "Neuman" are also the names for these nodes, you may also use the "Dirichlet", 0 or "Neuman", 0 to access the node. See the example below. + * \return \ier + * + * \details The character string "end" (or 'end' for the Fortran function) must be the last argument. It is used to indicate the end of the argument list. You may also use the empty string, "" ('' for Fortran), or the NULL string in C, to terminate the list. + */ +int cg_gorel(int fn, ...) { va_list ap; int status; - va_start (ap, file_number); - status = vcg_gorel(file_number, ap); + va_start (ap, fn); + status = vcg_gorel(fn, ap); va_end(ap); return status; } @@ -10675,7 +13287,7 @@ int cg_gorel(int file_number, ...) * directly callable from FORTRAN. * */ -int cg_gorel_f08(int file_number, ...) +int cg_gorel_f08(int fn, ...) { int n = 0; int index[CG_MAX_GOTO_DEPTH]; @@ -10686,12 +13298,12 @@ int cg_gorel_f08(int file_number, ...) cgi_error ("position not set with cg_goto"); return CG_ERROR; } - if (file_number != posit_file) { + if (fn != posit_file) { cgi_error("current position is in the wrong file"); return CG_ERROR; } - va_start (ap, file_number); + va_start (ap, fn); for (n = 0; n < CG_MAX_GOTO_DEPTH; n++) { label[n] = va_arg(ap, char *); if (label[n] == NULL || label[n][0] == 0) break; @@ -10704,8 +13316,18 @@ int cg_gorel_f08(int file_number, ...) } /*-----------------------------------------------------------------------*/ +/** + * \ingroup AccessingANode + * + * \brief Access a node via pathname + * + * \param[in] fn \FILE_fn + * \param[in] path The pathname for the node to go to. If a position has been already set, this may be a relative path, otherwise it is an absolute path name, starting with "/Basename", where Basename is the base under which you wish to move. -int cg_gopath(int file_number, const char *path) + * \return \ier + * + */ +int cg_gopath(int fn, const char *path) { int n, len; const char *p = path, *s; @@ -10742,7 +13364,7 @@ int cg_gopath(int file_number, const char *path) strncpy(label[0], p, len); label[0][len] = 0; - cg = cgi_get_file(file_number); + cg = cgi_get_file(fn); if (cg == 0) return CG_ERROR; for (n = 0; n < cg->nbases; n++) { @@ -10755,7 +13377,7 @@ int cg_gopath(int file_number, const char *path) cgi_error("base '%s' not found", label[0]); return CG_ERROR; } - ierr = cgi_set_posit(file_number, B, 0, index, lab); + ierr = cgi_set_posit(fn, B, 0, index, lab); if (ierr != CG_OK) return ierr; if (s == 0) return CG_OK; p = s; @@ -10768,7 +13390,7 @@ int cg_gopath(int file_number, const char *path) cgi_error("position not set with cg_goto"); return CG_ERROR; } - if (file_number != posit_file) { + if (fn != posit_file) { cgi_error("current position is in the wrong file"); return CG_ERROR; } @@ -10804,19 +13426,43 @@ int cg_gopath(int file_number, const char *path) } /*-----------------------------------------------------------------------*/ - -int cg_golist(int file_number, int B, int depth, char **label, int *index) +/** + * \ingroup AccessingANode + * + * \brief Access a node via arrays of labels and indices + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] depth Depth of the path list. The maximum depth is defined in cgnslib.h by CG_MAX_GOTO_DEPTH, and is currently equal to 20. + * \param[in] label Array of node labels for the path. This argument may be passed as NULL to cg_where(), otherwise it must be dimensioned by the calling program. The maximum size required is label[MAX_GO_TO_DEPTH][33]. You may call cg_where() with both label and index set to NULL in order to get the current depth, then dimension to that value. + * \param[in] index Array of node indices for the path. This argument may be passed as NULL to cg_where(), otherwise it must be dimensioned by the calling program. The maximum size required is index[MAX_GO_TO_DEPTH]. You may call cg_where() with both label and index set to NULL in order to get the current depth, then dimension to that value. + * \return \ier + * + */ +int cg_golist(int fn, int B, int depth, char **label, int *index) { if (depth >= CG_MAX_GOTO_DEPTH) { cgi_error("path is too deep"); return CG_ERROR; } - return cgi_set_posit(file_number, B, depth, index, label); + return cgi_set_posit(fn, B, depth, index, label); } /*-----------------------------------------------------------------------*/ - -int cg_where(int *file_number, int *B, int *depth, char **label, int *num) +/** + * \ingroup AccessingANode + * + * \brief Get path to current node + * + * \param[out] fn \FILE_fn + * \param[out] B \B_Base + * \param[out] depth Depth of the path list. The maximum depth is defined in cgnslib.h by CG_MAX_GOTO_DEPTH, and is currently equal to 20. + * \param[out] label Array of node labels for the path. This argument may be passed as NULL to cg_where(), otherwise it must be dimensioned by the calling program. The maximum size required is label[MAX_GO_TO_DEPTH][33]. You may call cg_where() with both label and index set to NULL in order to get the current depth, then dimension to that value. + * \param[out] num Array of node indices for the path. This argument may be passed as NULL to cg_where(), otherwise it must be dimensioned by the calling program. The maximum size required is index[MAX_GO_TO_DEPTH]. You may call cg_where() with both label and index set to NULL in order to get the current depth, then dimension to that value. + * \return \ier + * + */ +int cg_where(int *fn, int *B, int *depth, char **label, int *num) { int n; @@ -10824,7 +13470,7 @@ int cg_where(int *file_number, int *B, int *depth, char **label, int *num) cgi_error ("position not set with cg_goto"); return CG_ERROR; } - *file_number = posit_file; + *fn = posit_file; *B = posit_base; /* first entry is base */ *depth = posit_depth > 1 ? posit_depth - 1 : 0; @@ -10843,6 +13489,15 @@ int cg_where(int *file_number, int *B, int *depth, char **label, int *num) * Read and write Multiple path nodes \*****************************************************************************/ +/** + * \ingroup FamilyName + * + * \brief Read family name + * + * \param[out] family_name Family name. + * \return \ier + * + */ int cg_famname_read(char *family_name) { char *famname; @@ -10861,6 +13516,15 @@ int cg_famname_read(char *family_name) return CG_OK; } +/** + * \ingroup FamilyName + * + * \brief Write family name + * + * \param[in] family_name Family name. + * \return \ier + * + */ int cg_famname_write(const char * family_name) { char *famname; @@ -10891,7 +13555,15 @@ int cg_famname_write(const char * family_name) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup FamilyName + * + * \brief Get Number of family names + * + * \param[out] nfams Number of additional family names. + * \return \ier + * + */ int cg_nmultifam(int *nfams) { CHECK_FILE_OPEN @@ -10922,6 +13594,17 @@ int cg_nmultifam(int *nfams) return CG_OK; } +/** + * \ingroup FamilyName + * + * \brief Read multiple family names + * + * \param[in] N Family name index number, where 1 ≤ N ≤ nNames. + * \param[out] name Node name. + * \param[out] family Family name + * \return \ier + * + */ int cg_multifam_read(int N, char *name, char *family) { cgns_famname *famname; @@ -10940,6 +13623,17 @@ int cg_multifam_read(int N, char *name, char *family) return CG_OK; } +/** + * \ingroup FamilyName + * + * \brief Write multiple family names + * + * \param[in] name Node name. + * \param[in] family Family name + * \return \ier + * + * \details The additional family names written with cg_multifam_write are stored in AdditionalFamilyName_t nodes. + */ int cg_multifam_write(const char *name, const char *family) { cgns_famname *famname; @@ -10975,7 +13669,18 @@ int cg_multifam_write(const char *name, const char *family) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup ConvergenceHistory + * + * \brief Read ConvergenceHistory_t node + * + * \param[out] iterations Number of iterations for which convergence information is recorded. + * \param[out] NormDefinitions Description of the convergence information recorded in the data arrays. + * \return \ier + * + * \details The function cg_convergence_read reads a ConvergenceHistory_t node. If NormDefinitions is not defined in the CGNS database, this function returns a null string. If NormDefinitions exists, the library will allocate the space to store the description string, and return the description string to the application. It is the responsibility of the application to free this space when it is no longer needed by a call to cg_free(NormDefinitions). + * + */ int cg_convergence_read(int *iterations, char **NormDefinitions) { cgns_converg *converg; @@ -11002,6 +13707,18 @@ int cg_convergence_read(int *iterations, char **NormDefinitions) return CG_OK; } +/** + * \ingroup ConvergenceHistory + * + * \brief Write ConvergenceHistory_t node + * + * \param[in] iterations Number of iterations for which convergence information is recorded. + * \param[in] NormDefinitions Description of the convergence information recorded in the data arrays. + * \return \ier + * + * \details The function cg_convergence_write creates a ConvergenceHistory_t node. It must be the first one called when recording convergence history data. The NormDefinitions may be left undefined (i.e., a blank string). After creation of this node, the descriptors, data arrays, data class, and dimensional units characterizing the ConvergenceHistory_t data structure may be added. + * + */ int cg_convergence_write(int iterations, const char * NormDefinitions) { cgns_converg *converg; @@ -11052,7 +13769,17 @@ int cg_convergence_write(int iterations, const char * NormDefinitions) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup ReferenceState + * + * \brief Read text description of reference state. + * + * \param[in] StateDescription Text description of reference state. + * \return \ier + * + * \details The function cg_state_read reads the StateDescription of the local ReferenceState_t node. If StateDescription is undefined in the CGNS database, this function returns a null string. If StateDescription exists, the library will allocate the space to store the description string, and return the description string to the application. It is the responsibility of the application to free this space when it is no longer needed by a call to cg_free(StateDescription). + * + */ int cg_state_read(char **StateDescription) { cgns_state *state; @@ -11078,6 +13805,17 @@ int cg_state_read(char **StateDescription) return CG_OK; } +/** + * \ingroup ReferenceState + * + * \brief Create ReferenceState_t node + * + * \param[in] StateDescription Text description of reference state. + * \return \ier + * + * \details The function cg_state_write creates the ReferenceState_t node and must be called even if StateDescription is undefined (i.e., a blank string). The descriptors, data arrays, data class, and dimensional units characterizing the ReferenceState_t data structure may be added to this data structure after its creation. + * + */ int cg_state_write(const char * StateDescription) { cgns_state *state; @@ -11127,7 +13865,21 @@ int cg_state_write(const char * StateDescription) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup FlowEquationSet + * + * \brief Read Flow equation set info + * + * \param[out] EquationDimension Dimensionality of the governing equations; it is the number of spatial variables describing the flow. + * \param[out] GoverningEquationsFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of the governing equations; 0 if it doesn't, 1 if it does. + * \param[out] GasModelFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a gas model; 0 if it doesn't, 1 if it does. + * \param[out] ViscosityModelFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a viscosity model; 0 if it doesn't, 1 if it does. + * \param[out] ThermalConductivityModelFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a thermal conductivity model; 0 if it doesn't, 1 if it does. + * \param[out] TurbulenceClosureFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of the turbulence closure; 0 if it doesn't, 1 if it does. + * \param[out] TurbulenceModelFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a turbulence model; 0 if it doesn't, 1 if it does. + * \return \ier + * + */ int cg_equationset_read(int *EquationDimension, int *GoverningEquationsFlag, int *GasModelFlag, int *ViscosityModelFlag, int *ThermalConductivityModelFlag, @@ -11169,6 +13921,16 @@ int cg_equationset_read(int *EquationDimension, return CG_OK; } +/** + * \ingroup FlowEquationSet + * + * \brief Read chemistry equation set info + * + * \param[out] ThermalRelaxationFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a thermal relaxation model; 0 if it doesn't, 1 if it does. + * \param[out] ChemicalKineticsFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a chemical kinetics model; 0 if it doesn't, 1 if it does. + * \return \ier + * + */ int cg_equationset_chemistry_read(int *ThermalRelaxationFlag, int *ChemicalKineticsFlag) { @@ -11192,6 +13954,17 @@ int cg_equationset_chemistry_read(int *ThermalRelaxationFlag, return CG_OK; } +/** + * \ingroup FlowEquationSet + * + * \brief Read electromagnetic equation set info + * + * \param[out] ElecFldModelFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of an electric field model for electromagnetic flows;; 0 if it doesn't, 1 if it does. + * \param[out] MagnFldModelFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a magnetic field model for electromagnetic flows;; 0 if it doesn't, 1 if it does. + * \param[out] ConductivityModelFlag Flag indicating whether or not this FlowEquationSet_t node includes the definition of a conductivity model for electromagnetic flows; 0 if it doesn't, 1 if it does. + * \return \ier + * + */ int cg_equationset_elecmagn_read(int *ElecFldModelFlag, int *MagnFldModelFlag, int *ConductivityModelFlag) { @@ -11218,6 +13991,15 @@ int cg_equationset_elecmagn_read(int *ElecFldModelFlag, int *MagnFldModelFlag, return CG_OK; } +/** + * \ingroup FlowEquationSet + * + * \brief Write dimensionality of flow equations + * + * \param[in] EquationDimension Dimensionality of the governing equations; it is the number of spatial variables describing the flow. + * \return \ier + * + */ int cg_equationset_write(int EquationDimension) { cgns_equations *equations; @@ -11263,6 +14045,15 @@ int cg_equationset_write(int EquationDimension) /*----------------------------------------------------------------------*/ +/** + * \ingroup GoverningEquations + * + * \brief Read type of governing equation + * + * \param[out] EquationsType Type of governing equations. The admissible types are CG_Null, CG_UserDefined, FullPotential, Euler, NSLaminar, NSTurbulent, NSLaminarIncompressible, and NSTurbulentIncompressible. + * \return \ier + * + */ int cg_governing_read(CGNS_ENUMT(GoverningEquationsType_t) *EquationsType) { cgns_governing *governing; @@ -11280,6 +14071,16 @@ int cg_governing_read(CGNS_ENUMT(GoverningEquationsType_t) *EquationsType) return CG_OK; } + +/** + * \ingroup GoverningEquations + * + * \brief Write type of governing equation + * + * \param[in] Equationstype Type of governing equations. The admissible types are CG_Null, CG_UserDefined, FullPotential, Euler, NSLaminar, NSTurbulent, NSLaminarIncompressible, and NSTurbulentIncompressible. + * \return \ier + * + */ int cg_governing_write(CGNS_ENUMT(GoverningEquationsType_t) Equationstype) { cgns_governing *governing; @@ -11336,6 +14137,15 @@ int cg_governing_write(CGNS_ENUMT(GoverningEquationsType_t) Equationstype) /*----------------------------------------------------------------------*/ +/** + * \ingroup GoverningEquations + * + * \brief Read flags for diffusion terms + * + * \param[out] diffusion_model Flags defining which diffusion terms are included in the governing equations. This is only applicable to the Navier-Stokes equations with structured grids. See the discussion in the SIDS manual for details. + * \return \ier + * + */ int cg_diffusion_read(int *diffusion_model) { int n, ndata, ier=0; @@ -11373,6 +14183,15 @@ int cg_diffusion_read(int *diffusion_model) return CG_OK; } +/** + * \ingroup GoverningEquations + * + * \brief Write flags for diffusion terms + * + * \param[in] diffusion_model Flags defining which diffusion terms are included in the governing equations. This is only applicable to the Navier-Stokes equations with structured grids. See the discussion in the SIDS manual for details. + * \return \ier + * + */ int cg_diffusion_write(const int * diffusion_model) { int *diffusion; @@ -11421,6 +14240,36 @@ int cg_diffusion_write(const int * diffusion_model) /*----------------------------------------------------------------------*/ +/** + * \ingroup AuxiliaryModel + * + * \brief Read auxiliary model types + * + * \param[out] ModelLabel The CGNS label for the model being defined. The models supported by CGNS are: + * - GasModel_t + * - ViscosityModel_t + * - ThermalConductivityModel_t + * - TurbulenceClosure_t + * - TurbulenceModel_t + * - ThermalRelaxationModel_t + * - ChemicalKineticsModel_t + * - EMElectricFieldModel_t + * - EMMagneticFieldModel_t + * - EMConductivityModel_t + * \param[out] ModelType One of the model types (listed below) allowed for the ModelLabel selected. + * The types allowed for the various models are: + * GasModel_t CG_Null, CG_UserDefined, Ideal, VanderWaals, CaloricallyPerfect, ThermallyPerfect, ConstantDensity, RedlichKwong + * ViscosityModel_t CG_Null, CG_UserDefined, Constant, PowerLaw, SutherlandLaw + * ThermalConductivityModel_t CG_Null, CG_UserDefined, PowerLaw, SutherlandLaw, ConstantPrandtl + * TurbulenceModel_t CG_Null, CG_UserDefined, Algebraic_BaldwinLomax, Algebraic_CebeciSmith, HalfEquation_JohnsonKing, OneEquation_BaldwinBarth, OneEquation_SpalartAllmaras, TwoEquation_JonesLaunder, TwoEquation_MenterSST, TwoEquation_Wilcox + * TurbulenceClosure_t CG_Null, CG_UserDefined, EddyViscosity, ReynoldsStress, ReynoldsStressAlgebraic + * ThermalRelaxationModel_t CG_Null, CG_UserDefined, Frozen, ThermalEquilib, ThermalNonequilib + * ChemicalKineticsModel_t CG_Null, CG_UserDefined, Frozen, ChemicalEquilibCurveFit, ChemicalEquilibMinimization, ChemicalNonequilib + * EMElectricFieldModel_t CG_Null, CG_UserDefined, Constant, Frozen, Interpolated, Voltage + * EMMagneticFieldModel_t CG_Null, CG_UserDefined, Constant, Frozen, Interpolated + * EMConductivityModel_t CG_Null, CG_UserDefined, Constant, Frozen, Equilibrium_LinRessler, Chemistry_LinRessler + * \return \ier + */ int cg_model_read(const char *ModelLabel, CGNS_ENUMT(ModelType_t) *ModelType) { cgns_model *model; @@ -11439,6 +14288,36 @@ int cg_model_read(const char *ModelLabel, CGNS_ENUMT(ModelType_t) *ModelType) return CG_OK; } +/** + * \ingroup AuxiliaryModel + * + * \brief Write auxiliary model types + * + * \param[in] ModelLabel The CGNS label for the model being defined. The models supported by CGNS are: + * - GasModel_t + * - ViscosityModel_t + * - ThermalConductivityModel_t + * - TurbulenceClosure_t + * - TurbulenceModel_t + * - ThermalRelaxationModel_t + * - ChemicalKineticsModel_t + * - EMElectricFieldModel_t + * - EMMagneticFieldModel_t + * - EMConductivityModel_t + * \param[in] ModelType One of the model types (listed below) allowed for the ModelLabel selected. + * The types allowed for the various models are: + * GasModel_t CG_Null, CG_UserDefined, Ideal, VanderWaals, CaloricallyPerfect, ThermallyPerfect, ConstantDensity, RedlichKwong + * ViscosityModel_t CG_Null, CG_UserDefined, Constant, PowerLaw, SutherlandLaw + * ThermalConductivityModel_t CG_Null, CG_UserDefined, PowerLaw, SutherlandLaw, ConstantPrandtl + * TurbulenceModel_t CG_Null, CG_UserDefined, Algebraic_BaldwinLomax, Algebraic_CebeciSmith, HalfEquation_JohnsonKing, OneEquation_BaldwinBarth, OneEquation_SpalartAllmaras, TwoEquation_JonesLaunder, TwoEquation_MenterSST, TwoEquation_Wilcox + * TurbulenceClosure_t CG_Null, CG_UserDefined, EddyViscosity, ReynoldsStress, ReynoldsStressAlgebraic + * ThermalRelaxationModel_t CG_Null, CG_UserDefined, Frozen, ThermalEquilib, ThermalNonequilib + * ChemicalKineticsModel_t CG_Null, CG_UserDefined, Frozen, ChemicalEquilibCurveFit, ChemicalEquilibMinimization, ChemicalNonequilib + * EMElectricFieldModel_t CG_Null, CG_UserDefined, Constant, Frozen, Interpolated, Voltage + * EMMagneticFieldModel_t CG_Null, CG_UserDefined, Constant, Frozen, Interpolated + * EMConductivityModel_t CG_Null, CG_UserDefined, Constant, Frozen, Equilibrium_LinRessler, Chemistry_LinRessler + * \return \ier + */ int cg_model_write(const char * ModelLabel, CGNS_ENUMT(ModelType_t) ModelType) { cgns_model *model; @@ -11604,7 +14483,15 @@ int cg_model_write(const char * ModelLabel, CGNS_ENUMT(ModelType_t) ModelType) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup DataArrays + * + * \brief Get number of data arrays under current node + * + * \param[out] narrays Number of DataArray_t nodes under the current node. + * + * \return \ier + */ int cg_narrays(int *narrays) { @@ -11731,6 +14618,19 @@ int cg_narrays(int *narrays) return CG_OK; } +/** + * \ingroup DataArrays + * + * \brief Get data array info + * + * \param[in] A Data array index, where 1 ≤ A ≤ narrays. + * \param[out] ArrayName Name of the DataArray_t node. + * \param[out] DataType Type of data held in the DataArray_t node. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character. + * \param[out] DataDimension Number of dimensions of array in file (max 12). See Node Management Routines in CGIO User's Guide. + * \param[out] DimensionVector Dimensions of array in file. + * + * \return \ier + */ int cg_array_info(int A, char *ArrayName, CGNS_ENUMT(DataType_t) *DataType, int *DataDimension, cgsize_t *DimensionVector) { @@ -11754,6 +14654,16 @@ int cg_array_info(int A, char *ArrayName, CGNS_ENUMT(DataType_t) *DataType, return CG_OK; } +/** + * \ingroup DataArrays + * + * \brief Read data array + * + * \param[in] A Data array index, where 1 ≤ A ≤ narrays. + * \param[out] Data The data array in memory. + * + * \return \ier + */ int cg_array_read(int A, void *Data) { cgns_array *array; @@ -11783,6 +14693,18 @@ int cg_array_read(int A, void *Data) return CG_OK; } + +/** + * \ingroup DataArrays + * + * \brief Read data array as a certain type + * + * \param[in] A Data array index, where 1 ≤ A ≤ narrays. + * \param[in] type Type of data held in the DataArray_t node. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character. + * \param[out] Data The data array in memory. + * + * \return \ier + */ int cg_array_read_as(int A, CGNS_ENUMT(DataType_t) type, void *Data) { cgns_array *array; @@ -11843,6 +14765,27 @@ int cg_array_read_as(int A, CGNS_ENUMT(DataType_t) type, void *Data) return ier ? CG_ERROR : CG_OK; } + +/** + * \ingroup DataArrays + * + * \brief Read subset of data array to a shaped memory + * + * \param[in] A Data array index, where 1 ≤ A ≤ narrays. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[in] m_type The type of data held in memory. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character. + * \param[in] m_numdim Number of dimensions of array in memory (max 12). + * \param[in] m_dimvals Dimensions of array in memory. + * \param[in] m_rmin Lower range index in memory (eg., imin, jmin, kmin). + * \param[in] m_rmax Upper range index in memory (eg., imax, jmax, kmax). + * \param[out] data The data array in memory. + * + * \return \ier + * + * \details The functions cg_array_general_read allow for type conversion when reading from the file. + * When using cg_array_general_read, the lower core elements in the file have index 1 for defining range_min and range_max; whereas for the array in memory, defined by mem_rank and mem_dimensions, the lower array elements in memory have index 1 for defining mem_range_min and mem_range_max. The actual lower and upper bounds of the array in memory can be anything. For example, to fully read a two-dimensional 6 × 6 data array with 1 rind plane on each side in the file to an 8 × 8 array in memory (mem_rank = 2 and mem_dimensions = (8,8)), set range_min and range_max to (0,0) and (7,7), and set mem_range_min and mem_range_max to (1,1) and (8,8). + */ int cg_array_general_read(int A, const cgsize_t *s_rmin, const cgsize_t *s_rmax, CGNS_ENUMT(DataType_t) m_type, @@ -11883,6 +14826,19 @@ int cg_array_general_read(int A, data); } +/** + * \ingroup DataArrays + * + * \brief Write data array + * + * \param[in] ArrayName Name of the DataArray_t node. + * \param[in] DataType Type of data held in the DataArray_t node. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character. + * \param[in] DataDimension Number of dimensions of array in file (max 12). See Node Management Routines in CGIO User's Guide. + * \param[in] DimensionVector Dimensions of array in file. + * \param[in] Data The data array in memory. + * + * \return \ier + */ int cg_array_write(const char * ArrayName, CGNS_ENUMT(DataType_t) DataType, int DataDimension, const cgsize_t * DimensionVector, const void * Data) @@ -11948,6 +14904,30 @@ int cg_array_write(const char * ArrayName, CGNS_ENUMT(DataType_t) DataType, return CG_OK; } +/** + * \ingroup DataArrays + * + * \brief Write shaped array to a subset of data array + * + * \param[in] arrayname Name of the DataArray_t node. + * \param[in] s_type Type of data held in the DataArray_t node. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character. + * \param[in] s_numdim Number of dimensions of array in file (max 12). See Node Management Routines in CGIO User's Guide. + * \param[in] s_dimvals Dimensions of array in file. + * \param[in] s_rmin Lower range index in file (eg., imin, jmin, kmin). + * \param[in] s_rmax Upper range index in file (eg., imax, jmax, kmax). + * \param[in] m_type The type of data held in memory. The admissible types are Integer, LongInteger, RealSingle, RealDouble, and Character. + * \param[in] m_numdim Number of dimensions of array in memory (max 12). + * \param[in] m_dimvals Dimensions of array in memory. + * \param[in] m_rmin Lower range index in memory (eg., imin, jmin, kmin). + * \param[in] m_rmax Upper range index in memory (eg., imax, jmax, kmax). + * \param[in] data The data array in memory. + * + * \return \ier + * + * \details The function cg_array_general_write may be used to write from a subset of the array in memory to a subset of the array in the file. When using the partial write, any existing data from range_min to range_max will be overwritten by the new values. All other values will not be affected. + * The functions cg_array_general_write allow for type conversion when reading to the file. + * When using cg_array_general_write, the lower core elements in the file have index 1 for defining range_min and range_max; whereas for the array in memory, defined by mem_rank and mem_dimensions, the lower array elements in memory have index 1 for defining mem_range_min and mem_range_max. The actual lower and upper bounds of the array in memory can be anything. For example, to fully read a two-dimensional 6 × 6 data array with 1 rind plane on each side in the file to an 8 × 8 array in memory (mem_rank = 2 and mem_dimensions = (8,8)), set range_min and range_max to (0,0) and (7,7), and set mem_range_min and mem_range_max to (1,1) and (8,8). + */ int cg_array_general_write(const char *arrayname, CGNS_ENUMT(DataType_t) s_type, int s_numdim, const cgsize_t *s_dimvals, @@ -12013,7 +14993,15 @@ int cg_array_general_write(const char *arrayname, } /*----------------------------------------------------------------------*/ - +/** + * \ingroup IntegralData + * + * \brief Get number of IntegralData_t nodes + * + * \param[out] nintegrals Number of IntegralData_t nodes under current node. + * + * \return \ier + */ int cg_nintegrals(int *nintegrals) { CHECK_FILE_OPEN @@ -12043,6 +15031,16 @@ int cg_nintegrals(int *nintegrals) return CG_OK; } +/** + * \ingroup IntegralData + * + * \brief Get name of an IntegralData_t node + * + * \param[in] IntegralDataIndex Integral data index number, where 1 ≤ IntegralDataIndex ≤ nintegrals. + * \param[out] IntegralDataName Name of the IntegralData_t data structure. + * + * \return \ier + */ int cg_integral_read(int IntegralDataIndex, char *IntegralDataName) { int ier=0; @@ -12061,6 +15059,15 @@ int cg_integral_read(int IntegralDataIndex, char *IntegralDataName) return CG_OK; } +/** + * \ingroup IntegralData + * + * \brief Create IntegralData_t node + * + * \param[in] IntegralDataName Name of the IntegralData_t data structure. + * + * \return \ier + */ int cg_integral_write(const char * IntegralDataName) { cgns_integral *integral; @@ -12095,7 +15102,15 @@ int cg_integral_write(const char * IntegralDataName) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup RindLayers + * + * \brief Read number of rind layers + * + * \param[out] RindData Number of rind layers for each computational direction (structured grid) or number of rind points or elements (unstructured grid). For structured grids, the low/high sides have unit stride in the array (e.g., [NRindLowI, NRindHighI, NRindLowJ, NRindHighJ, NRindLowK, NRindHighK]). + * + * \return \ier + */ int cg_rind_read(int *RindData) { int n, ier=0; @@ -12120,6 +15135,17 @@ int cg_rind_read(int *RindData) return CG_OK; } +/** + * \ingroup RindLayers + * + * \brief Write number of rind layers + * + * \param[in] RindData Number of rind layers for each computational direction (structured grid) or number of rind points or elements (unstructured grid). For structured grids, the low/high sides have unit stride in the array (e.g., [NRindLowI, NRindHighI, NRindLowJ, NRindHighJ, NRindLowK, NRindHighK]). + * + * \return \ier + * + * \details When writing rind data for elements, cg_section_write must be called first, followed by cg_goto to access the Elements_t node, and then cg_rind_write. + */ int cg_rind_write(const int * RindData) { int n, ier=0; @@ -12160,7 +15186,15 @@ int cg_rind_write(const int * RindData) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup DescriptiveText + * + * \brief Get number of descriptors in file + * + * \param[out] ndescriptors Number of Descriptor_t nodes under the current node. + * \return \ier + * + */ int cg_ndescriptors(int *ndescriptors) { @@ -12287,6 +15321,20 @@ int cg_ndescriptors(int *ndescriptors) return CG_OK; } +/** + * \ingroup DescriptiveText + * + * \brief Read descriptive text + * + * \param[in] descr_no Descriptor index number, where 1 ≤ descr_no ≤ ndescriptors. + * \param[out] descr_name Name of the Descriptor_t node. + * \param[out] descr_text Description held in the Descriptor_t node. + * \return \ier + * + * + * \details Note that with cg_descriptor_read the memory for the descriptor character string, text, will be allocated by the Mid-Level Library. The application code is responsible for releasing this memory when it is no longer needed by calling cg_free(text). + * + */ int cg_descriptor_read(int descr_no, char *descr_name, char **descr_text) { cgns_descr *descr; @@ -12309,6 +15357,15 @@ int cg_descriptor_read(int descr_no, char *descr_name, char **descr_text) return CG_OK; } +/** + * \ingroup DescriptiveText + * + * \brief Write descriptive text + * + * \param[in] descr_name Name of the Descriptor_t node. + * \param[in] descr_text Description held in the Descriptor_t node. + * \return \ier + */ int cg_descriptor_write(const char * descr_name, const char * descr_text) { cgns_descr *descr; @@ -12343,7 +15400,14 @@ int cg_descriptor_write(const char * descr_name, const char * descr_text) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup DimensionalUnits + * + * \brief Get number of dimensional units + * + * \param[out] nunits Number of units used in the file (i.e., either 5 or 8). + * \return \ier + */ int cg_nunits(int *nunits) { cgns_units *units; @@ -12361,6 +15425,19 @@ int cg_nunits(int *nunits) return CG_OK; } +/** + * \ingroup DimensionalUnits + * + * \brief Read first five dimensional units + * + * \param[out] mass Mass units. Admissible values are CG_Null, CG_UserDefined, Kilogram, Gram, Slug, and PoundMass. + * \param[out] length Length units. Admissible values are CG_Null, CG_UserDefined, Meter, Centimeter, Millimeter, Foot, and Inch. + * \param[out] time Time units. Admissible values are CG_Null, CG_UserDefined, and Second. + * \param[out] temperature Temperature units. Admissible values are CG_Null, CG_UserDefined, Kelvin, Celsius, Rankine, and Fahrenheit. + * \param[out] angle Angle units. Admissible values are CG_Null, CG_UserDefined, Degree, and Radian. + * + * \return \ier + */ int cg_units_read(CGNS_ENUMT(MassUnits_t) *mass, CGNS_ENUMT(LengthUnits_t) *length, CGNS_ENUMT(TimeUnits_t) *time, @@ -12386,6 +15463,19 @@ int cg_units_read(CGNS_ENUMT(MassUnits_t) *mass, return CG_OK; } +/** + * \ingroup DimensionalUnits + * + * \brief Write first five dimensional units + * + * \param[in] mass Mass units. Admissible values are CG_Null, CG_UserDefined, Kilogram, Gram, Slug, and PoundMass. + * \param[in] length Length units. Admissible values are CG_Null, CG_UserDefined, Meter, Centimeter, Millimeter, Foot, and Inch. + * \param[in] time Time units. Admissible values are CG_Null, CG_UserDefined, and Second. + * \param[in] temperature Temperature units. Admissible values are CG_Null, CG_UserDefined, Kelvin, Celsius, Rankine, and Fahrenheit. + * \param[in] angle Angle units. Admissible values are CG_Null, CG_UserDefined, Degree, and Radian. + * + * \return \ier + */ int cg_units_write(CGNS_ENUMT(MassUnits_t) mass, CGNS_ENUMT(LengthUnits_t) length, CGNS_ENUMT(TimeUnits_t) time, @@ -12444,6 +15534,21 @@ int cg_units_write(CGNS_ENUMT(MassUnits_t) mass, return CG_OK; } +/** + * \ingroup DimensionalUnits + * + * \brief Read all eight dimensional units + * + * \param[out] mass Mass units. Admissible values are CG_Null, CG_UserDefined, Kilogram, Gram, Slug, and PoundMass. + * \param[out] length Length units. Admissible values are CG_Null, CG_UserDefined, Meter, Centimeter, Millimeter, Foot, and Inch. + * \param[out] time Time units. Admissible values are CG_Null, CG_UserDefined, and Second. + * \param[out] temperature Temperature units. Admissible values are CG_Null, CG_UserDefined, Kelvin, Celsius, Rankine, and Fahrenheit. + * \param[out] angle Angle units. Admissible values are CG_Null, CG_UserDefined, Degree, and Radian. + * \param[out] current Electric current units. Admissible values are CG_Null, CG_UserDefined, Ampere, Abampere, Statampere, Edison, and auCurrent. + * \param[out] amount Substance amount units. Admissible values are CG_Null, CG_UserDefined, Mole, Entities, StandardCubicFoot, and StandardCubicMeter. + * \param[out] intensity Luminous intensity units. Admissible values are CG_Null, CG_UserDefined, Candela, Candle, Carcel, Hefner, and Violle. + * \return \ier + */ int cg_unitsfull_read(CGNS_ENUMT(MassUnits_t) *mass, CGNS_ENUMT(LengthUnits_t) *length, CGNS_ENUMT(TimeUnits_t) *time, @@ -12475,6 +15580,22 @@ int cg_unitsfull_read(CGNS_ENUMT(MassUnits_t) *mass, return CG_OK; } +/** + * \ingroup DimensionalUnits + * + * \brief Write all eight dimensional units + * + * \param[in] mass Mass units. Admissible values are CG_Null, CG_UserDefined, Kilogram, Gram, Slug, and PoundMass. + * \param[in] length Length units. Admissible values are CG_Null, CG_UserDefined, Meter, Centimeter, Millimeter, Foot, and Inch. + * \param[in] time Time units. Admissible values are CG_Null, CG_UserDefined, and Second. + * \param[in] temperature Temperature units. Admissible values are CG_Null, CG_UserDefined, Kelvin, Celsius, Rankine, and Fahrenheit. + * \param[in] angle Angle units. Admissible values are CG_Null, CG_UserDefined, Degree, and Radian. + * \param[in] current Electric current units. Admissible values are CG_Null, CG_UserDefined, Ampere, Abampere, Statampere, Edison, and auCurrent. + * \param[in] amount Substance amount units. Admissible values are CG_Null, CG_UserDefined, Mole, Entities, StandardCubicFoot, and StandardCubicMeter. + * \param[in] intensity Luminous intensity units. Admissible values are CG_Null, CG_UserDefined, Candela, Candle, Carcel, Hefner, and Violle. + * + * \return \ier + */ int cg_unitsfull_write(CGNS_ENUMT(MassUnits_t) mass, CGNS_ENUMT(LengthUnits_t) length, CGNS_ENUMT(TimeUnits_t) time, @@ -12553,6 +15674,13 @@ int cg_unitsfull_write(CGNS_ENUMT(MassUnits_t) mass, /*----------------------------------------------------------------------*/ +/** + * \ingroup DimensionalExponents + * + * \brief Get exponent data type + * \param[out] DataType Data type in which the exponents are recorded. Admissible data types for the exponents are RealSingle and RealDouble. + * \return \ier + */ int cg_exponents_info(CGNS_ENUMT(DataType_t) *DataType) { cgns_exponent *exponent; @@ -12570,6 +15698,13 @@ int cg_exponents_info(CGNS_ENUMT(DataType_t) *DataType) return CG_OK; } +/** + * \ingroup DimensionalExponents + * + * \brief Get number of dimensional exponents + * \param[out] numexp Number of exponents used in the file (i.e., either 5 or 8). + * \return \ier + */ int cg_nexponents(int *numexp) { cgns_exponent *exponent; @@ -12587,6 +15722,15 @@ int cg_nexponents(int *numexp) return CG_OK; } +/** + * \ingroup DimensionalExponents + * + * \brief Read first five dimensional exponents + * \param[out] exponents Exponents for the dimensional units for mass, length, time, temperature, angle, electric current, substance amount, and luminous intensity, in that order. + * \return \ier + * + * \details When reading exponent data, either cg_exponents_read or cg_expfull_read may be used, regardless of the number of exponents used in the file. If cg_exponents_read is used, but all eight exponents are used in the file, only the first five exponents are returned. If cg_expfull_read is used, but only five exponents are used in the file, the returned values of the exponents for electric current, substance amount, and luminous intensity will be zero. + */ int cg_exponents_read(void *exponents) { cgns_exponent *exponent; @@ -12617,6 +15761,15 @@ int cg_exponents_read(void *exponents) return CG_OK; } + +/** + * \ingroup DimensionalExponents + * + * \brief Write first five dimensional exponents + * \param[in] DataType Data type in which the exponents are recorded. Admissible data types for the exponents are RealSingle and RealDouble. + * \param[in] exponents Exponents for the dimensional units for mass, length, time, temperature, angle, electric current, substance amount, and luminous intensity, in that order. + * \return \ier + */ int cg_exponents_write(CGNS_ENUMT(DataType_t) DataType, const void * exponents) { cgns_exponent *exponent; @@ -12666,6 +15819,15 @@ int cg_exponents_write(CGNS_ENUMT(DataType_t) DataType, const void * exponents) return CG_OK; } +/** + * \ingroup DimensionalExponents + * + * \brief Read all eight dimensional exponents + * \param[out] exponents Exponents for the dimensional units for mass, length, time, temperature, angle, electric current, substance amount, and luminous intensity, in that order. + * \return \ier + * + * \details When reading exponent data, either cg_exponents_read or cg_expfull_read may be used, regardless of the number of exponents used in the file. If cg_exponents_read is used, but all eight exponents are used in the file, only the first five exponents are returned. If cg_expfull_read is used, but only five exponents are used in the file, the returned values of the exponents for electric current, substance amount, and luminous intensity will be zero. + */ int cg_expfull_read(void *exponents) { cgns_exponent *exponent; @@ -12723,6 +15885,14 @@ int cg_expfull_read(void *exponents) return CG_OK; } +/** + * \ingroup DimensionalExponents + * + * \brief Write all eight dimensional exponents + * \param[in] DataType Data type in which the exponents are recorded. Admissible data types for the exponents are RealSingle and RealDouble. + * \param[in] exponents Exponents for the dimensional units for mass, length, time, temperature, angle, electric current, substance amount, and luminous intensity, in that order. + * \return \ier + */ int cg_expfull_write(CGNS_ENUMT(DataType_t) DataType, const void * exponents) { cgns_exponent *exponent; @@ -12779,7 +15949,13 @@ int cg_expfull_write(CGNS_ENUMT(DataType_t) DataType, const void * exponents) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup DataConversionFactors + * + * \brief Get conversion factors data type + * \param[out] DataType Data type in which the conversion factors are recorded. Admissible data types for the exponents are RealSingle and RealDouble. + * \return \ier + */ int cg_conversion_info(CGNS_ENUMT(DataType_t) *DataType) { cgns_conversion *conversion; @@ -12797,6 +15973,20 @@ int cg_conversion_info(CGNS_ENUMT(DataType_t) *DataType) return CG_OK; } +/** + * \ingroup DataConversionFactors + * + * \brief Read conversion factors + * \param[out] ConversionFactors Two-element array containing the scaling and offset factors. + * \return \ier + * + * \details The DataConversion_t data structure contains factors to convert the nondimensional data to "raw" dimensional data. The scaling and offset factors are contained in the two-element array ConversionFactors. In pseudo-Fortran, the conversion process is as follows: + + ConversionScale = ConversionFactors(1) + ConversionOffset = ConversionFactors(2) + Data(raw) = Data(nondimensional)*ConversionScale + ConversionOffset + + */ int cg_conversion_read(void *ConversionFactors) { cgns_conversion *conversion; @@ -12821,6 +16011,14 @@ int cg_conversion_read(void *ConversionFactors) return CG_OK; } +/** + * \ingroup DataConversionFactors + * + * \brief Write conversion factors + * \param[in] DataType Data type in which the conversion factors are recorded. Admissible data types for the exponents are RealSingle and RealDouble. + * \param[in] ConversionFactors Two-element array containing the scaling and offset factors. + * \return \ier + */ int cg_conversion_write(CGNS_ENUMT(DataType_t) DataType, const void * ConversionFactors) { @@ -12868,7 +16066,23 @@ int cg_conversion_write(CGNS_ENUMT(DataType_t) DataType, } /*----------------------------------------------------------------------*/ +/** + * \ingroup DataClass + * + * \brief Read data class + * \param[out] dataclass Data class for the nodes at this level. See below for the data classes currently supported in CGNS. + * \return \ier + * + * \details The data classes currently supported in CGNS are: + + Dimensional Regular dimensional data. + NormalizedByDimensional Nondimensional data that is normalized by dimensional reference quantities. + NormalizedByUnknownDimensional All fields and reference data are nondimensional. + NondimensionalParameter Nondimensional parameters such as Mach number and lift coefficient. + DimensionlessConstant Constant such as Ï€. +These classes are declared within typedef DataClass_t in cgnslib.h, and as parameters in cgnslib_f.h. + */ int cg_dataclass_read(CGNS_ENUMT(DataClass_t) *dataclass) { CGNS_ENUMT(DataClass_t) *DataClass; @@ -12887,6 +16101,23 @@ int cg_dataclass_read(CGNS_ENUMT(DataClass_t) *dataclass) return CG_OK; } +/** + * \ingroup DataClass + * + * \brief Write data class + * \param[in] dataclass Data class for the nodes at this level. See below for the data classes currently supported in CGNS. + * \return \ier + * + * \details The data classes currently supported in CGNS are: + + Dimensional Regular dimensional data. + NormalizedByDimensional Nondimensional data that is normalized by dimensional reference quantities. + NormalizedByUnknownDimensional All fields and reference data are nondimensional. + NondimensionalParameter Nondimensional parameters such as Mach number and lift coefficient. + DimensionlessConstant Constant such as Ï€. + +These classes are declared within typedef DataClass_t in cgnslib.h, and as parameters in cgnslib_f.h. + */ int cg_dataclass_write(CGNS_ENUMT(DataClass_t) dataclass) { CGNS_ENUMT(DataClass_t) *DataClass; @@ -12910,7 +16141,14 @@ int cg_dataclass_write(CGNS_ENUMT(DataClass_t) dataclass) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup GridLocation + * + * \brief Read grid location + * \param[out] GridLocation Location in the grid. The admissible locations are CG_Null, CG_UserDefined, Vertex, CellCenter, FaceCenter, IFaceCenter, JFaceCenter, KFaceCenter, and EdgeCenter. + * \return \ier + * + */ int cg_gridlocation_read(CGNS_ENUMT(GridLocation_t) *GridLocation) { CGNS_ENUMT(GridLocation_t) *location; @@ -12940,6 +16178,14 @@ int cg_gridlocation_read(CGNS_ENUMT(GridLocation_t) *GridLocation) return CG_OK; } +/** + * \ingroup GridLocation + * + * \brief Write grid location + * \param[in] GridLocation Location in the grid. The admissible locations are CG_Null, CG_UserDefined, Vertex, CellCenter, FaceCenter, IFaceCenter, JFaceCenter, KFaceCenter, and EdgeCenter. + * \return \ier + * + */ int cg_gridlocation_write(CGNS_ENUMT(GridLocation_t) GridLocation) { CGNS_ENUMT(GridLocation_t) *location; @@ -13023,6 +16269,14 @@ int cg_gridlocation_write(CGNS_ENUMT(GridLocation_t) GridLocation) /*----------------------------------------------------------------------*/ +/** + * \ingroup OrdinalValue + * + * \brief Read ordinal value + * \param[out] Ordinal Any integer value. + * \return \ier + * + */ int cg_ordinal_read(int *Ordinal) { int *ordinal; @@ -13040,6 +16294,14 @@ int cg_ordinal_read(int *Ordinal) return CG_OK; } +/** + * \ingroup OrdinalValue + * + * \brief Write ordinal value + * \param[in] Ordinal Any integer value. + * \return \ier + * + */ int cg_ordinal_write(int Ordinal) { int *ordinal; @@ -13063,7 +16325,14 @@ int cg_ordinal_write(int Ordinal) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup Links + * + * \brief Test if a node is a link + * \param[out] path_length Length of the path name of the linked node. The value 0 is returned if the node is not a link + * \return \ier + * + */ int cg_is_link(int *path_length) { double posit_id; @@ -13086,6 +16355,19 @@ int cg_is_link(int *path_length) return CG_OK; } +/** + * \ingroup Links + * + * \brief Get path information for a link at the current location + * \param[out] filename Name of the linked file, or empty string if the link is within the same file. + * \param[out] link_path Path name of the node which the link points to. + * + * \return \ier + * + * \details Use cg_goto(_f) to position to a location in the file prior to calling these routines. + * Memory is allocated by the library for the return values of the C function cg_link_read. This memory should be freed by the user when no longer needed by calling cg_free(filename) and cg_free(link_path). + * + */ int cg_link_read(char **filename, char **link_path) { int name_len, file_len; @@ -13115,6 +16397,26 @@ int cg_link_read(char **filename, char **link_path) return CG_OK; } +/** + * \ingroup Links + * + * \brief Create a link at the current location + * + * \param[in] nodename Name of the link node to create, e.g., GridCoordinates. + * \param[in] filename Name of the linked file, or empty string if the link is within the same file. + * \param[in] name_in_file Path name of the node which the link points to. This can be a simple or a compound name, e.g., Base/Zone 1/GridCoordinates. + * + * \return \ier + * + * \details Use cg_goto(_f) to position to a location in the file prior to calling these routines. + +When using cg_link_write, the node being linked to does not have to exist when the link is created. However, when the link is used, an error will occur if the linked-to node does not exist. + +Only nodes that support child nodes will support links. + +It is assumed that the CGNS version for the file containing the link, as determined by the CGNSLibraryVersion_t node, is also applicable to filename, the file containing the linked node. + * + */ int cg_link_write(const char * nodename, const char * filename, const char * name_in_file) { double posit_id, link_id; @@ -13199,7 +16501,26 @@ int cg_link_write(const char * nodename, const char * filename, const char * nam } /*----------------------------------------------------------------------*/ - +/** + * \ingroup UserDefinedData + * + * + * \brief Get number of UserDefinedData_t nodes + * + * \param[out] nuser_data Number of UserDefinedData_t nodes under current node. + * + * \return \ier + * + * \details After accessing a particular UserDefinedData_t node using cg_goto, + * the Point Set functions may be used to read or write point set information for the node. + * The function cg_gridlocation_write may also be used to specify the location of the data with respect to the grid (e.g., Vertex or FaceCenter). + * + * Multiple levels of UserDefinedData_t nodes may be written and retrieved by positioning via cg_goto. E.g., + * + * ier = cg_goto(fn, B, "Zone_t", Z, "UserDefinedData_t", ud1, + * "UserDefinedData_t", ud2, "UserDefinedData_t", ud3, "end"); + * + */ int cg_nuser_data(int *nuser_data) { @@ -13320,6 +16641,18 @@ int cg_nuser_data(int *nuser_data) return CG_OK; } +/** + * \ingroup UserDefinedData + * + * + * \brief Get name of an UserDefinedData_t node + * + * \param[in] Index User-defined data index number, where 1 ≤ Index ≤ nuser_data. + * \param[out] UserDataName Name of the UserDefinedData_t node. + * + * \return \ier + * + */ int cg_user_data_read(int Index, char *UserDataName) { int ier=0; @@ -13338,6 +16671,17 @@ int cg_user_data_read(int Index, char *UserDataName) return CG_OK; } +/** + * \ingroup UserDefinedData + * + * + * \brief Create UserDefinedData_t node + * + * \param[in] UserDataName Name of the UserDefinedData_t node. + * + * \return \ier + * + */ int cg_user_data_write(const char * UserDataName) { cgns_user_data *user_data; @@ -13369,7 +16713,18 @@ int cg_user_data_write(const char * UserDataName) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup RotatingCoordinates + * + * + * \brief Read rotating coordinates data + * + * \param[out] rot_rate Components of the angular velocity of the grid about the center of rotation. (In Fortran, this is an array of Real*4 values.) + * \param[out] rot_center Coordinates of the center of rotation. (In Fortran, this is an array of Real*4 values.) + * + * \return \ier + * + */ int cg_rotating_read(float *rot_rate, float *rot_center) { cgns_rotating *rotating; @@ -13400,6 +16755,18 @@ int cg_rotating_read(float *rot_rate, float *rot_center) return CG_OK; } +/** + * \ingroup RotatingCoordinates + * + * + * \brief Create rotating coordinates data + * + * \param[in] rot_rate Components of the angular velocity of the grid about the center of rotation. (In Fortran, this is an array of Real*4 values.) + * \param[in] rot_center Coordinates of the center of rotation. (In Fortran, this is an array of Real*4 values.) + * + * \return \ier + * + */ int cg_rotating_write(float const *rot_rate, float const *rot_center) { cgns_rotating *rotating; @@ -13469,7 +16836,18 @@ int cg_rotating_write(float const *rot_rate, float const *rot_center) } /*----------------------------------------------------------------------*/ - +/** + * \ingroup PointSets + * + * + * \brief Get point set information + * + * \param[out] ptset_type The point set type; either PointRange for a range of points or cells, or PointList for a list of discrete points or cells. + * \param[out] npnts The number of points or cells in the point set. For a point set type of PointRange, npnts is always two. For a point set type of PointList, npnts is the number of points or cells in the list. + * + * \return \ier + * + */ int cg_ptset_info(CGNS_ENUMT(PointSetType_t) *ptset_type, cgsize_t *npnts) { cgns_ptset *ptset; @@ -13490,6 +16868,17 @@ int cg_ptset_info(CGNS_ENUMT(PointSetType_t) *ptset_type, cgsize_t *npnts) return CG_OK; } +/** + * \ingroup PointSets + * + * + * \brief Read point set data + * + * \param[out] pnts The array of point or cell indices defining the point set. There should be npnts values, each of dimension IndexDimension (i.e., 1 for unstructured grids, and 2 or 3 for structured grids with 2-D or 3-D elements, respectively). + * + * \return \ier + * + */ int cg_ptset_read(cgsize_t *pnts) { cgns_ptset *ptset; @@ -13517,6 +16906,19 @@ int cg_ptset_read(cgsize_t *pnts) return CG_OK; } +/** + * \ingroup PointSets + * + * + * \brief Write point set data + * + * \param[in] ptset_type The point set type; either PointRange for a range of points or cells, or PointList for a list of discrete points or cells. + * \param[in] npnts The number of points or cells in the point set. For a point set type of PointRange, npnts is always two. For a point set type of PointList, npnts is the number of points or cells in the list. + * \param[in] pnts The array of point or cell indices defining the point set. There should be npnts values, each of dimension IndexDimension (i.e., 1 for unstructured grids, and 2 or 3 for structured grids with 2-D or 3-D elements, respectively). + * + * \return \ier + * + */ int cg_ptset_write(CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, const cgsize_t * pnts) { @@ -13605,6 +17007,17 @@ int cg_ptset_write(CGNS_ENUMT(PointSetType_t) ptset_type, cgsize_t npnts, * Read and write FamilyBCDataSet_t nodes \*****************************************************************************/ +/** + * \ingroup BoundaryConditionDatasets + * + * + * \brief Get number of family boundary condition datasets + * + * \param[out] n_dataset Number of BCDataSet nodes under the current FamilyBC_t node. + * \return \ier + * + * \details The above functions are applicable to BCDataSet_t nodes that are used to define boundary conditions for a CFD family, and thus are children of a FamilyBC_t node. The FamilyBC_t node must first be accessed using cg_goto. + */ int cg_bcdataset_info(int *n_dataset) { CHECK_FILE_OPEN @@ -13628,6 +17041,22 @@ int cg_bcdataset_info(int *n_dataset) return CG_OK; } + +/** + * \ingroup BoundaryConditionDatasets + * + * + * \brief Read family boundary condition dataset info + * + * \param[in] index Dataset index number, where 1 ≤ index ≤ ndataset. + * \param[out] name Name of dataset. + * \param[out] BCType Simple boundary condition type for the dataset. The supported types are listed in the table of Simple Boundary Condition Types in the SIDS manual, but note that FamilySpecified does not apply here. + * \param[out] DirichletFlag Flag indicating if the dataset contains Dirichlet data. + * \param[out] NeumannFlag Flag indicating if the dataset contains Neumann data. + * \return \ier + * + * \details The above functions are applicable to BCDataSet_t nodes that are used to define boundary conditions for a CFD family, and thus are children of a FamilyBC_t node. The FamilyBC_t node must first be accessed using cg_goto. + */ int cg_bcdataset_read(int index, char *name, CGNS_ENUMT(BCType_t) *BCType, int *DirichletFlag, int *NeumannFlag) { @@ -13651,6 +17080,21 @@ int cg_bcdataset_read(int index, char *name, CGNS_ENUMT(BCType_t) *BCType, return CG_OK; } + +/** + * \ingroup BoundaryConditionDatasets + * + * + * \brief Write family boundary condition dataset info + * + * \param[in] name Name of dataset. + * \param[in] BCType Simple boundary condition type for the dataset. The supported types are listed in the table of Simple Boundary Condition Types in the SIDS manual, but note that FamilySpecified does not apply here. + * \param[in] BCDataType Type of boundary condition in the dataset (i.e., for a BCData_t child node). Admissible types are Dirichlet and Neumann. + * \return \ier + * + * \details The above functions are applicable to BCDataSet_t nodes that are used to define boundary conditions for a CFD family, and thus are children of a FamilyBC_t node. The FamilyBC_t node must first be accessed using cg_goto. + * The first time cg_bcdataset_write is called with a particular DatasetName, BCType, and BCDataType, a new BCDataSet_t node is created, with a child BCData_t node. Subsequent calls with the same DatasetName and BCType may be made to add additional BCData_t nodes, of type BCDataType, to the existing BCDataSet_t node. + */ int cg_bcdataset_write(const char *name, CGNS_ENUMT(BCType_t) BCType, CGNS_ENUMT(BCDataType_t) BCDataType) { @@ -13771,9 +17215,20 @@ int cg_bcdataset_write(const char *name, CGNS_ENUMT(BCType_t) BCType, } /****************************************************************************/ -/* the index in this list IS the cgnslib.h/ElementType_t index */ +/** + * \ingroup ElementConnectivity + * + * + * \brief Get number of nodes for an element type. + * + * \param[in] type Type of element. See the eligible types for ElementType_t in the Typedefs section. + * \param[out] npe Number of nodes for an element of type type. + * \return \ier + * + */ int cg_npe(CGNS_ENUMT( ElementType_t ) type, int *npe) { +/* the index in this list IS the cgnslib.h/ElementType_t index */ static int el_size[NofValidElementTypes] = { 0, /* ElementTypeNull */ 0, /* ElementTypeUserDefined */ @@ -13904,7 +17359,39 @@ int cg_npe(CGNS_ENUMT( ElementType_t ) type, int *npe) /*****************************************************************************\ * General Delete Function \*****************************************************************************/ - +/** + * \ingroup DeletingANode + * + * \brief Delete a node + * + * \param[in] node_name Name of the child to be deleted. + * \return \ier + * + * \details The function cg_delete_node is used is conjunction with cg_goto. Once positioned at a parent node with cg_goto, a child of this node can be deleted with cg_delete_node. This function requires a single argument, NodeName, which is the name of the child to be deleted. + +Since the highest level that can be pointed to with cg_goto is a base node for a CGNS database (CGNSBase_t), the highest-level nodes that can be deleted are the children of a CGNSBase_t node. In other words, nodes located directly under the ADF (or HDF) root node (CGNSBase_t and CGNSLibraryVersion_t) can not be deleted with cg_delete. + +A few other nodes are not allowed to be deleted from the database because these are required nodes as defined by the SIDS, and deleting them would make the file non-CGNS compliant. These are: + + Under Zone_t: ZoneType + Under GridConnectivity1to1_t: PointRange, PointRangeDonor, Transform + Under OversetHoles_t: PointList and any IndexRange_t + Under GridConnectivity_t: PointRange, PointList, CellListDonor, PointListDonor + Under BC_t: PointList, PointRange + Under GeometryReference_t: GeometryFile, GeometryFormat + Under Elements_t: ElementRange, ElementConnectivity + Under Gravity_t: GravityVector + Under Axisymmetry_t: AxisymmetryReferencePoint, AxisymmetryAxisVector + Under RotatingCoordinates_t: RotationCenter, RotationRateVector + Under Periodic_t: RotationCenter, RotationAngle, Translation + Under AverageInterface_t: AverageInterfaceType + Under WallFunction_t: WallFunctionType + Under Area_t: AreaType, SurfaceArea, RegionName + +When a child node is deleted, both the database and the file on disk are updated to remove the node. One must be careful not to delete a node from within a loop of that node type. For example, if the number of zones below a CGNSBase_t node is nzones, a zone should never be deleted from within a zone loop! By deleting a zone, the total number of zones (nzones) changes, as well as the zone indexing. Suppose for example that nzones is 5, and that the third zone is deleted. After calling cg_delete_node, nzones is changed to 4, and the zones originally indexed 4 and 5 are now indexed 3 and 4. + * + * + */ int cg_delete_node(const char *node_name) { int n, m, index_dim; @@ -14797,7 +18284,19 @@ int cg_delete_node(const char *node_name) /*****************************************************************************\ * Free library malloced memory \*****************************************************************************/ +/** + * \ingroup FreeingMemory + * + * \brief Release library-allocated memory + * + * \param[in] data Data allocated by the Mid-Level Library. + * \return \ier + * + * \details This function does not affect the structure of a CGNS file; it is provided as a convenience to free memory allocated by the Mid-Level Library. This isn't necessary in Fortran, and thus an equivalent Fortran function is not provided. +The functions that are used to allocate memory for return values are cg_descriptor_read, cg_convergence_read, cg_geo_read, cg_link_read, and cg_state_read. Each of these may allocate space to contain the data returned to the application. It is the responsibility of the application to free this data when it is no longer needed. Calling cg_free is identical to calling the standard C function free, however it is probably safer in that the memory is freed in the same module in which it is created, particularly when the Mid-Level Library is a shared library or DLL. The routine checks for NULL data and will return CG_ERROR in this case, otherwise it returns CG_OK. + * + */ int cg_free(void *data) { if (data != NULL) { CGNS_FREE (data); diff --git a/externals/cgns/cgnslib.h b/externals/cgns/cgnslib.h index f2b3d5c2218..476c7689da1 100644 --- a/externals/cgns/cgnslib.h +++ b/externals/cgns/cgnslib.h @@ -32,16 +32,19 @@ * |_____|_| |_|_| \____/|_| \_\ |_/_/ \_\_| \_| |_| * * ------------------- DEVELOPER'S NOTES --------------------------- + * * (1) When adding a defined constant to this file, also add the same defined * constant to cgns_f.F90 + * + * (2) Fortran length of names for variables is limited to 31 characters. * * ------------------------------------------------------------------------- */ #ifndef CGNSLIB_H #define CGNSLIB_H -#define CGNS_VERSION 4200 -#define CGNS_DOTVERS 4.20 +#define CGNS_VERSION 4400 +#define CGNS_DOTVERS 4.40 #define CGNS_COMPATVERSION 2540 #define CGNS_COMPATDOTVERS 2.54 @@ -129,15 +132,16 @@ #define CG_CONFIG_FILE_TYPE 5 #define CG_CONFIG_RIND_INDEX 6 -#define CG_CONFIG_HDF5_COMPRESS 201 -#define CG_CONFIG_HDF5_MPI_COMM 202 -#define CG_CONFIG_HDF5_DISKLESS 203 -#define CG_CONFIG_HDF5_DISKLESS_INCR 204 -#define CG_CONFIG_HDF5_DISKLESS_WRITE 205 -#define CG_CONFIG_HDF5_ALIGNMENT 206 -#define CG_CONFIG_HDF5_MD_BLOCK_SIZE 207 -#define CG_CONFIG_HDF5_BUFFER 208 -#define CG_CONFIG_HDF5_SIEVE_BUF_SIZE 209 +#define CG_CONFIG_HDF5_COMPRESS 201 +#define CG_CONFIG_HDF5_MPI_COMM 202 +#define CG_CONFIG_HDF5_DISKLESS 203 +#define CG_CONFIG_HDF5_DISKLESS_INCR 204 +#define CG_CONFIG_HDF5_DISKLESS_WRITE 205 +#define CG_CONFIG_HDF5_ALIGNMENT 206 +#define CG_CONFIG_HDF5_MD_BLOCK_SIZE 207 +#define CG_CONFIG_HDF5_BUFFER 208 +#define CG_CONFIG_HDF5_SIEVE_BUF_SIZE 209 +#define CG_CONFIG_HDF5_ELINK_CACHE_SIZE 210 #define CG_CONFIG_RESET 1000 diff --git a/externals/cgns/pcgnslib.c b/externals/cgns/pcgnslib.c index 1acc54a5b30..90079fd9f29 100644 --- a/externals/cgns/pcgnslib.c +++ b/externals/cgns/pcgnslib.c @@ -17,6 +17,14 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. -------------------------------------------------------------------------*/ +/** + * \defgroup ParallelMisc Parallel Miscellaneous Routines + * \defgroup ParallelFile Parallel File Operations + * \defgroup ParallelGridCoordinate Parallel Grid Coordinate Data + * \defgroup ElementConnectivityData Parallel Element Connectivity Data + * \defgroup SolutionData Parallel Solution Data + * \defgroup ArrayData Parallel Array Data + **/ #include #include @@ -48,6 +56,13 @@ typedef struct cg_rw_t { } u; } cg_rw_t; +typedef struct cg_rw__ptr_t { + union { + void **rbuf; /* Pointer to buffer for read */ + const void **wbuf; /* Pointer to buffer to write */ + } u; +} cg_rw_ptr_t; + /* flag for parallel reading or parallel writing */ enum cg_par_rw{ CG_PAR_READ, @@ -358,6 +373,15 @@ static int check_parallel(cgns_file *cgfile) /*== Begin Function Definitions ==*/ /*================================*/ +/** + * \ingroup ParallelMisc + * + * \brief Set the MPI communicator. + * + * \param[in] comm The MPI communicator to be used by the CGNS library. + * \details Sets the MPI communicator for parallel operations by the CGNS library. The default value is MPI_COMM_WORLD. + * \return \ier + */ int cgp_mpi_comm(MPI_Comm comm) { /* check if we are actually running a parallel program */ @@ -378,7 +402,15 @@ int cgp_mpi_comm(MPI_Comm comm) return ctx_cgio.pcg_mpi_initialized ? CG_OK : CG_ERROR; } - +/** + * \ingroup ParallelMisc + * + * \brief Set the MPI info object. + * + * \param[in] info The MPI info object to be used by the CGNS library. + * \return \ier + * \details Passes the MPI info object for parallel operations to the CGNS library. Notes for Fortran: the data type for info is an INTEGER. + */ int cgp_mpi_info(MPI_Info info) { ctx_cgio.pcg_mpi_info = info; @@ -387,7 +419,16 @@ int cgp_mpi_info(MPI_Info info) } /*---------------------------------------------------------*/ - +/** + * \ingroup ParallelMisc + * + * \brief Set the parallel IO mode. + * + * \param[in] mode Parallel input/output mode. + * \return \ier + * \details Sets the mode for parallel data reads and writes. The default value is \p CGP_COLLECTIVE, which allows any number of processes to access the data. + * When set to \p CGP_COLLECTIVE, all processes must access the data. + */ int cgp_pio_mode(CGNS_ENUMT(PIOmode_t) mode) { if (mode == CGP_INDEPENDENT) @@ -404,6 +445,14 @@ int cgp_pio_mode(CGNS_ENUMT(PIOmode_t) mode) /*---------------------------------------------------------*/ +/** + * \ingroup ParallelMisc + * + * \brief Exit with error message. + * + * \details Is similar to \e cg_error_exit in that the process will exit with an error message. + * However, it will also print the process rank, and call \p MPI_Abort with an exit code of 1. + */ void cgp_error_exit(void) { @@ -416,6 +465,17 @@ void cgp_error_exit(void) } /*===== File IO Prototypes ================================*/ +/** + * \ingroup ParallelFile + * + * \brief Open a file for parallel IO. + * + * \param[in] filename \FILE_filename + * \param[in] mode \FILE_mode + * \param[out] fn \FILE_fn + * \return \ier + * \details Similar to \e cg_open and calls that routine. The differences is that \e cgp_open explicitly sets an internal CGNS flag to indicate parallel access. + */ int cgp_open(const char *filename, int mode, int *fn) { @@ -439,7 +499,15 @@ int cgp_open(const char *filename, int mode, int *fn) } /*---------------------------------------------------------*/ - +/** + * \ingroup ParallelFile + * + * \brief Close a CGNS file. + * + * \param[in] fn \FILE_fn + * \return \ier + * \details Similar to \e cg_close and calls that routine. + */ int cgp_close(int fn) { /* reset parallel access */ @@ -448,6 +516,22 @@ int cgp_close(int fn) } /*===== Grid IO Prototypes ================================*/ +/** + * \ingroup ParallelGridCoordinate + * + * \brief Create a coordinate data node by multiple processes in a parallel fashion. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] type \PGRID_datatype + * \param[in] coordname \PGRID_coordname + * \param[out] C \PGRID_Coordinate + * \return \ier + * \details To write the data in parallel, first call /e cgp_coord_write to create an empty data node. This call is identical + * to /e cg_coord_write with /p coord_array set to NULL (no data written). The actual data is then written to the node in parallel + * using either /e cgp_coord_write_data or /e cgp_coord_general_write_data where /p range_min and /p range_max specify the subset of coordinate data to be written by a given process. + */ int cgp_coord_write(int fn, int B, int Z, CGNS_ENUMT(DataType_t) type, const char *coordname, int *C) @@ -459,6 +543,24 @@ int cgp_coord_write(int fn, int B, int Z, CGNS_ENUMT(DataType_t) type, } /*---------------------------------------------------------*/ +/** + * \ingroup ParallelGridCoordinate + * + * \brief Write coordinate data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] C \C_Coordinate + * \param[in] rmin \PGRID_range_min + * \param[in] rmax \PGRID_range_max + * \param[in] coords \PGRID_coord_array + * \return \ier + * \details Writes the actual data to the node in parallel, where /p rmin and /p rmax specify the subset + * of coordinate data to be written by a given process. It is the + * responsibility of the application to ensure that the data type for the coordinate data + * matches that as defined in the file; no conversions are done. + */ int cgp_coord_write_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, const void *coords) @@ -509,10 +611,29 @@ int cgp_coord_write_data(int fn, int B, int Z, int C, } /*---------------------------------------------------------*/ +/** + * \ingroup ParallelGridCoordinate + * + * \brief Write shaped array to a subset of grid coordinates in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] C \PGRID_Coordinate + * \param[in] rmin \PGRID_range_min + * \param[in] rmax \PGRID_range_max + * \param[in] m_type \PGRID_mem_datatype + * \param[in] m_numdim \PGRID_mem_rank + * \param[in] m_arg_dimvals \PGRID_mem_dimensions + * \param[in] m_rmin \PGRID_mem_range_min + * \param[in] m_rmax \PGRID_mem_range_max + * \param[out] coords \PGRID_coord_array + * \return \ier + * \details The \e cgp_coord_general_write_data perform data conversions if \e datatype is different from \e mem_datatype. If \e coords == NULL, meaning + * this processor writes no data, then only \e fn, \e B, \e Z, and \e C need be set. In this case, \e Z and \e C are "representative" + * and can point to any valid zone. + */ -/* Note: if data == NULL, meaning this processor reads no data, then - only fn, B, Z, and C need be set. In this case, Z and C are "representative" - and can point to any valid zone */ int cgp_coord_general_write_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, CGNS_ENUMT(DataType_t) m_type, @@ -598,6 +719,24 @@ int cgp_coord_general_write_data(int fn, int B, int Z, int C, } /*---------------------------------------------------------*/ +/** + * \ingroup ParallelGridCoordinate + * + * \brief Read coordinate data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] C \C_Coordinate + * \param[in] rmin \PGRID_range_min + * \param[in] rmax \PGRID_range_max + * \param[out] coords \PGRID_coord_array + * \return \ier + * \details Reads the actual data to the node in parallel, where /p rmin and /p rmax specify the subset + * of coordinate data to be read by a given process. It is the + * responsibility of the application to ensure that the data type for the coordinate data + * matches that as defined in the file; no conversions are done. + */ int cgp_coord_read_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, void *coords) @@ -647,10 +786,29 @@ int cgp_coord_read_data(int fn, int B, int Z, int C, } /*---------------------------------------------------------*/ +/** + * \ingroup ParallelGridCoordinate + * + * \brief Read shaped array to a subset of grid coordinates in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] C \C_Coordinate + * \param[in] rmin \PGRID_range_min + * \param[in] rmax \PGRID_range_max + * \param[in] m_type \PGRID_mem_datatype + * \param[in] m_numdim \PGRID_mem_rank + * \param[in] m_arg_dimvals \PGRID_mem_dimensions + * \param[in] m_rmin \PGRID_mem_range_min + * \param[in] m_rmax \PGRID_mem_range_max + * \param[out] coords \PGRID_coord_array + * \return \ier + * \details The \e cgp_coord_general_read_data perform data conversions if \e datatype is different from \e mem_datatype. If \e coords == NULL, meaning + * this processor reads no data, then only \e fn, \e B, \e Z, and \e C need be set. In this case, \e Z and \e C are "representative" + * and can point to any valid zone. + */ -/* Note: if data == NULL, meaning this processor reads no data, then - only fn, B, Z, and C need be set. In this case, Z and C are "representative" - and can point to any valid zone */ int cgp_coord_general_read_data(int fn, int B, int Z, int C, const cgsize_t *rmin, const cgsize_t *rmax, CGNS_ENUMT(DataType_t) m_type, @@ -736,6 +894,28 @@ int cgp_coord_general_read_data(int fn, int B, int Z, int C, } /*===== Elements IO Prototypes ============================*/ +/* TODO: ref. cg_section_write + Add somewhere: (Note that for Fortran calls, all integer arguments are integer*4 in 32-bit mode and integer*8 in 64-bit mode. See 64-bit Fortran Portability and Issues.) +*/ +/** + * \ingroup ElementConnectivityData + * + * \brief Create a section data node. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] sectionname \PCONN_ElementSectionName + * \param[in] type \PCONN_type + * \param[in] start \PCONN_start + * \param[in] end \PCONN_end + * \param[in] nbndry \PCONN_nbndry + * \param[out] S \CONN_S + * \return \ier + * \details \p cgp_section_write is used to write element connectivity data by multiple processes in a parallel fashion. To write the element data in parallel, first call \e cgp_section_write to create an empty data node. This call is identical to \e cg_section_write with \e Elements set to \e NULL (no data written). The actual element data is then written to the node in parallel using \p cgp_element_write_data where \e start and \e end specify the range of the elements to be written by a given process. + * NOTE (1): Routine only works for constant sized elements, since it is not possible to compute file offsets for variable sized elements without knowledge of the entire element connectivity data. + * NOTE (2): It is the responsibility of the application to ensure that \e cgsize_t in the application is the same size as that defined in the file; no conversions are done. + */ int cgp_section_write(int fn, int B, int Z, const char *sectionname, CGNS_ENUMT(ElementType_t) type, cgsize_t start, cgsize_t end, @@ -751,19 +931,31 @@ int cgp_section_write(int fn, int B, int Z, const char *sectionname, return cg_section_partial_write(fn, B, Z, sectionname, type, start, end, nbndry, S); } +/** + * \ingroup ElementConnectivityData + * + * \brief Create a section data node. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] sectionname \PCONN_ElementSectionName + * \param[in] type \PCONN_type + * \param[in] start \PCONN_start + * \param[in] end \PCONN_end + * \param[in] maxoffset \PCONN_MaxOffset + * \param[in] nbndry \PCONN_nbndry + * \param[out] S \CONN_S + * \return \ier + * \details \p cgp_poly_section_write is used to write element connectivity data by multiple processes in a parallel fashion. To write the element data in parallel, first call \e cgp_section_write to create an empty data node. This call is identical to \e cg_section_write with \e Elements set to \e NULL (no data written). The actual element data is then written to the node in parallel using \p cgp_element_write_data where \e start and \e end specify the range of the elements to be written by a given process. + * NOTE (1): Routine only works for constant sized elements, since it is not possible to compute file offsets for variable sized elements without knowledge of the entire element connectivity data. + * NOTE (2): It is the responsibility of the application to ensure that \e cgsize_t in the application is the same size as that defined in the file; no conversions are done. + */ int cgp_poly_section_write(int fn, int B, int Z, const char *sectionname, CGNS_ENUMT(ElementType_t) type, cgsize_t start, cgsize_t end, cgsize_t maxoffset, int nbndry, int *S) { - cgns_zone *zone; - cgns_section *section = NULL; - double dummy_id; - int index; - int data[2]; - cgsize_t dim_vals; - cgsize_t num, ElementDataSize=0; - cg = cgi_get_file(fn); if (check_parallel(cg)) return CG_ERROR; if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) @@ -780,7 +972,23 @@ int cgp_poly_section_write(int fn, int B, int Z, const char *sectionname, } /*---------------------------------------------------------*/ - +/** + * \ingroup ElementConnectivityData + * + * \brief Write element data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start \PCONN_start + * \param[in] end \PCONN_end + * \param[in] elements \PCONN_Elements + * \return \ier + * \details \p cgp_elements_write_data is used to write element connectivity data by multiple processes in a parallel fashion. To write the element data in parallel, first call \e cgp_section_write to create an empty data node. This call is identical to \e cg_section_write with \e Elements set to \e NULL (no data written). The actual element data is then written to the node in parallel using \p cgp_element_write_data where \e start and \e end specify the range of the elements to be written by a given process. + * NOTE (1): Routine only works for constant sized elements, since it is not possible to compute file offsets for variable sized elements without knowledge of the entire element connectivity data. + * NOTE (2): It is the responsibility of the application to ensure that \e cgsize_t in the application is the same size as that defined in the file; no conversions are done. + */ int cgp_elements_write_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *elements) { @@ -827,7 +1035,21 @@ int cgp_elements_write_data(int fn, int B, int Z, int S, cgsize_t start, } /*---------------------------------------------------------*/ - +/** + * \ingroup ElementConnectivityData + * + * \brief Write element data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start \PCONN_start + * \param[in] end \PCONN_end + * \param[in] elements \PCONN_Elements + * \param[in] offsets \PCONN_Offsets + * \return \ier + */ int cgp_poly_elements_write_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *elements, const cgsize_t *offsets) { @@ -902,7 +1124,20 @@ int cgp_poly_elements_write_data(int fn, int B, int Z, int S, cgsize_t start, /*---------------------------------------------------------*/ - +/** + * \ingroup ElementConnectivityData + * + * \brief Read element data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start \PCONN_start + * \param[in] end \PCONN_end + * \param[out] elements \PCONN_Elements + * \return \ier + */ int cgp_elements_read_data(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, cgsize_t *elements) { @@ -946,7 +1181,20 @@ int cgp_elements_read_data(int fn, int B, int Z, int S, cgsize_t start, return readwrite_data_parallel(hid, type, 1, &rmin, &rmax, &Data, CG_PAR_READ); } - +/** + * \ingroup ElementConnectivityData + * + * \brief Write parent info for an element section data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \CONN_S + * \param[in] start \PCONN_start + * \param[in] end \PCONN_end + * \param[in] parent_data \PCONN_Elements + * \return \ier + */ int cgp_parent_data_write(int fn, int B, int Z, int S, cgsize_t start, cgsize_t end, const cgsize_t *parent_data) @@ -1062,7 +1310,20 @@ int cgp_parent_data_write(int fn, int B, int Z, int S, } /*===== Solution IO Prototypes ============================*/ - +/** + * \ingroup SolutionData + * + * \brief Create a solution field data node in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \PSOL_S + * \param[in] DataType \PSOL_datatype + * \param[in] fieldname \PSOL_fieldname + * \param[in] F \PSOL_F + * \return \ier + */ int cgp_field_write(int fn, int B, int Z, int S, CGNS_ENUMT(DataType_t) DataType, const char *fieldname, int *F) { @@ -1073,13 +1334,27 @@ int cgp_field_write(int fn, int B, int Z, int S, } /*---------------------------------------------------------*/ - +/** + * \ingroup SolutionData + * + * \brief Write field data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \PSOL_S + * \param[in] F \PSOL_F + * \param[in] rmin \PSOL_range_min + * \param[in] rmax \PSOL_range_max + * \param[in] data \PSOL_solution_array + * \return \ier + */ int cgp_field_write_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, const void *data) { int n; hid_t hid; - cgns_array *field; + cgns_array *field = NULL; CGNS_ENUMT(DataType_t) type; cg = cgi_get_file(fn); @@ -1114,9 +1389,29 @@ int cgp_field_write_data(int fn, int B, int Z, int S, int F, /*---------------------------------------------------------*/ -/* Note: if data == NULL, meaning this processor reads no data, then - only fn, B, Z, S, and F need be set. In this case, Z, S, and F are - "representative" and can point to any valid zone */ +/** + * \ingroup SolutionData + * + * \brief Write shaped array to a subset of flow solution field in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \PSOL_S + * \param[in] F \PSOL_F + * \param[in] rmin \PSOL_range_min + * \param[in] rmax \PSOL_range_max + * \param[in] m_type \PSOL_mem_datatype + * \param[in] m_numdim \PSOL_mem_rank + * \param[in] m_arg_dimvals \PSOL_mem_dimensions + * \param[in] m_rmin \PSOL_mem_range_min + * \param[in] m_rmax \PSOL_mem_range_max + * \param[in] data \PSOL_solution_array + * \return \ier + * \details If \e data == NULL, meaning this processor reads no data, then + * only \e fn,\e B, \e Z, \e S, and \e F need be set. In this case, \e Z, \e S, and \e F are + * "representative" and can point to any valid zone. + */ int cgp_field_general_write_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, CGNS_ENUMT(DataType_t) m_type, @@ -1127,7 +1422,7 @@ int cgp_field_general_write_data(int fn, int B, int Z, int S, int F, int n, ier; hid_t hid; cgns_sol *sol; - cgns_array *field; + cgns_array *field = NULL; /* get memory addresses */ cg = cgi_get_file(fn); @@ -1198,13 +1493,27 @@ int cgp_field_general_write_data(int fn, int B, int Z, int S, int F, } /*---------------------------------------------------------*/ - +/** + * \ingroup SolutionData + * + * \brief Read field data in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \PSOL_S + * \param[in] F \PSOL_F + * \param[in] rmin \PSOL_range_min + * \param[in] rmax \PSOL_range_max + * \param[in] data \PSOL_solution_array + * \return \ier + */ int cgp_field_read_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, void *data) { int n; hid_t hid; - cgns_array *field; + cgns_array *field = NULL; CGNS_ENUMT(DataType_t) type; cg = cgi_get_file(fn); @@ -1238,9 +1547,29 @@ int cgp_field_read_data(int fn, int B, int Z, int S, int F, /*---------------------------------------------------------*/ -/* Note: if data == NULL, meaning this processor reads no data, then - only fn, B, Z, S, and F need be set. In this case, Z, S, and F are - "representative" and can point to any valid zone */ +/** + * \ingroup SolutionData + * + * \brief Read subset of flow solution field to a shaped array in parallel. + * + * \param[in] fn \FILE_fn + * \param[in] B \B_Base + * \param[in] Z \Z_Zone + * \param[in] S \PSOL_S + * \param[in] F \PSOL_F + * \param[in] rmin \PSOL_range_min + * \param[in] rmax \PSOL_range_max + * \param[in] m_type \PSOL_mem_datatype + * \param[in] m_numdim \PSOL_mem_rank + * \param[in] m_arg_dimvals \PSOL_mem_dimensions + * \param[in] m_rmin \PSOL_mem_range_min + * \param[in] m_rmax \PSOL_mem_range_max + * \param[out] data \PSOL_solution_array + * \return \ier + * \details If \e data == NULL, meaning this processor reads no data, then + * only \e fn, \e B, \e Z, \e S, and \e F need be set. In this case, \e Z, \e S, and \e F are + * "representative" and can point to any valid zone. + */ int cgp_field_general_read_data(int fn, int B, int Z, int S, int F, const cgsize_t *rmin, const cgsize_t *rmax, CGNS_ENUMT(DataType_t) m_type, @@ -1251,7 +1580,7 @@ int cgp_field_general_read_data(int fn, int B, int Z, int S, int F, int n, ier; hid_t hid; cgns_sol *sol; - cgns_array *field; + cgns_array *field = NULL; /* get memory addresses */ cg = cgi_get_file(fn); @@ -1321,7 +1650,18 @@ int cgp_field_general_read_data(int fn, int B, int Z, int S, int F, } /*===== Array IO Prototypes ===============================*/ - +/** + * \ingroup ArrayData + * + * \brief Create an array data node. + * + * \param[in] ArrayName \PARR_arrayname + * \param[in] DataType \PARR_datatype + * \param[in] DataDimension \PARR_rank + * \param[in] DimensionVector \PARR_dimensions + * \param[in] A \PARR_A + * \return \ier + */ int cgp_array_write(const char *ArrayName, CGNS_ENUMT(DataType_t) DataType, int DataDimension, const cgsize_t *DimensionVector, int *A) { @@ -1355,7 +1695,17 @@ int cgp_array_write(const char *ArrayName, CGNS_ENUMT(DataType_t) DataType, } /*---------------------------------------------------------*/ - +/** + * \ingroup ArrayData + * + * \brief Write array data in parallel. + * + * \param[in] A \PARR_A + * \param[in] rmin \PARR_range_min + * \param[in] rmax \PARR_range_max + * \param[in] data \PARR_data + * \return \ier + */ int cgp_array_write_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, const void *data) { @@ -1390,9 +1740,26 @@ int cgp_array_write_data(int A, const cgsize_t *rmin, /*---------------------------------------------------------*/ -/* Note: if data == NULL, meaning this processor reads no data, then - only A need be set. In this case, A is "representative" and can point to - any valid array being written by another processor */ +/** + * \ingroup ArrayData + * + * \brief Write shaped array to a subset of data array in parallel. + * + * \param[in] A \PARR_A + * \param[in] rmin \PARR_range_min + * \param[in] rmax \PARR_range_max + * \param[in] m_type \PARR_mem_datatype + * \param[in] m_numdim \PARR_mem_rank + * \param[in] m_arg_dimvals \PARR_mem_dimensions + * \param[in] m_rmin \PARR_mem_range_min + * \param[in] m_rmax \PARR_mem_range_max + * \param[out] data \PARR_data + * \return \ier + * \details If \e data == NULL, meaning this processor reads no data, then + * only \e A need be set. In this case, \e A is "representative" and can point to + * any valid array being written by another processor + * + */ int cgp_array_general_write_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, CGNS_ENUMT(DataType_t) m_type, @@ -1468,7 +1835,17 @@ int cgp_array_general_write_data(int A, } /*---------------------------------------------------------*/ - +/** + * \ingroup ArrayData + * + * \brief Read array data in parallel. + * + * \param[in] A \PARR_A + * \param[in] rmin \PARR_range_min + * \param[in] rmax \PARR_range_max + * \param[in] data \PARR_data + * \return \ier + */ int cgp_array_read_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, void *data) { @@ -1502,9 +1879,25 @@ int cgp_array_read_data(int A, const cgsize_t *rmin, /*---------------------------------------------------------*/ -/* Note: if data == NULL, meaning this processor reads no data, then - only A need be set. In this case, A is "representative" and can point to - any valid array being written by another processor */ +/** + * \ingroup ArrayData + * + * \brief Read subset of data array to a shaped array in parallel. + * + * \param[in] A \PARR_A + * \param[in] rmin \PARR_range_min + * \param[in] rmax \PARR_range_max + * \param[in] m_type \PARR_mem_datatype + * \param[in] m_numdim \PARR_mem_rank + * \param[in] m_arg_dimvals \PARR_mem_dimensions + * \param[in] m_rmin \PARR_mem_range_min + * \param[in] m_rmax \PARR_mem_range_max + * \param[out] data \PARR_data + * \return \ier + * \details If \e data == NULL, meaning this processor reads no data, then + only \e A need be set. In this case, \e A is "representative" and can point to + any valid array being written by another processor. + */ int cgp_array_general_read_data(int A, const cgsize_t *rmin, const cgsize_t *rmax, CGNS_ENUMT(DataType_t) m_type, @@ -1579,17 +1972,18 @@ int cgp_array_general_read_data(int A, dataset, CG_PAR_READ); } +/******************************** + Multidataset APIs +*********************************/ -#if HDF5_HAVE_MULTI_DATASETS - -static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_info, +static int readwrite_multi_data_parallel(size_t count, hid_t *dset_id, hid_t *mem_type_id, hid_t *mem_space_id, hid_t *file_space_id, + cg_rw_ptr_t *data, int ndims, const cgsize_t *rmin, const cgsize_t *rmax, enum cg_par_rw rw_mode) { /* * Needs to handle a NULL dataset. MSB */ int k, n; - hid_t data_id, mem_shape_id, data_shape_id, hid; hsize_t *start, *dims; herr_t herr; hid_t plist_id; @@ -1599,24 +1993,24 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf /* convert from CGNS to HDF5 data type */ for (n = 0; n < count; n++) { - switch ((CGNS_ENUMT(DataType_t))multi_info[n].mem_type_id) { + switch ((CGNS_ENUMT(DataType_t))mem_type_id[n]) { case CGNS_ENUMV(Character): - multi_info[n].mem_type_id = H5T_NATIVE_CHAR; + mem_type_id[n] = H5T_NATIVE_CHAR; break; case CGNS_ENUMV(Integer): - multi_info[n].mem_type_id = H5T_NATIVE_INT32; + mem_type_id[n] = H5T_NATIVE_INT32; break; case CGNS_ENUMV(LongInteger): - multi_info[n].mem_type_id = H5T_NATIVE_INT64; + mem_type_id[n] = H5T_NATIVE_INT64; break; case CGNS_ENUMV(RealSingle): - multi_info[n].mem_type_id = H5T_NATIVE_FLOAT; + mem_type_id[n] = H5T_NATIVE_FLOAT; break; case CGNS_ENUMV(RealDouble): - multi_info[n].mem_type_id = H5T_NATIVE_DOUBLE; + mem_type_id[n] = H5T_NATIVE_DOUBLE; break; default: - cgi_error("unhandled data type %d\n", multi_info[n].mem_type_id); + cgi_error("unhandled data type %ld\n", mem_type_id[n]); free(start); free(dims); return CG_ERROR; @@ -1632,8 +2026,8 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf for (k = 0; k < count; k++) { /* Create a shape for the data in memory */ - multi_info[k].mem_space_id = H5Screate_simple(ndims, dims, NULL); - if (multi_info[k].mem_space_id < 0) { + mem_space_id[k] = H5Screate_simple(ndims, dims, NULL); + if (mem_space_id[k] < 0) { cgi_error("H5Screate_simple() failed"); free(start); free(dims); @@ -1641,8 +2035,8 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf } /* Open the data */ - if ((multi_info[k].dset_id = H5Dopen2(multi_info[k].dset_id, " data", H5P_DEFAULT)) < 0) { - H5Sclose(multi_info[k].mem_space_id); /** needs loop **/ + if ((dset_id[k] = H5Dopen2(dset_id[k], " data", H5P_DEFAULT)) < 0) { + H5Sclose(mem_space_id[k]); /** needs loop **/ cgi_error("H5Dopen2() failed"); free(start); free(dims); @@ -1650,10 +2044,10 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf } /* Create a shape for the data in the file */ - multi_info[k].dset_space_id = H5Dget_space(multi_info[k].dset_id); - if (multi_info[k].dset_space_id < 0) { - H5Sclose(multi_info[k].mem_space_id); - H5Dclose(multi_info[k].dset_id); + file_space_id[k] = H5Dget_space(dset_id[k]); + if (file_space_id[k] < 0) { + H5Sclose(mem_space_id[k]); + H5Dclose(dset_id[k]); cgi_error("H5Dget_space() failed"); free(start); free(dims); @@ -1661,12 +2055,11 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf } /* Select a section of the array in the file */ - herr = H5Sselect_hyperslab(multi_info[k].dset_space_id, H5S_SELECT_SET, start, + herr = H5Sselect_hyperslab(file_space_id[k], H5S_SELECT_SET, start, NULL, dims, NULL); if (herr < 0) { - H5Sclose(data_shape_id); - H5Sclose(mem_shape_id); - H5Dclose(data_id); + H5Sclose(mem_space_id[k]); + H5Dclose(dset_id[k]); cgi_error("H5Sselect_hyperslab() failed"); free(start); free(dims); @@ -1677,9 +2070,6 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf /* Set the access property list for data transfer */ plist_id = H5Pcreate(H5P_DATASET_XFER); if (plist_id < 0) { - H5Sclose(data_shape_id); - H5Sclose(mem_shape_id); - H5Dclose(data_id); cgi_error("H5Pcreate() failed"); free(start); free(dims); @@ -1690,31 +2080,43 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf herr = H5Pset_dxpl_mpio(plist_id, ctx_cgio.default_pio_mode); if (herr < 0) { H5Pclose(plist_id); - H5Sclose(data_shape_id); - H5Sclose(mem_shape_id); - H5Dclose(data_id); cgi_error("H5Pset_dxpl_mpio() failed"); free(start); free(dims); return CG_ERROR; } + /* If HDF5 does not support multi-dataset APIs, then resort to doing them one-by-one */ +#if HDF5_HAVE_MULTI_DATASETS /* Read or Write the data in parallel */ if (rw_mode == CG_PAR_READ) { - herr = H5Dread_multi(plist_id, count, multi_info); + herr = H5Dread_multi(count, dset_id, mem_type_id, mem_space_id, file_space_id, plist_id, data[0].u.rbuf); if (herr < 0) { cgi_error("H5Dread_multi() failed"); } } else { - herr = H5Dwrite_multi(plist_id, count, multi_info); + herr = H5Dwrite_multi(count, dset_id, mem_type_id, mem_space_id, file_space_id, plist_id, data[0].u.wbuf); if (herr < 0) { cgi_error("H5Dwrite_multi() failed"); } } +#else + for (k = 0; k < count; k++) { + if (rw_mode == CG_PAR_READ) { + herr = H5Dread(dset_id[k], mem_type_id[k], mem_space_id[k], file_space_id[k], plist_id, data[0].u.rbuf[k]); + if (herr < 0) { + cgi_error("H5Dread_multi() -- pseudo -- failed"); + } + } else { + herr = H5Dwrite(dset_id[k], mem_type_id[k], mem_space_id[k], file_space_id[k], plist_id, data[0].u.wbuf[k]); + if (herr < 0) { + cgi_error("H5Dwrite_multi() -- pseudo -- failed"); + } + } + } +#endif + H5Pclose(plist_id); - H5Sclose(data_shape_id); - H5Sclose(mem_shape_id); - H5Dclose(data_id); free(start); free(dims); return herr < 0 ? CG_ERROR : CG_OK; @@ -1723,72 +2125,97 @@ static int readwrite_multi_data_parallel(size_t count, H5D_rw_multi_t *multi_inf /*------------------- multi-dataset functions --------------------------------------*/ int cgp_coord_multi_read_data(int fn, int B, int Z, int *C, const cgsize_t *rmin, const cgsize_t *rmax, - void *coordsX, void *coordsY, void *coordsZ) + int nsets, void *buf[]) { - int n; - hid_t hid; - cgns_zone *zone; - cgns_zcoor *zcoor; - cgsize_t dims[3]; - cgsize_t index_dim; - CGNS_ENUMT(DataType_t) type[3]; - H5D_rw_multi_t multi_info[3]; + int n; + hid_t hid; + cgns_zone *zone = NULL; + cgns_zcoor *zcoor = NULL; + cgsize_t dims[3]; - cg = cgi_get_file(fn); - if (check_parallel(cg)) return CG_ERROR; + hid_t *dset_id = NULL; + hid_t *mem_type_id = NULL; + hid_t *mem_space_id = NULL; + hid_t *file_space_id = NULL; - if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) - return CG_ERROR; + int status; - zone = cgi_get_zone(cg, B, Z); - if (zone==0) return CG_ERROR; + cg = cgi_get_file(fn); + if (check_parallel(cg)) return CG_ERROR; - zcoor = cgi_get_zcoorGC(cg, B, Z); - if (zcoor==0) return CG_ERROR; + if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) + goto error; - for (n = 0; n < 3; n++) { - if (C[n] > zcoor->ncoords || C[n] <= 0) { - cgi_error("coord number %d invalid",C[n]); - return CG_ERROR; + dset_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_type_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + file_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + + zone = cgi_get_zone(cg, B, Z); + if (zone==0) goto error; + + zcoor = cgi_get_zcoorGC(cg, B, Z); + if (zcoor==0) goto error; + + for (n = 0; n < nsets; n++) { + if (C[n] > zcoor->ncoords || C[n] <= 0) { + cgi_error("coord number %d invalid",C[n]); + goto error; + } } - } - for (n = 0; n < zone->index_dim; n++) { - dims[n] = zone->nijk[n] + zcoor->rind_planes[2*n] + - zcoor->rind_planes[2*n+1]; - if (rmin[n] > rmax[n] || rmin[n] < 1 || rmax[n] > dims[n]) { - cgi_error("Invalid index ranges."); - return CG_ERROR; + for (n = 0; n < zone->index_dim; n++) { + dims[n] = zone->nijk[n] + zcoor->rind_planes[2*n] + + zcoor->rind_planes[2*n+1]; + if (rmin[n] > rmax[n] || rmin[n] < 1 || rmax[n] > dims[n]) { + cgi_error("Invalid index ranges."); + goto error; + } } - } - for (n = 0; n < 3; n++) { - multi_info[n].mem_type_id = cgi_datatype(zcoor->coord[C[n]-1].data_type); - to_HDF_ID(zcoor->coord[C[n]-1].id, hid); - multi_info[n].dset_id = hid; - } + for (n = 0; n < nsets; n++) { + mem_type_id[n] = cgi_datatype(zcoor->coord[C[n]-1].data_type); + to_HDF_ID(zcoor->coord[C[n]-1].id, hid); + dset_id[n] = hid; + } - multi_info[0].u.rbuf = coordsX; - multi_info[1].u.rbuf = coordsY; - multi_info[2].u.rbuf = coordsZ; + cg_rw_ptr_t Data; + Data.u.rbuf = buf; + status = readwrite_multi_data_parallel(nsets, dset_id, mem_type_id, mem_space_id, file_space_id, &Data, + zone->index_dim, rmin, rmax, CG_PAR_READ); - return readwrite_multi_data_parallel(3, multi_info, - zone->index_dim, rmin, rmax, CG_PAR_READ); + return status; + + error: + if(dset_id) + free(dset_id); + if(mem_type_id) + free(mem_type_id); + if(mem_space_id) + free(mem_space_id); + if(file_space_id) + free(file_space_id); + + return CG_ERROR; } /*---------------------------------------------------------*/ int cgp_coord_multi_write_data(int fn, int B, int Z, int *C, const cgsize_t *rmin, const cgsize_t *rmax, - const void *coordsX, const void *coordsY, const void *coordsZ) + int nsets, const void *buf[]) { int n; - cgns_zone *zone; - cgns_zcoor *zcoor; - cgsize_t dims[3]; - cgsize_t index_dim; - CGNS_ENUMT(DataType_t) type[3]; - H5D_rw_multi_t multi_info[3]; hid_t hid; + cgns_zone *zone = NULL; + cgns_zcoor *zcoor = NULL; + cgsize_t dims[3]; + + hid_t *dset_id = NULL; + hid_t *mem_type_id = NULL; + hid_t *mem_space_id = NULL; + hid_t *file_space_id = NULL; + + int status; cg = cgi_get_file(fn); if (check_parallel(cg)) return CG_ERROR; @@ -1796,16 +2223,21 @@ int cgp_coord_multi_write_data(int fn, int B, int Z, int *C, const cgsize_t *rmi if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; + dset_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_type_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + file_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + zone = cgi_get_zone(cg, B, Z); - if (zone==0) return CG_ERROR; + if (zone==0) goto error; zcoor = cgi_get_zcoorGC(cg, B, Z); - if (zcoor==0) return CG_ERROR; + if (zcoor==0) goto error; - for (n = 0; n < 3; n++) { + for (n = 0; n < nsets; n++) { if (C[n] > zcoor->ncoords || C[n] <= 0) { cgi_error("coord number %d invalid",C[n]); - return CG_ERROR; + goto error; } } @@ -1814,35 +2246,52 @@ int cgp_coord_multi_write_data(int fn, int B, int Z, int *C, const cgsize_t *rmi zcoor->rind_planes[2*n+1]; if (rmin[n] > rmax[n] || rmin[n] < 1 || rmax[n] > dims[n]) { cgi_error("Invalid index ranges."); - return CG_ERROR; + goto error; } } - for (n = 0; n < 3; n++) { - multi_info[n].mem_type_id = cgi_datatype(zcoor->coord[C[n]-1].data_type); + for (n = 0; n < nsets; n++) { + mem_type_id[n] = cgi_datatype(zcoor->coord[C[n]-1].data_type); to_HDF_ID(zcoor->coord[C[n]-1].id, hid); - multi_info[n].dset_id = hid; + dset_id[n] = hid; } - multi_info[0].u.wbuf = coordsX; - multi_info[1].u.wbuf = coordsY; - multi_info[2].u.wbuf = coordsZ; + cg_rw_ptr_t Data; + Data.u.wbuf = buf; + status = readwrite_multi_data_parallel(nsets, dset_id, mem_type_id, mem_space_id, file_space_id, &Data, + zone->index_dim, rmin, rmax, CG_PAR_WRITE); + + return status; + + error: + if(dset_id) + free(dset_id); + if(mem_type_id) + free(mem_type_id); + if(mem_space_id) + free(mem_space_id); + if(file_space_id) + free(file_space_id); + + return CG_ERROR; - return readwrite_multi_data_parallel(3, multi_info, - zone->index_dim, rmin, rmax, CG_PAR_WRITE); } /*---------------------------------------------------------*/ -int vcgp_field_multi_write_data(int fn, int B, int Z, int S, int *F, - const cgsize_t *rmin, const cgsize_t *rmax, int nsets, va_list ap) +int cgp_field_multi_write_data(int fn, int B, int Z, int S, int *F, + const cgsize_t *rmin, const cgsize_t *rmax, int nsets, const void *buf[]) { int n, m; hid_t hid; - cgns_array *field; - CGNS_ENUMT(DataType_t) type; - H5D_rw_multi_t *multi_info; + cgns_array *field = NULL; + + hid_t *dset_id = NULL; + hid_t *mem_type_id = NULL; + hid_t *mem_space_id = NULL; + hid_t *file_space_id = NULL; + int status; cg = cgi_get_file(fn); @@ -1851,7 +2300,10 @@ int vcgp_field_multi_write_data(int fn, int B, int Z, int S, int *F, if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) return CG_ERROR; - multi_info = (H5D_rw_multi_t *)malloc(nsets*sizeof(H5D_rw_multi_t)); + dset_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_type_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + file_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); for (n = 0; n < nsets; n++) { field = cgi_get_field(cg, B, Z, S, F[n]); @@ -1867,50 +2319,50 @@ int vcgp_field_multi_write_data(int fn, int B, int Z, int S, int *F, } } - multi_info[n].u.wbuf = va_arg(ap, const void *); - - multi_info[n].mem_type_id = cgi_datatype(field->data_type); + mem_type_id[n] = cgi_datatype(field->data_type); to_HDF_ID(field->id,hid); - multi_info[n].dset_id = hid; + dset_id[n] = hid; } - status = readwrite_multi_data_parallel(nsets, multi_info, + cg_rw_ptr_t Data; + Data.u.wbuf = buf; + status = readwrite_multi_data_parallel(nsets, dset_id, mem_type_id, mem_space_id, file_space_id, &Data, field->data_dim, rmin, rmax, CG_PAR_WRITE); - free(multi_info); + free(dset_id); + free(mem_type_id); + free(mem_space_id); + free(file_space_id); return status; error: - if(multi_info) - free(multi_info); + if(dset_id) + free(dset_id); + if(mem_type_id) + free(mem_type_id); + if(mem_space_id) + free(mem_space_id); + if(file_space_id) + free(file_space_id); return CG_ERROR; } -int cgp_field_multi_write_data(int fn, int B, int Z, int S, int *F, - const cgsize_t *rmin, const cgsize_t *rmax, int nsets, ...) -{ - va_list ap; - int status; - va_start(ap, nsets); - status = vcgp_field_multi_write_data(fn, B, Z, S, F, rmin, rmax, nsets, ap); - va_end(ap); - return status; - -} - - /*---------------------------------------------------------*/ -int vcgp_field_multi_read_data(int fn, int B, int Z, int S, int *F, - const cgsize_t *rmin, const cgsize_t *rmax, int nsets, va_list ap) +int cgp_field_multi_read_data(int fn, int B, int Z, int S, int *F, + const cgsize_t *rmin, const cgsize_t *rmax, int nsets, void *buf[]) { int n, m; hid_t hid; - cgns_array *field; - CGNS_ENUMT(DataType_t) type; - H5D_rw_multi_t *multi_info; + cgns_array *field = NULL; + + hid_t *dset_id; + hid_t *mem_type_id; + hid_t *mem_space_id; + hid_t *file_space_id; + int status; cg = cgi_get_file(fn); @@ -1919,7 +2371,10 @@ int vcgp_field_multi_read_data(int fn, int B, int Z, int S, int *F, if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) return CG_ERROR; - multi_info = (H5D_rw_multi_t *)malloc(nsets*sizeof(H5D_rw_multi_t)); + dset_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_type_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + file_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); for (n = 0; n < nsets; n++) { @@ -1935,54 +2390,60 @@ int vcgp_field_multi_read_data(int fn, int B, int Z, int S, int *F, goto error; } } - multi_info[n].u.rbuf = va_arg(ap, void *); - multi_info[n].mem_type_id = cgi_datatype(field->data_type); + mem_type_id[n] = cgi_datatype(field->data_type); to_HDF_ID(field->id,hid); - multi_info[n].dset_id = hid; + dset_id[n] = hid; } - status = readwrite_multi_data_parallel(nsets, multi_info, + cg_rw_ptr_t Data; + Data.u.rbuf = buf; + status = readwrite_multi_data_parallel(nsets, dset_id, mem_type_id, mem_space_id, file_space_id, &Data, field->data_dim, rmin, rmax, CG_PAR_READ); - free(multi_info); + + free(dset_id); + free(mem_type_id); + free(mem_space_id); + free(file_space_id); return status; error: - if(multi_info) - free(multi_info); + if(dset_id) + free(dset_id); + if(mem_type_id) + free(mem_type_id); + if(mem_space_id) + free(mem_space_id); + if(file_space_id) + free(file_space_id); return CG_ERROR; } -int cgp_field_multi_read_data(int fn, int B, int Z, int S, int *F, - const cgsize_t *rmin, const cgsize_t *rmax, int nsets, ...) -{ - va_list ap; - int status; - va_start(ap, nsets); - status = vcgp_field_multi_read_data(fn, B, Z, S, F, rmin, rmax, nsets, ap); - va_end(ap); - return status; - -} - /*---------------------------------------------------------*/ -int vcgp_array_multi_write_data(int fn, int *A, const cgsize_t *rmin, - const cgsize_t *rmax, int nsets, va_list ap) +int cgp_array_multi_write_data(int fn, int *A, const cgsize_t *rmin, + const cgsize_t *rmax, int nsets, const void *buf[]) { int n, m, ierr = 0; hid_t hid; - cgns_array *array; - CGNS_ENUMT(DataType_t) type; - H5D_rw_multi_t *multi_info; + cgns_array *array = NULL; + + hid_t *dset_id; + hid_t *mem_type_id; + hid_t *mem_space_id; + hid_t *file_space_id; + int status; cg = cgi_get_file(fn); if (check_parallel(cg)) return CG_ERROR; - multi_info = (H5D_rw_multi_t *)malloc(nsets*sizeof(H5D_rw_multi_t)); + dset_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_type_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + file_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); for (n = 0; n < nsets; n++) { @@ -1999,55 +2460,60 @@ int vcgp_array_multi_write_data(int fn, int *A, const cgsize_t *rmin, } } - multi_info[n].u.wbuf = va_arg(ap, const void *); - - multi_info[n].mem_type_id = cgi_datatype(array->data_type); + mem_type_id[n] = cgi_datatype(array->data_type); to_HDF_ID(array->id, hid); - multi_info[n].dset_id = hid; + dset_id[n] = hid; } - status = readwrite_multi_data_parallel(nsets, multi_info, + cg_rw_ptr_t Data; + Data.u.wbuf = buf; + status = readwrite_multi_data_parallel(nsets, dset_id, mem_type_id, mem_space_id, file_space_id, &Data, array->data_dim, rmin, rmax, CG_PAR_WRITE); - free(multi_info); + free(dset_id); + free(mem_type_id); + free(mem_space_id); + free(file_space_id); return status; error: - if(multi_info) - free(multi_info); - - return CG_ERROR; -} - -int cgp_array_multi_write_data(int fn, int *A, const cgsize_t *rmin, - const cgsize_t *rmax, int nsets, ...) -{ - va_list ap; - int status; - va_start(ap, nsets); - status = vcgp_array_multi_write_data(fn, A, rmin, rmax, nsets, ap); - va_end(ap); - return status; + if(dset_id) + free(dset_id); + if(mem_type_id) + free(mem_type_id); + if(mem_space_id) + free(mem_space_id); + if(file_space_id) + free(file_space_id); + return CG_ERROR; } /*---------------------------------------------------------*/ -int vcgp_array_multi_read_data(int fn, int *A, const cgsize_t *rmin, - const cgsize_t *rmax, int nsets, va_list ap) +int cgp_array_multi_read_data(int fn, int *A, const cgsize_t *rmin, + const cgsize_t *rmax, int nsets, void *buf[]) { int n, m, ierr = 0; hid_t hid; - cgns_array *array; - CGNS_ENUMT(DataType_t) type; - H5D_rw_multi_t *multi_info; + cgns_array *array = NULL; + + hid_t *dset_id; + hid_t *mem_type_id; + hid_t *mem_space_id; + hid_t *file_space_id; + int status; cg = cgi_get_file(fn); if (check_parallel(cg)) return CG_ERROR; - multi_info = (H5D_rw_multi_t *)malloc(nsets*sizeof(H5D_rw_multi_t)); + + dset_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_type_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + mem_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); + file_space_id = (hid_t *)malloc(nsets*sizeof(hid_t)); for (n = 0; n < nsets; n++) { @@ -2063,36 +2529,159 @@ int vcgp_array_multi_read_data(int fn, int *A, const cgsize_t *rmin, goto error; } } - multi_info[n].u.rbuf = va_arg(ap, void *); - multi_info[n].mem_type_id = cgi_datatype(array->data_type); + mem_type_id[n] = cgi_datatype(array->data_type); to_HDF_ID(array->id, hid); - multi_info[n].dset_id = hid; + dset_id[n] = hid; } - status = readwrite_multi_data_parallel(nsets, multi_info, + + cg_rw_ptr_t Data; + Data.u.rbuf = buf; + status = readwrite_multi_data_parallel(nsets, dset_id, mem_type_id, mem_space_id, file_space_id, &Data, array->data_dim, rmin, rmax, CG_PAR_READ); - free(multi_info); + free(dset_id); + free(mem_type_id); + free(mem_space_id); + free(file_space_id); return status; error: - if(multi_info) - free(multi_info); + if(dset_id) + free(dset_id); + if(mem_type_id) + free(mem_type_id); + if(mem_space_id) + free(mem_space_id); + if(file_space_id) + free(file_space_id); return CG_ERROR; } -int cgp_array_multi_read_data(int fn, int *A, const cgsize_t *rmin, - const cgsize_t *rmax, int nsets, ...) +/*===== PointList Functions =============================*/ + +/** + * \ingroup PointListData + * + * \brief Write index array to PointList in parallel. + * + * \details Must use functions in @ref AccessingANode to point to a PointSet to read from + * + * \param[in] file_number \FILE_fn + * \param[in] rmin Lower range index in file + * \param[in] rmax Upper range index in file + * \param[in] points Array of points + * \return \ier + */ +int cgp_ptlist_write_data(int file_number, cgsize_t rmin, + cgsize_t end, const cgsize_t *points) { - va_list ap; - int status; - va_start(ap, nsets); - status = vcgp_array_multi_read_data(fn, A, rmin, rmax, nsets, ap); - va_end(ap); - return status; + hid_t hid; + cgns_ptset *ptset; + cgsize_t range_min[2], range_max[2]; + CGNS_ENUMT(DataType_t) type; + + /* get memory address of file */ + cg = cgi_get_file(file_number); + if (check_parallel(cg)) return CG_ERROR; + + if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_WRITE)) + return CG_ERROR; + + if (posit == 0) { + cgi_error("No current position set by cg_goto\n"); + return CG_ERROR; + } + else if (strcmp(posit->label, "IndexArray_t") == 0) { + ptset = (cgns_ptset *) posit->posit; + } else { + cgi_error("Goto not pointing to IndexArray_t, but %s\n", posit->label); + return CG_ERROR; + } + + if (points) { + if (rmin > end || + rmin < 1 || + end > ptset->npts) { + cgi_error("Error in requested point set range."); + return CG_ERROR; + } + } + + range_min[0] = 1; + range_max[0] = 1; + range_min[1] = rmin; + range_max[1] = end; + type = cgi_datatype(ptset->data_type); + to_HDF_ID(ptset->id, hid); + + cg_rw_t Data; + Data.u.wbuf = points; + return readwrite_data_parallel(hid, type, + 2, range_min, range_max, &Data, CG_PAR_WRITE); } -#endif +/** + * \ingroup PointListData + * + * \brief Read index array to PointList in parallel. + * + * \details Must use functions in @ref AccessingANode to point to a PointSet to read from + * + * \param[in] file_number \FILE_fn + * \param[in] rmin Lower range index in file + * \param[in] rmax Upper range index in file + * \param[in] points Array of points + * \return \ier + */ +int cgp_ptlist_read_data(int file_number, cgsize_t rmin, cgsize_t rmax, cgsize_t *points) +{ + hid_t hid; + cgns_ptset *ptset; + cgsize_t range_min[2], range_max[2]; + CGNS_ENUMT(DataType_t) type; + + /* get memory address of file */ + cg = cgi_get_file(file_number); + if (check_parallel(cg)) return CG_ERROR; + + if (cgi_check_mode(cg->filename, cg->mode, CG_MODE_READ)) + return CG_ERROR; + + if (posit == 0) { + cgi_error("No current position set by cg_goto\n"); + return CG_ERROR; + } + else if (strcmp(posit->label, "IndexArray_t") == 0) { + ptset = (cgns_ptset *) posit->posit; + } else { + cgi_error("Goto not pointing to IndexArray_t, but %s\n", posit->label); + return CG_ERROR; + } + + if (points) { + if (rmin > rmax || + rmin < 1 || + rmax > ptset->npts) { + cgi_error("Error in requested point set range."); + return CG_ERROR; + } + } + + range_min[0] = 1; + range_max[0] = 1; + range_min[1] = rmin; + range_max[1] = rmax; + type = cgi_datatype(ptset->data_type); + + to_HDF_ID(ptset->id, hid); + + cg_rw_t Data; + Data.u.rbuf = points; + return readwrite_data_parallel(hid, type, + 2, range_min, range_max, &Data, CG_PAR_READ); +} +/*---------------------------------------------------------*/ diff --git a/externals/cgns/pcgnslib.h b/externals/cgns/pcgnslib.h index 5f96aa6bb5e..542b0a73e2b 100644 --- a/externals/cgns/pcgnslib.h +++ b/externals/cgns/pcgnslib.h @@ -78,10 +78,10 @@ CGNSDLL int cgp_coord_general_read_data(int fn, int B, int Z, int C, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *coords); CGNSDLL int cgp_coord_multi_read_data(int fn, int B, int Z, int *C, const cgsize_t *rmin, const cgsize_t *rmax, - void *coordsX, void *coordsY, void *coordsZ); + int nsets, void **buf); CGNSDLL int cgp_coord_multi_write_data(int fn, int B, int Z, int *C, const cgsize_t *rmin, const cgsize_t *rmax, - const void *coordsX, const void *coordsY, const void *coordsZ); + int nsets, const void **buf); /*===== Unstructured Grid Prototypes =====*/ @@ -123,11 +123,12 @@ CGNSDLL int cgp_field_general_read_data(int fn, int B, int Z, int S, int F, int m_numdim, const cgsize_t *m_arg_dimvals, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *data); + CGNSDLL int cgp_field_multi_read_data(int fn, int B, int Z, int S, int *F, - const cgsize_t *rmin, const cgsize_t *rmax, int nsets, ...); + const cgsize_t *rmin, const cgsize_t *rmax, int nsets, void **buf); CGNSDLL int cgp_field_multi_write_data(int fn, int B, int Z, int S, int *F, - const cgsize_t *rmin, const cgsize_t *rmax, int nsets, ...); + const cgsize_t *rmin, const cgsize_t *rmax, int nsets, const void **buf); /*===== Array IO Prototypes =====*/ @@ -150,10 +151,16 @@ CGNSDLL int cgp_array_general_read_data(int A, const cgsize_t *m_rmin, const cgsize_t *m_rmax, void *data); CGNSDLL int cgp_array_multi_write_data(int fn, int *A, const cgsize_t *rmin, - const cgsize_t *rmax, int nsets, ...); + const cgsize_t *rmax, int nsets, const void **buf); CGNSDLL int cgp_array_multi_read_data(int fn, int *A, const cgsize_t *rmin, - const cgsize_t *rmax, int nsets, ...); + const cgsize_t *rmax, int nsets, void **buf); + + +/*===== PointList Prototypes =====*/ +CGNSDLL int cgp_ptlist_write_data(int file_number, cgsize_t start, + cgsize_t end, const cgsize_t *points); +CGNSDLL int cgp_ptlist_read_data(int file_number, cgsize_t start, cgsize_t end, cgsize_t *points); /*===== exit with error and call MPI_Abort =====*/ From 87554b3d33407949fabfa2ed0c3ab9f19678b325 Mon Sep 17 00:00:00 2001 From: rois1995 <43813346+rois1995@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:15:23 +0100 Subject: [PATCH 128/139] Update TestCases/parallel_regression.py Co-authored-by: Mickael PHILIT --- TestCases/parallel_regression.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 481f355e9eb..80591acdf91 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1560,14 +1560,14 @@ def main(): ##################### # CGNS writer - CGNSWrite = TestCase('CGNSWrite') - CGNSWrite.cfg_dir = "CGNSWrite" - CGNSWrite.cfg_file = "config.cfg" - CGNSWrite.test_iter = 1 - CGNSWrite.test_vals = [-2.974473, 0.665204, 5.068846, -7.003873] - CGNSWrite.command = TestCase.Command("mpirun -n 2", "SU2_CFD") - CGNSWrite.new_output = True - test_list.append(CGNSWrite) + cgns_writer = TestCase('CGNSWrite') + cgns_writer.cfg_dir = "CGNSWrite" + cgns_writer.cfg_file = "config.cfg" + cgns_writer.test_iter = 1 + cgns_writer.test_vals = [-2.974473, 0.665204, 5.068846, -7.003873] + cgns_writer.command = TestCase.Command("mpirun -n 2", "SU2_CFD") + cgns_writer.new_output = True + test_list.append(cgns_writer) ###################################### ### RUN TESTS ### From 1b4091ddc176d74b6dd8924326dddf358dd9a23a Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 4 Dec 2023 15:25:04 +0100 Subject: [PATCH 129/139] - Changed name to regression case --- TestCases/{CGNSWrite => cgns_writer}/config.cfg | 0 TestCases/parallel_regression.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename TestCases/{CGNSWrite => cgns_writer}/config.cfg (100%) diff --git a/TestCases/CGNSWrite/config.cfg b/TestCases/cgns_writer/config.cfg similarity index 100% rename from TestCases/CGNSWrite/config.cfg rename to TestCases/cgns_writer/config.cfg diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 80591acdf91..e1acb128581 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1560,8 +1560,8 @@ def main(): ##################### # CGNS writer - cgns_writer = TestCase('CGNSWrite') - cgns_writer.cfg_dir = "CGNSWrite" + cgns_writer = TestCase('cgns_writer') + cgns_writer.cfg_dir = "cgns_writer" cgns_writer.cfg_file = "config.cfg" cgns_writer.test_iter = 1 cgns_writer.test_vals = [-2.974473, 0.665204, 5.068846, -7.003873] From 87f99447b48bfd449225b6d12b2d1df43fffa889 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 5 Dec 2023 08:49:16 +0100 Subject: [PATCH 130/139] - Removed comments from regression config --- TestCases/cgns_writer/config.cfg | 103 ++----------------------------- 1 file changed, 6 insertions(+), 97 deletions(-) diff --git a/TestCases/cgns_writer/config.cfg b/TestCases/cgns_writer/config.cfg index bfad06bafd9..12930ef75c9 100644 --- a/TestCases/cgns_writer/config.cfg +++ b/TestCases/cgns_writer/config.cfg @@ -1,144 +1,73 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file % -% Case description: Transonic simulation RAE2822 (RANS) % -% Author: Francisco Palacios % -% Institution: Stanford University % -% Date: 5/15/2013 % -% File Version 7.4.0 "Blackbird" % +% Case description: Subsonic U-Turn % +% Author: Andrea Rausa % +% Institution: Politecnico di Milano % +% Date: 12/2/2023 % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -% Physical governing equations (EULER, NAVIER_STOKES, -% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, -% POISSON_EQUATION) SOLVER= RANS -% -% Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST -% -% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) MATH_PROBLEM= DIRECT -% -% Restart solution (NO, YES) RESTART_SOL= NO % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % -% Mach number (non-dimensional, based on the free-stream values) MACH_NUMBER= 0.2 -% AirSpeed = 279.9663 -% Density = 1.225 -% -% Angle of attack (degrees, only for compressible flows) AOA= 0.0 -% Free-stream temperature (288.15 K by default) FREESTREAM_TEMPERATURE= 270.0 -% -% Reynolds number (non-dimensional, based on the free-stream values) REYNOLDS_NUMBER= 3.28E6 -% -% Reynolds length (1 m by default) REYNOLDS_LENGTH= 1 REF_DIMENSIONALIZATION= FREESTREAM_VEL_EQ_MACH % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % -% Reference origin for moment computation REF_ORIGIN_MOMENT_X = -0.2473 REF_ORIGIN_MOMENT_Y = 0.00 REF_ORIGIN_MOMENT_Z = 0.00 -% -% Reference length for pitching, rolling, and yawing non-dimensional moment REF_LENGTH= 1 -% -% Reference area for force coefficients (0 implies automatic calculation) -% Body tube cross-area REF_AREA= 1 % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % -% Navier-Stokes wall boundary marker(s) (NONE = no marker) MARKER_HEATFLUX= ( OuterWall, 0.0, InnerWall, 0.0 ) -% -% Farfield boundary marker(s) (NONE = no marker) MARKER_FAR= ( Inlet, Outlet ) - -% -% -% Marker(s) of the surface to be plotted or designed MARKER_PLOTTING= ( InnerWall ) -% -% Marker(s) of the surface where the functional (Cd, Cl, etc.) will be evaluated MARKER_MONITORING= ( InnerWall ) - % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % LINEAR_SOLVER= FGMRES LINEAR_SOLVER_PREC= ILU LINEAR_SOLVER_ERROR= 1.0e-6 -% lower memory consumption: LINEAR_SOLVER_ITER= 15 -% + % -------------------------- MULTIGRID PARAMETERS -----------------------------% % - -NEWTON_KRYLOV= NO -NEWTON_KRYLOV_IPARAM= (10, 5, 2) % n0, np, ft -NEWTON_KRYLOV_DPARAM= (1.0, 0.01, -6, 1e-5) % r0, tp, rf, e CFL_ADAPT= YES CFL_NUMBER= 1 CFL_REDUCTION_TURB= 1.0 -% CFL_ADAPT_PARAM= ( 0.5, 1.01, 1.0, 5, 0.0001) - ITER= 1 -MGLEVEL= 0 -% -MGCYCLE= V_CYCLE -MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) -MG_POST_SMOOTH= ( 1, 1, 1, 1 ) -MG_CORRECTION_SMOOTH= ( 1, 1, 1, 1 ) -MG_DAMP_RESTRICTION= 0.5 -MG_DAMP_PROLONGATION= 0.5 - % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, -% TURKEL_PREC, MSW) CONV_NUM_METHOD_FLOW= ROE USE_VECTORIZATION= YES -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_FLOW= NO -% -% Slope limiter (VENKATAKRISHNAN, MINMOD) SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -% -% Coefficient for the limiter (smooth regions) VENKAT_LIMITER_COEFF= 0.03 -% -% 2nd and 4th order artificial dissipation coefficients -JST_SENSOR_COEFF= ( 0.5, 0.02 ) -% -% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT) TIME_DISCRE_FLOW= EULER_IMPLICIT % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % -% Convective numerical method (SCALAR_UPWIND) CONV_NUM_METHOD_TURB= SCALAR_UPWIND -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the turbulence equations. -% Required for 2nd order upwind schemes (NO, YES) MUSCL_TURB= NO -% -% Time discretization (EULER_IMPLICIT) TIME_DISCRE_TURB= EULER_IMPLICIT @@ -148,38 +77,18 @@ CONV_FIELD= MOMENT_X CONV_STARTITER= 10 CONV_CAUCHY_ELEMS= 100 CONV_CAUCHY_EPS= 1E-6 -% % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % -% Mesh input file MESH_FILENAME= mesh.su2 -% -% Mesh input file format (SU2, CGNS, NETCDF_ASCII) MESH_FORMAT= SU2 -% -% Restart flow input file SOLUTION_FILENAME= restart_flow -% TABULAR_FORMAT= CSV -% -% Output file convergence history (w/o extension) CONV_FILENAME= history_First -% -% Output file restart flow RESTART_FILENAME= restart_flow -% -% Output file flow (w/o extension) variables VOLUME_FILENAME= flow -% -% Output file surface flow coefficient (w/o extension) SURFACE_FILENAME= surface_flow -% -% Writing solution file frequency OUTPUT_WRT_FREQ= 100 -% -% -% Screen output fields SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, LIFT, DRAG, MOMENT_Z) OUTPUT_FILES= (SURFACE_CGNS) WRT_FORCES_BREAKDOWN= NO From f457da5e0e04f0eca60a8e7b9b1a86487694b4f5 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 5 Dec 2023 15:00:42 +0100 Subject: [PATCH 131/139] - Format spaces in parallel_regression.py --- TestCases/parallel_regression.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index e1acb128581..f11842ae25c 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1560,13 +1560,13 @@ def main(): ##################### # CGNS writer - cgns_writer = TestCase('cgns_writer') - cgns_writer.cfg_dir = "cgns_writer" - cgns_writer.cfg_file = "config.cfg" - cgns_writer.test_iter = 1 - cgns_writer.test_vals = [-2.974473, 0.665204, 5.068846, -7.003873] - cgns_writer.command = TestCase.Command("mpirun -n 2", "SU2_CFD") - cgns_writer.new_output = True + cgns_writer = TestCase('cgns_writer') + cgns_writer.cfg_dir = "cgns_writer" + cgns_writer.cfg_file = "config.cfg" + cgns_writer.test_iter = 1 + cgns_writer.test_vals = [-2.974473, 0.665204, 5.068846, -7.003873] + cgns_writer.command = TestCase.Command("mpirun -n 2", "SU2_CFD") + cgns_writer.new_output = True test_list.append(cgns_writer) ###################################### From 224c5017cf3272f2121c7719d7973cb0bde1f856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 5 Dec 2023 18:11:58 +0100 Subject: [PATCH 132/139] Avoid recomputation of final coloring. --- Common/src/geometry/CGeometry.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 08d81daf59f..a3e92cf7045 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3645,17 +3645,17 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien auto lowerEdgeColorGroupSize = 1ul; /* lower bound that is known to work */ while (true) { - const auto currentEdgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); + const auto edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); /*--- if the coloring fails, reduce the color group size ---*/ - if (currentEdgeColoring.empty()) { + if (edgeColoring.empty()) { upperEdgeColorGroupSize = nextEdgeColorGroupSize; nextEdgeColorGroupSize = lowerEdgeColorGroupSize + (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; continue; } const su2double currentEfficiency = - coloringEfficiency(currentEdgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); + coloringEfficiency(edgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); /*--- if the coloring is not efficient, reduce the color group size ---*/ if (currentEfficiency < COLORING_EFF_THRESH) { @@ -3675,10 +3675,10 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien } edgeColorGroupSize = nextEdgeColorGroupSize; + } else { + edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); } - edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); - /*--- If the coloring fails use the natural coloring. This is a * "soft" failure as this "bad" coloring should be detected * downstream and a fallback strategy put in place. ---*/ From df30b2f0fc6dd7461cfedab7bcb27e0ad71da30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 5 Dec 2023 18:12:52 +0100 Subject: [PATCH 133/139] Fix edge color group size. --- Common/src/geometry/CGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index a3e92cf7045..b603786dcaf 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3645,7 +3645,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien auto lowerEdgeColorGroupSize = 1ul; /* lower bound that is known to work */ while (true) { - const auto edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); + const auto edgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); /*--- if the coloring fails, reduce the color group size ---*/ if (edgeColoring.empty()) { From 81f834b2ddd708d655a8b0f6598797458e28c23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 5 Dec 2023 18:55:02 +0100 Subject: [PATCH 134/139] Comment formatting. --- Common/src/geometry/CGeometry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index b603786dcaf..58fbfc42da6 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3638,7 +3638,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- Color the edges. ---*/ constexpr bool balanceColors = true; - /*--- if requested, find an efficient coloring with maximum color group size (up to edgeColorGroupSize) ---*/ + /*--- If requested, find an efficient coloring with maximum color group size (up to edgeColorGroupSize). ---*/ if (maximizeEdgeColorGroupSize) { auto upperEdgeColorGroupSize = edgeColorGroupSize + 1; /* upper bound that is deemed too large */ auto nextEdgeColorGroupSize = edgeColorGroupSize; /* next value that we are going to try */ @@ -3647,7 +3647,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien while (true) { const auto edgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); - /*--- if the coloring fails, reduce the color group size ---*/ + /*--- If the coloring fails, reduce the color group size. ---*/ if (edgeColoring.empty()) { upperEdgeColorGroupSize = nextEdgeColorGroupSize; nextEdgeColorGroupSize = lowerEdgeColorGroupSize + (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; @@ -3657,11 +3657,11 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien const su2double currentEfficiency = coloringEfficiency(edgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); - /*--- if the coloring is not efficient, reduce the color group size ---*/ + /*--- If the coloring is not efficient, reduce the color group size. ---*/ if (currentEfficiency < COLORING_EFF_THRESH) { upperEdgeColorGroupSize = nextEdgeColorGroupSize; } - /*--- otherwise, try to enlarge the color group size ---*/ + /*--- Otherwise, enlarge the color group size. ---*/ else { lowerEdgeColorGroupSize = nextEdgeColorGroupSize; } From 799c9bb5555928091182f381d78b39799c5fc0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 5 Dec 2023 19:00:20 +0100 Subject: [PATCH 135/139] Ensure that failed colorings reach the terminating condition. --- Common/src/geometry/CGeometry.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 58fbfc42da6..a2b02ac27f9 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3650,23 +3650,23 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- If the coloring fails, reduce the color group size. ---*/ if (edgeColoring.empty()) { upperEdgeColorGroupSize = nextEdgeColorGroupSize; - nextEdgeColorGroupSize = lowerEdgeColorGroupSize + (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; - continue; } - - const su2double currentEfficiency = - coloringEfficiency(edgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); - - /*--- If the coloring is not efficient, reduce the color group size. ---*/ - if (currentEfficiency < COLORING_EFF_THRESH) { - upperEdgeColorGroupSize = nextEdgeColorGroupSize; - } - /*--- Otherwise, enlarge the color group size. ---*/ + /*--- If the coloring succeeds, check the efficiency. ---*/ else { - lowerEdgeColorGroupSize = nextEdgeColorGroupSize; + const su2double currentEfficiency = + coloringEfficiency(edgeColoring, omp_get_max_threads(), nextEdgeColorGroupSize); + + /*--- If the coloring is not efficient, reduce the color group size. ---*/ + if (currentEfficiency < COLORING_EFF_THRESH) { + upperEdgeColorGroupSize = nextEdgeColorGroupSize; + } + /*--- Otherwise, enlarge the color group size. ---*/ + else { + lowerEdgeColorGroupSize = nextEdgeColorGroupSize; + } } - const auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; + const auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; nextEdgeColorGroupSize = lowerEdgeColorGroupSize + increment; if (increment == 0) { From de3b94e24b9c088067a47ae68454a80e133c41ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 5 Dec 2023 19:03:17 +0100 Subject: [PATCH 136/139] Add comment. --- Common/src/geometry/CGeometry.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index a2b02ac27f9..404ff102c56 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3669,6 +3669,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien const auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2; nextEdgeColorGroupSize = lowerEdgeColorGroupSize + increment; + /*--- Terminating condition. ---*/ if (increment == 0) { break; } From de941f3f28ba084bd09aabce9bf580ab29dd921f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Tue, 5 Dec 2023 19:17:24 +0100 Subject: [PATCH 137/139] Use member variable directly. --- Common/src/geometry/CGeometry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 404ff102c56..5ce438a33a8 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3645,7 +3645,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien auto lowerEdgeColorGroupSize = 1ul; /* lower bound that is known to work */ while (true) { - const auto edgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); + edgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); /*--- If the coloring fails, reduce the color group size. ---*/ if (edgeColoring.empty()) { From aec3aabae4539192154ad2cd6c47932ea4c0e504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Bl=C3=BChdorn?= Date: Wed, 6 Dec 2023 16:46:10 +0100 Subject: [PATCH 138/139] Avoid recomputation if last coloring was admissible. --- Common/src/geometry/CGeometry.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 5ce438a33a8..aeca6421763 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3644,12 +3644,15 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien auto nextEdgeColorGroupSize = edgeColorGroupSize; /* next value that we are going to try */ auto lowerEdgeColorGroupSize = 1ul; /* lower bound that is known to work */ + bool admissibleColoring = false; /* keep track wether the last tested coloring is admissible */ + while (true) { edgeColoring = colorSparsePattern(pattern, nextEdgeColorGroupSize, balanceColors); /*--- If the coloring fails, reduce the color group size. ---*/ if (edgeColoring.empty()) { upperEdgeColorGroupSize = nextEdgeColorGroupSize; + admissibleColoring = false; } /*--- If the coloring succeeds, check the efficiency. ---*/ else { @@ -3659,10 +3662,12 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien /*--- If the coloring is not efficient, reduce the color group size. ---*/ if (currentEfficiency < COLORING_EFF_THRESH) { upperEdgeColorGroupSize = nextEdgeColorGroupSize; + admissibleColoring = false; } /*--- Otherwise, enlarge the color group size. ---*/ else { lowerEdgeColorGroupSize = nextEdgeColorGroupSize; + admissibleColoring = true; } } @@ -3676,7 +3681,14 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien } edgeColorGroupSize = nextEdgeColorGroupSize; - } else { + + /*--- If the last tested coloring was not admissible, recompute the final coloring. ---*/ + if (!admissibleColoring) { + edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); + } + } + /*--- No adaptivity. ---*/ + else { edgeColoring = colorSparsePattern(pattern, edgeColorGroupSize, balanceColors); } From 8b89e857ff72782b0caccc3f63385c03bc67f6f7 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Wed, 6 Dec 2023 15:01:13 -0800 Subject: [PATCH 139/139] fix submodules --- externals/codi | 2 +- externals/mel | 2 +- subprojects/CoolProp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/externals/codi b/externals/codi index 17232fed052..0ad036f2c82 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit 17232fed05245dbb8f04a31e274a02d53458c75c +Subproject commit 0ad036f2c8254fa7b77180a443d99248c047c877 diff --git a/externals/mel b/externals/mel index 2484cd3258e..46205ab019e 160000 --- a/externals/mel +++ b/externals/mel @@ -1 +1 @@ -Subproject commit 2484cd3258ef800a10e361016cb341834ee7930b +Subproject commit 46205ab019e5224559091375a6d71aabae6bc5b9 diff --git a/subprojects/CoolProp b/subprojects/CoolProp index 0ce42fcf3bb..bafdea1f39e 160000 --- a/subprojects/CoolProp +++ b/subprojects/CoolProp @@ -1 +1 @@ -Subproject commit 0ce42fcf3bb2c373512bc825a4f0c1973a78f307 +Subproject commit bafdea1f39ee873a6bb9833e3a21fe41f90b85e8