Turbine CFD#

cylinder.vtp cfd.npz

# Data and model from ParaView software examples

import k3d
import numpy as np
import pyvista as pv
from k3d.helpers import map_colors
from k3d.colormaps import paraview_color_maps
from numpy.linalg import norm

cylinder = pv.read('cylinder.vtp')
plt_vtk = k3d.vtk_poly_data(cylinder,
                            color=0x000000,
                            opacity=0.3)

data = np.load('cfd.npz')
plt_vectors = k3d.vectors(data['o'], data['v'] * 3,
                          line_width=0.02,
                          colors=data['c'])

plot = k3d.plot()
plot += plt_vtk
plot += plt_vectors
plot.display()

plot.camera = [3.0792, 14.6017, -8.8171,
               -0.9959, 0.5287, -0.2337,
               1, 0, 0]
xx
yy
zz
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
1-1
zz
4-4
2-2
00
22
44
yy
1-1
zz
4-4
2-2
00
22
44
xx
4-4
2-2
00
22
44
yy
4-4
2-2
00
22
44
xx
K3D panel
Full screen
cameraAutoFit
gridAutoFit
gridVisible
fpsMeter
Mode
View
Camera
Trackball
FOV
voxelColor
lighting
color
flat_shading
opacity
visible
wireframe
head_size
line_width
use_head
visible
Js version: