From 57d4f51d347fb1e36638196d9bf49570047376c4 Mon Sep 17 00:00:00 2001 From: Capkirk123 Date: Wed, 25 Oct 2023 22:54:18 -0500 Subject: [PATCH 1/3] Add support for Polonium and Curium RTGs --- .../KerbalismConfig/Profiles/ROKerbalism.cfg | 69 +++++++++++++++++++ GameData/KerbalismConfig/System/Misc.cfg | 58 ++++++++++++++++ 2 files changed, 127 insertions(+) diff --git a/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg b/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg index 7658159d..f6b9a7ae 100644 --- a/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg +++ b/GameData/KerbalismConfig/Profiles/ROKerbalism.cfg @@ -826,6 +826,25 @@ Supply output = ElectricCharge@1.0 dump = true } + //Polonium-210, as used in early SNAP-3? + Process + { + name = RTGPo210 + modifier = _RTGPo210 + input = _RTGPo210@0.00000004181385 // 138.4 day half-life + output = ElectricCharge@1.0 + dump = true + } + + //Cesium-242, as used in SNAP-11 + Process + { + name = RTGCm242 + modifier = _RTGCm242 + input = _RTGCm242@0.00000000239035 // 242.1 day half-life + output = ElectricCharge@1.0 + dump = true + } Process { @@ -869,6 +888,34 @@ Supply !MODULE[ModuleCoreHeat],*{} } +@PART:HAS[@MODULE[ModuleResourceConverter]:HAS[#ConverterName[RTGPo210]]]:NEEDS[ProfileRealismOverhaul]:FOR[RP-0-Kerbalism] +{ + MODULE + { + name = ProcessController + resource = _RTGPo210 + title = RTGPo210 + capacity = #$../MODULE[ModuleResourceConverter]/OUTPUT_RESOURCE:HAS[#ResourceName[ElectricCharge]]/Ratio$ + running = true + toggle = false + } + !MODULE[ModuleCoreHeat],*{} +} + +@PART:HAS[@MODULE[ModuleResourceConverter]:HAS[#ConverterName[RTGCm242]]]:NEEDS[ProfileRealismOverhaul]:FOR[RP-0-Kerbalism] +{ + MODULE + { + name = ProcessController + resource = _RTGCm242 + title = RTGCm242 + capacity = #$../MODULE[ModuleResourceConverter]/OUTPUT_RESOURCE:HAS[#ResourceName[ElectricCharge]]/Ratio$ + running = true + toggle = false + } + !MODULE[ModuleCoreHeat],*{} +} + // ============================================================================ // Add configurable Life Support System to Life Support Unit part // ============================================================================ @@ -2025,6 +2072,28 @@ RESOURCE_DEFINITION @tags ^=:$:, rtg, radioisotope thermoelectric generator, radioactive, generator } +RESOURCE_DEFINITION +{ + name = _RTGPo210 + density = 0.0 + isVisible = false +} +@PART:HAS[@MODULE[ProcessController]:HAS[#resource[_RTGPo210]]]:NEEDS[ProfileRealismOverhaul]:LAST[Kerbalism] +{ + @tags ^=:$:, rtg, radioisotope thermoelectric generator, radioactive, generator +} + +RESOURCE_DEFINITION +{ + name = _RTGCm242 + density = 0.0 + isVisible = false +} +@PART:HAS[@MODULE[ProcessController]:HAS[#resource[_RTGCm242]]]:NEEDS[ProfileRealismOverhaul]:LAST[Kerbalism] +{ + @tags ^=:$:, rtg, radioisotope thermoelectric generator, radioactive, generator +} + RESOURCE_DEFINITION { name = _FuelCell diff --git a/GameData/KerbalismConfig/System/Misc.cfg b/GameData/KerbalismConfig/System/Misc.cfg index ad6ff9b9..e50b2992 100644 --- a/GameData/KerbalismConfig/System/Misc.cfg +++ b/GameData/KerbalismConfig/System/Misc.cfg @@ -97,3 +97,61 @@ //delete old converter module !MODULE[ModuleResourceConverter],*{} } + +//source: https://web.archive.org/web/20130215003518/http://fti.neep.wisc.edu/neep602/SPRING00/lecture5.pdf +// $2800/gram (2000$) = $512,000/kg (1965$) = 512 funds/kg +@PART:HAS[@MODULE[ModuleResourceConverter]:HAS[#ConverterName[RTGPo210]]]:NEEDS[ProfileRealismOverhaul]:FOR[zzzKerbalism] +{ + // get the amount of Pu + PuMass = #$RESOURCE[Plutonium-238]/maxAmount$ + // get the mass by multiplying for the density + @PuMass *= 0.019816 + // add the Pu mass to the part + @mass += #$PuMass$ + + // get the amount of Pu + PuCost = #$RESOURCE[Plutonium-238]/maxAmount$ + // get the cost by multiplying for the unit cost + + //@PuCost *= #$@RESOURCE_DEFINITION[Plutonium-238]/unitCost$ + @PuCost *= 512 + + // add the Pu cost to the part + @cost += #$PuCost$ + + // delete resources + !RESOURCE[Plutonium-238] {} + !RESOURCE[DepletedFuel] {} + + //delete old converter module + !MODULE[ModuleResourceConverter],*{} +} + +//source: https://web.archive.org/web/20130215003518/http://fti.neep.wisc.edu/neep602/SPRING00/lecture5.pdf +// $2000/gram (2000$) = $365,000/kg (1965$) = 365 funds/kg +@PART:HAS[@MODULE[ModuleResourceConverter]:HAS[#ConverterName[RTGCm242]]]:NEEDS[ProfileRealismOverhaul]:FOR[zzzKerbalism] +{ + // get the amount of Pu + PuMass = #$RESOURCE[Plutonium-238]/maxAmount$ + // get the mass by multiplying for the density + @PuMass *= 0.019816 + // add the Pu mass to the part + @mass += #$PuMass$ + + // get the amount of Pu + PuCost = #$RESOURCE[Plutonium-238]/maxAmount$ + // get the cost by multiplying for the unit cost + + //@PuCost *= #$@RESOURCE_DEFINITION[Plutonium-238]/unitCost$ + @PuCost *= 365 + + // add the Pu cost to the part + @cost += #$PuCost$ + + // delete resources + !RESOURCE[Plutonium-238] {} + !RESOURCE[DepletedFuel] {} + + //delete old converter module + !MODULE[ModuleResourceConverter],*{} +} From fd3a6d0a3a28803144ac1947e12ffe526afd7a20 Mon Sep 17 00:00:00 2001 From: Capkirk123 Date: Thu, 26 Oct 2023 21:50:17 -0500 Subject: [PATCH 2/3] Remove radiation from ASRG --- GameData/KerbalismConfig/Support/NearFuture.cfg | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GameData/KerbalismConfig/Support/NearFuture.cfg b/GameData/KerbalismConfig/Support/NearFuture.cfg index 926b1b7c..ab5c806b 100644 --- a/GameData/KerbalismConfig/Support/NearFuture.cfg +++ b/GameData/KerbalismConfig/Support/NearFuture.cfg @@ -203,11 +203,12 @@ Profile @PART[rtg-0625]:NEEDS[NearFutureElectrical]:AFTER[RealismOverhaul] { - MODULE:NEEDS[FeatureRadiation] - { - name = Emitter - radiation = 0.000002222 // 0.008 rad/h - } + //RTG probably shouldn't produce significant radiation? + //MODULE:NEEDS[FeatureRadiation] + //{ + // name = Emitter + // radiation = 0.000002222 // 0.008 rad/h + //} MODULE:NEEDS[ProfileRealismOverhaul] { From fb644b3cd7cd43ab5c36d475de12994762728c4b Mon Sep 17 00:00:00 2001 From: Capkirk123 Date: Thu, 26 Oct 2023 22:20:04 -0500 Subject: [PATCH 3/3] Remove dedicated ASRG patch, let generic patch get it --- .../KerbalismConfig/Support/NearFuture.cfg | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/GameData/KerbalismConfig/Support/NearFuture.cfg b/GameData/KerbalismConfig/Support/NearFuture.cfg index ab5c806b..b8e18e18 100644 --- a/GameData/KerbalismConfig/Support/NearFuture.cfg +++ b/GameData/KerbalismConfig/Support/NearFuture.cfg @@ -201,29 +201,6 @@ Profile } } -@PART[rtg-0625]:NEEDS[NearFutureElectrical]:AFTER[RealismOverhaul] -{ - //RTG probably shouldn't produce significant radiation? - //MODULE:NEEDS[FeatureRadiation] - //{ - // name = Emitter - // radiation = 0.000002222 // 0.008 rad/h - //} - - MODULE:NEEDS[ProfileRealismOverhaul] - { - name = ProcessController - resource = _RTG - title = RTG - capacity = #$../MODULE[ModuleGenerator]/OUTPUT_RESOURCE[ElectricCharge]/rate$ - running = true - toggle = false - } - - !MODULE[ModuleGenerator] {} - !MODULE[ModuleCoreHeat] {} -} - // ============================================================================ // Near Future Solar - curved panel support provided by SolarPanelFixer // ============================================================================