Closed WJPeace1 closed 8 months ago
Oops!
I will investigate.
Hi @WJPeace1 can you share the script you were using for the plots?
Hi @DanW97, here you go!
`
from math import inf from re import template import numpy as np import plotly as p import plotly.express as pexp import plotly.graph_objects as go import up4 from collections import defaultdict
hdf_name = '16_190_trajectories.hdf5'
filename_final = hdf_name.split(".hdf5")[0] variables = filenamefinal.split("")
if int(variables[0]) > 0: vvm = str(int(variables[0])/10) + str("VVM") else: vvm = str("Ungassed") print(vvm)
speed = int(variables[1]) speed_rpm = str(int(variables[1])) + str("RPM") statement = str(vvm) + str(" - ") + str(speed_rpm) tip_speed = (2 np.pi speed (1/60) 0.033) save_statement = str(speedrpm) + str("") + str(vvm)
data = up4.Data(hdf_name)
dim = data.dimensions() xmin = dim['xmin'] xmax = dim['xmax'] ymin = dim['ymin'] ymax = dim['ymax'] zmin = dim['zmin'] zmax = dim['zmax'] xmed = (xmin + xmax) 0.5 # midpoint in x-axis ymed = (ymin + ymax) 0.5 # midpoint in y-axis zimpeller = zmin + ((zmax - zmin)/3) # impeller level in the tank
cx = 25 cy = cx cz = cx
grid = up4.Grid.cartesian3d_from_data(data, cells = [cx,cy,cz]) # cartesian co-ordinates field = data.velocityfield(grid) xpos,ypos,zpos = field.cell_positions()
vel_slice_ymed = np.rot90(field.slice_pos(axis = 1, position = ymed),3) fig = go.Figure() fig.add_trace(go.Heatmap(z = vel_slice_ymed, zmin = 0)) fig.update_layout( title = str(f"{statement}" + ": Central Slice Velocity Field: XZ Plane "), title_x = 0.5, width = 1000, height = 1000, xaxis_title = " r/R ", yaxis_title = " z/H ", xaxis = dict( tickmode = 'array', tickvals = [0,int(cx/4),int(cx/2),int((3cx)/4),int(cx-1)], ticktext = [" -1 ", " -0.5 "," 0 ", " 0.5 "," 1 "], ), yaxis = dict( tickmode = 'array', tickvals = [0,int(cx/4),int(cx/2),int((3cx)/4),int(cx-1)], ticktext = [" 0 ", " 0.25 "," 0.5 ", " 0.75 "," 1 "], ), template = "plotly_white", font = dict( family = "Arial", size = 20, color = "black", ) )
fig.show()
`
The attached files show a velocity vector and a velocity scalar field in the same plane at the same location. As seen by the heatmap, the velocities are flipped about the centre of the image. This is true for all data in any axis view.