PySDM_examples.Arabas_et_al_2023.frozen_fraction

 1class FrozenFraction:
 2    def __init__(self, *, volume, droplet_volume, total_particle_number, rho_w):
 3        self.volume = volume
 4        self.rho_w = rho_w
 5        self.droplet_volume = droplet_volume
 6        self.total_particle_number = total_particle_number
 7
 8    def qi2ff(self, ice_mass_per_volume):
 9        ice_mass = ice_mass_per_volume * self.volume
10        ice_number = ice_mass / (self.rho_w * self.droplet_volume)
11        frozen_fraction = ice_number / self.total_particle_number
12        return frozen_fraction
13
14    def ff2qi(self, frozen_fraction):
15        ice_number = frozen_fraction * self.total_particle_number
16        ice_mass = ice_number * (self.rho_w * self.droplet_volume)
17        ice_mass_per_volume = ice_mass / self.volume
18        return ice_mass_per_volume
class FrozenFraction:
 2class FrozenFraction:
 3    def __init__(self, *, volume, droplet_volume, total_particle_number, rho_w):
 4        self.volume = volume
 5        self.rho_w = rho_w
 6        self.droplet_volume = droplet_volume
 7        self.total_particle_number = total_particle_number
 8
 9    def qi2ff(self, ice_mass_per_volume):
10        ice_mass = ice_mass_per_volume * self.volume
11        ice_number = ice_mass / (self.rho_w * self.droplet_volume)
12        frozen_fraction = ice_number / self.total_particle_number
13        return frozen_fraction
14
15    def ff2qi(self, frozen_fraction):
16        ice_number = frozen_fraction * self.total_particle_number
17        ice_mass = ice_number * (self.rho_w * self.droplet_volume)
18        ice_mass_per_volume = ice_mass / self.volume
19        return ice_mass_per_volume
FrozenFraction(*, volume, droplet_volume, total_particle_number, rho_w)
3    def __init__(self, *, volume, droplet_volume, total_particle_number, rho_w):
4        self.volume = volume
5        self.rho_w = rho_w
6        self.droplet_volume = droplet_volume
7        self.total_particle_number = total_particle_number
volume
rho_w
droplet_volume
total_particle_number
def qi2ff(self, ice_mass_per_volume):
 9    def qi2ff(self, ice_mass_per_volume):
10        ice_mass = ice_mass_per_volume * self.volume
11        ice_number = ice_mass / (self.rho_w * self.droplet_volume)
12        frozen_fraction = ice_number / self.total_particle_number
13        return frozen_fraction
def ff2qi(self, frozen_fraction):
15    def ff2qi(self, frozen_fraction):
16        ice_number = frozen_fraction * self.total_particle_number
17        ice_mass = ice_number * (self.rho_w * self.droplet_volume)
18        ice_mass_per_volume = ice_mass / self.volume
19        return ice_mass_per_volume