Comments (3)
Oops!
I will investigate.
from up4.
Hi @WJPeace1 can you share the script you were using for the plots?
from up4.
Hi @DanW97, here you go!
`
Velocity Fields
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
Import data
hdf_name = '16_190_trajectories.hdf5'
Extract values for plots and tip speed calculation
filename_final = hdf_name.split(".hdf5")[0]
variables = filename_final.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(speed_rpm) + str("_") + str(vvm)
Data Load-In
data = up4.Data(hdf_name)
# # Dimension Statistics # #
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
Forming a Grid
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()
CENTRE SLICES
YMed Slice
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()
`
from up4.
Related Issues (20)
- HDF5 Attributes
- Windows. HOT 2
- Nomenclature
- Colourmap interpolation
- Homogenity Index
- Volume Plots
- Slice Plots - ScalarPlotter
- Slice Plots - ComparisonPlotter
- Fix CI
- Implement distribution visualisation
- Collision modes
- Energy dissipation
- Robust arrow sizes for quiver plots in 2D
- Add Meaningful tests HOT 2
- Issue with 2D scalar field - offset HOT 5
- grid.collapse returns NaNs when granular temperature is initiated with grid containing values. HOT 1
- Tutorial for 'Data Visualisation' doesn't work HOT 7
- Dataset comparison HOT 1
- uPPPP name HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from up4.