Merge pull request #5031 from UristMcKerman/dev

HE pipes radiation and TEG fix
This commit is contained in:
Zuhayr
2014-05-20 20:36:20 +09:30
4 changed files with 27 additions and 13 deletions
+9
View File
@@ -1,3 +1,5 @@
#define STEFAN_BOLTZMANN_CONSTANT 0.0000000567
datum/pipeline
var/datum/gas_mixture/air
@@ -209,5 +211,12 @@ datum/pipeline
(partial_heat_capacity*target.heat_capacity/(partial_heat_capacity+target.heat_capacity))
air.temperature -= heat/total_heat_capacity
if(network)
network.update = 1
proc/radiate_heat(surface, thermal_conductivity)
var/total_heat_capacity = air.heat_capacity()
var/heat = STEFAN_BOLTZMANN_CONSTANT * surface * air.temperature ** 4 * thermal_conductivity
air.temperature = max(0, air.temperature - heat / total_heat_capacity)
if(network)
network.update = 1
+5 -5
View File
@@ -4,6 +4,7 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
icon_state = "intact"
level = 2
var/initialize_directions_he
var/surface = 2
minimum_temperature_difference = 20
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
@@ -49,12 +50,11 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
else
var/datum/gas_mixture/environment = loc.return_air()
environment_temperature = environment.temperature
var/datum/gas_mixture/pipe_air = return_air()
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
parent.temperature_interact(loc, volume, thermal_conductivity)
else
environment_temperature = loc:temperature
var/datum/gas_mixture/pipe_air = return_air()
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
parent.temperature_interact(loc, volume, thermal_conductivity)
parent.radiate_heat(surface, 1)
obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
@@ -294,6 +294,9 @@ update_flag
if (href_list["remove_tank"])
if(holding)
if (valve_open)
valve_open = 0
release_log += "Valve was <b>closed</b> by [usr] ([usr.ckey]), stopping the transfer into the [holding]<br>"
if(istype(holding, /obj/item/weapon/tank))
holding.manipulated_by = usr.real_name
holding.loc = loc
+10 -8
View File
@@ -84,15 +84,17 @@
air2.temperature = air2.temperature + heat/air2_heat_capacity
air1.temperature = air1.temperature - energy_transfer/air1_heat_capacity
//Transfer the air
circ1.air2.merge(air1)
circ2.air2.merge(air2)
//Transfer the air
if (air1)
circ1.air2.merge(air1)
if (air2)
circ2.air2.merge(air2)
//Update the gas networks
if(circ1.network2)
circ1.network2.update = 1
if(circ2.network2)
circ2.network2.update = 1
//Update the gas networks
if(circ1.network2)
circ1.network2.update = 1
if(circ2.network2)
circ2.network2.update = 1
// update icon overlays and power usage only if displayed level has changed
if(lastgen > 250000 && prob(10))