-- dwd_1998.lua ----------------------------------------------------------------------- -- Aspirations-Psychrometer-Tafeln -- Deutsch -- Englisch -- Francais, Español -- Herausgegeben vom Deutschen Wetterdienst -- 7., vollständig überarbeitete Auflage -- Copyright Friedr. Vieweg & Sohn Verlagsgesellschaft mbH, -- Braunschweig/Wiesbaden, 1998 -- ISBN 3-528-38231-7 ----------------------------------------------------------------------- -- Typed into Lua by H. Henkel, 2013. -- Tafel 1 -- Sättigungsdampfdruck in reiner Phase -- S. VIII local t = {} local test = {} local p_n = 1013.25 local R_v = 461.525 local e_i = function(t) -- (1) assert((t >= -50.9) and (t <= 0.0)) local T = 273.15 + t local e_i = math.exp(-6024.5282 * T^-1 + 24.7219 + 1.0613868e-2 * T - 1.3198825e-5 * T^2 - 0.49382577 * math.log(T) ) local unit = "hPa" return e_i, unit end t.e_i = e_i test[#test + 1] = { tafel = 1, var = "ei", input = {-23.7}, output = 0.7200, fun = e_i, } -- Tafel 1 -- Sättigungsdampfdruck in reiner Phase -- S. VIII local e_w = function(t) -- (2) assert((t >= -50.9) and (t <= 100.9)) local T = 273.15 + t local e_w = math.exp(-6096.9385 * T^-1 + 16.635794 - 2.711193e-2 * T + 1.673952e-5 * T^2 + 2.433502 * math.log(T) ) local unit = "hPa" return e_w, unit end t.e_w = e_w test[#test + 1] = { tafel = 1, var = "ew", input = {23.7}, output = 29.3237, fun = e_w, } -- Tafel 1 -- Sättigungsdampfdruck in reiner Phase -- S. VIII local e_i_prime = function(p_n, t) -- (3a) local e_i_prime = 1.0047 * e_i(t) local unit = "hPa" return e_i_prime, unit end t.e_i_prime = e_i_prime local e_w_prime = function(p_n, t) -- (3b) local e_w_prime = 1.0047 * e_w(t) local unit = "hPa" return e_w_prime, unit end t.e_w_prime = e_w_prime ----------------------------------------------------------------------- -- Tafel 2 -- Absolute Luftfeuchte bei Sättigung -- S. VIII local d_vi = function(t) -- (4) assert((t >= -50.9) and (t <= 0.0)) local T = 273.15 + t local Z = 1 - (343 - T) * p_n * 1e-8 -- (5) local d_vi = 1.0047 * e_i(t) * 1e5 / (Z * R_v * T) -- (4) local unit = "g/m^3" return d_vi, unit end t.d_vi = d_vi test[#test + 1] = { tafel = 2, var = "d_vi", input = {-23.7}, output = 0.6289, fun = d_vi, } -- Tafel 2 -- Absolute Luftfeuchte bei Sättigung -- S. IX local d_vw = function(t) -- (6) assert((t >= -50.9) and (t <= 100.9)) local T = 273.15 + t local Z = 1 - (343 - T) * p_n * 1e-8 -- (5) local d_vw = 1.0047 * e_w(t) * 1e5 / (Z * R_v * T) -- (6) local unit = "g/m^3" return d_vw, unit end t.d_vw = d_vw test[#test + 1] = { tafel = 2, var = "d_vw", input = {23.7}, output = 21.5142, fun = d_vw, } ----------------------------------------------------------------------- -- Tafel 3 -- Taupunkttemperatur und relative Luftfeuchte -- S. IX local t_d_from_y = function(y) local t_d if y >= 0 then t_d = 13.715 * y + 8.4262e-1 * y^2 + 1.9048e-2 * y^3 + 7.8158e-3 * y^4 -- (7a) else t_d = 13.7204 * y + 7.36631e-1 * y^2 + 3.32136e-2 * y^3 + 7.78591e-4 * y^4 -- (7b) end local unit = "deg. C" return t_d, unit end local t_d_i = function(t, t_i) -- Psychrometerformel für Eis local e_prime = 1.0047 * e_i(t_i) - 0.583 * (t - t_i) -- (9) local y = math.log(e_prime / (1.0047 * 6.11213)) -- (8a) local t_d = t_d_from_y(y) local unit = "deg. C" return t_d, unit end t.t_d_i = t_d_i test[#test + 1] = { tafel = 3, var = "t_d_i", input = {-2.1, -5.7}, output = -16.4, fun = t_d_i, } -- relative Feuchte local U_i = function(t, t_i) assert((t >= -30.2) and (t <= 9.4)) assert((t_i >= -30.0) and (t_i <= -0.1)) local e_prime = 1.0047 * e_i(t_i) - 0.583 * (t - t_i) -- (9) local U = 100 * e_prime / (1.0047 * e_w(t)) -- (10) local unit = "%" return U, unit end t.U_i = U_i test[#test + 1] = { tafel = 3, var = "U_i", input = {-2.1, -5.7}, output = 32, fun = U_i, } -- Tafel 3 -- Taupunkttemperatur und relative Luftfeuchte -- S. IX local t_d_w = function(t, t_w) -- Psychrometerformel für Wasser local e_prime = 1.0047 * e_w(t_w) - 0.662 * (1 + 0.000944 * t_w) * (t - t_w) -- (11) local y = math.log(e_prime / (1.0047 * 6.11213)) local t_d = t_d_from_y(y) local unit = "deg. C" return t_d, unit end t.t_d_w = t_d_w test[#test + 1] = { tafel = 3, var = "t_d_w", input = {25.3, 15.7}, output = 8.9, fun = t_d_w, } -- relative Feuchte local U_w = function(t, t_w) assert((t >= -10.0) and (t <= 59.0)) assert((t_w >= -10.0) and (t_w <= 45.9)) -- Psychrometerformel für Wasser local e_prime = 1.0047 * e_w(t_w) - 0.662 * (1 + 0.000944 * t_w) * (t - t_w) -- (11) local U = 100 * e_prime / (1.0047 * e_w(t)) -- (10) local unit = "%" return U, unit end t.U_w = U_w test[#test + 1] = { tafel = 3, var = "U_w", input = {25.3, 15.7}, output = 35, fun = U_w, } ------------------------------------------------------------------------ -- Tafel 4 -- Taupunkttemperatur -- S. X local t_d_from_U_t = function(U, t) assert((U >= 1) and (U <= 100)) assert((t >= -45) and (t <= 59)) local y = math.log(U * e_w(t) / (100 * 6.11213)) -- (8b) local t_d = t_d_from_y(y) local unit = "deg. C" return t_d, unit end t.t_d_from_U_t = t_d_from_U_t test[#test + 1] = { tafel = 4, var = "t_d_from_U_t", input = {35, 11}, output = -3.9, fun = t_d_from_U_t, } ------------------------------------------------------------------------ -- Tafel 5 -- Relative Luftfeuchte -- S. XI local U_from_t_t_d = function(t, t_d) assert((t >= -60) and (t <= 69)) assert((t_d >= -60) and (t_d <= 39)) local U = e_w(t_d) / e_w(t) * 100 -- (14) local unit = "%" return U, unit end t.U_from_t_t_d = U_from_t_t_d test[#test + 1] = { tafel = 5, var = "U_from_t_t_d", input = {21, 7}, output = 40, fun = U_from_t_t_d, } ------------------------------------------------------------------------ -- Tafel 6 -- Mischungsverhältnis feuchter Luft -- S. XI local r = function(e_prime, p) assert((e_prime >= 1) and (e_prime <= 50)) assert((p >= 920) and (p <= 1060)) local r = 0.62198e3 * e_prime / (p - e_prime) local unit = "g/kg" return r, unit end t.r = r test[#test + 1] = { tafel = 6, var = "r", input = {16, 1010}, output = 10.01, fun = r, } ------------------------------------------------------------------------ -- Tafel 7 -- Mischungsverhältnis feuchter Luft -- S. XI local r_from_t_d_p = function(t_d, p) assert((t_d >= 0) and (t_d <= 29.9)) assert((p >= 920) and (p <= 1060)) local r = 0.62198e3 * 1.0047 * e_w(t_d) / (p - 1.0047 * e_w(t_d)) -- (16) local unit = "g/kg" return r, unit end t.r_from_t_d_p = r_from_t_d_p test[#test + 1] = { tafel = 7, var = "r_from_t_d_p", input = {16.2, 990}, output = 11.85, fun = r_from_t_d_p, } ------------------------------------------------------------------------ -- Tafel 8 -- Spezifische Luftfeuchte -- S. XII local q = function(r) assert((r >= 0.0) and (r <= 39.9)) local q = 1e3 * r / (1e3 + r) local unit = "g/kg" return q, unit end t.q = q test[#test + 1] = { tafel = 8, var = "q", input = {18.7}, output = 18.36, fun = q, } ------------------------------------------------------------------------ -- Tafel 9 -- Äquivalenztemperatur -- S. XII local t_e = function(t, U) assert((t >= -4) and (t <= 45)) assert((U >= 5) and (U <= 100)) local c_w = 4217.8 local c_pa = 1005.67 local e_prime = 1.0047 * U / 100 * e_w(t) -- (19) local i_v = function(t) return 2500827 - 2360 * t end local r = r(e_prime, p_n) local t_e = t + r * 1e-3 * i_v(t) / (c_pa + r * 1e-3 * c_w) -- (18) local unit = "deg. C" return t_e, unit end t.t_e = t_e test[#test + 1] = { tafel = 9, var = "t_e", input = {23, 65}, output = 49.6, fun = t_e, } ------------------------------------------------------------------------ -- Tafel 10 -- Sättigungsdefizit -- S. XII local SD = function(t, U) assert((t >= -4) and (t <= 45)) assert((U >= 0) and (U <= 95)) local SD = 1.0047 * e_w(t) * (1 - U / 100) local unit = "hPa" return SD, unit end t.SD = SD test[#test + 1] = { tafel = 10, var = "SD", input = {25, 55}, output = 14.33, fun = SD, } ------------------------------------------------------------------------ -- Tafel 11 -- Sättigungsdefizit -- S. XIII local SD_from_t_t_w = function(t, t_w) assert((t >= -4) and (t <= 60)) assert((t_w >= -4) and (t_w <= 35)) local e_prime = 1.0047 * e_w(t_w) - 0.662 * (1 + 0.000944 * t_w) * (t - t_w) -- (11) local SD = 1.0047 * e_w(t) - e_prime -- (21) local unit = "hPa" return SD, unit end t.SD_from_t_t_w = SD_from_t_t_w test[#test + 1] = { tafel = 11, var = "SD", input = {22, 18}, output = 8.5, fun = SD_from_t_t_w, } ------------------------------------------------------------------------ -- Tafel 12 -- Dampfdruckkorrektion -- S. XIII local delta_e_prime_i = function(p, t, t_i) assert((p >= 600) and (p <= 1090)) assert(((t - t_i) >= 0) and ((t - t_i) <= 15.9)) local delta_e_prime_i = 0.583 * (t - t_i) * (p_n - p) / p_n -- (22) local unit = "hPa" return delta_e_prime_i, unit end t.delta_e_prime_i = delta_e_prime_i test[#test + 1] = { tafel = 12, var = "delta_e_prime_i", input = {880, 20, 17}, output = 0.23, fun = delta_e_prime_i, } local delta_e_prime_w = function(p, t, t_w) assert((p >= 600) and (p <= 1090)) assert(((t - t_w) >= 0) and ((t - t_w) <= 29.9)) local delta_e_prime_w = 0.662 * (1 + 0.000944 * t_w) * (t - t_w) * (p_n - p) / p_n -- (23) local unit = "hPa" return delta_e_prime_w, unit end t.delta_e_prime_w = delta_e_prime_w test[#test + 1] = { tafel = 12, var = "delta_e_prime_w", input = {910, 20, 15}, output = 0.34, fun = delta_e_prime_w, } ------------------------------------------------------------------------ -- Tafel 13 -- Korrektur der relativen Luftfeuchte -- S. XIII local delta_U = function(t, delta_e_prime) assert((t >= -25) and (t <= 69)) assert((delta_e_prime >= -1.1) and (delta_e_prime <= 4.8)) local delta_U = 100 * delta_e_prime / (1.0047 * e_w(t)) local unit = "%" return delta_U, unit end t.delta_U = delta_U test[#test + 1] = { tafel = 13, var = "delta_U", input = {5, 2}, output = 23, fun = delta_U, } ------------------------------------------------------------------------ -- Tafel 14 -- Dampfdruck feuchter Luft aus der Taupunkttemperatur -- S. XIV local e_prime_from_p_n_t_d = function(p_n, t_d) assert(p_n == 1013.25) assert((t_d >= -50) and (t_d <= 100.9)) local e_prime = 1.0047 * e_w(t_d) local unit = "hPa" return e_prime, unit end t.e_prime_from_p_n_t_d = e_prime_from_p_n_t_d test[#test + 1] = { tafel = 14, var = "e_prime_from_p_n_t_d", input = {1013.25, 8.9}, output = 11.46, fun = e_prime_from_p_n_t_d, } ------------------------------------------------------------------------ -- Tafel 15 -- Umwandlung von Hektopascal (hPa) in Torr (mm Hg) -- S. XIV local hpa2torr = function(p_hpa) local p_torr = 760 / 1013.25 * p_hpa local unit = "mm Hg" return p_torr, unit end t.hpa2torr = hpa2torr test[#test + 1] = { tafel = 15, var = "hpa2torr", input = {30.1}, output = 22.5769, fun = hpa2torr, } ------------------------------------------------------------------------ local test = function() for k, v in ipairs(test) do local tafel = v.tafel local var = v.var local inp = v.input local fun = v.fun local out = v.output local calc, unit = fun(table.unpack(inp)) local err = (calc - out) / out io.write(string.format("%2s %-20s ", tafel, var)) io.write(string.format("%10.4f %10.4f %-7s ", calc, out, unit)) io.write(string.format("%8.4f %%", err * 100)) if math.abs(err) > 0.01 then io.write(" ***") end io.write("\n") end end -- test() return t, test