<jupyter_start><jupyter_text>Homework 2<jupyter_code>from importlib import reload

import numpy as np

from matplotlib import pyplot as plt
import seaborn as sns

import unyt
sns.set_theme()
sns.set_style('whitegrid')
sns.set_context('notebook')<jupyter_output><empty_output><jupyter_text>Problem 1 -- Limiting $P = 800 \, \rm mm \, yr^{-1}$ $R_{\rm net} = 70 \, \rm W \, m^{-2}$  Calculate the potential evapotransopiration rate PET = $R_{\rm net}/L_V$  dividing by the density of water $\rho_w = 1 \rm \, g/cc$ for units:<jupyter_code>R_net = 70 * unyt.W / unyt.m**2
L_V = 2.5 * 10**6 * unyt.J / unyt.kg
rho_w = 1 * unyt.g/unyt.cm**3
#
PET = R_net / L_V / rho_w
PET.to('mm/yr')<jupyter_output><empty_output><jupyter_text>PET is close, but somewhat exceeds $P$ (883 vs. 800 mm/yr). Therefore, we are (marginally) water limited. ----  Problem 2 -- Mountains  a. Desert valley in Nevada $P = 300 \, \rm mm \, yr^{-1}$ PET=$1300 \, \rm mm \, yr^{-1}$<jupyter_code>P = 300 * unyt.mm/unyt.yr
PET = 1300 * unyt.mm/unyt.yr<jupyter_output><empty_output><jupyter_text>In steady state,  $0 = P - ET - Q$  This is a water-limited system ($P/PET \ll 1$) which implies a low streamflow ($Q/P \ll 1$). We expect ${\rm AET} \approx P$ and $Q \approx 0$.  b. Budyko estimations I believe Budyko approximates AET as: $\frac{\rm AET}{P} = \frac{\rm PET}{\sqrt{{\rm PET}^2 + P^2}}$<jupyter_code># Therefore
AET = P * PET / np.sqrt(PET**2 + P**2)
AET<jupyter_output><empty_output><jupyter_text>And, therefore, $Q$ is given by:<jupyter_code>Q = P - AET
Q<jupyter_output><empty_output><jupyter_text>c. Valley run-off ratio The run-off ratio is given by $Q/P$<jupyter_code># Calculation
runoff_ratio = Q/P
print(f'Runoff ratio = {float(runoff)}')<jupyter_output>Runoff ratio = 0.025608804305380203<jupyter_text>This is a low value, as anticipated.  d. Nevada mountains We will adopt $P_{\rm mountains} = 2 P_{\rm valley} = 600 \, \rm mm \, yr^{-1}$ And we are told to assume runoff-ratio$_{\rm mountains}$ = runoff-ratio$_{\rm valley}$ Therefore,  $Q_{\rm mountains} = 2 Q_{\rm valley}$<jupyter_code># P
P_mountains = 2 * P
# Q
Q_mountains = 2 * Q
Q_mountains<jupyter_output><empty_output><jupyter_text>e. Budyko in the mountains We will assume the net radiation is the same, ie. PET is the same<jupyter_code>AET_mountains = P_mountains * PET / np.sqrt(PET**2 + P_mountains**2)
AET_mountains
Q_mountains = P_mountains - AET_mountains
Q_mountains<jupyter_output><empty_output><jupyter_text>This is much higher than assuming the constant runoff ratio..  The actual runoff ratio is:<jupyter_code>runoff_ratio_mountains = Q_mountains / P_mountains
print(f'Runoff ratio in the mountains = {float(runoff_ratio_mountains)}')<jupyter_output>Runoff ratio in the mountains = 0.09204061549954834<jupyter_text>f. Increasing the albedo Now, we let $R_{\rm mountains} = 2 R_{\rm valley} / 3$ This reduces PET in the mountains by the same factor.  Proceeding through the calculations..<jupyter_code>PET_mountains = 2 * PET / 3.
AET_mountains_albedo = P_mountains * PET_mountains / np.sqrt(PET_mountains**2 + P_mountains**2)
Q_mountains_albedo = P_mountains - AET_mountains_albedo
runoff_ratio_mountains_albedo = Q_mountains_albedo / P_mountains
print("Our final quantities are:")
print(f"AET with albedo: {AET_mountains_albedo}")
print(f"Q with albedo: {Q_mountains_albedo}")
print(f"Runoff ratio with albedo: {runoff_ratio_mountains_albedo}")<jupyter_output>Our final quantities are:
AET with albedo: 493.3153149862672 mm/yr
Q with albedo: 106.6846850137328 mm/yr
Runoff ratio with albedo: 0.17780780835622134 dimensionless<jupyter_text>We have considerably higher runoff (and runoff ratio) do the lower AET. ----  Problem 3 -- Red dot  Our mass conservation equation (in class) explicitly ignored GW, i.e. $\frac{dS}{dt} = P - ET - Q$  In steady state, this led to  $\rm{AET} = P - Q$ Including GW would yield: $\rm{AET} = P - Q - GW$  Therefore, the red dot would decrease in y (a lower Evaporative index)  I see no reason for PET to change. ----  Problem 4 -- Vertical flow  We are given two points $A,B$ that are below ground at heights:<jupyter_code>z_A = -125 * unyt.mm
z_B = -625 * unyt.mm<jupyter_output><empty_output><jupyter_text>The figure indicates these have metric potentials:<jupyter_code>Psi_A = -734 * unyt.mm
Psi_B = -369 * unyt.mm<jupyter_output><empty_output><jupyter_text>Last, we have a hydraulic conductivity, $\kappa = 2 \, \rm mm \, hr^{-1}$<jupyter_code>kappa = 2 * unyt.mm / unyt.hr<jupyter_output><empty_output><jupyter_text>We will apply Darcy's Law for flow $q_w = -\kappa \frac{\partial H}{\partial z}$ which we will estimate as: $q_w = -\kappa \frac{\Delta H}{\Delta z}$<jupyter_code># Dz
Delta_z = z_A - z_B
Delta_z<jupyter_output><empty_output><jupyter_text>Calculate the Heads:<jupyter_code>Head_A = Psi_A + z_A
Head_B = Psi_B + z_B
print(f"Head A = {Head_A}, Head_B={Head_B}")
q_w = -kappa * (Head_A-Head_B) / Delta_z
q_w<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13148858816400727, 'fraction_numerical': 0.03453847707533832, 'mean_word_length': 4.867298578199052, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '15', 'dir': 'jupyter-structured-clean-dedup', 'id': '419838', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 2038, 'n_tokens_neox': 1879, 'n_words': 520, 'path': 'EART-252/HW/hw2.ipynb', 'repo_name': 'profxj/ocea200', 'size': '4951'}