Module: KerbalDyn::Part::Mixin::FuelTank

Included in:
FuelTank, RCSFuelTank, SolidRocket
Defined in:
lib/kerbaldyn/part/mixin/fuel_tank.rb

Instance Method Summary collapse

Instance Method Details

#dry_massObject



16
17
18
# File 'lib/kerbaldyn/part/mixin/fuel_tank.rb', line 16

def dry_mass
  return self['dryMass'].to_f
end

#fuelObject 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_densityObject

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_massObject

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