Skip to content

Commit

Permalink
add file timescales_comparison.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
AgnieszkaZaba committed Jan 8, 2025
1 parent a16f63f commit 9796bf2
Showing 1 changed file with 159 additions and 0 deletions.
159 changes: 159 additions & 0 deletions examples/PySDM_examples/Bolin_1958/timescales_comparison.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"cells": [
{
"metadata": {},
"cell_type": "markdown",
"source": [
"[![preview notebook](https://img.shields.io/static/v1?label=render%20on&logo=github&color=87ce3e&message=GitHub)](https://github.com/open-atmos/PySDM/blob/main/examples/PySDM_examples/Bolin_1958/timescales_comparison.ipynb)\n",
"[![launch on mybinder.org](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PySDM.git/main?urlpath=lab/tree/examples/PySDM_examples/Bolin_1958/timescales_comparison.ipynb)\n",
"[![launch on Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PySDM/blob/main/examples/PySDM_examples/Bolin_1958/timescales_comparison.ipynb)"
],
"id": "da62f9aa77468520"
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"#### Timescales comparison \n",
"##### Bolin\n",
"##### Gedzelman"
],
"id": "c7eb55d509c585e9"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-08T11:43:17.155448Z",
"start_time": "2025-01-08T11:43:17.152024Z"
}
},
"cell_type": "code",
"source": [
"import sys\n",
"if 'google.colab' in sys.modules:\n",
" !pip --quiet install open-atmos-jupyter-utils\n",
" from open_atmos_jupyter_utils import pip_install_on_colab\n",
" pip_install_on_colab('PySDM-examples')"
],
"id": "f508348dd491651d",
"outputs": [],
"execution_count": 1
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-08T12:12:05.343374Z",
"start_time": "2025-01-08T12:12:05.338334Z"
}
},
"cell_type": "code",
"source": [
"import numpy as np\n",
"from PySDM.physics import si\n",
"from PySDM import Formulae"
],
"id": "c680144e7ad3b94a",
"outputs": [],
"execution_count": 4
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-08T12:12:06.098091Z",
"start_time": "2025-01-08T12:12:06.044091Z"
}
},
"cell_type": "code",
"source": [
"formulae = Formulae(\n",
" terminal_velocity='RogersYau',\n",
" drop_growth='Mason1951',\n",
" diffusion_thermics='Neglect',\n",
" saturation_vapour_pressure='AugustRocheMagnus',\n",
" ventilation='Froessling1938',\n",
" particle_shape_and_density='LiquidSpheres',\n",
" air_dynamic_viscosity='ZografosEtAl1987',\n",
" constants={'BOLIN_ISOTOPE_TIMESCALE_COEFF_C1': 1.63},\n",
" isotope_relaxation_timescale='Bolin1958',\n",
")\n",
"const = formulae.constants"
],
"id": "16ed280e5d36eb94",
"outputs": [],
"execution_count": 5
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"TODO:\n",
" - maybe use definitions from Bolin? As a .py file?"
],
"id": "aa0405d30f2d6b2"
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-08T12:16:45.968461Z",
"start_time": "2025-01-08T12:16:45.035759Z"
}
},
"cell_type": "code",
"source": [
"a = radii = np.asarray([0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.15, 0.20]) * si.cm\n",
"# from Bolin\n",
"temperature = const.T0 + 10 * si.K\n",
"pressure = const.p_STP\n",
"D = formulae.diffusion_thermics.D(T=temperature, p=pressure) #diffusion coefficient\n",
"f = 1. #set\n",
"rho_s = 1\n",
"S = b = 0"
],
"id": "c71f0468385912c5",
"outputs": [],
"execution_count": 6
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-01-08T12:16:45.979506Z",
"start_time": "2025-01-08T12:16:45.977946Z"
}
},
"cell_type": "code",
"source": "tau = -4 * np.pi * a * D * f * rho_s * (S - 1)/(1 + b)",
"id": "66b599e2475f5b73",
"outputs": [],
"execution_count": 7
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "53edb54ed337d98b"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 9796bf2

Please sign in to comment.