Skip to content
Snippets Groups Projects
Commit c844b1d5 authored by Malte Nyhuis's avatar Malte Nyhuis
Browse files

new features initial commit

parent c4a63139
No related branches found
No related tags found
No related merge requests found
......@@ -55,3 +55,28 @@ def calc_dist_from_surface(surface_primary, surface_secondary, verbose=False):
p.show()
return h0n
def massflow_plane(mesh):
if not "Normals" in mesh.array_names:
mesh = mesh.compute_normals()
if not "Area" in mesh.array_names:
mesh = mesh.compute_cell_sizes()
mesh = mesh.point_data_to_cell_data()
normals = mesh.cell_normals
rhos = mesh["rho"]
areas = mesh["Area"]
velocities = mesh["U"]
massflow = np.array(
[vecAbs(vecProjection(velocities[i], normals[i])) for i in range(mesh.number_of_cells)]) ** 2 * rhos * areas
return massflow
def test_massflow_plane():
import pyvista as pv
plane = pv.Plane()
numcells = plane.number_of_cells
plane["U"] = np.array([1,0,0])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment