Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new freezer atmos devices and fix freezer fixgridatmos marker #34991

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
mixtures[5].Temperature = 5000f;

// 6: (Walk-In) Freezer
mixtures[6].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesStandard);
mixtures[6].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesStandard);
mixtures[6].Temperature = 235f; // Little colder than an actual freezer but gives a grace period to get e.g. themomachines set up, should keep warm for a few door openings
mixtures[6].AdjustMoles(Gas.Oxygen, Atmospherics.OxygenMolesFreezer);
mixtures[6].AdjustMoles(Gas.Nitrogen, Atmospherics.NitrogenMolesFreezer);
mixtures[6].Temperature = Atmospherics.FreezerTemp; // Little colder than an actual freezer but gives a grace period to get e.g. themomachines set up, should keep warm for a few door openings

// 7: Nitrogen (101kpa) for vox rooms
mixtures[7].AdjustMoles(Gas.Nitrogen, Atmospherics.MolesCellStandard);
Expand Down
15 changes: 15 additions & 0 deletions Content.Shared/Atmos/Atmospherics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public static class Atmospherics
/// </summary>
public const float T20C = 293.15f;

/// <summary>
/// -38.15ºC in K.
/// This is used to initialize roundstart freezer rooms.
/// </summary>
public const float FreezerTemp = 235f;

/// <summary>
/// Do not allow any gas mixture temperatures to exceed this number. It is occasionally possible
/// to have very small heat capacity (e.g. room that was just unspaced) and for large amounts of
Expand All @@ -65,6 +71,12 @@ public static class Atmospherics
/// </summary>
public const float MolesCellStandard = (OneAtmosphere * CellVolume / (T20C * R));

/// <summary>
/// Moles in a 2.5 m^3 cell at 101.325 kPa and -38.15ºC.
/// This is used in fix atmos freezer markers to ensure the air is at the correct atmospheric pressure while still being cold.
/// </summary>
public const float MolesCellFreezer = (OneAtmosphere * CellVolume / (FreezerTemp * R));

/// <summary>
/// Moles in a 2.5 m^3 cell at GasMinerDefaultMaxExternalPressure kPa and 20ºC
/// </summary>
Expand All @@ -81,6 +93,9 @@ public static class Atmospherics
public const float OxygenMolesStandard = MolesCellStandard * OxygenStandard;
public const float NitrogenMolesStandard = MolesCellStandard * NitrogenStandard;

public const float OxygenMolesFreezer = MolesCellFreezer * OxygenStandard;
public const float NitrogenMolesFreezer = MolesCellFreezer * NitrogenStandard;

#endregion

/// <summary>
Expand Down
11 changes: 11 additions & 0 deletions Resources/Prototypes/Atmospherics/thresholds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,14 @@
threshold: 0.8 # danger below 80% nitrogen
lowerWarnAround: !type:AlarmThresholdSetting
threshold: 1.125 # warning below 90%

- type: alarmThreshold
id: freezerTemperature
upperBound: !type:AlarmThresholdSetting
threshold: 335.15 # T-38.15C (235) + 100
lowerBound: !type:AlarmThresholdSetting
threshold: 135.15 # T-38.15C (235) - 100
Comment on lines +120 to +123
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These bounds are quite wide, but in line with the current bounds further up in this file. Someone else can eventually adjust this later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are, and they'll have to be manually adjusted if the freezer temp is changed.

My plan is to remove the directional fans in freezers when I give every map's freezer a proper atmos setup. Might be nice.

upperWarnAround: !type:AlarmThresholdSetting
threshold: 0.8
lowerWarnAround: !type:AlarmThresholdSetting
threshold: 1.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- type: entity
abstract: true
parent: AirSensorBase
id: AirSensorFreezerBase
suffix: Freezer Atmosphere
components:
- type: AtmosMonitor
temperatureThresholdId: freezerTemperature

- type: entity
parent: [AirSensorFreezerBase, AirSensor]
id: AirSensorFreezer

- type: entity
parent: [AirSensorFreezerBase, GasVentPump]
id: GasVentPumpFreezer

- type: entity
parent: [AirSensorFreezerBase, GasVentScrubber]
id: GasVentScrubberFreezer

# air alarm proto with auto: false to prevent the automatic switching of modes overriding the default values
- type: entity
parent: AirAlarm
id: AirAlarmFreezer
suffix: Freezer Atmosphere, auto mode disabled
components:
- type: AirAlarm
autoMode: false
Loading