PySDM_examples.Jensen_and_Nugent_2017.settings
1from typing import Optional 2 3from pystrict import strict 4from PySDM import Formulae 5from PySDM.physics import si 6from PySDM.initialisation.spectra import Lognormal, Sum 7 8INITIAL_RELATIVE_HUMIDITY = 0.8561 9INITIAL_TEMPERATURE = 284.3 * si.K 10INITIAL_PRESSURE = 938.5 * si.hPa 11INITIAL_ALTITUDE = 600 * si.metres 12 13 14@strict 15class Settings: 16 def __init__(self, *, aerosol: str, cloud_type: str, dt: Optional[float] = None): 17 self.p0 = INITIAL_PRESSURE 18 self.RH0 = INITIAL_RELATIVE_HUMIDITY 19 self.T0 = INITIAL_TEMPERATURE 20 self.z0 = INITIAL_ALTITUDE 21 self.t_end_of_ascent = 1500 * si.s if cloud_type == "Sc" else None 22 self.dt = dt or 1 * si.s # TODO #1266: not found in the paper yet 23 24 # Table 1 from [Petters & Kreidenweis 2007](https://doi.org/10.5194/acp-7-1961-2007) 25 self.kappa = 1.28 26 27 self.formulae = Formulae( 28 saturation_vapour_pressure="FlatauWalkoCotton", # TODO #1266: Bolton 29 diffusion_kinetics="GrabowskiEtAl2011", 30 diffusion_thermics="GrabowskiEtAl2011", 31 constants={ 32 # values from appendix B 33 "MAC": 0.036, 34 "HAC": 0.7, 35 }, 36 ) 37 38 self.vertical_velocity = { 39 # Table 2 in the paper 40 "Sc": lambda t: (1 if t < self.t_end_of_ascent else -1) * 0.4 * si.m / si.s, 41 "Cu": 2 * si.m / si.s, 42 }[cloud_type] 43 44 self.dry_radii_spectrum = { 45 # Table 1 in the paper 46 "modified polluted": Sum( 47 ( 48 Lognormal( 49 norm_factor=48 / si.cm**3, m_mode=0.029 * si.um, s_geom=1.36 50 ), 51 Lognormal( 52 norm_factor=114 / si.cm**3, m_mode=0.071 * si.um, s_geom=1.57 53 ), 54 ) 55 ), 56 "pristine": Sum( 57 ( 58 Lognormal( 59 norm_factor=125 / si.cm**3, m_mode=0.011 * si.um, s_geom=1.2 60 ), 61 Lognormal( 62 norm_factor=65 / si.cm**3, m_mode=0.06 * si.um, s_geom=1.7 63 ), 64 ) 65 ), 66 }[aerosol]
INITIAL_RELATIVE_HUMIDITY =
0.8561
INITIAL_TEMPERATURE =
284.3
INITIAL_PRESSURE =
93850.0
INITIAL_ALTITUDE =
600.0
@strict
class
Settings:
15@strict 16class Settings: 17 def __init__(self, *, aerosol: str, cloud_type: str, dt: Optional[float] = None): 18 self.p0 = INITIAL_PRESSURE 19 self.RH0 = INITIAL_RELATIVE_HUMIDITY 20 self.T0 = INITIAL_TEMPERATURE 21 self.z0 = INITIAL_ALTITUDE 22 self.t_end_of_ascent = 1500 * si.s if cloud_type == "Sc" else None 23 self.dt = dt or 1 * si.s # TODO #1266: not found in the paper yet 24 25 # Table 1 from [Petters & Kreidenweis 2007](https://doi.org/10.5194/acp-7-1961-2007) 26 self.kappa = 1.28 27 28 self.formulae = Formulae( 29 saturation_vapour_pressure="FlatauWalkoCotton", # TODO #1266: Bolton 30 diffusion_kinetics="GrabowskiEtAl2011", 31 diffusion_thermics="GrabowskiEtAl2011", 32 constants={ 33 # values from appendix B 34 "MAC": 0.036, 35 "HAC": 0.7, 36 }, 37 ) 38 39 self.vertical_velocity = { 40 # Table 2 in the paper 41 "Sc": lambda t: (1 if t < self.t_end_of_ascent else -1) * 0.4 * si.m / si.s, 42 "Cu": 2 * si.m / si.s, 43 }[cloud_type] 44 45 self.dry_radii_spectrum = { 46 # Table 1 in the paper 47 "modified polluted": Sum( 48 ( 49 Lognormal( 50 norm_factor=48 / si.cm**3, m_mode=0.029 * si.um, s_geom=1.36 51 ), 52 Lognormal( 53 norm_factor=114 / si.cm**3, m_mode=0.071 * si.um, s_geom=1.57 54 ), 55 ) 56 ), 57 "pristine": Sum( 58 ( 59 Lognormal( 60 norm_factor=125 / si.cm**3, m_mode=0.011 * si.um, s_geom=1.2 61 ), 62 Lognormal( 63 norm_factor=65 / si.cm**3, m_mode=0.06 * si.um, s_geom=1.7 64 ), 65 ) 66 ), 67 }[aerosol]
Settings(*, aerosol: str, cloud_type: str, dt: Optional[float] = None)
17 def __init__(self, *, aerosol: str, cloud_type: str, dt: Optional[float] = None): 18 self.p0 = INITIAL_PRESSURE 19 self.RH0 = INITIAL_RELATIVE_HUMIDITY 20 self.T0 = INITIAL_TEMPERATURE 21 self.z0 = INITIAL_ALTITUDE 22 self.t_end_of_ascent = 1500 * si.s if cloud_type == "Sc" else None 23 self.dt = dt or 1 * si.s # TODO #1266: not found in the paper yet 24 25 # Table 1 from [Petters & Kreidenweis 2007](https://doi.org/10.5194/acp-7-1961-2007) 26 self.kappa = 1.28 27 28 self.formulae = Formulae( 29 saturation_vapour_pressure="FlatauWalkoCotton", # TODO #1266: Bolton 30 diffusion_kinetics="GrabowskiEtAl2011", 31 diffusion_thermics="GrabowskiEtAl2011", 32 constants={ 33 # values from appendix B 34 "MAC": 0.036, 35 "HAC": 0.7, 36 }, 37 ) 38 39 self.vertical_velocity = { 40 # Table 2 in the paper 41 "Sc": lambda t: (1 if t < self.t_end_of_ascent else -1) * 0.4 * si.m / si.s, 42 "Cu": 2 * si.m / si.s, 43 }[cloud_type] 44 45 self.dry_radii_spectrum = { 46 # Table 1 in the paper 47 "modified polluted": Sum( 48 ( 49 Lognormal( 50 norm_factor=48 / si.cm**3, m_mode=0.029 * si.um, s_geom=1.36 51 ), 52 Lognormal( 53 norm_factor=114 / si.cm**3, m_mode=0.071 * si.um, s_geom=1.57 54 ), 55 ) 56 ), 57 "pristine": Sum( 58 ( 59 Lognormal( 60 norm_factor=125 / si.cm**3, m_mode=0.011 * si.um, s_geom=1.2 61 ), 62 Lognormal( 63 norm_factor=65 / si.cm**3, m_mode=0.06 * si.um, s_geom=1.7 64 ), 65 ) 66 ), 67 }[aerosol]