-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathExportCFDy+csvFiles.py
68 lines (51 loc) · 1.62 KB
/
ExportCFDy+csvFiles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
###############################################################################
###############################################################################
#Copyright (c) 2016, Andy Schroder
#See the file README.md for licensing information.
###############################################################################
###############################################################################
from subprocess import call
from os import rename
BaseName='StraightEqualHeightChannels'
#turbulent case names and grid levels
Cases=[
[
'Re3000T', #case name
[0], #geometry grid levels
[0], #property grid levels
'', #suffix
],
[
'Re4000T',
[0],
[0],
'',
],
[
'10m-Re3000T',
[0,1,2],
[0,1,2],
'',
],
[
'10m-Re3000T',
[0],
[0],
'_LowPressure',
],
]
#add some blank lines
print
print
for Case in Cases:
for GeometryGridLevel in Case[1]:
for PropertyGridLevel in Case[2]:
CaseName=BaseName+'-'+Case[0]+'_G'+2*str(GeometryGridLevel)+'R_P'+2*str(PropertyGridLevel)+Case[3]
#open starccm+ with the current file and run the macro that exports the csv files
call(['starccm+','-licpath','[email protected]','-power','-podkey','YourPODKeyHERE!','-collab','-batch','ExportCFDyPluscsvFiles.java',CaseName+'.sim'])
#can't figure out how to get starccm+ to accept a variable on the command line or figure out what it's current simulation name is, so just export data to static filenames and then immediately rename.
rename('exported_data/y+.csv','exported_data/'+CaseName+'-y+.csv')
#add a separator
print
print
print '---------------------------------------------'