Make heat generator not lose energy when below ambient temperature, and use the Carnot Engine equations for efficiency.
This commit is contained in:
parent
8a4aaff44a
commit
3544addf20
1 changed files with 8 additions and 3 deletions
|
@ -405,9 +405,14 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
|
|||
@Override
|
||||
public double[] simulateHeat()
|
||||
{
|
||||
double workDone = getTemp()*thermalEfficiency;
|
||||
transferHeatTo(-workDone);
|
||||
setEnergy(getEnergy() + workDone);
|
||||
if(getTemp() > 0)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue