PySDM_examples.Szumowski_et_al_1998.make_default_product_collection

  1import numpy as np
  2
  3from PySDM import products as PySDM_products
  4
  5
  6def make_default_product_collection(settings):
  7    cloud_range = (settings.aerosol_radius_threshold, settings.drizzle_radius_threshold)
  8    products = [
  9        # Note: consider better radius_bins_edges
 10        PySDM_products.ParticleSizeSpectrumPerMassOfDryAir(
 11            name="Particles Wet Size Spectrum",
 12            unit="mg^-1 um^-1",
 13            radius_bins_edges=settings.r_bins_edges,
 14        ),
 15        PySDM_products.ParticleSizeSpectrumPerMassOfDryAir(
 16            name="Particles Dry Size Spectrum",
 17            unit="mg^-1 um^-1",
 18            radius_bins_edges=settings.r_bins_edges,
 19            dry=True,
 20        ),
 21        PySDM_products.TotalParticleConcentration(),
 22        PySDM_products.TotalParticleSpecificConcentration(),
 23        PySDM_products.ParticleConcentration(
 24            radius_range=(0, settings.aerosol_radius_threshold)
 25        ),
 26        PySDM_products.ParticleConcentration(
 27            name="n_c_cm3", unit="cm^-3", radius_range=cloud_range
 28        ),
 29        PySDM_products.WaterMixingRatio(
 30            name="cloud water mixing ratio", radius_range=cloud_range
 31        ),
 32        PySDM_products.WaterMixingRatio(
 33            name="rain water mixing ratio",
 34            radius_range=(settings.drizzle_radius_threshold, np.inf),
 35        ),
 36        PySDM_products.ParticleConcentration(
 37            name="drizzle concentration",
 38            radius_range=(settings.drizzle_radius_threshold, np.inf),
 39            unit="cm^-3",
 40        ),
 41        PySDM_products.ParticleSpecificConcentration(
 42            name="aerosol specific concentration",
 43            radius_range=(0, settings.aerosol_radius_threshold),
 44            unit="mg^-1",
 45        ),
 46        PySDM_products.MeanRadius(unit="um"),
 47        PySDM_products.SuperDropletCountPerGridbox(),
 48        PySDM_products.AmbientRelativeHumidity(name="RH_env", var="RH"),
 49        PySDM_products.AmbientPressure(name="p_env", var="p"),
 50        PySDM_products.AmbientTemperature(name="T_env", var="T"),
 51        PySDM_products.AmbientWaterVapourMixingRatio(
 52            name="water_vapour_mixing_ratio_env", var="water_vapour_mixing_ratio"
 53        ),
 54        PySDM_products.AmbientDryAirDensity(name="rhod_env", var="rhod"),
 55        PySDM_products.AmbientDryAirPotentialTemperature(name="thd_env", var="thd"),
 56        PySDM_products.CPUTime(),
 57        PySDM_products.WallTime(),
 58        PySDM_products.EffectiveRadius(unit="um", radius_range=cloud_range),
 59        PySDM_products.RadiusBinnedNumberAveragedTerminalVelocity(
 60            radius_bin_edges=settings.terminal_velocity_radius_bin_edges
 61        ),
 62    ]
 63
 64    if settings.processes["fluid advection"]:
 65        products.append(PySDM_products.MaxCourantNumber())
 66        products.append(PySDM_products.CoolingRate(unit="K/min"))
 67    if settings.processes["condensation"]:
 68        products.append(PySDM_products.CondensationTimestepMin(name="dt_cond_min"))
 69        products.append(PySDM_products.CondensationTimestepMax(name="dt_cond_max"))
 70        products.append(PySDM_products.PeakSupersaturation(unit="%", name="S_max"))
 71        products.append(PySDM_products.ActivatingRate())
 72        products.append(PySDM_products.DeactivatingRate())
 73        products.append(PySDM_products.RipeningRate())
 74    if settings.processes["particle advection"]:
 75        products.append(
 76            PySDM_products.SurfacePrecipitation(name="surf_precip", unit="mm/day")
 77        )
 78    if settings.processes["coalescence"]:
 79        products.append(PySDM_products.CollisionTimestepMean(name="dt_coal_avg"))
 80        products.append(PySDM_products.CollisionTimestepMin(name="dt_coal_min"))
 81        products.append(PySDM_products.CollisionRatePerGridbox(name="cr"))
 82        products.append(PySDM_products.CollisionRateDeficitPerGridbox(name="crd"))
 83        products.append(PySDM_products.CoalescenceRatePerGridbox(name="cor"))
 84    if settings.processes["breakup"]:
 85        products.append(PySDM_products.BreakupRatePerGridbox(name="br"))
 86        products.append(PySDM_products.BreakupRateDeficitPerGridbox(name="brd"))
 87    if settings.processes["freezing"]:
 88        products.append(PySDM_products.IceWaterContent())
 89        if settings.freezing_singular:
 90            products.append(
 91                PySDM_products.FreezableSpecificConcentration(settings.T_bins_edges)
 92            )
 93        else:
 94            products.append(PySDM_products.TotalUnfrozenImmersedSurfaceArea())
 95            # TODO #599 immersed surf spec
 96        products.append(
 97            PySDM_products.ParticleSpecificConcentration(
 98                radius_range=(-np.inf, 0), name="n_ice"
 99            )
100        )
101
102    return products
def make_default_product_collection(settings):
  7def make_default_product_collection(settings):
  8    cloud_range = (settings.aerosol_radius_threshold, settings.drizzle_radius_threshold)
  9    products = [
 10        # Note: consider better radius_bins_edges
 11        PySDM_products.ParticleSizeSpectrumPerMassOfDryAir(
 12            name="Particles Wet Size Spectrum",
 13            unit="mg^-1 um^-1",
 14            radius_bins_edges=settings.r_bins_edges,
 15        ),
 16        PySDM_products.ParticleSizeSpectrumPerMassOfDryAir(
 17            name="Particles Dry Size Spectrum",
 18            unit="mg^-1 um^-1",
 19            radius_bins_edges=settings.r_bins_edges,
 20            dry=True,
 21        ),
 22        PySDM_products.TotalParticleConcentration(),
 23        PySDM_products.TotalParticleSpecificConcentration(),
 24        PySDM_products.ParticleConcentration(
 25            radius_range=(0, settings.aerosol_radius_threshold)
 26        ),
 27        PySDM_products.ParticleConcentration(
 28            name="n_c_cm3", unit="cm^-3", radius_range=cloud_range
 29        ),
 30        PySDM_products.WaterMixingRatio(
 31            name="cloud water mixing ratio", radius_range=cloud_range
 32        ),
 33        PySDM_products.WaterMixingRatio(
 34            name="rain water mixing ratio",
 35            radius_range=(settings.drizzle_radius_threshold, np.inf),
 36        ),
 37        PySDM_products.ParticleConcentration(
 38            name="drizzle concentration",
 39            radius_range=(settings.drizzle_radius_threshold, np.inf),
 40            unit="cm^-3",
 41        ),
 42        PySDM_products.ParticleSpecificConcentration(
 43            name="aerosol specific concentration",
 44            radius_range=(0, settings.aerosol_radius_threshold),
 45            unit="mg^-1",
 46        ),
 47        PySDM_products.MeanRadius(unit="um"),
 48        PySDM_products.SuperDropletCountPerGridbox(),
 49        PySDM_products.AmbientRelativeHumidity(name="RH_env", var="RH"),
 50        PySDM_products.AmbientPressure(name="p_env", var="p"),
 51        PySDM_products.AmbientTemperature(name="T_env", var="T"),
 52        PySDM_products.AmbientWaterVapourMixingRatio(
 53            name="water_vapour_mixing_ratio_env", var="water_vapour_mixing_ratio"
 54        ),
 55        PySDM_products.AmbientDryAirDensity(name="rhod_env", var="rhod"),
 56        PySDM_products.AmbientDryAirPotentialTemperature(name="thd_env", var="thd"),
 57        PySDM_products.CPUTime(),
 58        PySDM_products.WallTime(),
 59        PySDM_products.EffectiveRadius(unit="um", radius_range=cloud_range),
 60        PySDM_products.RadiusBinnedNumberAveragedTerminalVelocity(
 61            radius_bin_edges=settings.terminal_velocity_radius_bin_edges
 62        ),
 63    ]
 64
 65    if settings.processes["fluid advection"]:
 66        products.append(PySDM_products.MaxCourantNumber())
 67        products.append(PySDM_products.CoolingRate(unit="K/min"))
 68    if settings.processes["condensation"]:
 69        products.append(PySDM_products.CondensationTimestepMin(name="dt_cond_min"))
 70        products.append(PySDM_products.CondensationTimestepMax(name="dt_cond_max"))
 71        products.append(PySDM_products.PeakSupersaturation(unit="%", name="S_max"))
 72        products.append(PySDM_products.ActivatingRate())
 73        products.append(PySDM_products.DeactivatingRate())
 74        products.append(PySDM_products.RipeningRate())
 75    if settings.processes["particle advection"]:
 76        products.append(
 77            PySDM_products.SurfacePrecipitation(name="surf_precip", unit="mm/day")
 78        )
 79    if settings.processes["coalescence"]:
 80        products.append(PySDM_products.CollisionTimestepMean(name="dt_coal_avg"))
 81        products.append(PySDM_products.CollisionTimestepMin(name="dt_coal_min"))
 82        products.append(PySDM_products.CollisionRatePerGridbox(name="cr"))
 83        products.append(PySDM_products.CollisionRateDeficitPerGridbox(name="crd"))
 84        products.append(PySDM_products.CoalescenceRatePerGridbox(name="cor"))
 85    if settings.processes["breakup"]:
 86        products.append(PySDM_products.BreakupRatePerGridbox(name="br"))
 87        products.append(PySDM_products.BreakupRateDeficitPerGridbox(name="brd"))
 88    if settings.processes["freezing"]:
 89        products.append(PySDM_products.IceWaterContent())
 90        if settings.freezing_singular:
 91            products.append(
 92                PySDM_products.FreezableSpecificConcentration(settings.T_bins_edges)
 93            )
 94        else:
 95            products.append(PySDM_products.TotalUnfrozenImmersedSurfaceArea())
 96            # TODO #599 immersed surf spec
 97        products.append(
 98            PySDM_products.ParticleSpecificConcentration(
 99                radius_range=(-np.inf, 0), name="n_ice"
100            )
101        )
102
103    return products