Skip to content

vapour deposition on ice (temporarily as a separate dynamic - to be combined with condensation); introducing physics.latent_heat_sublimation (and renamings in physics: latent_heat to latent_heat_vapourisation, condensation_coordinate to diffusion_coordinate) #1389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 71 commits into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1992194
boilerplate code for starting with vapour deposition on ice
slayoo Sep 17, 2024
b800e64
Added looping over super particles and implemented ambient parameters
tluettm Sep 17, 2024
5be8563
Added commentary for pylint
tluettm Sep 17, 2024
894a39e
improve readability by using unfrozen trivia function
slayoo Sep 18, 2024
4e0f212
employ formula_flattened trick in deposition backend method
slayoo Sep 18, 2024
839f78c
renaming condensation coordinate to diffusion coordinate
slayoo Sep 18, 2024
7777b0c
work in progress on mass-based diffusion coordinate for deposition
slayoo Sep 18, 2024
0c879cb
Added ambient moisture and dm/dt
tluettm Sep 18, 2024
4d60bd2
Added saturation ratio over ice to deposition
tluettm Sep 18, 2024
857ca7d
Added subsaturation and saturation to deposition on ice test
tluettm Sep 19, 2024
d7783f4
Added change of water vapour mixing ratio due to deposition on ice
tluettm Sep 19, 2024
6e16036
temporarily make condensation and diffusion coordinates separate
slayoo Sep 19, 2024
7c2527b
fix for last commit
slayoo Sep 19, 2024
9284959
check if Formulae.particle_shape_and_density supports mixed phase
slayoo Sep 19, 2024
abef771
add one TODO
slayoo Sep 19, 2024
055b799
one more commit for coordinates
slayoo Sep 19, 2024
86ebc89
one more TODO
slayoo Sep 19, 2024
0697f21
work in progress on A&A example: support for freezing and vapour depo…
slayoo Sep 19, 2024
70ed3a1
missing multiplication by multiplicity; missing multiplication by den…
slayoo Sep 19, 2024
da030a5
Removed updates to predicted water vapour mixing ration to make vapou…
tluettm Sep 25, 2024
6d3b326
Added setup for kinetic correction routines in ice deposition methods
tluettm Sep 26, 2024
8e5f6dc
Added kinetic correction for diffusivity and conductivity in ice vapo…
tluettm Sep 27, 2024
f3a1bf8
Changed name of ice vapour deposition kinetic corection routine
tluettm Oct 7, 2024
c229529
Added capacity of ice crystals during deposition of vapour as its own…
tluettm Oct 7, 2024
75a61e5
Added latent heat of sublimation routines
tluettm Oct 7, 2024
3a8cabc
Added ice crystal temperature correction factor for vapour deposition
tluettm Oct 8, 2024
95cf76e
Added latent heating for ice vapour deposition and included it in uni…
tluettm Oct 9, 2024
211f1f0
Merge github.com:slayoo/PySDM into HEAD
tluettm Dec 11, 2024
0e839c4
Checked values for howell factor and added it to deposition growth term
tluettm Dec 11, 2024
87deb4f
Merge branch 'main' into deposition
slayoo Jan 2, 2025
fe94710
precommit changes
slayoo Jan 3, 2025
6fc3266
Removed commented section in unit test
tluettm Feb 11, 2025
631823a
Merged main into deposition
tluettm Feb 12, 2025
5725b31
Merged main into deposition
tluettm Feb 12, 2025
59f7f84
Merged remote deposition into local deposition
tluettm Feb 14, 2025
8bf40bc
Resolved merge conflicts and introduced signed water mass to depositi…
tluettm Feb 20, 2025
cc7c54a
Added reference for MAC and HAC ice coefficients
tluettm Feb 20, 2025
441cbc3
remove spurious files
slayoo Mar 21, 2025
4d7831d
fixing merge conflicts
slayoo Mar 21, 2025
b19f88b
rename condensation_coordinate to diffusion_coordinate
slayoo Mar 21, 2025
c733ae1
remove leftover file
slayoo Mar 21, 2025
c57d505
precommit, pylint hints, removing leftover files
slayoo Mar 22, 2025
c9cf54e
test for M&K latent heat, refactors, cleanups
slayoo Mar 22, 2025
4b4d8d7
pylint hints
slayoo Mar 22, 2025
4e40da6
pylint disable, todo labels, cleanups
slayoo Mar 22, 2025
3c70445
pylint disable comments
slayoo Mar 22, 2025
b2b8888
bib fix, removing code that is part of homogeneous freezing PR #1488
slayoo Mar 23, 2025
c4381fd
adapting A&A example code, regenerated notebook, more latent_heat API…
slayoo Mar 23, 2025
2207051
latent heat API changes
slayoo Mar 23, 2025
cb0073e
fixes in deposition backend method, regenerated notebook
slayoo Mar 23, 2025
9569d70
one more pylint disable
slayoo Mar 23, 2025
11f1755
one more latent_heat_vapourisation fix
slayoo Mar 23, 2025
679d433
fix smoke test
slayoo Mar 23, 2025
0912732
parallel=False for Numba in deposition
slayoo Mar 24, 2025
a99651d
shorten execution time of the new not-so-unit test
slayoo Mar 24, 2025
5d91131
added unit test for relative growth rates for vapour deposition on ice
tluettm Mar 24, 2025
7e05754
add unit test for dm_dt(m) based on Spichtinger & Gierens 2009 Fig. 5
slayoo Mar 27, 2025
eaf0df3
Changed Howell factor
tluettm Mar 27, 2025
358fa48
Merge pull request #52 from tluettm/howell_factor_rewrite
slayoo Mar 27, 2025
0d99faa
Merge branch 'deposition' into test_relative_growth_rates
slayoo Mar 27, 2025
3594be8
Merge pull request #51 from tluettm/test_relative_growth_rates
slayoo Mar 27, 2025
563d794
shorten relative mass rate test code
slayoo Mar 27, 2025
97285e5
add asserts to the S&G test (which fail for logarithmic coordinate!)
slayoo Mar 27, 2025
a454545
reuse common code for howell factor
slayoo Mar 27, 2025
bdc257f
pylint hints
slayoo Mar 27, 2025
077dad2
bibs
slayoo Mar 27, 2025
423bc6c
comment -> docstring
slayoo Mar 27, 2025
b3d0b76
shorter timestep, more asserts
slayoo Mar 28, 2025
b237de2
Merge remote-tracking branch 'upstream/main' into HEAD
slayoo Mar 30, 2025
925b74b
regenerate A&A notebook with shorter timestep
slayoo Mar 30, 2025
5aa947e
disable test for "homogeneous"
slayoo Mar 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PySDM/backends/impl_numba/methods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
from .physics_methods import PhysicsMethods
from .terminal_velocity_methods import TerminalVelocityMethods
from .seeding_methods import SeedingMethods
from .deposition_methods import DepositionMethods
18 changes: 9 additions & 9 deletions PySDM/backends/impl_numba/methods/condensation_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def step_impl( # pylint: disable=too-many-arguments,too-many-locals
rhod, T, water_vapour_mixing_ratio
)
pv = formulae.state_variable_triplet__pv(p, water_vapour_mixing_ratio)
lv = formulae.latent_heat__lv(T)
lv = formulae.latent_heat_vapourisation__lv(T)
pvs = formulae.saturation_vapour_pressure__pvs_water(T)
DTp = formulae.diffusion_thermics__D(T, p)
RH = pv / pvs
Expand Down Expand Up @@ -390,9 +390,9 @@ def minfun( # pylint: disable=too-many-arguments,too-many-locals
K,
ventilation_factor,
):
if x_new > formulae.condensation_coordinate__x_max():
if x_new > formulae.diffusion_coordinate__x_max():
return x_old - x_new
mass_new = formulae.condensation_coordinate__mass(x_new)
mass_new = formulae.diffusion_coordinate__mass(x_new)
volume_new = formulae.particle_shape_and_density__mass_to_volume(mass_new)
r_new = formulae.trivia__radius(volume_new)
RH_eq = formulae.hygroscopicity__RH_eq(
Expand All @@ -418,7 +418,7 @@ def minfun( # pylint: disable=too-many-arguments,too-many-locals
return (
x_old
- x_new
+ timestep * formulae.condensation_coordinate__dx_dt(mass_new, dm_dt)
+ timestep * formulae.diffusion_coordinate__dx_dt(mass_new, dm_dt)
)

@numba.njit(**jit_flags)
Expand Down Expand Up @@ -450,9 +450,9 @@ def calculate_ml_new( # pylint: disable=too-many-branches,too-many-arguments,to
v_drop = formulae.particle_shape_and_density__mass_to_volume(
attributes.water_mass[drop]
)
x_old = formulae.condensation_coordinate__x(attributes.water_mass[drop])
x_old = formulae.diffusion_coordinate__x(attributes.water_mass[drop])
r_old = formulae.trivia__radius(v_drop)
x_insane = formulae.condensation_coordinate__x(
x_insane = formulae.diffusion_coordinate__x(
formulae.particle_shape_and_density__volume_to_mass(
attributes.vdry[drop] / 100
)
Expand Down Expand Up @@ -499,11 +499,11 @@ def calculate_ml_new( # pylint: disable=too-many-branches,too-many-arguments,to
Kr,
ventilation_factor,
)
mass_old = formulae.condensation_coordinate__mass(x_old)
mass_old = formulae.diffusion_coordinate__mass(x_old)
dm_dt_old = formulae.particle_shape_and_density__dm_dt(
r=r_old, r_dr_dt=r_dr_dt_old
)
dx_old = timestep * formulae.condensation_coordinate__dx_dt(
dx_old = timestep * formulae.diffusion_coordinate__dx_dt(
mass_old, dm_dt_old
)
else:
Expand Down Expand Up @@ -572,7 +572,7 @@ def calculate_ml_new( # pylint: disable=too-many-branches,too-many-arguments,to
else:
x_new = x_old

mass_new = formulae.condensation_coordinate__mass(x_new)
mass_new = formulae.diffusion_coordinate__mass(x_new)
mass_cr = formulae.particle_shape_and_density__volume_to_mass(
attributes.v_cr[drop]
)
Expand Down
172 changes: 172 additions & 0 deletions PySDM/backends/impl_numba/methods/deposition_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
"""basic water vapor deposition on ice for CPU backend, for Howell factor see:
[Howell 1949](https://doi.org/10.1175/1520-0469(1949)006%3C0134:TGOCDI%3E2.0.CO;2)
"""

from functools import cached_property
import numba
import numpy as np
from PySDM.backends.impl_common.backend_methods import BackendMethods


class DepositionMethods(BackendMethods): # pylint:disable=too-few-public-methods
@cached_property
def _deposition(self):
assert self.formulae.particle_shape_and_density.supports_mixed_phase()

formulae = self.formulae_flattened

@numba.njit(**{**self.default_jit_flags, **{"parallel": False}})
def body( # pylint: disable=too-many-arguments
*,
multiplicity,
signed_water_mass,
current_temperature,
current_total_pressure,
current_relative_humidity,
current_water_activity,
current_vapour_mixing_ratio,
current_dry_air_density,
current_dry_potential_temperature,
cell_volume,
time_step,
cell_id,
reynolds_number,
schmidt_number,
# to be modified
predicted_vapour_mixing_ratio,
predicted_dry_potential_temperature,
):
# pylint: disable=too-many-locals
n_sd = len(signed_water_mass)
for i in range(n_sd):
if not formulae.trivia__unfrozen(signed_water_mass[i]):
ice_mass = -signed_water_mass[i]
cid = cell_id[i]

radius = formulae.particle_shape_and_density__mass_to_radius(
signed_water_mass[i]
)

diameter = radius * 2.0

temperature = current_temperature[cid]
pressure = current_total_pressure[cid]
rho = current_dry_air_density[cid]
pvs_ice = formulae.saturation_vapour_pressure__pvs_ice(temperature)
latent_heat_sub = formulae.latent_heat_sublimation__ls(temperature)

capacity = formulae.diffusion_ice_capacity__capacity(diameter)

ventilation_factor = formulae.ventilation__ventilation_coefficient(
sqrt_re_times_cbrt_sc=formulae.trivia__sqrt_re_times_cbrt_sc(
Re=reynolds_number[i],
Sc=schmidt_number[cid],
)
)

Dv_const = formulae.diffusion_thermics__D(temperature, pressure)
lambdaD = formulae.diffusion_ice_kinetics__lambdaD(
temperature, pressure
)
diffusion_coefficient = formulae.diffusion_ice_kinetics__D(
Dv_const, radius, lambdaD, temperature
)

Ka_const = formulae.diffusion_thermics__K(temperature, pressure)
lambdaK = formulae.diffusion_ice_kinetics__lambdaK(
temperature, pressure
)
thermal_conductivity = formulae.diffusion_ice_kinetics__K(
Ka_const, radius, lambdaK, temperature, rho
)
saturation_ratio_ice = (
current_relative_humidity[cid] / current_water_activity[cid]
)

if saturation_ratio_ice == 1:
continue

howell_factor_x_diffcoef_x_rhovsice_x_icess = (
formulae.drop_growth__r_dr_dt(
RH_eq=1,
T=temperature,
RH=saturation_ratio_ice,
lv=latent_heat_sub,
pvs=pvs_ice,
D=diffusion_coefficient,
K=thermal_conductivity,
ventilation_factor=ventilation_factor,
)
* formulae.constants.rho_w
)

dm_dt = (
4
* np.pi
* capacity
* howell_factor_x_diffcoef_x_rhovsice_x_icess
)

delta_rv_i = (
-dm_dt * multiplicity[i] * time_step / (cell_volume * rho)
)
if -delta_rv_i > current_vapour_mixing_ratio[cid]:
assert False

Check warning on line 114 in PySDM/backends/impl_numba/methods/deposition_methods.py

View check run for this annotation

Codecov / codecov/patch

PySDM/backends/impl_numba/methods/deposition_methods.py#L114

Added line #L114 was not covered by tests
predicted_vapour_mixing_ratio[cid] += delta_rv_i

predicted_dry_potential_temperature[cid] += (
formulae.state_variable_triplet__dthd_dt(
rhod=current_dry_air_density[cid],
thd=current_dry_potential_temperature[cid],
T=temperature,
d_water_vapour_mixing_ratio__dt=delta_rv_i / time_step,
lv=latent_heat_sub,
)
* time_step
)

x_old = formulae.diffusion_coordinate__x(ice_mass)
dx_dt_old = formulae.diffusion_coordinate__dx_dt(ice_mass, dm_dt)
x_new = formulae.trivia__explicit_euler(x_old, time_step, dx_dt_old)
signed_water_mass[i] = -formulae.diffusion_coordinate__mass(x_new)

return body

def deposition( # pylint: disable=too-many-locals
self,
*,
multiplicity,
signed_water_mass,
current_temperature,
current_total_pressure,
current_relative_humidity,
current_water_activity,
current_vapour_mixing_ratio,
current_dry_air_density,
current_dry_potential_temperature,
cell_volume,
time_step,
cell_id,
reynolds_number,
schmidt_number,
predicted_vapour_mixing_ratio,
predicted_dry_potential_temperature,
):
self._deposition(
multiplicity=multiplicity.data,
signed_water_mass=signed_water_mass.data,
current_temperature=current_temperature.data,
current_total_pressure=current_total_pressure.data,
current_relative_humidity=current_relative_humidity.data,
current_water_activity=current_water_activity.data,
current_vapour_mixing_ratio=current_vapour_mixing_ratio.data,
current_dry_air_density=current_dry_air_density.data,
current_dry_potential_temperature=current_dry_potential_temperature.data,
cell_volume=cell_volume,
time_step=time_step,
cell_id=cell_id.data,
reynolds_number=reynolds_number.data,
schmidt_number=schmidt_number.data,
predicted_vapour_mixing_ratio=predicted_vapour_mixing_ratio.data,
predicted_dry_potential_temperature=predicted_dry_potential_temperature.data,
)
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _make_solve(formulae): # pylint: disable=too-many-statements,too-many-local

@numba.njit(**{**JIT_FLAGS, **{"parallel": False}})
def _liquid_water_mixing_ratio(n, x, m_d_mean):
return np.sum(n * jit_formulae.condensation_coordinate__mass(x)) / m_d_mean
return np.sum(n * jit_formulae.diffusion_coordinate__mass(x)) / m_d_mean

@numba.njit(**{**JIT_FLAGS, **{"parallel": False}})
def _impl( # pylint: disable=too-many-arguments,too-many-locals
Expand Down Expand Up @@ -127,7 +127,7 @@ def _impl( # pylint: disable=too-many-arguments,too-many-locals
)
sum_n_dm_dt = 0
for i, x_i in enumerate(x):
m = jit_formulae.condensation_coordinate__mass(x_i)
m = jit_formulae.diffusion_coordinate__mass(x_i)
v = jit_formulae.particle_shape_and_density__mass_to_volume(m)
r = jit_formulae.trivia__radius(v)
Dr = jit_formulae.diffusion_kinetics__D(DTp, r, lambdaD)
Expand All @@ -152,7 +152,7 @@ def _impl( # pylint: disable=too-many-arguments,too-many-locals
ventilation_factor,
)
dm_dt = jit_formulae.particle_shape_and_density__dm_dt(r, r_dr_dt)
dy_dt[idx_x + i] = jit_formulae.condensation_coordinate__dx_dt(m, dm_dt)
dy_dt[idx_x + i] = jit_formulae.diffusion_coordinate__dx_dt(m, dm_dt)
sum_n_dm_dt += n[i] * dm_dt
dy_dt[idx_thd] = dot_thd + jit_formulae.state_variable_triplet__dthd_dt(
rhod, thd, T, dot_water_vapour_mixing_ratio - sum_n_dm_dt / m_d_mean, lv
Expand Down Expand Up @@ -211,7 +211,7 @@ def _odesys( # pylint: disable=too-many-arguments,too-many-locals
air_dynamic_viscosity,
rhod,
pvs,
jit_formulae.latent_heat__lv(T),
jit_formulae.latent_heat_vapourisation__lv(T),
)
return dy_dt

Expand All @@ -234,7 +234,7 @@ def solve( # pylint: disable=too-many-arguments,too-many-locals,unused-argument
n_sd_in_cell = len(cell_idx)
y0 = np.empty(n_sd_in_cell + idx_x)
y0[idx_thd] = thd
y0[idx_x:] = jit_formulae.condensation_coordinate__x(
y0[idx_x:] = jit_formulae.diffusion_coordinate__x(
attributes.water_mass[cell_idx]
)
total_water_mixing_ratio = (
Expand Down Expand Up @@ -282,7 +282,7 @@ def solve( # pylint: disable=too-many-arguments,too-many-locals,unused-argument
m_new = 0
for i in range(n_sd_in_cell):
attributes.water_mass[cell_idx[i]] = (
jit_formulae.condensation_coordinate__mass(y1[idx_x + i])
jit_formulae.diffusion_coordinate__mass(y1[idx_x + i])
)
m_new += (
attributes.multiplicity[cell_idx[i]]
Expand Down
16 changes: 8 additions & 8 deletions PySDM/backends/impl_thrust_rtc/methods/condensation_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def __update_drop_masses(self):
struct Minfun {{
static __device__ real_type value(real_type x_new, void* args_p) {{
auto args = static_cast<real_type*>(args_p);
if (x_new > {phys.condensation_coordinate.x_max.c_inline()}) {{
if (x_new > {phys.diffusion_coordinate.x_max.c_inline()}) {{
return {args("x_old")} - x_new;
}}
auto m_new = {phys.condensation_coordinate.mass.c_inline(x="x_new")};
auto m_new = {phys.diffusion_coordinate.mass.c_inline(x="x_new")};
auto v_new = {phys.particle_shape_and_density.mass_to_volume.c_inline(mass="m_new")};
auto r_new = {phys.trivia.radius.c_inline(volume="v_new")};
auto sgm = {phys.surface_tension.sigma.c_inline(
Expand Down Expand Up @@ -133,7 +133,7 @@ def __update_drop_masses(self):
r="r_new", r_dr_dt="r_dr_dt"
)};
return {args("x_old")} - x_new + {args("dt")} * {
phys.condensation_coordinate.dx_dt.c_inline(m="m_new", dm_dt="dm_dt")
phys.diffusion_coordinate.dx_dt.c_inline(m="m_new", dm_dt="dm_dt")
};
}}
}};
Expand All @@ -152,10 +152,10 @@ def __update_drop_masses(self):
auto v_old = {phys.particle_shape_and_density.mass_to_volume.c_inline(
mass="water_mass[i]"
)};
auto x_old = {phys.condensation_coordinate.x.c_inline(mass="water_mass[i]")};
auto x_old = {phys.diffusion_coordinate.x.c_inline(mass="water_mass[i]")};
auto r_old = {phys.trivia.radius.c_inline(volume="v_old")};
auto m_insane = {phys.particle_shape_and_density.volume_to_mass.c_inline(volume="vdry[i] / 100")};
auto x_insane = {phys.condensation_coordinate.x.c_inline(mass="m_insane")};
auto x_insane = {phys.diffusion_coordinate.x.c_inline(mass="m_insane")};
auto rd3 = vdry[i] / {const.PI_4_3};
auto sgm = {phys.surface_tension.sigma.c_inline(
T="_T", v_wet="v", v_dry="vdry[i]", f_org="_f_org[i]"
Expand Down Expand Up @@ -194,7 +194,7 @@ def __update_drop_masses(self):
ventilation_factor="ventilation_factor",
)};
dm_dt_old = {phys.particle_shape_and_density.dm_dt.c_inline(r="r_old", r_dr_dt="r_dr_dt_old")};
dx_old = dt * {phys.condensation_coordinate.dx_dt.c_inline(
dx_old = dt * {phys.diffusion_coordinate.dx_dt.c_inline(
m="water_mass[i]", dm_dt="dm_dt_old"
)};
}}
Expand Down Expand Up @@ -249,7 +249,7 @@ def __update_drop_masses(self):
x_new = x_old;
}}
}}
water_mass[i] = {phys.condensation_coordinate.mass.c_inline(x="x_new")};
water_mass[i] = {phys.diffusion_coordinate.mass.c_inline(x="x_new")};
""".replace(
"real_type", self._get_c_type()
),
Expand Down Expand Up @@ -323,7 +323,7 @@ def __pre(self):
)};
pv[i] = {phys.state_variable_triplet.pv.c_inline(
p='p[i]', water_vapour_mixing_ratio='predicted_water_vapour_mixing_ratio[i]')};
lv[i] = {phys.latent_heat.lv.c_inline(
lv[i] = {phys.latent_heat_vapourisation.lv.c_inline(
T='T[i]')};
pvs[i] = {phys.saturation_vapour_pressure.pvs_water.c_inline(
T='T[i]')};
Expand Down
2 changes: 2 additions & 0 deletions PySDM/backends/numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Numba( # pylint: disable=too-many-ancestors,duplicate-code
methods.TerminalVelocityMethods,
methods.IsotopeMethods,
methods.SeedingMethods,
methods.DepositionMethods,
):
Storage = ImportedStorage
Random = ImportedRandom
Expand Down Expand Up @@ -78,3 +79,4 @@ def __init__(self, formulae=None, double_precision=True, override_jit_flags=None
methods.TerminalVelocityMethods.__init__(self)
methods.IsotopeMethods.__init__(self)
methods.SeedingMethods.__init__(self)
methods.DepositionMethods.__init__(self)
1 change: 1 addition & 0 deletions PySDM/dynamics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
from PySDM.dynamics.freezing import Freezing
from PySDM.dynamics.relaxed_velocity import RelaxedVelocity
from PySDM.dynamics.seeding import Seeding
from PySDM.dynamics.vapour_deposition_on_ice import VapourDepositionOnIce
20 changes: 20 additions & 0 deletions PySDM/dynamics/vapour_deposition_on_ice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""basic water vapor deposition on ice"""

from PySDM.dynamics.impl import register_dynamic


@register_dynamic()
class VapourDepositionOnIce:
def __init__(self):
"""called by the user while building a particulator"""
self.particulator = None

def register(self, *, builder):
"""called by the builder"""
self.particulator = builder.particulator
assert builder.formulae.particle_shape_and_density.supports_mixed_phase()
builder.request_attribute("Reynolds number")

def __call__(self):
"""called by the particulator during simulation"""
self.particulator.deposition()
Loading
Loading