Skip to content

Commit bcaa030

Browse files
authored
Merge pull request #33 from su2code/feature_wallfunction
incompressible turbulent bend
2 parents 66239ea + dfc8ff6 commit bcaa030

10 files changed

+157209
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
r,Un
2+
-0.4970760233918129, 0.2676923076923077
3+
-0.48245614035087725, 0.3599999999999999
4+
-0.4619883040935673, 0.4015384615384616
5+
-0.4473684210526316, 0.4938461538461538
6+
-0.42690058479532167, 0.5676923076923077
7+
-0.40935672514619886, 0.6276923076923078
8+
-0.37134502923976614, 0.6784615384615384
9+
-0.32456140350877194, 0.6784615384615384
10+
-0.28654970760233917, 0.6553846153846155
11+
-0.24853801169590645, 0.6276923076923078
12+
-0.20175438596491235, 0.6046153846153847
13+
-0.17836257309941517, 0.6138461538461538
14+
-0.1549707602339181, 0.6369230769230769
15+
-0.11403508771929827, 0.6646153846153846
16+
-0.07309941520467833, 0.7384615384615385
17+
-0.05263157894736836, 0.7892307692307693
18+
-0.029239766081871288, 0.8676923076923078
19+
-0.011695906432748537, 0.9461538461538461
20+
1.1102230246251565e-16, 1.0153846153846153
21+
0.023391812865497075, 1.0661538461538462
22+
0.04385964912280704, 1.1123076923076924
23+
0.06725146198830412, 1.1400000000000001
24+
0.10818713450292405, 1.153846153846154
25+
0.14619883040935688, 1.1400000000000001
26+
0.1871345029239767, 1.1400000000000001
27+
0.2134502923976609, 1.1353846153846154
28+
0.2485380116959065, 1.1215384615384616
29+
0.2865497076023392, 1.1123076923076924
30+
0.31871345029239784, 1.0892307692307692
31+
0.36257309941520477, 1.0984615384615384
32+
0.39766081871345027, 1.0846153846153848
33+
0.4356725146198832, 1.0846153846153848
34+
0.4883040935672516, 0.9184615384615386
35+
0.497076023391813, 0.8076923076923077
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
# extract contour plots from the 90 degree bend from Sudo et al.
2+
# check below the different places to modify the details of the contour
3+
4+
# trace generated using paraview version 5.11.0-RC2
5+
6+
# diameter
7+
D = 0.104
8+
# radius of curvature
9+
R = 0.208
10+
#
11+
12+
#### import the simple module from the paraview
13+
from paraview.simple import *
14+
#### disable automatic camera reset on 'Show'
15+
paraview.simple._DisableFirstRenderCameraReset()
16+
import numpy as np
17+
import math
18+
19+
# create a new 'XML MultiBlock Data Reader'
20+
sudovtm = XMLMultiBlockDataReader(registrationName='sudo.vtm', FileName=['sudo.vtm'])
21+
sudovtm.PointArrayStatus = ['Pressure', 'Velocity', 'Turb_Kin_Energy', 'Omega', 'Pressure_Coefficient', 'Density', 'Laminar_Viscosity', 'Skin_Friction_Coefficient', 'Heat_Flux', 'Y_Plus', 'Residual_Pressure', 'Residual_Velocity', 'Residual_TKE', 'Residual_Omega', 'Eddy_Viscosity']
22+
23+
# set active source
24+
SetActiveSource(sudovtm)
25+
26+
# get active view
27+
renderView1 = GetActiveViewOrCreate('RenderView')
28+
29+
# create a new 'Slice'
30+
slice1 = Slice(registrationName='Slice1', Input=sudovtm)
31+
slice1.SliceType = 'Plane'
32+
33+
34+
################################################################################
35+
# ### 1/5 change the location of the slice plane ### #
36+
################################################################################
37+
# CASE 1
38+
# Z/D = -1.0
39+
#slice1.SliceType.Origin = [0.0, 0.0, -0.104]
40+
#slice1.SliceType.Normal = [0.0, 0.0, 1.0]
41+
42+
# CASE 2
43+
# Z/D = 0.0 (phi=0.0)
44+
slice1.SliceType.Origin = [0.208, 0.0, 0.0]
45+
slice1.SliceType.Normal = [0.0, 0.0, 1.0]
46+
47+
# CASE 3
48+
# phi=30.0
49+
#ALPHA=30.0
50+
#slice1.SliceType.Origin = [0.208, 0.0, 0.0]
51+
#slice1.SliceType.Normal = [np.sin(math.radians(ALPHA)), 0.0, np.cos(math.radians(ALPHA))]
52+
53+
# CASE 4
54+
# phi=60.0
55+
#ALPHA=60
56+
#slice1.SliceType.Origin = [0.208, 0.0, 0.0]
57+
#slice1.SliceType.Normal = [np.sin(math.radians(ALPHA)), 0.0, np.cos(math.radians(ALPHA))]
58+
59+
# CASE 5
60+
# phi = 90.0
61+
#slice1.SliceType.Origin = [0.208, 0.0, 0.0]
62+
#slice1.SliceType.Normal = [1.0, 0.0, 0.0]
63+
64+
# CASE 6
65+
# Z/D = +1.0
66+
#slice1.SliceType.Origin = [0.312, 0.0, 0.0]
67+
#slice1.SliceType.Normal = [1.0, 0.0, 0.0]
68+
################################################################################
69+
################################################################################
70+
71+
# create a new 'Calculator'
72+
calculator1 = Calculator(registrationName='Calculator1', Input=slice1)
73+
74+
# Properties modified on calculator1
75+
################################################################################
76+
# ### 2/5 compute the normalized velocity in the plane ### #
77+
################################################################################
78+
# CASE 1
79+
# Z/D = -1.0
80+
#calculator1.Function = 'Velocity_Z/8.7'
81+
82+
# CASE 2
83+
# Z/D = 0.0 (phi=0)
84+
calculator1.Function = 'Velocity_Z/8.7'
85+
86+
# CASE 3
87+
# phi=30
88+
#calculator1.Function = '(0.5*Velocity_X+0.5*sqrt(3)*Velocity_Z)/(8.7)'
89+
90+
# CASE 4
91+
# phi=60
92+
#calculator1.Function = '(0.5*sqrt(3)*Velocity_X+0.5*Velocity_Z)/(8.7)'
93+
94+
# CASE 5
95+
# phi=90
96+
#calculator1.Function = 'Velocity_X/8.7'
97+
98+
# CASE 6
99+
# Z/D = 1.0
100+
#calculator1.Function = 'Velocity_X/8.7'
101+
################################################################################
102+
################################################################################
103+
104+
# show data in view
105+
calculator1Display = Show(calculator1, renderView1, 'GeometryRepresentation')
106+
# hide color bar/color legend
107+
calculator1Display.SetScalarBarVisibility(renderView1, False)
108+
109+
# get color transfer function/color map for 'Result'
110+
resultLUT = GetColorTransferFunction('Result')
111+
# Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
112+
resultLUT.ApplyPreset('Black-Body Radiation', True)
113+
# Properties modified on resultLUT
114+
resultLUT.NumberOfTableValues = 32
115+
116+
# create a new 'Contour'
117+
contour1 = Contour(registrationName='Contour1', Input=calculator1)
118+
contour1.ContourBy = ['POINTS', 'Result']
119+
# Properties modified on contour1
120+
################################################################################
121+
# ### 3/5 set the specific isocontour lines for the plane ### #
122+
################################################################################
123+
124+
# CASE 1
125+
# Z/D = -1.0
126+
#contour1.Isosurfaces = [0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]
127+
128+
# CASE 2
129+
# Z/D = 0.0
130+
contour1.Isosurfaces = [0.85, 0.9, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]
131+
132+
#CASE 3
133+
# phi = 30.0
134+
#contour1.Isosurfaces = [0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]
135+
136+
# CASE 4
137+
# phi = 60.0
138+
#contour1.Isosurfaces = [0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]
139+
140+
# CASE 5
141+
# phi = 90.0
142+
#contour1.Isosurfaces = [0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05]
143+
144+
# CASE 6
145+
# Z/D = +1.0
146+
#contour1.Isosurfaces = [0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15]
147+
################################################################################
148+
149+
150+
# show data in view
151+
contour1Display = Show(contour1, renderView1, 'GeometryRepresentation')
152+
# turn off scalar coloring
153+
ColorBy(contour1Display, None)
154+
# Hide the scalar bar for this color map if no visible data is colored by it.
155+
HideScalarBarIfNotNeeded(resultLUT, renderView1)
156+
# change solid color to black
157+
contour1Display.DiffuseColor = [0.0, 0.0, 0.0]
158+
# increase the line thickness
159+
contour1Display.LineWidth = 2.0
160+
161+
# create a new 'Extract Block'
162+
extractBlock1 = ExtractBlock(registrationName='ExtractBlock1', Input=calculator1)
163+
# Properties modified on extractBlock1
164+
extractBlock1.Selectors = ['/Root/Zone0IncompFluid/Boundary/wall_1', '/Root/Zone0IncompFluid/Boundary/wall_2', '/Root/Zone0IncompFluid/Boundary/wall_bend']
165+
# show data in view
166+
extractBlock1Display = Show(extractBlock1, renderView1, 'GeometryRepresentation')
167+
# change solid color
168+
extractBlock1Display.DiffuseColor = [0.0, 0.0, 0.0]
169+
170+
# Hide orientation axes
171+
renderView1.OrientationAxesVisibility = 0
172+
173+
# reset view to fit data
174+
renderView1.ResetCamera(False)
175+
176+
# get layout
177+
layout1 = GetLayout()
178+
179+
# layout/tab size in pixels
180+
layout1.SetSize(1304, 746)
181+
182+
################################################################################
183+
# 4/5 current camera placement for renderView1, view is distance L before the plane
184+
################################################################################
185+
186+
L = 0.115
187+
188+
# CASE 1
189+
# view for Z/D=-1
190+
#renderView1.CameraFocalPoint = [0.0, 0.026, -0.104]
191+
#renderView1.CameraPosition = [0.0, 0.026, -0.104-L]
192+
193+
# CASE 2
194+
# view for Z/D=0
195+
renderView1.CameraFocalPoint = [0.0, 0.026, 0.000]
196+
renderView1.CameraPosition = [0.0, 0.026, -0.000-L]
197+
198+
# CASE 3
199+
# view for phi=30
200+
#ALPHA=30
201+
#X = R - R * np.cos(math.radians(ALPHA))
202+
#Z = R * np.sin(math.radians(ALPHA))
203+
#renderView1.CameraFocalPoint = [X, 0.026, Z]
204+
#Xp = X - L*np.sin(math.radians(ALPHA))
205+
#Zp = Z - L*np.cos(math.radians(ALPHA))
206+
#renderView1.CameraPosition = [Xp, 0.026, Zp]
207+
208+
# CASE 4
209+
# view for phi=60
210+
#ALPHA=60
211+
#X = R - R * np.cos(math.radians(ALPHA))
212+
#Z = R * np.sin(math.radians(ALPHA))
213+
#renderView1.CameraFocalPoint = [X, 0.026, Z]
214+
#Xp = X - L*np.sin(math.radians(ALPHA))
215+
#Zp = Z - L*np.cos(math.radians(ALPHA))
216+
#renderView1.CameraPosition = [Xp, 0.026, Zp]
217+
218+
# CASE 5
219+
# view for phi=90
220+
#renderView1.CameraFocalPoint = [0.208, 0.026, 0.208]
221+
#renderView1.CameraPosition = [0.208-L, 0.026, 0.208]
222+
223+
# CASE 6
224+
# view for Z/D = +1
225+
#renderView1.CameraFocalPoint = [0.312, 0.026, 0.208]
226+
#renderView1.CameraPosition = [0.312-L, 0.026, 0.208]
227+
228+
#
229+
renderView1.CameraViewUp = [0.0, 1.0, 0.0]
230+
renderView1.CameraParallelScale = 0.058
231+
################################################################################
232+
233+
# update the view to ensure updated data information
234+
renderView1.Update()
235+
236+
# 5/5 save screenshot
237+
# CASE 1
238+
#SaveScreenshot('./slice_ZD_minus_1.png', renderView1, ImageResolution=[1304, 746])
239+
# CASE 2
240+
SaveScreenshot('./slice_ZD_0.png', renderView1, ImageResolution=[1304, 746])
241+
# CASE 3
242+
#SaveScreenshot('./slice_phi_30.png', renderView1, ImageResolution=[1304, 746])
243+
# CASE 4
244+
#SaveScreenshot('./slice_phi_60.png', renderView1, ImageResolution=[1304, 746])
245+
# CASE 5
246+
#SaveScreenshot('./slice_phi_90.png', renderView1, ImageResolution=[1304, 746])
247+
# CASE 1
248+
#SaveScreenshot('./slice_ZD_plus_1.png', renderView1, ImageResolution=[1304, 746])
249+

0 commit comments

Comments
 (0)