-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprimeObjects.jl
158 lines (131 loc) · 4.38 KB
/
primeObjects.jl
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
@everywhere mutable struct fields2d_shared
## even more slowly !!!
##UphsCells::Array{Float64,2}
##UphsNodes::Array{Float64,2}
densityCells::SharedArray{Float64,1}
UxCells::SharedArray{Float64,1}
UyCells::SharedArray{Float64,1}
pressureCells::SharedArray{Float64,1}
aSoundCells::SharedArray{Float64,1}
VMAXCells::SharedArray{Float64,1}
densityNodes::SharedArray{Float64,1}
UxNodes::SharedArray{Float64,1}
UyNodes::SharedArray{Float64,1}
pressureNodes::SharedArray{Float64,1}
#UconsCellsOld::Array{Float64,2}
#UconsCellsNew::Array{Float64,2}
end
@everywhere mutable struct fields2d
## even more slowly !!!
##UphsCells::Array{Float64,2}
##UphsNodes::Array{Float64,2}
densityCells::Array{Float64,1}
UxCells::Array{Float64,1}
UyCells::Array{Float64,1}
pressureCells::Array{Float64,1}
aSoundCells::Array{Float64,1}
VMAXCells::Array{Float64,1}
densityNodes::Array{Float64,1}
UxNodes::Array{Float64,1}
UyNodes::Array{Float64,1}
pressureNodes::Array{Float64,1}
#UconsCellsOld::Array{Float64,2}
#UconsCellsNew::Array{Float64,2}
end
@everywhere struct mesh2d_shared
mesh_connectivity::SharedArray{Int64,2} ## [nCellsx3]
Z::SharedVector{Float64} ## [nCellsx1] 1/cell_areas
cell_edges_Nx::SharedArray{Float64,2} ## [nCellsx4]
cell_edges_Ny::SharedArray{Float64,2} ## [nCellsx4]
cell_edges_length::SharedArray{Float64,2} ## [nCellsx4]
cell_stiffness::SharedArray{Int64,2} ## [nCellsx4]
end
@everywhere struct mesh2d
nCells::Int64
nNodes::Int64
nNeibCells::Int64 ## max number of neighbors
nBSets::Int64 ## number of boundaries
xNodes::Array{Float64,1} ## mesh_nodes[nNodesx3]
yNodes::Array{Float64,1} ## mesh_nodes[nNodesx3]
mesh_connectivity::Array{Int64,2} ## [nCellsx7]
bc_data::Array{Int64,2}
bc_indexes::Array{Int64,1}
cell_nodes_X::Array{Float64,2} ## [nCellsx4]
cell_nodes_Y::Array{Float64,2} ## [nCellsx4]
cell_mid_points::Array{Float64,2} ## [nCellsx2]
cell_areas::Array{Float64,1} ## [nCellsx1]
Z::Array{Float64,1} ## [nCellsx1] 1/cell_areas
cell_edges_Nx::Array{Float64,2} ## [nCellsx4]
cell_edges_Ny::Array{Float64,2} ## [nCellsx4]
cell_edges_length::Array{Float64,2} ## [nCellsx4]
cell_stiffness::Array{Int64,2} ## [nCellsx4]
cell_clusters::Array{Int64,2} ## [nNodesx8]
node_stencils::Array{Float64,2} ## [nNodesx8]
maxArea::Float64
maxEdgeLength::Float64
VTKCells::Array{MeshCell,1}
node2cellsL2up::Array{Int64,2} ## [nCellsx4]
node2cellsL2down::Array{Int64,2} ## [nCellsx4]
end
# flux approximation:
# 1 - AUSM+
# 2 - exact Riemann solver
# 3 - hybrid, AUSM + RB
# flux limiter:
# 1 - minmod
# 2 - van Leer
# spatial approximation
# 1 - First order upwind;
# 2 - Second order upwind
# spatial approximation
# 1 - 2nd order TVD RK
# 2 - 3rd order TVD RK (depricated)
# 3 - 4th order general compact RK
@everywhere struct SOLVER2D
FLUXtype::Int8
FLUXlimiter::Int8
SpatialDiscretization::Int8
TimeDiscretization::Int8
end
@everywhere struct CONTROLS
CFL::Float64
dt::Float64 # time step
timeStepMethod::Int8 # fixed or #adaptive
startTime::Float64 # actual physical time to start simulation
stopTime::Float64 # actual physical time to stop simulation
plotResidual::Int8 # flag to plot residuals
densityConstrained::Int8 # flag to constrain density
minDensityConstrained::Float64
maxDensityConstrained::Float64
end
@everywhere struct plotCONTROLS
contoursType::Int8 # 0 - filled contours , 1 - contour lines only
nContours::Int8 # number of contours to plot
rhoMINcont::Float64 #min density
rhoMAXcont::Float64 #max density
productionVideo::Int8 # flag to production video
end
@everywhere struct outputCONTROLS
verbosity::Int8
header::String
saveResiduals::Int8
saveResults::Int8
fileNameResults::String
fileNameResiduals::String
saveDataToVTK::Int8
fileNameVTK::String
end
@everywhere mutable struct DYNAMICCONTROLS
flowTime::Float64 # actual physical time
cpuTime::Float64 # cpu time
tau::Float64 # tau
verIter::Int64 # iterator for verbosity (output)
curIter::Int64 # global iterator for time steppings
rhoMax::Float64 #max denisty in domain
rhoMin::Float64 #min density in domain;
velmax::Float64 #max velocity in domain
globalPath::String # loacl path to the code
localTestPath::String #path to the test
isSolutionConverged::Int8 # flag to show if the convergence criteria is satisfied
isRunSimulation::Int8 # flag to run or stop Simulation
end