diff --git a/code/ZAS/_gas_mixture_xgm.dm b/code/ZAS/_gas_mixture_xgm.dm index 06f7e0d70a..b193fb1692 100644 --- a/code/ZAS/_gas_mixture_xgm.dm +++ b/code/ZAS/_gas_mixture_xgm.dm @@ -128,15 +128,27 @@ . += ratio * specific_entropy_gas(g) . /= total_moles -//Returns the ideal gas specific entropy of a specific gas in the mix. This is the entropy due to that gas per mole of /that/ gas in the mixture, not the entropy due to that gas per mole of gas mixture. +/* + Returns the ideal gas specific entropy of a specific gas in the mix. This is the entropy due to that gas per mole of /that/ gas in the mixture, not the entropy due to that gas per mole of gas mixture. + + For the purposes of SS13, the specific entropy is just a number that tells you how hard it is to move gas. You can replace this with whatever you want. + Just remember that returning a SMALL number == adding gas to this gas mix is HARD, taking gas away is EASY, and that returning a LARGE number means the opposite (so a vacuum would approach infinity). + + So returning a constant/(partial pressure) would probably do what most players expect. Although the version I have implemented below is a bit more nuanced than simply 1/P in that it scales in a way + which is bit more realistic (natural log), and returns a fairly accurate entropy around room temperatures and pressures. +*/ /datum/gas_mixture/proc/specific_entropy_gas(var/gasid) if (!(gasid in gas) || gas[gasid] == 0) return SPECIFIC_ENTROPY_VACUUM //that gas isn't here var/molar_mass = gas_data.molar_mass[gasid] var/specific_heat = gas_data.specific_heat[gasid] - //group_multiplier gets divided out in volume/gas[gasid] - return R_IDEAL_GAS_EQUATION * ( log( (IDEAL_GAS_ENTROPY_CONSTANT*volume/gas[gasid]) * sqrt((molar_mass*specific_heat*temperature)**3) + 1 ) + 5/2 ) + + //group_multiplier gets divided out in volume/gas[gasid] - also, V/(m*T) = R/(partial pressure) + //This equation is not accurate at all, but should work well enough for a game. + //Based on the form of Sackur-Tetrode + some curve fitting to specific entropy tables for N2 gas + some adjustments to make it work down to 0 K + //(the real S-T equation does not work at low temperatures, you need quantum mechanics to do it, but screw that) and with the specific power atmos machinery calculations. + return R_IDEAL_GAS_EQUATION * ( log( (IDEAL_GAS_ENTROPY_CONSTANT*volume/(gas[gasid] * temperature)) * (molar_mass*specific_heat*temperature)**(2/3) + 1 ) + 15 ) //Updates the total_moles count and trims any empty gases. /datum/gas_mixture/proc/update_values() diff --git a/code/setup.dm b/code/setup.dm index 361cfaa66c..267fab61a9 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -837,8 +837,8 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse //These balance how easy or hard it is to create huge pressure gradients with pumps and filters. Lower values means it takes longer to create large pressures differences. //Has no effect on pumping gasses from high pressure to low, only from low to high. Must be between 0 and 1. -#define ATMOS_PUMP_EFFICIENCY 0.6 -#define ATMOS_FILTER_EFFICIENCY 0.45 +#define ATMOS_PUMP_EFFICIENCY 1.0 +#define ATMOS_FILTER_EFFICIENCY 1.0 //will not bother pumping or filtering if the gas source as fewer than this amount of moles, to help with performance. #define MINUMUM_MOLES_TO_PUMP 0.01