Search in sources :

Example 1 with ITileHeatHandler

use of mekanism.common.capabilities.heat.ITileHeatHandler in project Mekanism by mekanism.

the class FusionReactorMultiblockData method transferHeat.

private void transferHeat() {
    // Transfer from plasma to casing
    double plasmaCaseHeat = plasmaCaseConductivity * (lastPlasmaTemperature - lastCaseTemperature);
    setPlasmaTemp(getPlasmaTemp() - plasmaCaseHeat / plasmaHeatCapacity);
    heatCapacitor.handleHeat(plasmaCaseHeat);
    // Transfer from casing to water if necessary
    double caseWaterHeat = MekanismGeneratorsConfig.generators.fusionWaterHeatingRatio.get() * (lastCaseTemperature - biomeAmbientTemp);
    int waterToVaporize = (int) (HeatUtils.getSteamEnergyEfficiency() * caseWaterHeat / HeatUtils.getWaterThermalEnthalpy());
    waterToVaporize = Math.min(waterToVaporize, Math.min(waterTank.getFluidAmount(), MathUtils.clampToInt(steamTank.getNeeded())));
    if (waterToVaporize > 0) {
        MekanismUtils.logMismatchedStackSize(waterTank.shrinkStack(waterToVaporize, Action.EXECUTE), waterToVaporize);
        steamTank.insert(MekanismGases.STEAM.getStack(waterToVaporize), Action.EXECUTE, AutomationType.INTERNAL);
        caseWaterHeat = waterToVaporize * HeatUtils.getWaterThermalEnthalpy() / HeatUtils.getSteamEnergyEfficiency();
        heatCapacitor.handleHeat(-caseWaterHeat);
    }
    for (ITileHeatHandler source : heatHandlers) {
        source.simulate();
    }
    // Passive energy generation
    double caseAirHeat = MekanismGeneratorsConfig.generators.fusionCasingThermalConductivity.get() * (lastCaseTemperature - biomeAmbientTemp);
    heatCapacitor.handleHeat(-caseAirHeat);
    energyContainer.insert(FloatingLong.create(caseAirHeat * MekanismGeneratorsConfig.generators.fusionThermocoupleEfficiency.get()), Action.EXECUTE, AutomationType.INTERNAL);
}
Also used : ITileHeatHandler(mekanism.common.capabilities.heat.ITileHeatHandler)

Aggregations

ITileHeatHandler (mekanism.common.capabilities.heat.ITileHeatHandler)1