Module: KerbalDyn::Part::Mixin::FuelTank
- Included in:
- FuelTank, RCSFuelTank, SolidRocket
- Defined in:
- lib/kerbaldyn/part/mixin/fuel_tank.rb
Instance Method Summary collapse
- #dry_mass ⇒ Object
-
#fuel ⇒ Object
(also: #internal_fuel, #capacity)
Fuel capacity in m^3 to match mks requirement, even though the game seems to display liters.
-
#fuel_density ⇒ Object
Calculated density in kg/m^3.
-
#fuel_mass ⇒ Object
The mass of the fuel.
Instance Method Details
#dry_mass ⇒ Object
16 17 18 |
# File 'lib/kerbaldyn/part/mixin/fuel_tank.rb', line 16 def dry_mass return self['dryMass'].to_f end |
#fuel ⇒ Object Also known as: internal_fuel, capacity
Fuel capacity in m^3 to match mks requirement, even though the game seems to display liters.
Note that 1 m^3 = 1000 liters
10 11 12 |
# File 'lib/kerbaldyn/part/mixin/fuel_tank.rb', line 10 def fuel return (self['fuel'] || self['internalFuel']).to_f / 1000.0 end |
#fuel_density ⇒ Object
Calculated density in kg/m^3.
Note that 1 m^3 = 1000 liters
28 29 30 |
# File 'lib/kerbaldyn/part/mixin/fuel_tank.rb', line 28 def fuel_density return self.fuel_mass / self.capacity end |
#fuel_mass ⇒ Object
The mass of the fuel.
21 22 23 |
# File 'lib/kerbaldyn/part/mixin/fuel_tank.rb', line 21 def fuel_mass return self.mass - self.dry_mass end |