Skip to content

Commit 0ebb12c

Browse files
committedMay 23, 2018
fix in mach analysis and cleanup in both analysis
1 parent b190c78 commit 0ebb12c

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed
 

‎airofilAnalysisMach.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
ouputF = open(WORKING_DIR + '/' + 'machResult_' + datetime.now().strftime('%Y-%m-%d_%H_%M_%S') + '.csv', 'w')
5454
ouputF.write('machNr,AOA,CL,CD,CM,E,Iterations,Time(min)\n')
5555

56+
57+
5658
for mach in MACH_NR:
5759
projectName = 'analysis_mach_%0.3f' % (mach)
5860
projectDir = WORKING_DIR + '/' + projectName
@@ -67,25 +69,21 @@
6769
cfd.gmsh_generate_mesh(scale=REF_LENGTH)
6870
cfd.su2_fix_mesh()
6971

70-
config['MACH_NUMBER'] = str(mach / 100.)
72+
config['MACH_NUMBER'] = str(mach)
7173
cfd.su2_solve(config)
7274

73-
totalCL, totalCD, totalCM, totalE = cfd.su2_parse_results()
74-
75-
print('totalCL: ' + str(totalCL))
76-
print('totalCD: ' + str(totalCD))
7775
results = cfd.su2_parse_iteration_result()
78-
# totalCL, totalCD, totalCM, totalE = cfd.su2_parse_results()
79-
totalCL = results['CL']
80-
totalCD = results['CD']
81-
totalCM = results['CMz']
82-
totalE = results['CL/CD']
76+
cfd.clean_up()
77+
78+
print('totalCL: ' + str(results['CL']))
79+
print('totalCD: ' + str(results['CD']))
80+
8381
ouputF.write(str(mach / 100.) + ','
8482
+ str(results['AOA']) + ','
85-
+ str(totalCL) + ','
86-
+ str(totalCD) + ','
87-
+ str(totalCM) + ','
88-
+ str(totalE) + ','
83+
+ str(results['CL']) + ','
84+
+ str(results['CD']) + ','
85+
+ str(results['CMz']) + ','
86+
+ str(results['CL/CD']) + ','
8987
+ str(results['Iteration']) + ','
9088
+ str(results['Time(min)']) + '\n')
9189
ouputF.flush()

‎airofilAnalysisPolar.py

+8-13
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,17 @@
7474
config['AOA'] = str(a)
7575
cfd.su2_solve(config)
7676

77-
totalCL, totalCD, totalCM, totalE = cfd.su2_parse_results()
78-
79-
print('totalCL: ' + str(totalCL))
80-
print('totalCD: ' + str(totalCD))
8177
results = cfd.su2_parse_iteration_result()
82-
# totalCL, totalCD, totalCM, totalE = cfd.su2_parse_results()
83-
totalCL = results['CL']
84-
totalCD = results['CD']
85-
totalCM = results['CMz']
86-
totalE = results['CL/CD']
78+
cfd.clean_up()
79+
80+
print('totalCL: ' + str(results['CL']))
81+
print('totalCD: ' + str(results['CD']))
8782
ouputF.write(str(MACH_NR) + ','
8883
+ str(a) + ','
89-
+ str(totalCL) + ','
90-
+ str(totalCD) + ','
91-
+ str(totalCM) + ','
92-
+ str(totalE) + ','
84+
+ str(results['CL']) + ','
85+
+ str(results['CD']) + ','
86+
+ str(results['CMz']) + ','
87+
+ str(results['CL/CD']) + ','
9388
+ str(results['Iteration']) + ','
9489
+ str(results['Time(min)']) + '\n')
9590
ouputF.flush()

0 commit comments

Comments
 (0)
Please sign in to comment.