Skip to content

Commit

Permalink
Add CH4 fuel cell (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Capkirk123 committed Mar 20, 2024
1 parent 61769ce commit 26ed55b
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 1 deletion.
4 changes: 4 additions & 0 deletions GameData/KerbalismConfig/Localization/en-us.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ Localization
#KERBALISM_empty_lqd_hydrogen = $VESSEL Liquid Hydrogen tanks are empty
#KERBALISM_refill_lqd_hydrogen = $VESSEL has refilled the Liquid Hydrogen tanks

#KERBALISM_low_lqd_methane = $VESSEL Liquid Methane reserves are low
#KERBALISM_empty_lqd_methane = $VESSEL Liquid Methane tanks are empty
#KERBALISM_refill_lqd_methane = $VESSEL has refilled the Liquid Methane tanks

#KERBALISM_low_lqd_oxygen = $VESSEL Liquid Oxygen reserves are low
#KERBALISM_empty_lqd_oxygen = $VESSEL Liquid Oxygen tanks are empty
#KERBALISM_refill_lqd_oxygen = $VESSEL has refilled the Liquid Oxygen tanks
Expand Down
113 changes: 112 additions & 1 deletion GameData/KerbalismConfig/Profiles/ROKerbalism.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ Supply
refill_message = #KERBALISM_refill_lqd_hydrogen //$VESSEL has refilled the Liquid Hydrogen tanks
}
Supply
{
resource = LqdMethane
low_message = #KERBALISM_low_lqd_methane //$VESSEL Liquid Methane reserves are low
empty_message = #KERBALISM_empty_lqd_methane //$VESSEL Liquid Methane tanks are empty
refill_message = #KERBALISM_refill_lqd_methane //$VESSEL has refilled the Liquid Methane tanks
}
Supply
{
resource = LqdOxygen
low_message = #KERBALISM_low_lqd_oxygen //$VESSEL Liquid Oxygen reserves are low
Expand Down Expand Up @@ -451,6 +458,33 @@ Supply
output = ElectricCharge@1.0
dump = Water
}
//Methane fuel cells
// source: https://pubs.rsc.org/en/content/articlelanding/2017/ra/c7ra05245f
// https://pubs.rsc.org/en/content/articlelanding/2017/ra/c7ra05245f
// Still in development, not going for a specific technology
// Similar efficiency to H2 fuel cells
// Guessing 75% efficient by HHV
// Methane has a HHV of 55.5 MJ/kg
// Liquid Methane has a density of 0.42561 kg/L
// Therefore, we need 0.0000423346 / 0.75 = 0.0000564461 L/s of Lqd Methane to generate 1 kW
// 3.9899 kg O2 for every kg methane
// Liquid Oxygen has a density of 1.141 kg/L, so 1.4883 L oxygen for every liter methane
// running stoich, we then need 0.0000840087 L/s of Lqd Oxygen to match
// 0.0864864 kg/hr LCH4, 0.345074 kg/hr O2
// this will produce 0.194271 kg/hr H2O and 0.237298 kg/hr CO2
// 0.0000539642 L/s H2O, 0.0337858 L/s CO2
Process
{
name = fuel cell ch4
modifier = _FuelCellCH4
input = LqdOxygen@0.0000840087
input = LqdMethane@0.0000564461
output = Water@0.0000539642
output = CarbonDioxide@0.0337858
output = ElectricCharge@1.0
dump = Water,CarbonDioxide
}
// Based on current electrolysis rates where it takes 12.749kWh to make 1L of H
// Convention: 1 "unit" creates just a little more O2 per second than is needed for 1 crew
Expand Down Expand Up @@ -1236,6 +1270,14 @@ Supply
capacity = 1
running = true
}
MODULE
{
name = ProcessController
resource = _FuelCellCH4
title = CH4 Fuel Cell
capacity = 1
running = true
}
MODULE
{
Expand Down Expand Up @@ -1317,6 +1359,21 @@ Supply
id_value = _FuelCellShuttle
}
}
SETUP //CH4
{
name = CH4 Hydrocarbon Fuel Cell
desc = Combines <b>LqdMethane</b> and <b>LqdOxygen</b> to produce <b>Water</b>, <b>Carbon Dioxide</b> and <b>Electricity</b>.
tech = powerNF
mass = 0.015 //better specific power than H2 fuel cells, but requires more cooling
MODULE
{
type = ProcessController
id_field = resource
id_value = _FuelCellCH4
}
}
}
}
Expand Down Expand Up @@ -1353,6 +1410,14 @@ Supply
capacity = 0.75
running = true
}
MODULE
{
name = ProcessController
resource = _FuelCellCH4
title = CH4 Fuel Cell
capacity = 0.75
running = true
}
MODULE
{
Expand Down Expand Up @@ -1404,6 +1469,21 @@ Supply
id_value = _FuelCellShuttle
}
}
SETUP //CH4
{
name = CH4 Hydrocarbon Fuel Cell
desc = Combines <b>LqdMethane</b> and <b>LqdOxygen</b> to produce <b>Water</b>, <b>Carbon Dioxide</b>, and <b>Electricity</b>.
tech = powerNF
mass = 0.01125
MODULE
{
type = ProcessController
id_field = resource
id_value = _FuelCellCH4
}
}
}
}
Expand Down Expand Up @@ -1440,6 +1520,14 @@ Supply
capacity = 6
running = true
}
MODULE
{
name = ProcessController
resource = _FuelCellCH4
title = CH4 Fuel Cell
capacity = 6
running = true
}
MODULE
{
Expand Down Expand Up @@ -1491,6 +1579,21 @@ Supply
id_value = _FuelCellShuttle
}
}
SETUP //CH4
{
name = CH4 Hydrocarbon Fuel Cell
desc = Combines <b>LqdMethane</b> and <b>LqdOxygen</b> to produce <b>Water</b>, <b>Carbon Dioxide</b> and <b>Electricity</b>.
tech = powerNF
mass = 0.0825
MODULE
{
type = ProcessController
id_field = resource
id_value = _FuelCellCH4
}
}
}
}
Expand Down Expand Up @@ -2159,6 +2262,7 @@ RESOURCE_DEFINITION
density = 0.0
isVisible = false
}
RESOURCE_DEFINITION
{
name = _FuelCellGas
Expand All @@ -2173,7 +2277,14 @@ RESOURCE_DEFINITION
isVisible = false
}
@PART:HAS[@MODULE[ProcessController]:HAS[#resource[_FuelCell]]]:NEEDS[ProfileRealismOverhaul]:LAST[Kerbalism]
RESOURCE_DEFINITION
{
name = _FuelCellCH4
density = 0.0
isVisible = false
}
@PART:HAS[@MODULE[ProcessController]:HAS[#resource[_FuelCell*]]]:NEEDS[ProfileRealismOverhaul]:LAST[Kerbalism]
{
@tags ^=:$:, fuel cell, lqdhydrogen, lqdoxygen, generator
}
Expand Down

0 comments on commit 26ed55b

Please sign in to comment.