Vulcan
Aerospace Engineering Utilities Built on Janus
Loading...
Searching...
No Matches
Rocket.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <janus/janus.hpp>
4
6
17template <typename Scalar>
18Scalar thrust_from_mdot(const Scalar &mdot, const Scalar &Ve) {
19 return mdot * Ve;
20}
21
32template <typename Scalar>
33Scalar exhaust_velocity(const Scalar &Isp, double g0 = 9.80665) {
34 return Isp * g0;
35}
36
48template <typename Scalar>
49Scalar specific_impulse(const Scalar &thrust, const Scalar &mdot,
50 double g0 = 9.80665) {
51 return thrust / (mdot * g0);
52}
53
65template <typename Scalar>
66Scalar delta_v(const Scalar &Ve, const Scalar &m0, const Scalar &mf) {
67 return Ve * janus::log(m0 / mf);
68}
69
81template <typename Scalar>
82Scalar propellant_mass(const Scalar &delta_v, const Scalar &m0,
83 const Scalar &Ve) {
84 return m0 * (1.0 - janus::exp(-delta_v / Ve));
85}
86
97template <typename Scalar>
98Scalar mass_flow_rate(const Scalar &thrust, const Scalar &Ve) {
99 return thrust / Ve;
100}
101
112template <typename Scalar>
113Scalar burn_time(const Scalar &propellant_mass, const Scalar &mdot) {
114 return propellant_mass / mdot;
115}
116
117} // namespace vulcan::propulsion::rocket
Definition Rocket.hpp:5
Scalar specific_impulse(const Scalar &thrust, const Scalar &mdot, double g0=9.80665)
Calculates specific impulse from thrust, mass flow rate, and gravity.
Definition Rocket.hpp:49
Scalar exhaust_velocity(const Scalar &Isp, double g0=9.80665)
Calculates effective exhaust velocity from specific impulse.
Definition Rocket.hpp:33
Scalar mass_flow_rate(const Scalar &thrust, const Scalar &Ve)
Calculates mass flow rate from thrust and exhaust velocity.
Definition Rocket.hpp:98
Scalar burn_time(const Scalar &propellant_mass, const Scalar &mdot)
Calculates burn time for a given propellant mass and flow rate.
Definition Rocket.hpp:113
Scalar delta_v(const Scalar &Ve, const Scalar &m0, const Scalar &mf)
Calculates Delta-V using the Tsiolkovsky rocket equation.
Definition Rocket.hpp:66
Scalar thrust_from_mdot(const Scalar &mdot, const Scalar &Ve)
Calculates thrust from mass flow rate and effective exhaust velocity.
Definition Rocket.hpp:18
Scalar propellant_mass(const Scalar &delta_v, const Scalar &m0, const Scalar &Ve)
Calculates required propellant mass for a given Delta-V.
Definition Rocket.hpp:82