Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
r,Un
-0.4970760233918129, 0.2676923076923077
-0.48245614035087725, 0.3599999999999999
-0.4619883040935673, 0.4015384615384616
-0.4473684210526316, 0.4938461538461538
-0.42690058479532167, 0.5676923076923077
-0.40935672514619886, 0.6276923076923078
-0.37134502923976614, 0.6784615384615384
-0.32456140350877194, 0.6784615384615384
-0.28654970760233917, 0.6553846153846155
-0.24853801169590645, 0.6276923076923078
-0.20175438596491235, 0.6046153846153847
-0.17836257309941517, 0.6138461538461538
-0.1549707602339181, 0.6369230769230769
-0.11403508771929827, 0.6646153846153846
-0.07309941520467833, 0.7384615384615385
-0.05263157894736836, 0.7892307692307693
-0.029239766081871288, 0.8676923076923078
-0.011695906432748537, 0.9461538461538461
1.1102230246251565e-16, 1.0153846153846153
0.023391812865497075, 1.0661538461538462
0.04385964912280704, 1.1123076923076924
0.06725146198830412, 1.1400000000000001
0.10818713450292405, 1.153846153846154
0.14619883040935688, 1.1400000000000001
0.1871345029239767, 1.1400000000000001
0.2134502923976609, 1.1353846153846154
0.2485380116959065, 1.1215384615384616
0.2865497076023392, 1.1123076923076924
0.31871345029239784, 1.0892307692307692
0.36257309941520477, 1.0984615384615384
0.39766081871345027, 1.0846153846153848
0.4356725146198832, 1.0846153846153848
0.4883040935672516, 0.9184615384615386
0.497076023391813, 0.8076923076923077
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
# extract contour plots from the 90 degree bend from Sudo et al.
# check below the different places to modify the details of the contour

# trace generated using paraview version 5.11.0-RC2

# diameter
D = 0.104
# radius of curvature
R = 0.208
#

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
import numpy as np
import math

# create a new 'XML MultiBlock Data Reader'
sudovtm = XMLMultiBlockDataReader(registrationName='sudo.vtm', FileName=['sudo.vtm'])
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']

# set active source
SetActiveSource(sudovtm)

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')

# create a new 'Slice'
slice1 = Slice(registrationName='Slice1', Input=sudovtm)
slice1.SliceType = 'Plane'


################################################################################
# ### 1/5 change the location of the slice plane ### #
################################################################################
# CASE 1
# Z/D = -1.0
#slice1.SliceType.Origin = [0.0, 0.0, -0.104]
#slice1.SliceType.Normal = [0.0, 0.0, 1.0]

# CASE 2
# Z/D = 0.0 (phi=0.0)
slice1.SliceType.Origin = [0.208, 0.0, 0.0]
slice1.SliceType.Normal = [0.0, 0.0, 1.0]

# CASE 3
# phi=30.0
#ALPHA=30.0
#slice1.SliceType.Origin = [0.208, 0.0, 0.0]
#slice1.SliceType.Normal = [np.sin(math.radians(ALPHA)), 0.0, np.cos(math.radians(ALPHA))]

# CASE 4
# phi=60.0
#ALPHA=60
#slice1.SliceType.Origin = [0.208, 0.0, 0.0]
#slice1.SliceType.Normal = [np.sin(math.radians(ALPHA)), 0.0, np.cos(math.radians(ALPHA))]

# CASE 5
# phi = 90.0
#slice1.SliceType.Origin = [0.208, 0.0, 0.0]
#slice1.SliceType.Normal = [1.0, 0.0, 0.0]

# CASE 6
# Z/D = +1.0
#slice1.SliceType.Origin = [0.312, 0.0, 0.0]
#slice1.SliceType.Normal = [1.0, 0.0, 0.0]
################################################################################
################################################################################

# create a new 'Calculator'
calculator1 = Calculator(registrationName='Calculator1', Input=slice1)

# Properties modified on calculator1
################################################################################
# ### 2/5 compute the normalized velocity in the plane ### #
################################################################################
# CASE 1
# Z/D = -1.0
#calculator1.Function = 'Velocity_Z/8.7'

# CASE 2
# Z/D = 0.0 (phi=0)
calculator1.Function = 'Velocity_Z/8.7'

# CASE 3
# phi=30
#calculator1.Function = '(0.5*Velocity_X+0.5*sqrt(3)*Velocity_Z)/(8.7)'

# CASE 4
# phi=60
#calculator1.Function = '(0.5*sqrt(3)*Velocity_X+0.5*Velocity_Z)/(8.7)'

# CASE 5
# phi=90
#calculator1.Function = 'Velocity_X/8.7'

# CASE 6
# Z/D = 1.0
#calculator1.Function = 'Velocity_X/8.7'
################################################################################
################################################################################

# show data in view
calculator1Display = Show(calculator1, renderView1, 'GeometryRepresentation')
# hide color bar/color legend
calculator1Display.SetScalarBarVisibility(renderView1, False)

# get color transfer function/color map for 'Result'
resultLUT = GetColorTransferFunction('Result')
# Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
resultLUT.ApplyPreset('Black-Body Radiation', True)
# Properties modified on resultLUT
resultLUT.NumberOfTableValues = 32

