Hi @Sumanth_Penmetcha . I just modified the settings on the forum to allow .pdf uploads. The calculations in your image look correct to me. It was not clear to me that by “height” you meant z-axis since the particles could be oriented differently, but now I know what you mean.
Note that the volume will scale as the cube of the scaling ratio, so if you know the volume V
of the original particle, you can just compute r**3 * V
for the volume of the scaled particle (where r
is the scaling ratio d/d_p0
).
You can get the d_p0
value from the Superquadric Designer popup, or you can use the functions in mfixgui/tools/sqp_funcs.py
:
from math import floor, log10, hypot
from math import pi as 𝜋, gamma as 𝛤
def sqp_d0(a,b,c,m,n):
# Diameter of bounding sphere of superquadric
a,b = max(a,b), min(a,b)
if m == n == 2:
return 2*max(a,c)
if n == 2:
return 2*hypot(a,c)
if n < 2.1:
n = 2.1
if m == 2:
𝛼 = 0
else:
if abs(m-2) < 0.1:
m = 2.1 if m>2 else 1.9
𝛼 = (b/a)**(2/(m-2))
𝛾 = (1+𝛼**m)**(n/m-1)
𝛽 = (𝛾*c**2 / a**2)**(1/(n-2))
𝜁 = 1 / ((1+𝛼**m)**(n/m)+𝛽**n)**(1/n)
x = a*𝜁
y = b*𝛼*𝜁
z = c*𝛽*𝜁
return 2*hypot(x,y,z)
def sqp_volume(a,b,c,m,n):
e1, e2 = 2/n, 2/m
def B(a,b): return 𝛤(a)*𝛤(b)/𝛤(a+b) # Beta function
#Jaklič, A., Leonardis, A., Solina, F. (2000). Superquadrics and Their Geometric Properties.
# formula 2.60 https://cse.buffalo.edu/~jryde/cse673/files/superquadrics.pdf
V = 2 * a*b*c * e1*e2 * B(e1/2 + 1, e1) * B(e2/2, e2/2)
return V