Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Droplet Contact Numbers and Probabilities
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AVT-FVT
public
Droplet Contact Numbers and Probabilities
Commits
c25e1979
Commit
c25e1979
authored
6 months ago
by
ssibirtsev
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
db14fb91
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
script/DCNumPro_plot.py
+54
-0
54 additions, 0 deletions
script/DCNumPro_plot.py
with
54 additions
and
0 deletions
script/DCNumPro_plot.py
0 → 100644
+
54
−
0
View file @
c25e1979
"""
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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment