Skip to content

Commit 84354e3

Browse files
committed
Merge branch 'develop' into adaptive_edge_color_group_size
2 parents de941f3 + 086facf commit 84354e3

16 files changed

Lines changed: 5263 additions & 942 deletions

File tree

SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ void CCGNSFileWriter::WriteData(string val_filename) {
3838

3939
/*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/
4040
val_filename.append(fileExt);
41-
4241
/*--- Open the CGNS file for writing. ---*/
4342
InitializeMeshFile(val_filename);
4443

@@ -132,15 +131,16 @@ void CCGNSFileWriter::WriteField(int iField, const string& FieldName) {
132131
/*--- Coordinate vector is written in blocks, one for each process. ---*/
133132
cgsize_t nodeBegin = 1;
134133
auto nodeEnd = static_cast<cgsize_t>(nLocalPoints);
135-
136-
if (isCoord) {
137-
int CoordinateNumber;
138-
CallCGNS(cg_coord_partial_write(cgnsFileID, cgnsBase, cgnsZone, dataType, FieldName.c_str(), &nodeBegin, &nodeEnd,
139-
sendBufferField.data(), &CoordinateNumber));
140-
} else {
141-
int fieldNumber;
142-
CallCGNS(cg_field_partial_write(cgnsFileID, cgnsBase, cgnsZone, cgnsFields, dataType, FieldName.c_str(), &nodeBegin,
143-
&nodeEnd, sendBufferField.data(), &fieldNumber));
134+
if (nLocalPoints > 0) {
135+
if (isCoord) {
136+
int CoordinateNumber;
137+
CallCGNS(cg_coord_partial_write(cgnsFileID, cgnsBase, cgnsZone, dataType, FieldName.c_str(), &nodeBegin, &nodeEnd,
138+
sendBufferField.data(), &CoordinateNumber));
139+
} else {
140+
int fieldNumber;
141+
CallCGNS(cg_field_partial_write(cgnsFileID, cgnsBase, cgnsZone, cgnsFields, dataType, FieldName.c_str(), &nodeBegin,
142+
&nodeEnd, sendBufferField.data(), &fieldNumber));
143+
}
144144
}
145145

146146
for (int i = 0; i < size; ++i) {

TestCases/cgns_writer/config.cfg

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2+
% %
3+
% SU2 configuration file %
4+
% Case description: Subsonic U-Turn %
5+
% Author: Andrea Rausa %
6+
% Institution: Politecnico di Milano %
7+
% Date: 12/2/2023 %
8+
% File Version 8.0.0 "Harrier" %
9+
% %
10+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11+
12+
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
13+
%
14+
SOLVER= RANS
15+
KIND_TURB_MODEL= SST
16+
MATH_PROBLEM= DIRECT
17+
RESTART_SOL= NO
18+
19+
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
20+
%
21+
MACH_NUMBER= 0.2
22+
AOA= 0.0
23+
FREESTREAM_TEMPERATURE= 270.0
24+
REYNOLDS_NUMBER= 3.28E6
25+
REYNOLDS_LENGTH= 1
26+
REF_DIMENSIONALIZATION= FREESTREAM_VEL_EQ_MACH
27+
28+
% ---------------------- REFERENCE VALUE DEFINITION ---------------------------%
29+
%
30+
REF_ORIGIN_MOMENT_X = -0.2473
31+
REF_ORIGIN_MOMENT_Y = 0.00
32+
REF_ORIGIN_MOMENT_Z = 0.00
33+
REF_LENGTH= 1
34+
REF_AREA= 1
35+
36+
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
37+
%
38+
MARKER_HEATFLUX= ( OuterWall, 0.0, InnerWall, 0.0 )
39+
MARKER_FAR= ( Inlet, Outlet )
40+
MARKER_PLOTTING= ( InnerWall )
41+
MARKER_MONITORING= ( InnerWall )
42+
43+
% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%
44+
%
45+
LINEAR_SOLVER= FGMRES
46+
LINEAR_SOLVER_PREC= ILU
47+
LINEAR_SOLVER_ERROR= 1.0e-6
48+
LINEAR_SOLVER_ITER= 15
49+
50+
% -------------------------- MULTIGRID PARAMETERS -----------------------------%
51+
%
52+
CFL_ADAPT= YES
53+
CFL_NUMBER= 1
54+
CFL_REDUCTION_TURB= 1.0
55+
CFL_ADAPT_PARAM= ( 0.5, 1.01, 1.0, 5, 0.0001)
56+
ITER= 1
57+
58+
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
59+
%
60+
CONV_NUM_METHOD_FLOW= ROE
61+
USE_VECTORIZATION= YES
62+
MUSCL_FLOW= NO
63+
SLOPE_LIMITER_FLOW= VENKATAKRISHNAN
64+
VENKAT_LIMITER_COEFF= 0.03
65+
TIME_DISCRE_FLOW= EULER_IMPLICIT
66+
67+
% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------%
68+
%
69+
CONV_NUM_METHOD_TURB= SCALAR_UPWIND
70+
MUSCL_TURB= NO
71+
TIME_DISCRE_TURB= EULER_IMPLICIT
72+
73+
74+
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
75+
%
76+
CONV_FIELD= MOMENT_X
77+
CONV_STARTITER= 10
78+
CONV_CAUCHY_ELEMS= 100
79+
CONV_CAUCHY_EPS= 1E-6
80+
81+
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
82+
%
83+
MESH_FILENAME= mesh.su2
84+
MESH_FORMAT= SU2
85+
SOLUTION_FILENAME= restart_flow
86+
TABULAR_FORMAT= CSV
87+
CONV_FILENAME= history_First
88+
RESTART_FILENAME= restart_flow
89+
VOLUME_FILENAME= flow
90+
SURFACE_FILENAME= surface_flow
91+
OUTPUT_WRT_FREQ= 100
92+
SCREEN_OUTPUT= (INNER_ITER, WALL_TIME, RMS_DENSITY, LIFT, DRAG, MOMENT_Z)
93+
OUTPUT_FILES= (SURFACE_CGNS)
94+
WRT_FORCES_BREAKDOWN= NO
95+
VOLUME_OUTPUT= (COORDINATES)
96+
HISTORY_OUTPUT= (ITER)

TestCases/parallel_regression.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,20 @@ def main():
15551555
species3_multizone_restart.multizone = True
15561556
test_list.append(species3_multizone_restart)
15571557

1558+
#####################
1559+
## CGNS writer ###
1560+
#####################
1561+
1562+
# CGNS writer
1563+
cgns_writer = TestCase('cgns_writer')
1564+
cgns_writer.cfg_dir = "cgns_writer"
1565+
cgns_writer.cfg_file = "config.cfg"
1566+
cgns_writer.test_iter = 1
1567+
cgns_writer.test_vals = [-2.974473, 0.665204, 5.068846, -7.003873]
1568+
cgns_writer.command = TestCase.Command("mpirun -n 2", "SU2_CFD")
1569+
cgns_writer.new_output = True
1570+
test_list.append(cgns_writer)
1571+
15581572
######################################
15591573
### RUN TESTS ###
15601574
######################################

externals/cgns/adf/ADF_interface.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ else { /** this node is NOT a link **/
12091209
CHECK_ADF_ABORT( *error_return ) ;
12101210

12111211
for( i=0; i<num_ids; i++ ) {
1212-
ADF_Delete( ID, ids[i], error_return ) ; /* resursion */
1212+
ADF_Delete( ID, ids[i], error_return ) ; /* recursion */
12131213
CHECK_ADF_ABORT( *error_return ) ;
12141214
} /* end for */
12151215

@@ -1596,7 +1596,7 @@ if ( lenfilename == 0 ) /** no filename **/
15961596
{
15971597
strcpy( name_in_file, &link_data[1] );
15981598
}
1599-
else if ( lenfilename > 0 && lenfilename == strlen( link_data ) )
1599+
else if ( lenfilename == strlen( link_data ) )
16001600
{
16011601
strcpy( file, link_data) ; /** no link ? **/
16021602
}
@@ -1688,7 +1688,7 @@ if ( lenfilename == 0 ) /** no filename **/
16881688
{
16891689
*len_name = (int)strlen(link_data) - 1;
16901690
}
1691-
else if ( lenfilename > 0 && lenfilename == strlen( link_data ) )
1691+
else if ( lenfilename == strlen( link_data ) )
16921692
{
16931693
*len_file = (int)lenfilename;
16941694
}

externals/cgns/adf/ADF_internals.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ bytes start end description range / format
155155
156156
157157
Variable: min 32 Data-chunks
158-
(Minimum is 32 bytes, which cooresponds to the size required for a free-chunk)
158+
(Minimum is 32 bytes, which corresponds to the size required for a free-chunk)
159159
bytes start end description range / format
160160
4 0 3 "DaTa" boundary tag Tag
161161
12 4 15 Pointer to End-of-Data-Tag
@@ -7187,7 +7187,7 @@ NULL_STRING_POINTER
71877187
ADF_FILE_NOT_OPENED
71887188
PRISTK_NOT_FOUND
71897189
Note: errors are only important for GET mode since you must then go ahead
7190-
and read the data fom the file. The stack is only meant to speed things
7190+
and read the data from the file. The stack is only meant to speed things
71917191
up, not stop the process !!!
71927192
***********************************************************************/
71937193
int ADFI_stack_control( const unsigned int file_index,

0 commit comments

Comments
 (0)