{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%%capture storage\n", "# The above redirects all output of the below commands to the variable 'storage' instead of displaying it.\n", "# It can be viewed by typing: 'storage()'\n", "# Setting up worksheet and importing equations from other worksheets\n", "load('temp/Worksheet_setup.sage')\n", "load_session('temp/leaf_enbalance_eqs.sobj')\n", "fun_loadvars(dict_vars) # any variables defined using var2() are saved with their attributes in dict_vars. Here we re-define them based on dict_vars from the other worksheet." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Equations to compute stomatal conductance based on sizes and densities of stomata\n", "Equation numbers in comments refer to Lehmann & Or, 2013" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Definitions of additional variables

" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "F_p" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Following Lehmann_2015_Effects\n", "var2('B_l', 'Boundary layer thickness', meter, domain1='positive')\n", "var2('g_sp', 'Diffusive conductance of a stomatal pore', mole/second/meter^2, domain1='positive')\n", "var2('r_sp', 'Diffusive resistance of a stomatal pore', meter^2*second/mole, domain1='positive')\n", "var2('r_vs', 'Diffusive resistance of a stomatal vapour shell', meter^2*second/mole, domain1='positive')\n", "var2('r_bwmol', 'Leaf BL resistance in molar units', meter^2*second/mole, domain1='positive', latexname = 'r_{bw,mol}')\n", "var2('r_end', 'End correction, representing resistance between evaporating sites and pores', meter^2*second/mole, domain1='positive')\n", "var2('A_p', 'Cross-sectional pore area', meter^2, domain1='positive')\n", "var2('d_p', 'Pore depth', meter, domain1='positive')\n", "var2('V_m', 'Molar volume of air', meter^3/mole, domain1='positive')\n", "var2('n_p', 'Pore density', 1/meter^2, domain1='positive')\n", "var2('r_p', 'Pore radius (for ellipsoidal pores, half the pore width)', meter, domain1='positive')\n", "var2('l_p', 'Pore length', meter, domain1='positive')\n", "var2('k_dv', 'Ratio $D_{va}/V_m$', mole/meter/second, domain1='positive', latexname='k_{dv}')\n", "var2('s_p', 'Spacing between stomata', meter, domain1='positive')\n", "var2('F_p', 'Fractional pore area (pore area per unit leaf area)', meter^2/meter^2, domain1='positive')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "'Molar volume of air'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "docdict[V_m]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Equations from Lehmann & Or, 2013" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "k_dv == D_va/V_m" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "mole/(meter*second) == mole/(meter*second)\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "g_sp == A_p*k_dv*n_p/d_p" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "mole/(meter^2*second) == mole/(meter^2*second)\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "A_p == pi*r_p^2" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "meter^2 == meter^2\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "r_sp == d_p/(A_p*k_dv*n_p)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "meter^2*second/mole == meter^2*second/mole\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "r_sp == d_p/(pi*k_dv*n_p*r_p^2)" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "meter^2*second/mole == meter^2*second/mole\n" ] } ], "source": [ "# Eqn1\n", "eq_kdv = k_dv == D_va/V_m\n", "print units_check(eq_kdv)\n", "eq_gsp_A = g_sp == A_p/d_p*k_dv*n_p\n", "print units_check(eq_gsp_A)\n", "eq_Ap_rp = A_p == pi*r_p^2\n", "print units_check(eq_Ap_rp)\n", "eq_rsp_A = r_sp == 1/eq_gsp_A.rhs()\n", "print units_check(eq_rsp_A)\n", "eq_rsp_rp = r_sp == 1/eq_gsp_A.rhs().subs(eq_Ap_rp)\n", "print units_check(eq_rsp_rp)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "r_vs == 1/4*(1/r_p - 4/(pi*s_p))/(k_dv*n_p)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter^2*second/mole == meter^2*second/mole" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Eq. 2(c)\n", "eq_rvs_B = r_vs == (1/(4*r_p) - 1/(pi*s_p))*1/(k_dv*n_p)\n", "units_check(eq_rvs_B)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "r_vs == 1/4*(1/r_p - 4/(pi*s_p))/(k_dv*n_p)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter^2*second/mole == meter^2*second/mole" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Eq. 2(d)\n", "eq_rvs_S = r_vs == (1/(2*pi*r_p) - 1/(pi*s_p))*1/(k_dv*n_p)\n", "units_check(eq_rvs_B)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "s_p == 1/sqrt(n_p)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter == sqrt(n_p)/sqrt(n_p/meter^2)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Below Eq. 3(b)\n", "assume(n_p>0)\n", "eq_sp_np = s_p == 1/sqrt(n_p)\n", "units_check(eq_sp_np)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "r_end == 1/4/(k_dv*n_p*r_p)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter^2*second/mole == meter^2*second/mole" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Eq. 2(a)\n", "eq_rend_rp = r_end == 1/(4*r_p*k_dv*n_p)\n", "units_check(eq_rend_rp)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "r_end == log(2*l_p/r_p)/(pi*k_dv*l_p*n_p)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter^2*second/mole == meter^2*second/mole" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Eq. 2(b)\n", "eq_rend_PW = r_end == log(4*(l_p/2)/r_p)/(2*pi*l_p/2*k_dv*n_p)\n", "units_check(eq_rend_PW)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "g_swmol == (1/(r_end + r_sp + r_vs))" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "mole/(meter^2*second) == mole/(meter^2*second)" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eq_gswmol = g_swmol == 1/(r_end + r_sp + r_vs)\n", "units_check(eq_gswmol)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

It actually does not seem to make much sense to add r_end to the resistances, as it does not reflect the geometry of the inter-cellular air space! Also eq_rvs_B is the correct one to use for stomata, as eq_rvs_S is valid for droplets, not holes!

" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "n_p == s_p^(-2)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter^(-2) == meter^(-2)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "assume(s_p>0)\n", "eq_np_sp = solve(eq_sp_np, n_p)[0]\n", "units_check(eq_np_sp)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "r_bwmol == B_l/k_dv" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter^2*second/mole == meter^2*second/mole" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Eq. 5\n", "eq_rbwmol = r_bwmol == B_l/k_dv\n", "units_check(eq_rbwmol)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "'Ratio $D_{va}/V_m$'" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "docdict[k_dv]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below, we compare our system of equations to Eq. 7a in Lehmann & Or (2015), i.e. we check if $\\frac{r_{bwmol}}{r_{tot}} = 1/(1 + s_p^2/B_l*(1/(2*r_p) + d_p/(\\pi*r_p^2)))$:" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "2*pi*B_l*r_p^2/(2*pi*B_l*r_p^2 + (pi*r_p + 2*d_p)*s_p^2)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "2/(s_p^2*(1/r_p + 2*d_p/(pi*r_p^2))/B_l + 2)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "0" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Verification of Eq. 7a\n", "eq1 = (r_bwmol/(2*r_end + r_sp + r_bwmol)).subs(eq_rend_rp, eq_rsp_rp, eq_rvs_B, eq_rbwmol).subs(eq_np_sp)\n", "eq1.simplify_full().show()\n", "eq7a = 1/(1 + s_p^2/B_l*(1/(2*r_p) + d_p/(pi*r_p^2)))\n", "eq7a.show()\n", "(eq1 - eq7a).simplify_full()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Additional equations for calculating conductances of laser perforated foils" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "A_p == pi*r_p^2" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter^2 == meter^2" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Pore area for circular pores\n", "eq_Ap = A_p == pi*r_p^2\n", "units_check(eq_Ap)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "r_p == sqrt(A_p/pi)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter == sqrt(A_p*meter^2/pi)/sqrt(A_p/pi)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# To deduce pore radius from pore area, assuming circular pore:\n", "eq_rp_Ap = solve(eq_Ap_rp, r_p)[0]\n", "units_check(eq_rp_Ap)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# For regular pore distribution we can derive the pore density from porosity and pore area\n", "eq_np = n_p == F_p/A_p" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "g_sw == -(P_wa - P_wl)*R_mol*T_a*T_l*g_swmol/(P_a*P_wl*T_a - P_a*P_wa*T_l)" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter/second == meter/second" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Conversion from mol/m2/s to m/s, i.e. from g_swmol to g_sw\n", "eq_gsw_gswmol = solve(eq_gtwmol_gtw(g_tw = g_sw, g_twmol = g_swmol), g_sw)[0]\n", "units_check(eq_gsw_gswmol)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "g_sw == R_mol*T_a*g_swmol/P_a" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "meter/second == meter/second" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Simplification, neglecting effect of leaf-air temperature difference\n", "eq_gsw_gswmol_iso = eq_gsw_gswmol(T_l = T_a).simplify_full()\n", "units_check(eq_gsw_gswmol_iso)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Saving session so that it can be loaded using load_session().\n", "save_session('temp/stomatal_cond_eqs.sobj')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Table of symbols

" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
VariableDescription (value)Units
Cross-sectional pore area m
Fraction of one-sided leaf area covered by stomata (1 if stomata are on one side only, 2 if they are on both sides)1
Fraction of projected area exchanging sensible heat with the air (2)1
Thermal diffusivity of dry air m s
Boundary layer thicknessm
Specific heat of dry air (1010) J K kg
Concentration of water in the free air mol m
Concentration of water in the leaf air space mol m
Pore depthm
Binary diffusion coefficient of water vapour in air m s
Latent heat flux from leafJ m s
Transpiration rate in molar unitsmol m s
Longwave emmissivity of the leaf surface (1.0)1
Fractional pore area (pore area per unit leaf area)1
Gravitational acceleration (9.81)m s
Boundary layer conductance to water vapour m s
Boundary layer conductance to water vapour mol m s
Diffusive conductance of a stomatal poremol m s
Stomatal conductance to water vapourm s
Stomatal conductance to water vapourmol m s
Total leaf conductance to water vapourm s
Total leaf layer conductance to water vapourmol m s
Average 1-sided convective transfer coefficientJ K m s
Sensible heat flux from leafJ m s
Thermal conductivity of dry airJ K m s
Ratio mol m s
Characteristic length scale for convection (size of leaf)m
Pore lengthm
Latent heat of evaporation (2.45e6)J kg
Molar mass of nitrogen (0.028)kg mol
Molar mass of oxygen (0.032)kg mol
Molar mass of water (0.018)kg mol
Grashof number1
Lewis number1
Nusselt number1
Pore density m
Critical Reynolds number for the onset of turbulence1
Reynolds number1
Sherwood number1
Kinematic viscosity of dry air m s
Air pressurePa
Partial pressure of nitrogen in the atmospherePa
Partial pressure of oxygen in the atmospherePa
Vapour pressure in the atmospherePa
Saturation vapour pressure at air temperaturePa
Vapour pressure inside the leafPa
Prandtl number (0.71)1
Boundary layer resistance to water vapour, inverse of s m
Leaf BL resistance in molar unitss m mol
End correction, representing resistance between evaporating sites and poress m mol
Longwave radiation away from leafJ m s
Molar gas constant (8.314472)J K mol
Pore radius (for ellipsoidal pores, half the pore width)m
Solar shortwave fluxJ m s
Diffusive resistance of a stomatal pores m mol
Stomatal resistance to water vapour, inverse of s m
Total leaf resistance to water vapour, s m
Diffusive resistance of a stomatal vapour shells m mol
Density of dry airkg m
Density of air at the leaf surfacekg m
Spacing between stomatam
Stefan-Boltzmann constant (5.67e-8)J K m s
Air temperatureK
Leaf temperatureK
Radiative temperature of objects surrounding the leafK
Molar volume of air m mol
Wind velocitym s
\n", "
" ], "text/plain": [ " Variable Description (value) Units\n", "+-----------+---------------------------------------------------------------------------------------------------------------------+----------------------------------+\n", " A_p Cross-sectional pore area m$^{2}$\n", " a_s Fraction of one-sided leaf area covered by stomata (1 if stomata are on one side only, 2 if they are on both sides) 1\n", " a_sh Fraction of projected area exchanging sensible heat with the air (2) 1\n", " alpha_a Thermal diffusivity of dry air m$^{2}$ s$^{-1}$\n", " B_l Boundary layer thickness m\n", " c_pa Specific heat of dry air (1010) J K$^{-1}$ kg$^{-1}$\n", " C_wa Concentration of water in the free air mol m$^{-3}$\n", " C_wl Concentration of water in the leaf air space mol m$^{-3}$\n", " d_p Pore depth m\n", " D_va Binary diffusion coefficient of water vapour in air m$^{2}$ s$^{-1}$\n", " E_l Latent heat flux from leaf J m$^{-2}$ s$^{-1}$\n", " E_lmol Transpiration rate in molar units mol m$^{-2}$ s$^{-1}$\n", " epsilon_l Longwave emmissivity of the leaf surface (1.0) 1\n", " F_p Fractional pore area (pore area per unit leaf area) 1\n", " g Gravitational acceleration (9.81) m s$^{-2}$\n", " g_bw Boundary layer conductance to water vapour m s$^{-1}$\n", " g_bwmol Boundary layer conductance to water vapour mol m$^{-2}$ s$^{-1}$\n", " g_sp Diffusive conductance of a stomatal pore mol m$^{-2}$ s$^{-1}$\n", " g_sw Stomatal conductance to water vapour m s$^{-1}$\n", " g_swmol Stomatal conductance to water vapour mol m$^{-2}$ s$^{-1}$\n", " g_tw Total leaf conductance to water vapour m s$^{-1}$\n", " g_twmol Total leaf layer conductance to water vapour mol m$^{-2}$ s$^{-1}$\n", " h_c Average 1-sided convective transfer coefficient J K$^{-1}$ m$^{-2}$ s$^{-1}$\n", " H_l Sensible heat flux from leaf J m$^{-2}$ s$^{-1}$\n", " k_a Thermal conductivity of dry air J K$^{-1}$ m$^{-1}$ s$^{-1}$\n", " k_dv Ratio $D_{va}/V_m$ mol m$^{-1}$ s$^{-1}$\n", " L_l Characteristic length scale for convection (size of leaf) m\n", " l_p Pore length m\n", " lambda_E Latent heat of evaporation (2.45e6) J kg$^{-1}$\n", " M_N2 Molar mass of nitrogen (0.028) kg mol$^{-1}$\n", " M_O2 Molar mass of oxygen (0.032) kg mol$^{-1}$\n", " M_w Molar mass of water (0.018) kg mol$^{-1}$\n", " Gr Grashof number 1\n", " Le Lewis number 1\n", " Nu Nusselt number 1\n", " n_p Pore density m$^{-2}$\n", " Re_c Critical Reynolds number for the onset of turbulence 1\n", " Re Reynolds number 1\n", " Sh Sherwood number 1\n", " nu_a Kinematic viscosity of dry air m$^{2}$ s$^{-1}$\n", " P_a Air pressure Pa\n", " P_N2 Partial pressure of nitrogen in the atmosphere Pa\n", " P_O2 Partial pressure of oxygen in the atmosphere Pa\n", " P_wa Vapour pressure in the atmosphere Pa\n", " P_was Saturation vapour pressure at air temperature Pa\n", " P_wl Vapour pressure inside the leaf Pa\n", " Pr Prandtl number (0.71) 1\n", " r_bw Boundary layer resistance to water vapour, inverse of $g_{bw}$ s m$^{-1}$\n", " r_bwmol Leaf BL resistance in molar units s m$^{2}$ mol$^{-1}$\n", " r_end End correction, representing resistance between evaporating sites and pores s m$^{2}$ mol$^{-1}$\n", " R_ll Longwave radiation away from leaf J m$^{-2}$ s$^{-1}$\n", " R_mol Molar gas constant (8.314472) J K$^{-1}$ mol$^{-1}$\n", " r_p Pore radius (for ellipsoidal pores, half the pore width) m\n", " R_s Solar shortwave flux J m$^{-2}$ s$^{-1}$\n", " r_sp Diffusive resistance of a stomatal pore s m$^{2}$ mol$^{-1}$\n", " r_sw Stomatal resistance to water vapour, inverse of $g_{sw}$ s m$^{-1}$\n", " r_tw Total leaf resistance to water vapour, $r_{bv} + r_{sv}$ s m$^{-1}$\n", " r_vs Diffusive resistance of a stomatal vapour shell s m$^{2}$ mol$^{-1}$\n", " rho_a Density of dry air kg m$^{-3}$\n", " rho_al Density of air at the leaf surface kg m$^{-3}$\n", " s_p Spacing between stomata m\n", " sigm Stefan-Boltzmann constant (5.67e-8) J K$^{-4}$ m$^{-2}$ s$^{-1}$\n", " T_a Air temperature K\n", " T_l Leaf temperature K\n", " T_w Radiative temperature of objects surrounding the leaf K\n", " V_m Molar volume of air m$^{3}$ mol$^{-1}$\n", " v_w Wind velocity m s$^{-1}$" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Creating dictionary to substitute names of units with shorter forms\n", "var('m s J Pa K kg mol')\n", "subsdict = {meter: m, second: s, joule: J, pascal: Pa, kelvin: K, kilogram: kg, mole: mol}\n", "var('N_Re_L N_Re_c N_Le N_Nu_L N_Gr_L N_Sh_L')\n", "dict_varnew = {Re: N_Re_L, Re_c: N_Re_c, Le: N_Le, Nu: N_Nu_L, Gr: N_Gr_L, Sh: N_Sh_L}\n", "dict_varold = {v: k for k, v in dict_varnew.iteritems()}\n", "variables = sorted([str(variable.subs(dict_varnew)) for variable in udict.keys()],key=str.lower)\n", "tableheader = [('Variable', 'Description (value)', 'Units')]\n", "tabledata = [('Variable', 'Description (value)', 'Units')]\n", "for variable1 in variables:\n", " variable2 = eval(variable1).subs(dict_varold)\n", " variable = str(variable2)\n", " tabledata.append((eval(variable),docdict[eval(variable)],fun_units_formatted(variable)))\n", "\n", "table(tabledata, header_row=True)" ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 7.3", "language": "", "name": "sagemath" }, "language": "python", "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.10" }, "nav_menu": {}, "toc": { "navigate_menu": true, "number_sections": true, "sideBar": true, "threshold": 6, "toc_cell": false, "toc_section_display": "block", "toc_window_display": true } }, "nbformat": 4, "nbformat_minor": 0 }