|
53 | 53 | ouputF = open(WORKING_DIR + '/' + 'machResult_' + datetime.now().strftime('%Y-%m-%d_%H_%M_%S') + '.csv', 'w')
|
54 | 54 | ouputF.write('machNr,AOA,CL,CD,CM,E,Iterations,Time(min)\n')
|
55 | 55 |
|
| 56 | + |
| 57 | + |
56 | 58 | for mach in MACH_NR:
|
57 | 59 | projectName = 'analysis_mach_%0.3f' % (mach)
|
58 | 60 | projectDir = WORKING_DIR + '/' + projectName
|
|
67 | 69 | cfd.gmsh_generate_mesh(scale=REF_LENGTH)
|
68 | 70 | cfd.su2_fix_mesh()
|
69 | 71 |
|
70 |
| - config['MACH_NUMBER'] = str(mach / 100.) |
| 72 | + config['MACH_NUMBER'] = str(mach) |
71 | 73 | cfd.su2_solve(config)
|
72 | 74 |
|
73 |
| - totalCL, totalCD, totalCM, totalE = cfd.su2_parse_results() |
74 |
| - |
75 |
| - print('totalCL: ' + str(totalCL)) |
76 |
| - print('totalCD: ' + str(totalCD)) |
77 | 75 | 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 | + |
83 | 81 | ouputF.write(str(mach / 100.) + ','
|
84 | 82 | + 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']) + ',' |
89 | 87 | + str(results['Iteration']) + ','
|
90 | 88 | + str(results['Time(min)']) + '\n')
|
91 | 89 | ouputF.flush()
|
|
0 commit comments