Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into auxtools-atmos
This commit is contained in:
@@ -374,3 +374,28 @@ get_true_breath_pressure(pp) --> gas_pp = pp/breath_pp*total_moles()
|
||||
to_chat(src, "Total time (new gas mixture): [total_time]ms")
|
||||
to_chat(src, "Operations per second: [100000 / (total_time/1000)]")
|
||||
*/
|
||||
|
||||
/// Releases gas from src to output air. This means that it can not transfer air to gas mixture with higher pressure.
|
||||
/// a global proc due to rustmos
|
||||
/proc/release_gas_to(datum/gas_mixture/input_air, datum/gas_mixture/output_air, target_pressure)
|
||||
var/output_starting_pressure = output_air.return_pressure()
|
||||
var/input_starting_pressure = input_air.return_pressure()
|
||||
|
||||
if(output_starting_pressure >= min(target_pressure,input_starting_pressure-10))
|
||||
//No need to pump gas if target is already reached or input pressure is too low
|
||||
//Need at least 10 KPa difference to overcome friction in the mechanism
|
||||
return FALSE
|
||||
|
||||
//Calculate necessary moles to transfer using PV = nRT
|
||||
if((input_air.total_moles() > 0) && (input_air.return_temperature()>0))
|
||||
var/pressure_delta = min(target_pressure - output_starting_pressure, (input_starting_pressure - output_starting_pressure)/2)
|
||||
//Can not have a pressure delta that would cause output_pressure > input_pressure
|
||||
|
||||
var/transfer_moles = pressure_delta*output_air.return_volume()/(input_air.return_temperature() * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = input_air.remove(transfer_moles)
|
||||
output_air.merge(removed)
|
||||
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
@@ -358,7 +358,7 @@
|
||||
/datum/gas/oxygen = 20,
|
||||
/datum/gas/nitrogen = 20,
|
||||
/datum/gas/nitrous_oxide = 5,
|
||||
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST*400
|
||||
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST*25
|
||||
)
|
||||
|
||||
/datum/gas_reaction/nitrylformation/react(datum/gas_mixture/air)
|
||||
@@ -369,8 +369,8 @@
|
||||
var/energy_used = heat_efficency*NITRYL_FORMATION_ENERGY
|
||||
if ((air.get_moles(/datum/gas/oxygen) - heat_efficency < 0 )|| (air.get_moles(/datum/gas/nitrogen) - heat_efficency < 0)) //Shouldn't produce gas from nothing.
|
||||
return NO_REACTION
|
||||
air.adjust_moles(/datum/gas/oxygen, heat_efficency)
|
||||
air.adjust_moles(/datum/gas/nitrogen, heat_efficency)
|
||||
air.adjust_moles(/datum/gas/oxygen, -heat_efficency)
|
||||
air.adjust_moles(/datum/gas/nitrogen, -heat_efficency)
|
||||
air.adjust_moles(/datum/gas/nitryl, heat_efficency*2)
|
||||
|
||||
if(energy_used > 0)
|
||||
@@ -499,7 +499,7 @@
|
||||
min_requirements = list(
|
||||
/datum/gas/nitrogen = 10,
|
||||
/datum/gas/tritium = 5,
|
||||
"TEMP" = 5000000)
|
||||
"ENER" = NOBLIUM_FORMATION_ENERGY)
|
||||
|
||||
/datum/gas_reaction/nobliumformation/react(datum/gas_mixture/air)
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
|
||||
Reference in New Issue
Block a user