From 26ed55bf3789edb0872d58384843655ea734048a Mon Sep 17 00:00:00 2001 From: Capkirk123 Date: Wed, 20 Mar 2024 19:27:38 -0400 Subject: [PATCH] Add CH4 fuel cell (#161) --- .../KerbalismConfig/Localization/en-us.cfg | 4 + .../KerbalismConfig/Profiles/ROKerbalism.cfg | 113 +++++++++++++++++- 2 files changed, 116 insertions(+), 1 deletion(-) diff --git a/GameData/KerbalismConfig/Localization/en-us.cfg b/GameData/KerbalismConfig/Localization/en-us.cfg index 38704c8..ca6d81d 100644 --- a/GameData/KerbalismConfig/Localization/en-us.cfg +++ b/GameData/KerbalismConfig/Localization/en-us.cfg @@ -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 diff --git a/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg b/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg index 13f64e9..a6c91a3 100644 --- a/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg +++ b/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg @@ -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 @@ -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 @@ -1236,6 +1270,14 @@ Supply capacity = 1 running = true } + MODULE + { + name = ProcessController + resource = _FuelCellCH4 + title = CH4 Fuel Cell + capacity = 1 + running = true + } MODULE { @@ -1317,6 +1359,21 @@ Supply id_value = _FuelCellShuttle } } + + SETUP //CH4 + { + name = CH4 Hydrocarbon Fuel Cell + desc = Combines LqdMethane and LqdOxygen to produce Water, Carbon Dioxide and Electricity. + 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 + } + } } } @@ -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 { @@ -1404,6 +1469,21 @@ Supply id_value = _FuelCellShuttle } } + + SETUP //CH4 + { + name = CH4 Hydrocarbon Fuel Cell + desc = Combines LqdMethane and LqdOxygen to produce Water, Carbon Dioxide, and Electricity. + tech = powerNF + mass = 0.01125 + + MODULE + { + type = ProcessController + id_field = resource + id_value = _FuelCellCH4 + } + } } } @@ -1440,6 +1520,14 @@ Supply capacity = 6 running = true } + MODULE + { + name = ProcessController + resource = _FuelCellCH4 + title = CH4 Fuel Cell + capacity = 6 + running = true + } MODULE { @@ -1491,6 +1579,21 @@ Supply id_value = _FuelCellShuttle } } + + SETUP //CH4 + { + name = CH4 Hydrocarbon Fuel Cell + desc = Combines LqdMethane and LqdOxygen to produce Water, Carbon Dioxide and Electricity. + tech = powerNF + mass = 0.0825 + + MODULE + { + type = ProcessController + id_field = resource + id_value = _FuelCellCH4 + } + } } } @@ -2159,6 +2262,7 @@ RESOURCE_DEFINITION density = 0.0 isVisible = false } + RESOURCE_DEFINITION { name = _FuelCellGas @@ -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 }