Skip to content

Commit

Permalink
feat: config to bump down heat exchanger efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
bruberu committed Jul 24, 2024
1 parent 60c1570 commit a409d62
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/main/java/gregtech/common/ConfigHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ public static class NuclearOptions {
"The level of detail to which fission reactors are analyzed. May cause more lag at higher values." })
@Config.RangeInt(min = 5, max = 10000)
public double fissionReactorResolution = 100;

@Config.Comment({ "Nuclear coolant heat exchanger recipe efficiency multiplier for balancing purposes",
"Default: 0.1" })
@Config.RangeDouble(min = 0, max = 1000)
public double heatExchangerEfficiencyMultiplier = 0.0625;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ public static void init() {
.chancedOutput(dust, Zirconium, 1645, 0)
.chancedOutput(dust, Molybdenum, 1169, 0)
.chancedOutput(dust, Neodymium, 1030, 0)
.chancedOutput(dust, Ruthenium, 609, 0)
.chancedOutput(dust, Lead, 659, 0)
.chancedOutput(dust, Ruthenium, 609, 0)
.chancedOutput(dust, Technetium, 297, 0)
.fluidOutputs(Krypton.getFluid(16), Xenon.getFluid(111), Radon.getFluid(125))
.buildAndRegister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import gregtech.api.unification.material.Materials;
import gregtech.api.unification.material.properties.CoolantProperty;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.common.ConfigHolder;

public class FluidRecipeHandler {

Expand All @@ -18,9 +19,12 @@ public static void runRecipeGeneration() {

public static void processCoolant(Material mat, CoolantProperty coolant) {
int waterAmt = 6;
double multiplier = ConfigHolder.machines.nuclear.heatExchangerEfficiencyMultiplier;

// water temp difference * water heat capacity * amount / coolantHeatCapacity * (hotHpTemp - coolantTemp)
int coolantAmt = (int) Math.ceil(100 * 4168 * waterAmt / (coolant.getSpecificHeatCapacity() *
(coolant.getHotHPCoolant().getFluid().getTemperature() - mat.getFluid().getTemperature())));
(coolant.getHotHPCoolant().getFluid().getTemperature() - mat.getFluid().getTemperature())) *
multiplier);

RecipeMaps.HEAT_EXCHANGER_RECIPES.recipeBuilder().duration(1).circuitMeta(1)
.fluidInputs(coolant.getHotHPCoolant().getFluid(coolantAmt), Materials.Water.getFluid(waterAmt))
Expand All @@ -33,7 +37,8 @@ public static void processCoolant(Material mat, CoolantProperty coolant) {
waterAmt = 600;
// Slightly more efficient
coolantAmt = (int) Math.ceil(100 * 4168 * waterAmt / (coolant.getSpecificHeatCapacity() *
(coolant.getHotHPCoolant().getFluid().getTemperature() - mat.getFluid().getTemperature())));
(coolant.getHotHPCoolant().getFluid().getTemperature() - mat.getFluid().getTemperature())) *
multiplier);

RecipeMaps.HEAT_EXCHANGER_RECIPES.recipeBuilder().duration(1).circuitMeta(2)
.fluidInputs(coolant.getHotHPCoolant().getFluid(coolantAmt), Materials.Water.getFluid(waterAmt))
Expand Down

0 comments on commit a409d62

Please sign in to comment.