Open
Conversation
Document outlines approaches for extending LEM to handle: - Sedimentation: particles falling through S' field - Ice particle statistics: low multiplicity problem - Phase coupling: WBF process and S' fluctuations Five approaches analyzed with pros/cons: A) Phase-Separated LEM B) Spatial LEM (Fortran research code style) C) Lagrangian S' History (recommended) D) Conditional Statistics E) Hybrid approach Includes research questions and suggested starting point.
- collision.py: Remove hardcoded V_parcel=1.0 and rho_parcel=1.0, use actual parcel density/volume (collision rates were ~82x too high) - collision.py: Fix E_H80 interpolation to convert radius to microns (missing *1.0E6 disabled interpolation entirely) - collision.py: Fix kappa sequential mutation bug in same_weights_update and rewrite mass logic to match Fortran reference pattern - collision.py: Remove unnecessary hardcoded constants that shadowed function parameters - parameters.py: Fix N_l trailing comma that made it a tuple - parcel.py: Fix temperature sign logic for sine/oscillation modes (use T -= dz*g/cp unconditionally instead of checking w_parcel sign) - condensation.py: Fix dead wrong V_parcel formula (was 100/P/(R*T)) - analysis.py: Guard division by zero when no cloud droplets exist
- widget.py: nt_widget uses BoundedIntText (min=1, max=100000) - widget.py: sigma min 0.0→0.01, mu min 0.0→0.001 to prevent div-by-zero - print_plot.py: jet→viridis colormap (perceptually uniform) - print_plot.py: fix "Evaporaton" typo - print_plot.py: move deepcopy outside DSD loop (was re-copying every iteration) - print_plot.py: fig.show()→plt.show() for Jupyter compatibility - timestep_routine.py: add tqdm progress bar - timestep_routine.py: move time_array outside loop (was recomputed every step) - timestep_routine.py: remove unused pylab import
- animation.py: Replace clear_output()+fig.show() loop pattern with FigureWidget + batch_update for in-place updates (no memory leak) - animation.py: Only slice data up to current timestep (was sending full arrays) - aero_init.py: Remove unused scipy.stats.lognorm import
Presets (widget.py): - Maritime/Continental/Arctic dropdown auto-fills aerosol grid - Maritime: few hygroscopic CCN → fast rain onset - Continental: many small CCN → suppressed rain - Arctic: ultra-clean → extreme drizzle behavior Ablation Lab (widget.py + physics modules): - Kelvin (curvature) effect toggle: afactor=0 when off - Raoult (solute) effect toggle: bfactor=0 when off - Constant collision efficiency (E=1) vs Hall (1980) - Simplified terminal velocity (Stokes) vs Beard (1976) - ws_drops_stokes() added for pure Stokes drag comparison - All switches threaded through timestep_routine → physics modules Performance (@jit): - radius_liquid_euler: 0.2 µs/call with numba nopython - esatw: 0.1 µs/call with numba nopython - sigma_air_liq: JIT-compiled with cache - Removed unused scipy.optimize import
Port turbulent collision kernel (Ayala et al. 2008, NJP; Wang & Grabowski 2009, QJRMS) from SAM-LCM micro_coll.f90: - phi_w(), zhi_func(): helper functions for Ayala analytical model - gck(): general collection kernel with turbulent radial relative velocity and radial distribution function - E_turb(): turbulent enhancement factor lookup tables at epsilon = 100 and 400 cm^2/s^3 with bilinear interpolation - Ablation Lab toggle + epsilon widget in notebook
- Fix ZeroDivisionError when particles have M=0 or Ns=0 after collision (skip degenerate particles in condensation loop) - Add safety floor in Newton-Raphson solver for r_aero=0 and r_eul_old=0 - Add adaptive condensation substep option (Arnason & Brown 1971): dt_sub = min(2*tau_phase, dt) where tau_phase = 1/(4*pi*D_v*sum(A*r)/V) - New widget toggle in Ablation Lab + threaded through notebook
Fix Nc/Nr unit convention: multiply PyLCM values by rho to convert from /kg/1e6 to proper /cm3, matching Fortran output convention.
When p_crit > 1 in LSM, gamma = NINT(p_crit) collisions occur per pair instead of just 1. Includes limiter to prevent over-collection. Reduces PyLCM peak Nr from ~20 to ~6 /cm3 (Fortran: 2.2 /cm3).
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.