-
Notifications
You must be signed in to change notification settings - Fork 0
/
ObukhovLength.m
48 lines (46 loc) · 1.63 KB
/
ObukhovLength.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function L = ObukhovLength(ustar, T0, AVGwpTp)
%
% Matt Werner ([email protected]) - July 1, 2021
%
% Calculate the Obukhov length (L), determining the stability of the
% atmosphere. This quantity represents "the ratio of mechanically-derived
% total kinetic energy (TKE) to buoyancy-derived TKE" (Aylor, Eq. 8.11).
%
% Given an elevation z, atmospheric conditions are considered...
% NEUTRAL if z/|L| << 1
% UNSTABLE if L < 0 AND z/|L| > 0.1
% STABLE if L > 0 AND z/|L| > 0.1.
%
% Inputs:
%
% ustar - Friction velocity.
% Size: 1-by-1 (scalar)
% Units: m/s (meters per second)
%
% T0 - Potential temperature.
% Size: 1-by-1 (scalar)
% Units: K (Kelvin)
%
% AVGwpTp - Time-averaged value of the vertical wind fluctuation
% with the temperature fluctuation. This quantity is
% identical to the product of the local sensible heat
% flux (H0) with the inverse of air density (rho) and
% specific heat at constant pressure (cp), or
% avgwpTp = H0/(rho*cp).
% Size: 1-by-1 (scalar)
% Units: K m/s (Kelvin * meters per second)
%
% Outputs:
%
% L - The Obukhov length.
% Size: 1-by-1 (scalar)
% Units: m (meters)
%
%% Checks
% No checks
%% Computation
% Define constants
k = 0.4; % von Karman constant
g = 9.81; % gravitational acceleration (m/s2)
% Calculate the Obukhov length
L = -ustar^3 / (k*(g/T0)*AVGwpTp);