1
0
mirror of https://gitlab.com/lander-team/air-prop-simulation.git synced 2025-07-23 14:41:38 +00:00
Files
Air-Prop-Simulation/calcs.jl
2021-03-16 11:30:35 -07:00

125 lines
3.6 KiB
Julia
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### A Pluto.jl notebook ###
# v0.12.20
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
el
end
end
# ╔═╡ 7d1e8730-81f7-11eb-0b4d-d7c878032280
begin
using Unitful
using Roots
using PlutoUI
end
# ╔═╡ d8461f50-833d-11eb-04f2-f9e262a97ba5
md"## Air Compressor Thrust Calcs"
# ╔═╡ 2a976cf0-833e-11eb-3892-03869a9b0acc
html"<button onclick='present()'>present</button>"
# ╔═╡ b0efd6c2-81f9-11eb-2aad-efc9bdd8c220
@bind diam Slider(0.1:.1:6.5, default=.5)
# ╔═╡ bc06c722-81fa-11eb-05ac-e38ac21ce27e
@bind p Slider(15:6000, default=126)
# ╔═╡ 99835750-81fe-11eb-3a7e-1132eb3cdd90
@bind w Slider(.5:.25:20, default=5)
# ╔═╡ a9f59000-81f7-11eb-15c0-4520acb6543f
begin
M = w*u"kg"
P_amb = 1u"atm"
P_c = p*u"psi"
d_nozzle = diam*u"mm"
a_nozzle = (pi/4)*d_nozzle^2
γ = 1.4
R = 287.05u"J/(kg * K)"
T = 300u"K"
burn_time = 5u"s"
V = 68u"inch^3"
end;
# ╔═╡ 764dcf30-81fa-11eb-3155-559823202b8f
md"Area of Nozzle: $(a_nozzle) | $(round(u\"inch^2\",a_nozzle, digits = 4))"
# ╔═╡ b4a957a0-833e-11eb-1ca9-0d87d162790f
md"Diameter of Nozzle: $(d_nozzle) | $(round(u\"inch\",d_nozzle, digits = 4))"
# ╔═╡ a7bef990-81fa-11eb-3976-817c3e383e64
md"Pressure of system: $(P_c)"
# ╔═╡ b113c030-81fe-11eb-2042-776472e720ac
md"Mass of Lander: $(M) | $(round(u\"lb\",M, digits = 2))"
# ╔═╡ a9317cb0-81f7-11eb-26e5-95719252409b
begin
ve = sqrt((2 * γ / (γ - 1)) * R * T * (1 - P_amb / P_c)^((γ - 1) / γ)) |> u"m/s"
ρ = P_c / (R * T) |> u"kg/m^3"
= ρ * a_nozzle * ve |> u"kg/s"
end;
# ╔═╡ cf5b7030-846d-11eb-2f23-290624c7d684
M_air = ρ*V |> u"kg"
# ╔═╡ 2149b640-846e-11eb-262b-299ded0c61c5
M_air /
# ╔═╡ c57fe2d0-81f7-11eb-27d7-4b5c0520998d
Thrust = * ve + a_nozzle * (P_c - P_amb) |> u"N"
# ╔═╡ 213ef2c0-81fb-11eb-1425-15bfcf1dc14c
volume_air = * burn_time / ρ |> u"inch^3";
# ╔═╡ 9388c570-833d-11eb-3baa-758b5cb19065
md"Air Needed: $(round(ustrip(volume_air/burn_time)*.004329,digits=3)) Gallon/s"
# ╔═╡ e85b0e90-81fe-11eb-0dd5-0b3df376a4f7
begin
W_earth = 9.81u"m/s^2" * M |> u"N"
W_moon = 1.623u"m/s^2" * M |> u"N"
end;
# ╔═╡ 57844480-833a-11eb-3a57-bf00cecde849
md"Thrust to Weight Ratio Earth: $(Thrust/W_earth)"
# ╔═╡ a5c735d0-833a-11eb-2bae-71ba4af6b3a1
md"Thrust to Weight Ratio Moon: $(Thrust/W_moon)"
# ╔═╡ Cell order:
# ╟─d8461f50-833d-11eb-04f2-f9e262a97ba5
# ╟─2a976cf0-833e-11eb-3892-03869a9b0acc
# ╟─7d1e8730-81f7-11eb-0b4d-d7c878032280
# ╟─764dcf30-81fa-11eb-3155-559823202b8f
# ╟─b4a957a0-833e-11eb-1ca9-0d87d162790f
# ╟─b0efd6c2-81f9-11eb-2aad-efc9bdd8c220
# ╟─a7bef990-81fa-11eb-3976-817c3e383e64
# ╠═bc06c722-81fa-11eb-05ac-e38ac21ce27e
# ╟─b113c030-81fe-11eb-2042-776472e720ac
# ╠═99835750-81fe-11eb-3a7e-1132eb3cdd90
# ╠═a9f59000-81f7-11eb-15c0-4520acb6543f
# ╠═a9317cb0-81f7-11eb-26e5-95719252409b
# ╠═2149b640-846e-11eb-262b-299ded0c61c5
# ╠═cf5b7030-846d-11eb-2f23-290624c7d684
# ╠═c57fe2d0-81f7-11eb-27d7-4b5c0520998d
# ╟─213ef2c0-81fb-11eb-1425-15bfcf1dc14c
# ╠═9388c570-833d-11eb-3baa-758b5cb19065
# ╟─e85b0e90-81fe-11eb-0dd5-0b3df376a4f7
# ╟─57844480-833a-11eb-3a57-bf00cecde849
# ╟─a5c735d0-833a-11eb-2bae-71ba4af6b3a1