Python based practical for Exoclimes VII cloud modelling review talk. This repository acts as a supplemental to the presentation (included here too).
Each example code has extended notes and line-by-line comments that detail each part of each method. Suggestions, ideas and improvements that help the learning/user experience are most welcome!
Each example uses a 1D approach to demonstrate the salient features of each approach. It is relatively simple to design 3D versions and couple to hydrodynamic models (e.g. GCMs).
- Example 1: Ackerman & Marley (2001) model
- Example 2: Tracer saturation adustment model
- Example 3: Two-moment monodisperse mass moment mixed material model
NOTE: The best way to generate a non-irradiated profile (e.g. brown dwarf) is set the zenith angle to a small value (e.g. mu_z = 1e-6) and Tirr to a low value (e.g. Tirr = 1), rather than set Tirr = 0. Then set the Tint to the required Teff. This is just due to the (probably bad) way the semi-grey and picket-fence T-p profile calculation was coded.
To run the code for each example, for example, example 1.py, enter the following in the terminal:
python example_1.py
You will need to install the following packages for the examples to work, (e.g. using conda or pip):
- pyyaml
- numpy
- scipy
- matplotlib
- seaborn
- numba (for @jit constructs)
This should generate matplotlib plot popups, as well as png files in the directory with the results.
Parameters for each example can be modified in the parameters.yaml file - feel free to modify this to try out different scenarios. Various condensation species can be set, see the `vapour_pressure' function in the atm_module.py file for a complete list. Then set the appropriate paramaters in the parameter.yaml file for that species.
WARNING: examples 2 and 3 will take longer to calculate than 1, in the small amount of integration time used as the default here, you're unlikely to achieve a converged solution.
I use an implicit Crank-Nicolson 1D diffusion solver and 1D MUSCL-like advection solver with 3 step Runge-Kutta for the particle settling rates. In addition, for 1D models a Strang operator splitting scheme is used to try conserve 2nd order time accuracy, for GCMs you can use a single call with full timesteps to speed up computation, as 2nd-3rd order accuracy is typically not needed anyway.
- Woitke & Helling (2003)
- Woitke & Helling (2004)
- Helling & Woitke (2006)
- Helling et al. (2008)
- Woitke et al. (2020)
These are codes for learning basics and toy modelling only, and are NOT complete with regards to physics/chemistry in-depth details (which matter a lot), may contain bugs, and are not as tested as the original implementations. They are also not numerically optimised (on purpose for readability).
So do NOT use these for end product science, consult an expert in the field for example (non-exhaustive list) A&M -> VIRGA [Natasha Batalha, Caroline Morley, Mark Marley], tracer sat adj -> [Xianyu Tan, Tad Komacek, Elspeth Lee], two mass moment microphysics -> [Kazumasa Ohno, Elspeth Lee] if you want to go further with any of the methods for `real' science.
For bin models (not used here) consult a CARMA expert e.g. Diana Powell, Peter Gao.
For interest in the DRIFT moment methodology consult Christiane Helling or Peter Woitke.
For interest in advanced size distribution dependent mass moment methods consult Elspeth Lee or Kazumasa Ohno.