PySDM_examples.Morrison_and_Grabowski_2007.strato_cumulus
1import numpy as np 2from PySDM_examples.Morrison_and_Grabowski_2007.common import Common 3 4from PySDM.physics import si 5 6 7class StratoCumulus(Common): 8 def __init__(self, formulae, rhod_w_max: float): 9 super().__init__(formulae) 10 self.th_std0 = 289 * si.kelvins 11 self.initial_water_vapour_mixing_ratio = 7.5 * si.grams / si.kilogram 12 self.p0 = 1015 * si.hectopascals 13 self.rhod_w_max = rhod_w_max 14 15 def stream_function(self, xX, zZ, _): 16 X = self.size[0] 17 return ( 18 -self.rhod_w_max * X / np.pi * np.sin(np.pi * zZ) * np.cos(2 * np.pi * xX) 19 ) 20 21 def rhod_of_zZ(self, zZ): 22 p = getattr( 23 self.formulae.hydrostatics, 24 "p_of_z_assuming_const_th_and_initial_water_vapour_mixing_ratio", 25 )( 26 self.formulae.constants.g_std, 27 self.p0, 28 self.th_std0, 29 self.initial_water_vapour_mixing_ratio, 30 z=zZ * self.size[-1], 31 ) 32 rhod = self.formulae.state_variable_triplet.rho_d( 33 p, self.initial_water_vapour_mixing_ratio, self.th_std0 34 ) 35 return rhod
8class StratoCumulus(Common): 9 def __init__(self, formulae, rhod_w_max: float): 10 super().__init__(formulae) 11 self.th_std0 = 289 * si.kelvins 12 self.initial_water_vapour_mixing_ratio = 7.5 * si.grams / si.kilogram 13 self.p0 = 1015 * si.hectopascals 14 self.rhod_w_max = rhod_w_max 15 16 def stream_function(self, xX, zZ, _): 17 X = self.size[0] 18 return ( 19 -self.rhod_w_max * X / np.pi * np.sin(np.pi * zZ) * np.cos(2 * np.pi * xX) 20 ) 21 22 def rhod_of_zZ(self, zZ): 23 p = getattr( 24 self.formulae.hydrostatics, 25 "p_of_z_assuming_const_th_and_initial_water_vapour_mixing_ratio", 26 )( 27 self.formulae.constants.g_std, 28 self.p0, 29 self.th_std0, 30 self.initial_water_vapour_mixing_ratio, 31 z=zZ * self.size[-1], 32 ) 33 rhod = self.formulae.state_variable_triplet.rho_d( 34 p, self.initial_water_vapour_mixing_ratio, self.th_std0 35 ) 36 return rhod
def
rhod_of_zZ(self, zZ):
22 def rhod_of_zZ(self, zZ): 23 p = getattr( 24 self.formulae.hydrostatics, 25 "p_of_z_assuming_const_th_and_initial_water_vapour_mixing_ratio", 26 )( 27 self.formulae.constants.g_std, 28 self.p0, 29 self.th_std0, 30 self.initial_water_vapour_mixing_ratio, 31 z=zZ * self.size[-1], 32 ) 33 rhod = self.formulae.state_variable_triplet.rho_d( 34 p, self.initial_water_vapour_mixing_ratio, self.th_std0 35 ) 36 return rhod
Inherited Members
- PySDM_examples.Morrison_and_Grabowski_2007.common.Common
- formulae
- condensation_rtol_x
- condensation_rtol_thd
- condensation_adaptive
- condensation_substeps
- condensation_dt_cond_range
- condensation_schedule
- coalescence_adaptive
- coalescence_dt_coal_range
- coalescence_optimized_random
- coalescence_substeps
- kernel
- coalescence_efficiency
- breakup_efficiency
- breakup_fragmentation
- freezing_singular
- freezing_thaw
- freezing_inp_spec
- displacement_adaptive
- displacement_rtol
- freezing_inp_frac
- n_sd_per_gridbox
- aerosol_radius_threshold
- drizzle_radius_threshold
- r_bins_edges
- T_bins_edges
- terminal_velocity_radius_bin_edges
- output_interval
- spin_up_time
- mode_1
- mode_2
- spectrum_per_mass_of_dry_air
- kappa
- processes
- mpdata_iters
- mpdata_iga
- mpdata_fct
- mpdata_tot
- versions
- dt
- simulation_time
- grid
- size
- n_steps
- steps_per_output_interval
- n_spin_up
- output_steps
- n_sd
- initial_vapour_mixing_ratio_profile
- initial_dry_potential_temperature_profile