Skip to content

add isotopic ventilation ratio to physics (f_heavy to f_light) #1532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion PySDM/formulae.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from PySDM.dynamics.terminal_velocity.gunn_and_kinzer import TpDependent


class Formulae: # pylint: disable=too-few-public-methods,too-many-instance-attributes
class Formulae: # pylint: disable=too-few-public-methods,too-many-instance-attributes,too-many-statements
def __init__( # pylint: disable=too-many-locals
self,
*,
Expand Down Expand Up @@ -55,6 +55,7 @@ def __init__( # pylint: disable=too-many-locals
isotope_diffusivity_ratios: str = "Null",
isotope_relaxation_timescale: str = "Null",
isotope_temperature_inference: str = "Null",
isotope_ventilation_ratio: str = "Null",
optical_albedo: str = "Null",
optical_depth: str = "Null",
particle_shape_and_density: str = "LiquidSpheres",
Expand Down Expand Up @@ -97,6 +98,7 @@ def __init__( # pylint: disable=too-many-locals
self.isotope_diffusivity_ratios = isotope_diffusivity_ratios
self.isotope_relaxation_timescale = isotope_relaxation_timescale
self.isotope_temperature_inference = isotope_temperature_inference
self.isotope_ventilation_ratio = isotope_ventilation_ratio
self.particle_shape_and_density = particle_shape_and_density
self.air_dynamic_viscosity = air_dynamic_viscosity
self.terminal_velocity = terminal_velocity
Expand Down
1 change: 1 addition & 0 deletions PySDM/physics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
isotope_diffusivity_ratios,
isotope_relaxation_timescale,
isotope_temperature_inference,
isotope_ventilation_ratio,
latent_heat_vapourisation,
latent_heat_sublimation,
optical_albedo,
Expand Down
2 changes: 2 additions & 0 deletions PySDM/physics/constants_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@
PRUPPACHER_RASMUSSEN_1979_XTHRES = 1.4 * si.dimensionless
"""
[Pruppacher & Rasmussen 1979](https://doi.org/10.1175/1520-0469(1979)036%3C1255:AWTIOT%3E2.0.CO;2)
also in
[Beard & Pruppacher 1971](https://doi.org/10.1175/1520-0469(1971)028%3C1455:AWTIOT%3E2.0.CO;2)
"""
PRUPPACHER_RASMUSSEN_1979_CONSTSMALL = 1.0 * si.dimensionless
""" 〃 """
Expand Down
6 changes: 6 additions & 0 deletions PySDM/physics/isotope_ventilation_ratio/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
Isotope ventilation coefficient formulae
"""

from PySDM.impl.null_physics_class import Null
from .brutsaert_1982 import Brutsaert1982
15 changes: 15 additions & 0 deletions PySDM/physics/isotope_ventilation_ratio/brutsaert_1982.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
based on [Brutsaert 1982](https://doi.org/10.1007/978-94-017-1497-6) Springer Netherlands
statement about ventilation coefficient for heavy isotopes on pp. 92-93.
"""


class Brutsaert1982: # pylint: disable=too-few-public-methods
def __init__(self, _):
pass

@staticmethod
def isotope_ventilation_ratio(ventilation_coefficient, diffusivity_ratio):
"""heavy to light isotope ventilation ratio"""
D_ratio_cbrt = diffusivity_ratio ** (1 / 3)
return (1 - D_ratio_cbrt) / ventilation_coefficient + D_ratio_cbrt
14 changes: 14 additions & 0 deletions docs/bibliography.json
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,13 @@
"title": "Environmental isotopes in lake studies",
"label": "Gonfiantini 1986 (The Terrestrial Environment, B)"
},
"https://doi.org/10.1007/978-94-017-1497-6": {
"usages": [
"PySDM/physics/isotope_ventilation_ratio/brutsaert_1982.py"
],
"title": "Evaporation into the Atmosphere: Theory, History, and Applications",
"label": "Brutsaert 1982 (Springer Netherlands)"
},
"https://doi.org/10.1029/JC080i009p01133": {
"usages": [
"PySDM/physics/isotope_diffusivity_ratios/stewart_1975.py",
Expand Down Expand Up @@ -834,6 +841,13 @@
"title": "The Growth of Cloud Drops in Uniformly Cooled Air",
"label": "Howell 1949 (J. Atmos. Sci.)"
},
"https://doi.org/10.1175/1520-0469(1971)028%3C1455:AWTIOT%3E2.0.CO;2": {
"usages": [
"PySDM/physics/constants_defaults.py"
],
"title": "A Wind Tunnel Investigation of the Rate of Evaporation of Small Water Drops Falling at Terminal Velocity in Air",
"label": "Beard & Pruppacher 1971 (J. Atmos. Sci. 28)"
},
"https://doi.org/10.1029/JD089iD07p11749": {
"usages": [
"PySDM/physics/isotope_kinetic_fractionation_factors/jouzel_and_merlivat_1984.py",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "initial_id",
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
""
]
}
],
"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
}
24 changes: 24 additions & 0 deletions tests/unit_tests/physics/test_isotope_ventilation_ratio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""test isotope ventilation ratio"""

from PySDM import Formulae
from PySDM.physics import isotope_ventilation_ratio, constants_defaults
from PySDM.physics.dimensional_analysis import DimensionalAnalysis


class TestIsotopeVentilationRatio: # pylint: disable=too-few-public-methods
@staticmethod
def test_dimensionality():
with DimensionalAnalysis():
# Arrange
formulae = Formulae(isotope_ventilation_ratio="Brutsaert1982")
si = constants_defaults.si
sut = formulae.isotope_ventilation_ratio.isotope_ventilation_ratio

# Act
re = sut(
ventilation_coefficient=1 * si.dimensionless,
diffusivity_ratio=1 * si.dimensionless,
)

# Assert
assert re.check(si.dimensionless)
Loading