diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index 0a4eac78e2..4ce388b844 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -200,9 +200,13 @@ datum/pipeline if(network) network.update = 1 - proc/radiate_heat(surface, thermal_conductivity) + //surface must be the surface area in m^2 + proc/radiate_heat_to_space(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 the h/e pipes radiate less than the AVERAGE_SOLAR_RADIATION, then they will heat up, otherwise they will cool down. It turns out the critical temperature is -26 C + var/heat_gain = surface*(AVERAGE_SOLAR_RADIATION - STEFAN_BOLTZMANN_CONSTANT*thermal_conductivity*(air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4) + + air.add_thermal_energy(heat_gain) if(network) network.update = 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/he_pipes.dm b/code/ATMOSPHERICS/he_pipes.dm index a8e7e06bad..607e974ee4 100644 --- a/code/ATMOSPHERICS/he_pipes.dm +++ b/code/ATMOSPHERICS/he_pipes.dm @@ -4,7 +4,7 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging icon_state = "intact" level = 2 var/initialize_directions_he - var/surface = 2 + var/surface = 2 //surface area in m^2 minimum_temperature_difference = 20 thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT @@ -53,8 +53,8 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging 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 - parent.radiate_heat(surface, 1) + else if(istype(loc, /turf/space/)) + parent.radiate_heat_to_space(surface, 1) obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction diff --git a/code/setup.dm b/code/setup.dm index 12d81c637d..f5b680ee3e 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -6,10 +6,13 @@ #define R_IDEAL_GAS_EQUATION 8.31 //kPa*L/(K*mol) #define ONE_ATMOSPHERE 101.325 //kPa - -#define STEFAN_BOLTZMANN_CONSTANT 0.0000000567 //W/(m^2*K^4) #define IDEAL_GAS_ENTROPY_CONSTANT 1164 //(mol^3 * s^3) / (kg^3 * L). Equal to (4*pi/(avrogadro's number * planck's constant)^2)^(3/2) / (avrogadro's number * 1000 Liters per m^3). +//radiation constants +#define STEFAN_BOLTZMANN_CONSTANT 0.0000000567 //W/(m^2*K^4) +#define COSMIC_RADIATION_TEMPERATURE 3.15 //K +#define AVERAGE_SOLAR_RADIATION 200 //W/m^2. Kind of arbitrary. Really this should depend on the sun position much like solars. + #define CELL_VOLUME 2500 //liters in a cell #define MOLES_CELLSTANDARD (ONE_ATMOSPHERE*CELL_VOLUME/(T20C*R_IDEAL_GAS_EQUATION)) //moles in a 2.5 m^3 cell at 101.325 Pa and 20 degC