Skip to content
Snippets Groups Projects
Commit c25e1979 authored by ssibirtsev's avatar ssibirtsev
Browse files

Upload New File

parent db14fb91
No related branches found
No related tags found
No related merge requests found
"""
Droplet Contact Numbers and Probabilities (DCNumPro)
Determine droplet contact numbers and probabilities based on
the median and the standard deviation of a droplet size distribution.
Source code of DCNumPro: https://git.rwth-aachen.de/avt-fvt/public/contact-numbers-and-probabilities/
DCNumPro uses a 3D cell-based Voronoi library based on voro++: https://github.com/wackywendell/tess
The source code of DCNumPro is licensed under the Eclipse Public License v2.0 (EPL 2.0).
Copyright (c) 2024 Fluid Process Engineering (AVT.FVT), RWTH Aachen University.
Written by Stepan Sibirtsev & Andrey Kirsanov
The coyprights and license terms are given in LICENSE.
This script contains all functions for plotting.
Script version date: 23.11.2024
"""
""" Import packages """
import numpy as np
import matplotlib.pyplot as plt
""" Functions """
def plot_particles(M_particle_steady):
""" Function to graphically display spheres in 3D """
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# Center coordinates of the steady state particles
centers = M_particle_steady[:,[1,2,3]]
# Radii
radii = M_particle_steady[:,5]/2
# Iterate through all spheres
for center, radius in zip(centers, radii):
# Create a grid of points
u = np.linspace(0, 2 * np.pi, 100)
v = np.linspace(0, np.pi, 100)
x = radius * np.outer(np.cos(u), np.sin(v)) + center[2] # x-axis in the (z, y, x) order
y = radius * np.outer(np.sin(u), np.sin(v)) + center[1] # y-axis in the (z, y, x) order
z = radius * np.outer(np.ones(np.size(u)), np.cos(v)) + center[0] # z-axis in the (z, y, x) order
# Plot the surface
ax.plot_surface(x, y, z, color='b', alpha=0.3)
# Set the same limits for x, y, and z axes
ax.set_xlim(-1000, 1000)
ax.set_ylim(-1000, 1000)
ax.set_zlim(0, 500)
# Set the aspect ratio to be equal
ax.set_aspect('equal', adjustable='box')
# Set labels
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')
# Show the plot
plt.show()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment