Skip to content

Commit 77359c6

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into fix_resource_not_released_in_dtor
2 parents 6f70ec0 + cd4ecca commit 77359c6

8 files changed

Lines changed: 45 additions & 134 deletions

File tree

AUTHORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Andrew Wendorff
5454
Aniket C. Aranake
5555
Antonio Rubino
5656
Arne Bachmann
57+
Arne Voß
5758
Beckett Y. Zhou
5859
Benjamin S. Kirk
5960
Brendan Tracey
@@ -91,6 +92,7 @@ JonathanSmith1936
9192
Kedar Naik
9293
LaSerpe
9394
Lennaert Tol
95+
Lisa Kusch
9496
Matteo Pini
9597
Max Aehle
9698
Max Le

Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ class CCGNSMeshReaderFVM: public CMeshReaderFVM {
4545

4646
#ifdef HAVE_CGNS
4747
int cgnsFileID; /*!< \brief CGNS file identifier. */
48-
int cgnsBase; /*!< \brief CGNS database index. */
49-
int cgnsZone; /*!< \brief CGNS zone index. */
48+
const int cgnsBase = 1; /*!< \brief CGNS database index (the CGNS reader currently assumes a single database). */
49+
const int cgnsZone = 1; /*!< \brief CGNS zone index (and 1 zone in that database). */
5050

51-
int nZones; /*!< \brief Total number of zones in the CGNS file. */
5251
int nSections; /*!< \brief Total number of sections in the CGNS file. */
5352

5453
vector<bool> isInterior; /*!< \brief Vector of booleans to store whether each section in the CGNS file is an interior or boundary section. */

Common/src/CConfig.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,6 +3363,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
33633363
SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= INC_RANS", CURRENT_FUNCTION);
33643364
}
33653365

3366+
/*--- Check if turbulence model can be used for AXISYMMETRIC case---*/
3367+
if (Axisymmetric && Kind_Turb_Model != TURB_MODEL::NONE && Kind_Turb_Model != TURB_MODEL::SST && Kind_Turb_Model != TURB_MODEL::SST_SUST){
3368+
SU2_MPI::Error("Axisymmetry is currently only supported for KIND_TURB_MODEL chosen as SST or SST_SUST", CURRENT_FUNCTION);
3369+
}
3370+
33663371
/*--- Set the boolean Wall_Functions equal to true if there is a
33673372
definition for the wall founctions ---*/
33683373

Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ CCGNSMeshReaderFVM::CCGNSMeshReaderFVM(CConfig *val_config,
3535
: CMeshReaderFVM(val_config, val_iZone, val_nZone) {
3636

3737
#ifdef HAVE_CGNS
38-
/*--- We use val_iZone with +1 for the 1-based indexing in CGNS. ---*/
39-
cgnsZone = val_iZone + 1;
40-
nZones = val_nZone;
41-
42-
/*--- The CGNS reader currently assumes a single database. ---*/
43-
cgnsBase = 1;
4438
OpenCGNSFile(config->GetMesh_FileName());
4539

4640
/*--- Read the basic information about the database and zone(s). ---*/

SU2_CFD/include/numerics/turbulent/turb_sources.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,10 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
599599
if (Coord_i[1] < EPS) return;
600600

601601
AD::SetPreaccIn(Coord_i[1]);
602+
AD::SetPreaccIn(V_i[idx.Velocity() + 1]);
602603

603604
const su2double yinv = 1.0 / Coord_i[1];
604-
const su2double rhov = Density_i * V_i[2];
605+
const su2double rhov = Density_i * V_i[idx.Velocity() + 1];
605606
const su2double& k = ScalarVar_i[0];
606607
const su2double& w = ScalarVar_i[1];
607608

@@ -611,7 +612,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
611612

612613
/*--- Production ---*/
613614
const su2double pk_axi = max(
614-
0.0, 2.0 / 3.0 * rhov * k * ((2.0 * yinv * V_i[2] - PrimVar_Grad_i[2][1] - PrimVar_Grad_i[1][0]) / zeta - 1.0));
615+
0.0, 2.0 / 3.0 * rhov * k * ((2.0 * yinv * V_i[idx.Velocity() + 1] - PrimVar_Grad_i[idx.Velocity()+1][1] - PrimVar_Grad_i[idx.Velocity()][0]) / zeta - 1.0));
615616
const su2double pw_axi = alfa_blended * zeta / k * pk_axi;
616617

617618
/*--- Convection-Diffusion ---*/

SU2_PY/SU2/io/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ def read_config(filename):
829829
def write_config(filename,param_dict):
830830
""" updates an existing config file """
831831

832-
temp_filename = "temp.cfg"
832+
temp_filename = filename+"_tmp"
833833
shutil.copy(filename,temp_filename)
834834
output_file = open(filename,"w")
835835

TestCases/axisymmetric_rans/air_nozzle/air_nozzle.cfg

Lines changed: 16 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -7,205 +7,99 @@
77
% File Version 7.3.0 "Blackbird" %
88
% %
99
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10-
10+
%
1111
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
1212
%
13-
% Physical governing equations (EULER, NAVIER_STOKES,
14-
% FEM_EULER, FEM_NAVIER_STOKES, FEM_RANS, FEM_LES,
15-
% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY,
16-
% POISSON_EQUATION)
1713
SOLVER= RANS
18-
%
19-
% Specify turbulence model (NONE, SA, SA_NEG, SST, SA_E, SA_COMP, SA_E_COMP)
2014
KIND_TURB_MODEL= SST
21-
%
22-
% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT)
23-
MATH_PROBLEM= DIRECT
24-
%
25-
% Restart solution (NO, YES)
2615
RESTART_SOL= YES
2716
%
28-
% System of measurements (SI, US)
29-
% International system of units (SI): ( meters, kilograms, Kelvins,
30-
% Newtons = kg m/s^2, Pascals = N/m^2,
31-
% Density = kg/m^3, Speed = m/s,
32-
% Equiv. Area = m^2 )
33-
% United States customary units (US): ( inches, slug, Rankines, lbf = slug ft/s^2,
34-
% psf = lbf/ft^2, Density = slug/ft^3,
35-
% Speed = ft/s, Equiv. Area = ft^2 )
36-
SYSTEM_MEASUREMENTS= SI
37-
%
3817
AXISYMMETRIC= YES
3918
%
4019
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
4120
%
42-
% Mach number (non-dimensional, based on the free-stream values)
4321
MACH_NUMBER= 1E-9
4422
%
45-
% Angle of attack (degrees, only for compressible flows)
46-
AOA= 0.0
47-
%
48-
% Side-slip angle (degrees, only for compressible flows)
49-
SIDESLIP_ANGLE= 0.0
50-
%
51-
% Init option to choose between Reynolds (default) or thermodynamics quantities
52-
% for initializing the solution (REYNOLDS, TD_CONDITIONS)
5323
INIT_OPTION= TD_CONDITIONS
5424
%
55-
% Free-stream option to choose between density and temperature (default) for
56-
% initializing the solution (TEMPERATURE_FS, DENSITY_FS)
5725
FREESTREAM_OPTION= TEMPERATURE_FS
58-
%
59-
% Free-stream pressure (101325.0 N/m^2, 2116.216 psf by default)
6026
FREESTREAM_PRESSURE= 1400000
61-
%
62-
% Free-stream temperature (288.15 K, 518.67 R by default)
6327
FREESTREAM_TEMPERATURE= 373.15
6428
%
65-
% Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE,
66-
% FREESTREAM_VEL_EQ_MACH, FREESTREAM_VEL_EQ_ONE)
6729
REF_DIMENSIONALIZATION= DIMENSIONAL
68-
30+
%
6931
% ---- IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------%
7032
%
71-
% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS,
72-
% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY)
7333
FLUID_MODEL= STANDARD_AIR
74-
34+
%
7535
% --------------------------- VISCOSITY MODEL ---------------------------------%
7636
%
77-
% Viscosity model (SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY).
7837
VISCOSITY_MODEL= CONSTANT_VISCOSITY
38+
MU_CONSTANT= 1.716E-5
7939
%
80-
% Molecular Viscosity that would be constant (1.716E-5 by default)
81-
MU_CONSTANT= 1.716E-5
82-
8340
% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------%
8441
%
85-
% Laminar Conductivity model (CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL,
86-
% POLYNOMIAL_CONDUCTIVITY).
8742
CONDUCTIVITY_MODEL= CONSTANT_PRANDTL
88-
%
89-
% Laminar Prandtl number (0.72 (air), only for CONSTANT_PRANDTL)
9043
PRANDTL_LAM= 0.72
91-
%
92-
% Turbulent Prandtl number (0.9 (air) by default)
9344
PRANDTL_TURB= 0.90
94-
45+
%
9546
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
9647
%
97-
% Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker)
98-
% Format: ( marker name, constant heat flux (J/m^2), ... )
9948
MARKER_HEATFLUX= ( WALL, 0.0 )
100-
%
101-
% Symmetry boundary marker(s) (NONE = no marker)
10249
MARKER_SYM= ( SYMMETRY )
50+
MARKER_RIEMANN= ( INFLOW, TOTAL_CONDITIONS_PT, 1400000.0, 373.15, 1.0, 0.0, 0.0, \
51+
OUTFLOW, STATIC_PRESSURE, 100000.0, 0.0, 0.0, 0.0, 0.0 )
10352
%
104-
% Riemann boundary marker(s) (NONE = no marker)
105-
% Format: (marker, data kind flag, list of data)
106-
MARKER_RIEMANN= ( INFLOW, TOTAL_CONDITIONS_PT, 1400000.0, 373.15, 1.0, 0.0, 0.0, OUTFLOW, STATIC_PRESSURE, 100000.0, 0.0, 0.0, 0.0, 0.0 )
107-
10853
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
10954
%
110-
% Numerical method for spatial gradients (GREEN_GAUSS, WEIGHTED_LEAST_SQUARES)
11155
NUM_METHOD_GRAD= GREEN_GAUSS
11256
%
113-
% CFL number (initial value for the adaptive CFL number)
11457
CFL_NUMBER= 1000.0
115-
%
116-
% Adaptive CFL number (NO, YES)
11758
CFL_ADAPT= NO
118-
%
119-
% Parameters of the adaptive CFL number (factor down, factor up, CFL min value,
120-
% CFL max value )
121-
CFL_ADAPT_PARAM= ( 0.1, 2.0, 10.0, 1000.0 )
122-
%
123-
% Maximum Delta Time in local time stepping simulations
12459
MAX_DELTA_TIME= 1E6
125-
60+
%
12661
% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------%
12762
%
128-
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations.
129-
% Required for 2nd order upwind schemes (NO, YES)
13063
MUSCL_FLOW= YES
131-
%
132-
% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG,
133-
% BARTH_JESPERSEN, VAN_ALBADA_EDGE)
13464
SLOPE_LIMITER_FLOW= NONE
135-
65+
%
13666
% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%
13767
%
138-
% Linear solver or smoother for implicit formulations (BCGSTAB, FGMRES, SMOOTHER_JACOBI,
139-
% SMOOTHER_ILU, SMOOTHER_LUSGS,
140-
% SMOOTHER_LINELET)
14168
LINEAR_SOLVER= FGMRES
142-
%
143-
% Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI)
14469
LINEAR_SOLVER_PREC= ILU
145-
%
146-
% Linear solver ILU preconditioner fill-in level (0 by default)
14770
LINEAR_SOLVER_ILU_FILL_IN= 0
148-
%
149-
% Minimum error of the linear solver for implicit formulations
15071
LINEAR_SOLVER_ERROR= 0.01
151-
%
152-
% Max number of iterations of the linear solver for the implicit formulation
15372
LINEAR_SOLVER_ITER= 10
154-
73+
%
15574
% -------------------------- MULTIGRID PARAMETERS -----------------------------%
15675
%
157-
% Multi-grid levels (0 = no multi-grid)
15876
MGLEVEL= 0
159-
77+
%
16078
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
16179
%
162-
% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, AUSMPLUSUP, AUSMPLUSUP2, HLLC,
163-
% TURKEL_PREC, MSW, FDS)
16480
CONV_NUM_METHOD_FLOW= ROE
165-
%
166-
% Entropy fix coefficient (0.0 implies no entropy fixing, 1.0 implies scalar
167-
% artificial dissipation)
16881
ENTROPY_FIX_COEFF= 0.1
169-
%
170-
% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT, EULER_EXPLICIT)
17182
TIME_DISCRE_FLOW= EULER_IMPLICIT
17283
%
173-
17484
% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------%
17585
%
176-
% Convective numerical method (SCALAR_UPWIND)
17786
CONV_NUM_METHOD_TURB= SCALAR_UPWIND
178-
%
179-
% Time discretization (EULER_IMPLICIT)
18087
TIME_DISCRE_TURB= EULER_IMPLICIT
181-
%
182-
% Reduction factor of the CFL coefficient in the turbulence problem
18388
CFL_REDUCTION_TURB= 1.0
184-
89+
%
18590
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
18691
%
187-
% Number of total iterations
18892
ITER= 1000
189-
%
190-
% Min value of the residual (log10 of the residual)
19193
CONV_RESIDUAL_MINVAL= -12
192-
%
193-
% Start convergence criteria at iteration number
19494
CONV_STARTITER= 10
195-
95+
%
19696
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
19797
%
198-
% Mesh input file
19998
MESH_FILENAME= nozzle.su2
20099
%
201-
% Mesh input file format (SU2, CGNS)
202-
MESH_FORMAT= SU2
203-
%
204-
% Restart flow input file
205100
SOLUTION_FILENAME= solution_flow.dat
206-
%
207-
% Writing solution file frequency
208101
OUTPUT_WRT_FREQ= 1000
209102
%
210-
% Screen output
211-
SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, RMS_TKE, RMS_DISSIPATION)
103+
% Note: This cfg is used for a primal and adjoint Testcase, therefore both residuals are present here.
104+
SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, RMS_TKE, RMS_DISSIPATION, \
105+
RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, RMS_ADJ_TKE, RMS_ADJ_DISSIPATION)

TestCases/parallel_regression_AD.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,22 @@ def main():
168168
discadj_incomp_turb_NACA0012_sst.tol = 0.00001
169169
test_list.append(discadj_incomp_turb_NACA0012_sst)
170170

171+
####################################################################
172+
### Disc. Adj. Axisymmetric RANS ###
173+
####################################################################
174+
175+
# Adjoint Axisymmetric RANS
176+
discadj_axisymmetric_rans_nozzle = TestCase('discadj_axisymmetric_rans')
177+
discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle"
178+
discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle.cfg"
179+
discadj_axisymmetric_rans_nozzle.test_iter = 10
180+
discadj_axisymmetric_rans_nozzle.test_vals = [-10.391857, -15.524696, -7.715907, -17.350541]
181+
discadj_axisymmetric_rans_nozzle.su2_exec = "mpirun -n 2 SU2_CFD_AD"
182+
discadj_axisymmetric_rans_nozzle.timeout = 1600
183+
discadj_axisymmetric_rans_nozzle.tol = 0.00001
184+
discadj_axisymmetric_rans_nozzle.no_restart = True
185+
test_list.append(discadj_axisymmetric_rans_nozzle)
186+
171187
#######################################################
172188
### Unsteady Disc. adj. compressible RANS ###
173189
#######################################################

0 commit comments

Comments
 (0)