Skip to content

Ideas for new features and examples

Sylwester Arabas edited this page Sep 15, 2023 · 76 revisions

Some of the ideas listed below are good candidates for individual or team projects or theses.

Physics:

  • mixing scenario indicator product (like the alpha parameter from Grabowski & Morrison)
  • deliquescence + efflorescence
  • cloud formation on adiabatic descent (Bohren 1986, JAS)
  • radiative transfer (see Numba code here: https://doi.org/10.1016/j.cpc.2021.108198)
  • cloud biology: https://acp.copernicus.org/articles/20/1777/2020/acp-20-1777-2020.html
  • Ouzo (Ostwald ripening)
  • ventilation coefficient in condensation
  • turbulent kernels
  • drop temperatures
  • the initial water amount added to the system by r_wet_init - where and how to take into account/report
  • diffusion kinetics as in eq. 9 G&T'21: https://acp.copernicus.org/articles/21/4059/2021/
  • add checks for mass conservation in dry radius discretisation (if we are discretising number distribution, in the example (or even within initialisation logic) we should be able to impose a threshold on the acceptable level of incurred mass difference (between the one obtainable via moments of dry volume and the analytical value stemming from lognormal distribution parameters))
  • Eulerian diffusion in kinematic_2d: through mu_coeff of PyMPDATA

Chemistry:

  • support for >0D (not aware of any major reason it should not work!)
  • reproduce 2D setup simulations from J&P (but also Schmeller & Geresdi '19)
  • @njit for all methods
  • numba.prange where possible
  • better than Explicit Euler in oxidation
  • take Henry coefficients and other constants from chempy?
  • GPU support

New examples:

Unit test ideas

  • two-sd ripening test case
  • n=0 energy conservation test for parcel
  • unit test checking precipitation from other than lowest grid cell
  • 32-bit multiplicity overflows (see xfail in Berry smoke test)
  • tests for collision_deficit=0 with adaptivity=True (and !=0 for adaptivity=False) (i.e., min would not be needed in g = min(int(gamma[i]), prop) in compute_gamma_body() with adaptivity)
  • depict float/double difference case with a unit test (to check if fakeThrust is able to reproduce it) (this first need a big refactor around PrecisionResolver - currently switching the precision requires modifying source code!)
  • include a sample reference netCDF file in the repo and check if its contents match the data generated within CI (what about including Wall and CPU times?)
  • unit test for presence of zero-filling loop in sum_pair and alike (case of odd number of sd and single-sd in adjecent cells)
  • test with coal_dt_range=[dt, dt] and fixed seed -> should be same behaviour as adaptive=False

Refactors

  • around super().sync()/self.notify() magic in moist environments
  • common base class for kinematic envs
  • phase out precision resolver (precision field for Formulae?) + usage also for constants
  • unify ParticlesSizeSpectrum and ParticlesVolumeSpectrum products
  • combine fuse logic with dt_range in make_adapt_substeps(), i.e. set n_substeps_max = ... (fuse) instead of raising NotImplementedError()
  • remove length from backend methods (len(idx) enough)
  • remove all explicit types from C++ code in Thrust backend (decltype + auto should be enough)
  • something cleaner than: particulator.attributes.attributes[...].mark_updated()
  • create a base class for all *Methods backend.impl classes to fix self.formulae initialisation
  • shouldn't Pint be a test-time dependency only?
  • sort out double si units in examples (one fake, one real)
  • do recalculate_cell_id & recalculate TpRH from within attributes

Performance:

  • employ MergeShuffle for parallel permutations (https://github.com/axel-bacher/mergeshuffle)
  • lookup tables for speeding up physics
  • moments, moments, moments
  • use atomicAdd in Numba flag_precipitated
  • introduce times_max? (one loop less on GPU)
  • padding of arrays for ThrustRTC: idx size and relative storages sizes should be a multiple of 32 to ensure that all data of 1 super-droplets are in one GPU memory bank to avoid serialization
  • rethink if gamma vector should not be of integer type
  • gradually decrease the amount of shuffled numbers during adaptive coalescence substeps
  • parallel random shuffling on CPU (np.random.rand() within numba.prange), hint: https://github.com/numba/numba/issues/2486#issuecomment-320089562
  • one loop instead of two in coalescence normalize (without the need to use temporary memory for norm_factor)

Non-physics new features/refactors:

Visualisations, interactive notebooks, etc:

  • enhance out-of-the box settings in Paraview (netCDF output)
  • kernel plots
  • droplets in space with vtk-js: https://kitware.github.io/vtk-js/examples/
  • more controls in kinematic 2D GUI: spin-up, random seed, terminal velocity choice, kernel choice, backend choice, aerosol spectrum parameters, parallelisation controls, products, initialisation controls (constant multiplicity, ...)

New CI features (most also applies to PyMPDATA):

Packaging, dissemination, etc:

  • conda package