# create a new 'Contour'
contour1 = Contour(registrationName='Contour1', Input=calculator1)
contour1.ContourBy = ['POINTS', 'Result']
# Properties modified on contour1
################################################################################
# ### 3/5 set the specific isocontour lines for the plane ### #
################################################################################

# CASE 1
# Z/D = -1.0
#contour1.Isosurfaces = [0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]

# CASE 2
# Z/D = 0.0
contour1.Isosurfaces = [0.85, 0.9, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]

#CASE 3
# phi = 30.0
#contour1.Isosurfaces = [0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]

# CASE 4
# phi = 60.0
#contour1.Isosurfaces = [0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15, 1.20]

# CASE 5
# phi = 90.0
#contour1.Isosurfaces = [0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05]

# CASE 6
# Z/D = +1.0
#contour1.Isosurfaces = [0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05, 1.10, 1.15]
################################################################################


# show data in view
contour1Display = Show(contour1, renderView1, 'GeometryRepresentation')
# turn off scalar coloring
ColorBy(contour1Display, None)
# Hide the scalar bar for this color map if no visible data is colored by it.
HideScalarBarIfNotNeeded(resultLUT, renderView1)
# change solid color to black
contour1Display.DiffuseColor = [0.0, 0.0, 0.0]
# increase the line thickness
contour1Display.LineWidth = 2.0

# create a new 'Extract Block'
extractBlock1 = ExtractBlock(registrationName='ExtractBlock1', Input=calculator1)
# Properties modified on extractBlock1
extractBlock1.Selectors = ['/Root/Zone0IncompFluid/Boundary/wall_1', '/Root/Zone0IncompFluid/Boundary/wall_2', '/Root/Zone0IncompFluid/Boundary/wall_bend']
# show data in view
extractBlock1Display = Show(extractBlock1, renderView1, 'GeometryRepresentation')
# change solid color
extractBlock1Display.DiffuseColor = [0.0, 0.0, 0.0]

# Hide orientation axes
renderView1.OrientationAxesVisibility = 0

# reset view to fit data
renderView1.ResetCamera(False)

# get layout
layout1 = GetLayout()

# layout/tab size in pixels
layout1.SetSize(1304, 746)

################################################################################
# 4/5 current camera placement for renderView1, view is distance L before the plane
################################################################################

L = 0.115

# CASE 1
# view for Z/D=-1
#renderView1.CameraFocalPoint = [0.0, 0.026, -0.104]
#renderView1.CameraPosition = [0.0, 0.026, -0.104-L]

# CASE 2
# view for Z/D=0
renderView1.CameraFocalPoint = [0.0, 0.026, 0.000]
renderView1.CameraPosition = [0.0, 0.026, -0.000-L]

# CASE 3
# view for phi=30
#ALPHA=30
#X = R - R * np.cos(math.radians(ALPHA))
#Z = R * np.sin(math.radians(ALPHA))
#renderView1.CameraFocalPoint = [X, 0.026, Z]
#Xp = X - L*np.sin(math.radians(ALPHA))
#Zp = Z - L*np.cos(math.radians(ALPHA))
#renderView1.CameraPosition = [Xp, 0.026, Zp]

# CASE 4
# view for phi=60
#ALPHA=60
#X = R - R * np.cos(math.radians(ALPHA))
#Z = R * np.sin(math.radians(ALPHA))
#renderView1.CameraFocalPoint = [X, 0.026, Z]
#Xp = X - L*np.sin(math.radians(ALPHA))
#Zp = Z - L*np.cos(math.radians(ALPHA))
#renderView1.CameraPosition = [Xp, 0.026, Zp]

# CASE 5
# view for phi=90
#renderView1.CameraFocalPoint = [0.208, 0.026, 0.208]
#renderView1.CameraPosition = [0.208-L, 0.026, 0.208]

# CASE 6
# view for Z/D = +1
#renderView1.CameraFocalPoint = [0.312, 0.026, 0.208]
#renderView1.CameraPosition = [0.312-L, 0.026, 0.208]

#
renderView1.CameraViewUp = [0.0, 1.0, 0.0]
renderView1.CameraParallelScale = 0.058
################################################################################

# update the view to ensure updated data information
renderView1.Update()

# 5/5 save screenshot
# CASE 1
#SaveScreenshot('./slice_ZD_minus_1.png', renderView1, ImageResolution=[1304, 746])
# CASE 2
SaveScreenshot('./slice_ZD_0.png', renderView1, ImageResolution=[1304, 746])
# CASE 3
#SaveScreenshot('./slice_phi_30.png', renderView1, ImageResolution=[1304, 746])
# CASE 4
#SaveScreenshot('./slice_phi_60.png', renderView1, ImageResolution=[1304, 746])
# CASE 5
#SaveScreenshot('./slice_phi_90.png', renderView1, ImageResolution=[1304, 746])
# CASE 1
#SaveScreenshot('./slice_ZD_plus_1.png', renderView1, ImageResolution=[1304, 746])

Loading