Skip to content

Commit

Permalink
disable pylint "pointless-statement" check
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnieszka Żaba committed Nov 24, 2024
1 parent 7883d19 commit 28be899
Showing 1 changed file with 71 additions and 65 deletions.
136 changes: 71 additions & 65 deletions examples/PySDM_examples/Bolin_1958/table_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"cell_type": "markdown",
"id": "bb84c52c57a729ec",
"metadata": {},
"source": [
"### based on Table 1 from B.Bolin 1958 \"On the use of tritium as a tracer for water in nature\"."
]
"source": "### based on Table 1 from B.Bolin 1958 \"On the use of tritium as a tracer for water in nature\"."
},
{
"cell_type": "code",
Expand Down Expand Up @@ -55,6 +53,14 @@
"outputs": [],
"execution_count": 4
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "# pylint: disable=pointless-statement",
"id": "a1097d761bc5b541"
},
{
"cell_type": "code",
"id": "e29a92d6680c4e51",
Expand All @@ -72,73 +78,13 @@
"execution_count": 5
},
{
"cell_type": "code",
"id": "314f42c310883cfa",
"metadata": {
"ExecuteTime": {
"end_time": "2024-11-23T14:42:06.731063Z",
"start_time": "2024-11-23T14:42:03.594204Z"
}
},
"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",
")\n",
"const = formulae.constants\n",
"any_non_zero_value = 44.\n",
"temperature = const.T0 + 10 * si.K\n",
"pressure = const.p_STP\n",
"pvs = formulae.saturation_vapour_pressure.pvs_water(temperature)\n",
"v_term = formulae.terminal_velocity.v_term(radii)\n",
"eta_air=formulae.air_dynamic_viscosity.eta_air(temperature)\n",
"D=formulae.diffusion_thermics.D(T=temperature, p=pressure)\n",
"\n",
"air_density = pressure/const.Rd/temperature\n",
"assert abs(air_density - 1)/air_density <.3\n",
"Re = formulae.particle_shape_and_density.reynolds_number(\n",
" radius=radii,\n",
" velocity_wrt_air=v_term,\n",
" dynamic_viscosity=eta_air,\n",
" density=air_density,\n",
")\n",
"Sc = formulae.trivia.air_schmidt_number(\n",
" dynamic_viscosity=eta_air, \n",
" diffusivity=D, \n",
" density=air_density,\n",
")\n",
"F = formulae.ventilation.ventilation_coefficient(sqrt_re_times_cbrt_sc=Re**(1/2) * Sc**(1/3))\n",
"f = .75\n",
"\n",
"r_dr_dt = formulae.drop_growth.r_dr_dt(\n",
" RH_eq=1,\n",
" T=temperature,\n",
" RH=0,\n",
" lv=0,\n",
" pvs=pvs,\n",
" D=D,\n",
" K=any_non_zero_value,\n",
" ventilation_factor=F\n",
")\n",
"adjustment_time = (-3 / radii**2 * r_dr_dt * c1)**-1\n",
"\n",
"\n",
"pandas.options.display.float_format = '{:>,.2g}'.format\n",
"data = pandas.DataFrame({\n",
" 'radius [cm]': in_unit(radii, si.cm),\n",
" 'adjustment time [s]': adjustment_time,\n",
" 'terminal velocity [m/s]': v_term,\n",
" 'distance [m]': v_term * adjustment_time,\n",
" \n",
"})\n",
"\n",
"data"
],
"cell_type": "code",
"outputs": [
{
"data": {
Expand Down Expand Up @@ -245,7 +191,67 @@
"output_type": "execute_result"
}
],
"execution_count": 6
"execution_count": 6,
"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",
")\n",
"const = formulae.constants\n",
"any_non_zero_value = 44.\n",
"temperature = const.T0 + 10 * si.K\n",
"pressure = const.p_STP\n",
"pvs = formulae.saturation_vapour_pressure.pvs_water(temperature)\n",
"v_term = formulae.terminal_velocity.v_term(radii)\n",
"eta_air=formulae.air_dynamic_viscosity.eta_air(temperature)\n",
"D=formulae.diffusion_thermics.D(T=temperature, p=pressure)\n",
"\n",
"air_density = pressure/const.Rd/temperature\n",
"assert abs(air_density - 1)/air_density <.3\n",
"Re = formulae.particle_shape_and_density.reynolds_number(\n",
" radius=radii,\n",
" velocity_wrt_air=v_term,\n",
" dynamic_viscosity=eta_air,\n",
" density=air_density,\n",
")\n",
"Sc = formulae.trivia.air_schmidt_number(\n",
" dynamic_viscosity=eta_air, \n",
" diffusivity=D, \n",
" density=air_density,\n",
")\n",
"F = formulae.ventilation.ventilation_coefficient(sqrt_re_times_cbrt_sc=Re**(1/2) * Sc**(1/3))\n",
"f = .75\n",
"\n",
"r_dr_dt = formulae.drop_growth.r_dr_dt(\n",
" RH_eq=1,\n",
" T=temperature,\n",
" RH=0,\n",
" lv=0,\n",
" pvs=pvs,\n",
" D=D,\n",
" K=any_non_zero_value,\n",
" ventilation_factor=F\n",
")\n",
"adjustment_time = (-3 / radii**2 * r_dr_dt * c1)**-1\n",
"\n",
"\n",
"pandas.options.display.float_format = '{:>,.2g}'.format\n",
"data = pandas.DataFrame({\n",
" 'radius [cm]': in_unit(radii, si.cm),\n",
" 'adjustment time [s]': adjustment_time,\n",
" 'terminal velocity [m/s]': v_term,\n",
" 'distance [m]': v_term * adjustment_time,\n",
" \n",
"})\n",
"\n",
"data "
],
"id": "314f42c310883cfa"
},
{
"cell_type": "code",
Expand Down

0 comments on commit 28be899

Please sign in to comment.