PySDM_examples.Srivastava_1982.equations
1import numpy as np 2 3 4class Equations: 5 """Equations from Srivastava 1982: "A Simple Model of Particle Coalescence and Breakup" 6 (https://doi.org/10.1175/1520-0469(1982)039%3C1317:ASMOPC%3E2.0.CO;2) 7 note: all equations assume constant fragment mass""" 8 9 @property 10 def alpha_star(self): 11 """see eq. 6""" 12 return self._alpha_star or self.alpha / self.c / self.M 13 14 @property 15 def beta_star(self): 16 """see eq. 6""" 17 return self._beta_star or self.beta / self.c 18 19 def tau(self, t): 20 """see eq. 6""" 21 return self.c * self.M * t 22 23 def __init__( 24 self, *, M=None, c=None, alpha=None, beta=None, alpha_star=None, beta_star=None 25 ): 26 if alpha_star and (alpha or M or c): 27 raise ValueError("conflicting parameter") 28 self.M = M 29 self.c = c 30 self.alpha = alpha 31 self.beta = beta 32 33 self._beta_star = beta_star 34 self._alpha_star = alpha_star 35 36 if alpha_star and beta_star: 37 amb = alpha_star - beta_star 38 self._A = amb / 2 / alpha_star 39 self._B = 1 / np.sqrt( 40 (0.5 / alpha_star + beta_star / alpha_star) 41 + amb**2 / (4 * alpha_star**2) 42 ) 43 44 def eq12(self): 45 """equilibrium (τ→∞) mean mass under collisions and spontaneous breakup 46 (no collisional breakup) 47 expressed as a ratio to fragment mass (i.e., dimensionless)""" 48 equilibrium_mean_mass_to_frag_mass_ratio = ( 49 0.5 + (0.25 + 0.5 / self.alpha_star) ** 0.5 50 ) 51 return equilibrium_mean_mass_to_frag_mass_ratio 52 53 def eq13(self, m0, tau): 54 """mean mass expressed as a ratio to fragment mass as a function of 55 dimensionless scaled time (τ) under coalescence and collisional breakup 56 (no spontaneous breakup)""" 57 mean_mass_to_frag_mass_ratio = self._eq13(m0, tau) 58 return mean_mass_to_frag_mass_ratio 59 60 def _eq13(self, m0, tau): 61 ebt = np.exp(-self.beta_star * tau) 62 return m0 * ebt + (1 + 0.5 / self.beta_star) * (1 - ebt) 63 64 def eq14(self): 65 """equilibrium (τ→∞) mean mass expressed as a ratio to fragment mass for 66 under collisional merging and breakup (no spontaneous breakup)""" 67 equilibrium_mean_mass_to_frag_mass_ratio = 1 + 0.5 / self.beta_star 68 return equilibrium_mean_mass_to_frag_mass_ratio 69 70 def eq15(self, m): 71 return (m - self._A) * self._B 72 73 def eq15_m_of_y(self, y): 74 return (y / self._B) + self._A 75 76 def eq16(self, tau): 77 return tau * self.alpha_star / self._B 78 79 def eq10(self, m0, tau): 80 """ratio of mean mass to fragment size mass as a function of scaled time 81 for the case of coalescence only""" 82 mean_mass_to_frag_mass_ratio = m0 + tau / 2 83 return mean_mass_to_frag_mass_ratio 84 85 86class EquationsHelpers: 87 def __init__(self, total_volume, total_number_0, rho, frag_mass): 88 self.total_volume = total_volume 89 self.total_number_0 = total_number_0 90 self.rho = rho 91 self.frag_mass = frag_mass 92 93 def m0(self): 94 mean_volume_0 = self.total_volume / self.total_number_0 95 m0 = self.rho * mean_volume_0 / self.frag_mass 96 return m0
5class Equations: 6 """Equations from Srivastava 1982: "A Simple Model of Particle Coalescence and Breakup" 7 (https://doi.org/10.1175/1520-0469(1982)039%3C1317:ASMOPC%3E2.0.CO;2) 8 note: all equations assume constant fragment mass""" 9 10 @property 11 def alpha_star(self): 12 """see eq. 6""" 13 return self._alpha_star or self.alpha / self.c / self.M 14 15 @property 16 def beta_star(self): 17 """see eq. 6""" 18 return self._beta_star or self.beta / self.c 19 20 def tau(self, t): 21 """see eq. 6""" 22 return self.c * self.M * t 23 24 def __init__( 25 self, *, M=None, c=None, alpha=None, beta=None, alpha_star=None, beta_star=None 26 ): 27 if alpha_star and (alpha or M or c): 28 raise ValueError("conflicting parameter") 29 self.M = M 30 self.c = c 31 self.alpha = alpha 32 self.beta = beta 33 34 self._beta_star = beta_star 35 self._alpha_star = alpha_star 36 37 if alpha_star and beta_star: 38 amb = alpha_star - beta_star 39 self._A = amb / 2 / alpha_star 40 self._B = 1 / np.sqrt( 41 (0.5 / alpha_star + beta_star / alpha_star) 42 + amb**2 / (4 * alpha_star**2) 43 ) 44 45 def eq12(self): 46 """equilibrium (τ→∞) mean mass under collisions and spontaneous breakup 47 (no collisional breakup) 48 expressed as a ratio to fragment mass (i.e., dimensionless)""" 49 equilibrium_mean_mass_to_frag_mass_ratio = ( 50 0.5 + (0.25 + 0.5 / self.alpha_star) ** 0.5 51 ) 52 return equilibrium_mean_mass_to_frag_mass_ratio 53 54 def eq13(self, m0, tau): 55 """mean mass expressed as a ratio to fragment mass as a function of 56 dimensionless scaled time (τ) under coalescence and collisional breakup 57 (no spontaneous breakup)""" 58 mean_mass_to_frag_mass_ratio = self._eq13(m0, tau) 59 return mean_mass_to_frag_mass_ratio 60 61 def _eq13(self, m0, tau): 62 ebt = np.exp(-self.beta_star * tau) 63 return m0 * ebt + (1 + 0.5 / self.beta_star) * (1 - ebt) 64 65 def eq14(self): 66 """equilibrium (τ→∞) mean mass expressed as a ratio to fragment mass for 67 under collisional merging and breakup (no spontaneous breakup)""" 68 equilibrium_mean_mass_to_frag_mass_ratio = 1 + 0.5 / self.beta_star 69 return equilibrium_mean_mass_to_frag_mass_ratio 70 71 def eq15(self, m): 72 return (m - self._A) * self._B 73 74 def eq15_m_of_y(self, y): 75 return (y / self._B) + self._A 76 77 def eq16(self, tau): 78 return tau * self.alpha_star / self._B 79 80 def eq10(self, m0, tau): 81 """ratio of mean mass to fragment size mass as a function of scaled time 82 for the case of coalescence only""" 83 mean_mass_to_frag_mass_ratio = m0 + tau / 2 84 return mean_mass_to_frag_mass_ratio
Equations from Srivastava 1982: "A Simple Model of Particle Coalescence and Breakup" (https://doi.org/10.1175/1520-0469(1982)039%3C1317:ASMOPC%3E2.0.CO;2) note: all equations assume constant fragment mass
24 def __init__( 25 self, *, M=None, c=None, alpha=None, beta=None, alpha_star=None, beta_star=None 26 ): 27 if alpha_star and (alpha or M or c): 28 raise ValueError("conflicting parameter") 29 self.M = M 30 self.c = c 31 self.alpha = alpha 32 self.beta = beta 33 34 self._beta_star = beta_star 35 self._alpha_star = alpha_star 36 37 if alpha_star and beta_star: 38 amb = alpha_star - beta_star 39 self._A = amb / 2 / alpha_star 40 self._B = 1 / np.sqrt( 41 (0.5 / alpha_star + beta_star / alpha_star) 42 + amb**2 / (4 * alpha_star**2) 43 )
10 @property 11 def alpha_star(self): 12 """see eq. 6""" 13 return self._alpha_star or self.alpha / self.c / self.M
see eq. 6
15 @property 16 def beta_star(self): 17 """see eq. 6""" 18 return self._beta_star or self.beta / self.c
see eq. 6
45 def eq12(self): 46 """equilibrium (τ→∞) mean mass under collisions and spontaneous breakup 47 (no collisional breakup) 48 expressed as a ratio to fragment mass (i.e., dimensionless)""" 49 equilibrium_mean_mass_to_frag_mass_ratio = ( 50 0.5 + (0.25 + 0.5 / self.alpha_star) ** 0.5 51 ) 52 return equilibrium_mean_mass_to_frag_mass_ratio
equilibrium (τ→∞) mean mass under collisions and spontaneous breakup (no collisional breakup) expressed as a ratio to fragment mass (i.e., dimensionless)
54 def eq13(self, m0, tau): 55 """mean mass expressed as a ratio to fragment mass as a function of 56 dimensionless scaled time (τ) under coalescence and collisional breakup 57 (no spontaneous breakup)""" 58 mean_mass_to_frag_mass_ratio = self._eq13(m0, tau) 59 return mean_mass_to_frag_mass_ratio
mean mass expressed as a ratio to fragment mass as a function of dimensionless scaled time (τ) under coalescence and collisional breakup (no spontaneous breakup)
65 def eq14(self): 66 """equilibrium (τ→∞) mean mass expressed as a ratio to fragment mass for 67 under collisional merging and breakup (no spontaneous breakup)""" 68 equilibrium_mean_mass_to_frag_mass_ratio = 1 + 0.5 / self.beta_star 69 return equilibrium_mean_mass_to_frag_mass_ratio
equilibrium (τ→∞) mean mass expressed as a ratio to fragment mass for under collisional merging and breakup (no spontaneous breakup)
80 def eq10(self, m0, tau): 81 """ratio of mean mass to fragment size mass as a function of scaled time 82 for the case of coalescence only""" 83 mean_mass_to_frag_mass_ratio = m0 + tau / 2 84 return mean_mass_to_frag_mass_ratio
ratio of mean mass to fragment size mass as a function of scaled time for the case of coalescence only
87class EquationsHelpers: 88 def __init__(self, total_volume, total_number_0, rho, frag_mass): 89 self.total_volume = total_volume 90 self.total_number_0 = total_number_0 91 self.rho = rho 92 self.frag_mass = frag_mass 93 94 def m0(self): 95 mean_volume_0 = self.total_volume / self.total_number_0 96 m0 = self.rho * mean_volume_0 / self.frag_mass 97 return m0