-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathExportCFDcsvFiles.py
90 lines (71 loc) · 1.86 KB
/
ExportCFDcsvFiles.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
###############################################################################
###############################################################################
#Copyright (c) 2016, Andy Schroder
#See the file README.md for licensing information.
###############################################################################
###############################################################################
from subprocess import call
from os import rename
BaseName='StraightEqualHeightChannels'
#name of the slices to be exported
SliceNames=[
'BottomHalfChannel',
'BottomWall',
'TopHalfChannel',
'TopWall',
]
#case names and grid levels
Cases=[
[
'Re10L', #case name
[0,1,2], #geometry grid levels
[0,1,2], #property grid levels
'', #suffix
],
[
'Re50L',
[0],
[0],
'',
],
[
'Re3000T',
[0],
[0],
'',
],
[
'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','ExportCFDcsvFiles.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.
for SliceName in SliceNames:
rename('exported_data/'+SliceName+'.csv','exported_data/'+CaseName+'-'+SliceName+'.csv')
#add a separator
print
print
print '---------------------------------------------'