Make heat generator not lose energy when below ambient temperature, and use the Carnot Engine equations for efficiency.

This commit is contained in:
Ben Spiers 2014-12-22 20:10:01 +00:00
parent 8a4aaff44a
commit 3544addf20

View file

@ -405,9 +405,14 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
@Override @Override
public double[] simulateHeat() public double[] simulateHeat()
{ {
double workDone = getTemp()*thermalEfficiency; if(getTemp() > 0)
transferHeatTo(-workDone); {
setEnergy(getEnergy() + workDone); double carnotEfficiency = getTemp() / (getTemp() + IHeatTransfer.AMBIENT_TEMP);
double heatLost = thermalEfficiency * getTemp();
double workDone = heatLost * carnotEfficiency;
transferHeatTo(-heatLost);
setEnergy(getEnergy() + workDone);
}
return HeatUtils.simulate(this, Coord4D.get(this), worldObj); return HeatUtils.simulate(this, Coord4D.get(this), worldObj);
} }