Skip to content

Instantly share code, notes, and snippets.

@xeger xeger/bfr.rb
Last active Oct 6, 2017

Embed
What would you like to do?
Ballistic rocket passenger transport
#! /usr/bin/env ruby
require 'rubygems'
require 'quantify'
include Math
# Mission parameters:
# 100 people plus baggage
# from New York City to Shanghai
# on a 100km ballistic trajectory
Dsurf = 11800.km
Amax = 100.km
Pax = 240
Mpayload = 100.kg * Pax
# Facts about Big Momma
Rearth = 6370.km
GPearth = (1.km**3 / 1.s**2) * 398_600
Gearth = 9.807.m / 1.s**2
# delta vee
# see http://www.alternatewars.com/BBOW/ABM/DeltaV_BMs.htm
Rburnout = Rearth + Amax
GRad = GPearth / Rburnout
RangeAngle = (Dsurf / Rearth).value
Dv1 = sqrt(((GRad * 2 * sin(RangeAngle)/2) / (1+sin(RangeAngle)/2)).value).km/1.s
Dv2 = Dv1 * 0.20 # wild guess for braking DV
Dv = Dv1 + Dv2
# BFR ship and engines
# see https://www.youtube.com/watch?v=E4FY894HyF8
# and https://web.archive.org/web/20160928040332/http://www.spacex.com/sites/spacex/files/mars_presentation.pdf
# and https://en.wikipedia.org/wiki/Merlin_(rocket_engine_family)
Mship = 85.t # cited in 2017 video
Ne = 12 # need enough engines to get off the ground!
Me = 750.kg * Ne # assumed Raptor mass (compare to Merlin mass: 470kg)
F1 = 1_700.kN # cited in 2017 video
Isp = 330 # cited at 330-356 in the video; assume all sea level burns
F = F1*Ne # combined thrust from all engines
Ve = Gearth * Isp # exhaust velocity
PCH4 = 0.21 # propellant ratio of methane
PO2 = 0.78 # propellant ratio of O2
# Tsiolkovsky equation; solving for m0
Mdry = Mship + Me
M0 = (Mdry+Mpayload) * E ** (Dv / Ve).to_si.value
Mprop = M0 - (Mdry+Mpayload)
# Acceleration profile
M = (Mdry+Mpayload+Mprop)
Acc = (F.to_si / M.to_si) - Gearth
# Fuel parameters
DenCH4 = 0.656.g/1.L # methane density at STP
DenO2 = 1.429.g/1.L # oxygen density at STP
# Cost of CH4 for a given mass of methalox propellant
def costCH4()
mass = Mprop*PCH4
# wellhead cost of CH4: approx $4 per 1,000 ft^3
# see https://www.eia.gov/energyexplained/index.cfm?page=natural_gas_prices
vol_per_dollar = ((1.ft**3) * 1000).to(Unit.L) / 4
mass_per_dollar = vol_per_dollar * DenCH4
(mass / mass_per_dollar).to_si.value
end
# Cost of O2 for a given mass of methalox propellant
def costO2()
mass = Mprop*PO2
# $0.16 / kg at 2001 prices
# see https://www.quora.com/How-much-does-NASA-pay-per-kg-for-hydrogen-and-oxygen-in-rocket-fuel
dollar_per_kg = 0.25
dollar_per_kg * mass.to_si.value
end
MoleCH4 = 16.04.g
MoleCO2 = 44.01.g
def co2_footprint()
(Mprop * PCH4) / MoleCH4 * MoleCO2
end
puts 'Performance'
puts '-----------'
puts 'Net accel: ' + (Acc / Gearth).value.round(2).to_s + ' g'
puts 'Propellant: ' + Mprop.round(1).to_s
puts
puts 'Cost per pax'
puts '------------'
puts ' Propellant: $' + ((costCH4 + costO2) / Pax).round(0).to_s
puts ' CO2: ' + (co2_footprint / Pax).round(3).to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.