From e011c90ad0cb91824b1d3d8592a2e302eb0968c4 Mon Sep 17 00:00:00 2001 From: Marcel Frommelt Date: Mon, 11 Jan 2021 19:34:00 +0900 Subject: [PATCH] Synchronization between local PC and gitea --- Super-Pressure.py | 123 ++++++++++++++++++ .../natural_constants.cpython-38.pyc | Bin 0 -> 297 bytes input/__pycache__/user_input.cpython-38.pyc | Bin 0 -> 677 bytes input/atmosphere.nc | Bin 1024 -> 0 bytes models/__init__.py | Bin 1024 -> 0 bytes models/__pycache__/__init__.cpython-38.pyc | Bin 0 -> 154 bytes models/__pycache__/drag.cpython-38.pyc | Bin 0 -> 357 bytes .../simple_atmosphere.cpython-38.pyc | Bin 0 -> 950 bytes models/__pycache__/sun.cpython-38.pyc | Bin 0 -> 2260 bytes models/__pycache__/test1.cpython-38.pyc | Bin 0 -> 292 bytes models/__pycache__/thermal.cpython-38.pyc | Bin 0 -> 1088 bytes models/test2.py | 3 + models/thermal.py | 111 ++++++++++++++++ output/placeholder.txt | Bin 1024 -> 0 bytes 14 files changed, 237 insertions(+) create mode 100644 Super-Pressure.py create mode 100644 input/__pycache__/natural_constants.cpython-38.pyc create mode 100644 input/__pycache__/user_input.cpython-38.pyc create mode 100644 models/__pycache__/__init__.cpython-38.pyc create mode 100644 models/__pycache__/drag.cpython-38.pyc create mode 100644 models/__pycache__/simple_atmosphere.cpython-38.pyc create mode 100644 models/__pycache__/sun.cpython-38.pyc create mode 100644 models/__pycache__/test1.cpython-38.pyc create mode 100644 models/__pycache__/thermal.cpython-38.pyc create mode 100644 models/test2.py create mode 100644 models/thermal.py diff --git a/Super-Pressure.py b/Super-Pressure.py new file mode 100644 index 0000000..198663e --- /dev/null +++ b/Super-Pressure.py @@ -0,0 +1,123 @@ +import numpy as np +import matplotlib.pyplot as plt + +# VARIABLES: + +v0 = 0.00 # Initial Balloon Velocity in [m/s] +s0 = 0.00 # Initial Balloon Altitude in [m] +p0 = 101325 # (Initial) Air Pressure in [Pa] +rho_a = 1.2250 # (Initial) Air Density in [kg/m^3] + +tmax = 50000 + +T_a = 288.15 # (Initial) Air Temperature in [K] +g = 9.80665 # local gravitation in [m/s^2] +dt = 0.01 # time step in [s] +cD = 0.47 # drag coefficient balloon (spherical) [-] + +R_a = 287.1 # Specific Gas Constant Dry Air in [J/(kg * K)] +R_He = 2077.1 # Specific Gas Constant Helium in [J/(kg * K)] + + + +m_B = 50 # Balloon (Start) Mass in [kg] +m_PL = 10 # Balloon Payload (Start) Mass in [kg] + + + + +pi = np.pi + +def T(h): + if h >= 0 and h <= 11000: + res = 288.15 - 0.0065 * h + return res + elif h > 11000 and h <= 20000: + res = 216.65 + return res + elif h >= 20000: + res = 216.65 + 0.0010 * (h - 20000) + return res + +def p(h): + if h >= 0 and h <= 11000: + res = 101325 * ((288.15 - 0.0065 * h)/288.15) ** 5.25577 + return res + elif h > 11000 and h <= 20000: + res = 22632 * np.exp(-(h - 11000)/6341.62) + return res + elif h > 20000: + res = 5474.87 * ((216.65 + 0.0010 * (z - 20000))/216.65) ** (-34.163) + return res + +def rho(h): + res = p(h)/(R_a * T(h)) + return res + + + + +# p_a = p0 # air pressure = constant +p_He = 101325 # initial gas pressure = air pressure +T_g = 288.15 # gas temperature = air temperature = constant + + +# GAS DENSITY +rho_g = p_He / (R_He * T_g) + +V_B = m_B / rho_g +D_B = (6 * V_B / pi) ** (1/3) + + +v = [] +time = [] +alt = [] + + +v_z = v0 +z = s0 +t = 0 +D = 0 + +rho_plot = [] +T_plot = [] +p_plot = [] +D_plot = [] + +while t < tmax: + v.append(v_z) + alt.append(z) + time.append(t) + + rho_plot.append(rho(z)) + T_plot.append(T(z)) + p_plot.append(p(z)) + D_plot.append(D) + + D = 0.5 * cD * 0.25 * pi * rho(z) * v_z ** 2 * D_B ** 2 + I = g * V_B * (rho(z) - rho_g) + G = g * m_PL + + + dv_z = (I - np.sign(v_z) * D - G) / m_B * dt + + v_z += dv_z * dt + z += v_z * dt + + t += dt + + + +#plt.plot(time, rho_plot) +#plt.plot(time, T_plot) +###plt.plot(time, v) +###plt.show() +#plt.plot(time, ind) +#plt.plot(time, D_plot) + +plt.plot(time, alt) +plt.show() + + + + diff --git a/input/__pycache__/natural_constants.cpython-38.pyc b/input/__pycache__/natural_constants.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..deed592ccbd3e892d1c17c958e65690f54b2b63f GIT binary patch literal 297 zcmWIL<>g`kf;qx};u9Dd7#@Q-$N(tD-~hzM3P2)-A&Mb|F^VyTDT*nDIf^-jC5k15 zHHtNbEs8CLJ(xk0BVE4rb>NP9$`0wXW&**-LWgu?5U^U{kSP$9$dEpvE%@0p>52B~ zXAWd6@-57>OHTuXZ}xtg?6(-xZ?Oi&CuSCbsPx3*Tg*Z6uD2LdZ?P6P+Ag`msnC-l$aBroS#=*l9*RgtXEKZi^C>2KczG$)ehw4VjdvD!iazX DZ*^F~ literal 0 HcmV?d00001 diff --git a/input/__pycache__/user_input.cpython-38.pyc b/input/__pycache__/user_input.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6b29c8259cbbb1a60c703d20978668e3ef746e6 GIT binary patch literal 677 zcmY+9&ui0Q7{}B6Xw$Ckx~_8~Iy?w6a3!s`DJJ4Uc2KALad-*5#60QSjHHcu--z2l zPo6ypGCg}yWakO~1H$|V-h(2ZLNk0Qem~?P8?{*oph(Pq6| z%?Az}ajnnx_xyO+xQKM#<=UC=T3u_Y(_QLZKHupsTNb`;%d*DA+h@-0#nV!cX%fj| zOnYGzOCzStoqvG+)py(sB>baQ1*8tJH%gqMw*AmL#&97uD_tlX2u+{3D;dDeW| zll2KjSvt%HAdAb9{-5&)MKjKF literal 0 HcmV?d00001 diff --git a/input/atmosphere.nc b/input/atmosphere.nc index 06d7405020018ddf3cacee90fd4af10487da3d20..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 1024 ScmZQz7zLvtFd70QH3R?z00031 diff --git a/models/__init__.py b/models/__init__.py index 06d7405020018ddf3cacee90fd4af10487da3d20..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 1024 ScmZQz7zLvtFd70QH3R?z00031 diff --git a/models/__pycache__/__init__.cpython-38.pyc b/models/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cecabe008b2182eca61457503ab9d2feda99f487 GIT binary patch literal 154 zcmWIL<>g`k0#=9X@gVv!h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6w>*(xTqIJKxa zCO5GtIW;FHpfWilu_!m7C_gJTxuiJ8H?g=RwJ0PbwKx-~CO;)Lr#L1)J~J<~BtBlR Vpz;=n4N$N&C)EyQ@Mj=q006z2CBOgx literal 0 HcmV?d00001 diff --git a/models/__pycache__/drag.cpython-38.pyc b/models/__pycache__/drag.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..342001e0490fa8aff7d4595558bea2aeb26d2255 GIT binary patch literal 357 zcmYjNu};H44E5b5qJTP)fr&j!KL8L#>cB)*3A#j)qBK4wsgfr0rAVnd@+E96Ec^i9 zaRU-!>MtM$d=*2V^lZPgp=VW=pgp3ZNz#(6!en99Q?hvlI_A-ztI1_NH=0abr%OJky}AOpKJ~qqeu6D|}vKoGl1C<;b4?YF)QIxf{r}_wReZgW$f= T4z79Sy3#j-m2rm;q$mFXw@FQH literal 0 HcmV?d00001 diff --git a/models/__pycache__/simple_atmosphere.cpython-38.pyc b/models/__pycache__/simple_atmosphere.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..747855b57bf7cc602914a9ecbd271ae40f8e9b1c GIT binary patch literal 950 zcmZva&1(};5Wwecc9YFltu@lvc*w;=N~n0NA~w>CmxgFl2q6%*d2181NtSsVF%m(r zp1k=7SUu*h&{Oduc(50b3wrSogC}nyJvg%oX`#;YX5Pol?7ZKbon$fwB$+EG^+X8Z z2QSWwMvDRsl_w=Z3J1z;HAhr68It-wR728`VY0f6NRzA~wQa~nClmoW;fvK`L-2ei zoKmN;Nkdgg4JmEgz${sov+LAeBYqBvJA@zpQR~g zc@`sqN-&GaKc4(q1sFeM(XcSS`Tq0cql2d#lWdW;kH3(l+J*7S==ayH-O|PgMw&00 zeh6)aQ3?;#-+P<4YCFnCRqI&Tu$@|I&}drNDPixC-SAXx%Tk_=<)*D#N~O?!Y(7b*qJ8zWov@5Q`!qbkaI~CRtpd-E+tc+6<8G(}b?e$npUi zfq6zIjVUy#XF!H85sWz|##bTV2;r+p(}TByBhwHE8O^{uamF`7zRzV$#$|#drch;^ zawbo626z{yc#--BTF0*hAU`W|p?ga=uD$+gTrLFnY&Geb_g?UzpIy8VtjzzgIyP0h6iQD?3hbX;&(^EP!+-?8s-4=cuG3R5>@ GX6zplImg@p literal 0 HcmV?d00001 diff --git a/models/__pycache__/sun.cpython-38.pyc b/models/__pycache__/sun.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..802efe86a1dea58d38f229439fee3a5a87eca099 GIT binary patch literal 2260 zcmcH*YiJxrcxPr`cez|H$t5|Hm?pK+UMba9Tcm{C#WYq*o5Us+yQEy#o9*7kd&JpI z%au83u~kv46Xb1@WiI3S!BxLkiXxRy5}~yLnmt>m1)V^F8K! z&FnX~udy*K!AP9Ek>RkK7sTp;fk*>5I{;CMqJmUJ21db}7&7p1K`E++TGR~9=M$iH zLx;6Yl@pQ?qAJy34pTHCCG{Ful17u*YaB6|o7-K^nr^;a@|2;1J9IROJk7S;j5Axx z%0hE-gkV+xh5?+tfLw`7E}F)1iKE3C!%X53U6~UuQ+x_n6<6WpNi?T&%G%}hb9x0eEpmNDjb5`EYxk+qj<;NU1U$i{Euo!JJ%tUEC zG;0uQ*&Zq~0yGmL8xfb8CFf9?6*F$xz~)gy1s!Ht1~Ch6GQ>n8O!fEYJTmKM4RDzC z2(u0u8f2cCDLWn>GCVS}`;oUL)Y#-h}wa>AbGgUNM)+$VmSF$;i6~|e5+RD1l z)E?7uEjF36oIL21sa0^Mz}Tjliq|5HnkBn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ycache__/test1.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2fc0c63871145e8e9a829305b586d7f4a0a6f38 GIT binary patch literal 292 zcmYjMv1$TA5S`i8LztMw3T{+$eeQSU`&2czb}Ov-VVo3nbz0wr*N{i>sxh1lUKuR!wZ$tu|%daD3YN Y>b&ZLuC&nh#yV|N&_n!dA zIrtB}%8?)AALx^bC;o!*VD*5CmDKC2>gt;6n*E`n8Uh-g_!TeSM(BriZjuYm8nAi; zf+LPov}d)G;>ZC_Qj(E~;493HT)^Da%lyc%Fc0h?3NU(xxX*(#!~+q0B2magK5&Mj z0q*RgdhHUbqdGSD!4}AnGc9zI39#M0D;-$6EpQ;1++aOxu6LC#vePd$N-1Z(xuQMSgD7Q+&a7-~AFR&I+tA*T_%D1P zLUnpr2u0hn$Y`VSkm`aiEG^Re3rkBh$!RKBhuT`I{fAd%t$pl4(sE;g_hkrRCAR9m3FA0tnTTUk zi{q@|-PGEHar~~!((6bN$Gm6(>{`GCwvkM$3nYhaDJy=it}i$Dm5{2LG1(GnbEnrj zVlvy2#j$8<)qKg677|9H638jINL5oG3HY9LzSEOF6tRt|%D}Gg;tFfoE&4+?!N%8t z)n^bT>bn|!#ietO`yN=1CYqFF5=|pO{L(A^Tj<1-d!@(m2?Fhwcp7%lMyAmu8izeB zy>Vo{Dbx@0#&w3vZ9TX2&N1ZpW01>(F?181g46w=3}8pXEoqnOvJy|hO1?qkN!tMo z7##uweSZwwKERj(F zZVYE4vXOKQkwX2OzZ`+;CU}xan6tVAj)GqjA?)HB9(6|XjMH%BT|nwJGnwR_uAa}C z?n;)%ts+;N". + The day-of-year (DOY) goes from 001 to 365 (366 in leap years). + The allowed subformat is: + - 'doy': day of year + """ + name = 'doy' # Unique format name + subfmts = (('doy', + '%j', + '{yday:03d}'), + ('doy', + '%j', + '{yday:03d}'), + ('doy', + '%j', + '{yday:03d}')) + +def AirMass(x, p_0, ELV, h): + p_air = x + ELV_rad = np.deg2rad(ELV) # convert ELV from degree to radian + Dip = np.arccos(R_E / (R_E + h)) # Dip in radian + + if ELV_rad >= -Dip and ELV_rad < 0: + res = p_air/p_0 * (1 + ELV_rad/Dip) - 70 * ELV_rad/Dip + else: + res = (p_air/p_0) * ((1229 + (614 * np.sin(ELV_rad)) ** 2) ** (1/2) - 614 * np.sin(ELV_rad)) + + return res + +#if ELV >= -(180/np.pi * np.arccos(R_e / (R_e + h))): +# tau_atm = 0.5 * (np.exp(-0.65 * AirMass(p_air, p_0, ELV, h)) + np.exp(-0.095 * AirMass(p_air, p_0, ELV, h))) +# tau_atmIR = 1.716 - 0.5 * (np.exp(-0.65 * p_air/p_0) + np.exp(-0.095 * p_air/p_0)) +#else: +# tau_atm = 0 +# tau_atmIR = 0 +# +#doy = int(utc.doy) +# +#MA = (357.52911 + 0.98560028 * (utc.jd - 2451545)) % 360 # in degree, reference: see folder "literature" +#TA = MA + 2 * e * np.sin(np.deg2rad(MA)) + 5/4 * e ** 2 * np.sin(np.deg2rad(2 * MA)) +#I_Sun = 1367.5 * ((1 + e * np.cos(np.deg2rad(TA)))/(1 - e ** 2)) ** 2 +#I_SunZ = I_Sun * tau_atm +#q_sun = I_SunZ +# +#q_IRground = epsilon_ground * sigma * T_ground ** 4 +# +#q_IREarth = q_IRground * tau_atmIR +# +#if ELV <= 0: +# q_Albedo = 0 +#else: +# q_Albedo = Albedo * I_Sun * np.sin(np.deg2rad(ELV)) +# +### NEEDED: +# Diameter = ... +# V_relative = ... +# rho_air = ... +# rho_gas = ... +# T_film = ... +# T_air = ... +# T_gas = ... +# +#my_air = (1.458 * 10 ** -6 * T_air ** 1.5) / (T_air + 110.4) +#my_gas = 1.895 * 10 ** -5 * (T_gas/273.15) ** 0.647 +#k_air = 0.0241 * (T_air/273.15) ** 0.9 +#k_gas = 0.144 * (T_gas/273.15) ** 0.7 +#Pr_air = 0.804 - 3.25 * 10 ** (-4) * T_air +#Pr_gas = 0.729 - 1.6 * 10 ** (-4) * T_gas +# +#Gr_air = (rho_air ** 2 * g * np.abs(T_film - T_air) * Diameter ** 3) / (T_air * my_air ** 2) +#Nu_air = 2 + 0.45 * (Gr_air * Pr_air) ** 0.25 +#HC_free = Nu_air * k_air / Diameter +#Re = V_relative * Diameter * rho_air / my_air +#HC_forced = k_air / Diameter * (2 + 0.41 * Re ** 0.55) +#HC_internal = 0.13 * k_gas * ((rho_gas ** 2 * g * np.abs(T_film - T_gas) * Pr_gas) / (T_gas * my_air ** 2)) ** (1/3) +#HC_external = np.maximum(HC_free, HC_forced) +# +#Q_Sun = alpha_VIS * A_proj * q_sun * (1 + tau_VIS/(1 - r_VIS)) +#Q_Albedo = alpha_VIS * A_surf * q_Albedo * ViewFactor * (1 + tau_VIS/(1 - r_VIS)) +#Q_IREarth = alpha_IR * A_surf * q_IREarth * ViewFactor * (1 + tau_IR/(1 - r_IR)) +#Q_IRFilm = sigma * epsilon * alpha_IR * A_surf * T_film ** 4 * 1/(1 - r_IR) +#Q_IROut = sigma * epsilon * A_surf * T_film ** 4 * (1 * tau_IR/(1 - r_IR)) +#Q_ConvExt = HC_external * A_effective * (T_air - T_film) +#Q_ConvInt = HC_internal * A_effective * (T_film - T_gas) +# +#HalfConeAngle = np.arcsin(R_E/(R_E + h)) +#ViewFactor = (1 - np.cos(HalfConeAngle))/2 +# +# +# +#RoC = -V_z +# +#dT_gas = (Q_ConvInt/(gamma * c_v * M_gas) - (gamma - 1)/gamma * rho_air * g / (rho_gas * R_gas) * RoC) * dt +#dT_film = ((Q_Sun + Q_Albedo + Q_IREarth + Q_IRfilm + Q_ConvExt - Q_ConvInt - Q_IRout)/(c_f * M_film)) * dt + + + + + + + + + diff --git a/output/placeholder.txt b/output/placeholder.txt index 06d7405020018ddf3cacee90fd4af10487da3d20..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 GIT binary patch literal 0 HcmV?d00001 literal 1024 ScmZQz7zLvtFd70QH3R?z00031