Hopefully final TEG fixes

This commit is contained in:
Markolie
2016-10-13 19:40:16 +02:00
parent 61e1ae0f03
commit 8b541bb1e9
3 changed files with 28 additions and 20 deletions
@@ -2,7 +2,7 @@
//node2, air2, network2 correspond to output
/obj/machinery/atmospherics/binary/circulator
name = "circulator/heat exchanger"
desc = "A gas circulator pump and heat exchanger."
desc = "A gas circulator pump and heat exchanger. Its input port is on the south side, and its output port is on the north side."
icon = 'icons/obj/atmospherics/circulator.dmi'
icon_state = "circ1-off"
@@ -41,20 +41,20 @@
var/output_starting_pressure = air1.return_pressure()
var/input_starting_pressure = air2.return_pressure()
if(output_starting_pressure >= input_starting_pressure-10)
if(output_starting_pressure >= input_starting_pressure - 10)
//Need at least 10 KPa difference to overcome friction in the mechanism
last_pressure_delta = 0
return null
//Calculate necessary moles to transfer using PV = nRT
if(air2.temperature>0)
var/pressure_delta = (input_starting_pressure - output_starting_pressure)/2
if(air2.temperature > 0)
var/pressure_delta = (input_starting_pressure - output_starting_pressure) / 2
var/transfer_moles = pressure_delta * air1.volume/(air2.temperature * R_IDEAL_GAS_EQUATION)
last_pressure_delta = pressure_delta
//world << "pressure_delta = [pressure_delta]; transfer_moles = [transfer_moles];"
//log_debug("pressure_delta = [pressure_delta]; transfer_moles = [transfer_moles];")
//Actually transfer the gas
var/datum/gas_mixture/removed = air2.remove(transfer_moles)