Skip to content

Commit

Permalink
Add new freezer atmos devices and fix freezer fixgridatmos marker (sp…
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtisticRoomba authored Feb 12, 2025
1 parent 5c98da4 commit 75727db
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 3 deletions.
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
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

0 comments on commit 75727db

Please sign in to comment.