Make thermomachines more thermodynamically sound (#18984)

Co-authored-by: Ilya246 <ilyukarno@gmail.com>
This commit is contained in:
Kevin Zheng
2023-08-22 00:34:45 -07:00
committed by GitHub
parent 8636234ff1
commit bb7a19d32e
5 changed files with 107 additions and 60 deletions

View File

@@ -12,9 +12,8 @@ namespace Content.Server.Atmos.Piping.Unary.Components
public string InletName = "pipe";
/// <summary>
/// Current maximum temperature, calculated from <see cref="BaseHeatCapacity"/> and the quality of matter
/// bins. The heat capacity effectively determines the rate at which the thermo machine can add or remove
/// heat from a pipenet.
/// Current electrical power consumption, in watts. Increasing power increases the ability of the
/// thermomachine to heat or cool air.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float HeatCapacity = 10000;
@@ -30,12 +29,31 @@ namespace Content.Server.Atmos.Piping.Unary.Components
[ViewVariables(VVAccess.ReadWrite)]
public float TargetTemperature = Atmospherics.T20C;
[DataField("mode")]
public ThermoMachineMode Mode = ThermoMachineMode.Freezer;
/// <summary>
/// Tolerance for temperature setpoint hysteresis.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public float TemperatureTolerance = 2f;
/// <summary>
/// Implements setpoint hysteresis to prevent heater from rapidly cycling on and off at setpoint.
/// If true, add Sign(Cp)*TemperatureTolerance to the temperature setpoint.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public bool HysteresisState = false;
/// <summary>
/// Coefficient of performance. Output power / input power.
/// Positive for heaters, negative for freezers.
/// </summary>
[DataField("coefficientOfPerformance")]
[ViewVariables(VVAccess.ReadWrite)]
public float Cp = 0.9f; // output power / input power, positive is heat
/// <summary>
/// Current minimum temperature, calculated from <see cref="InitialMinTemperature"/> and <see
/// cref="MinTemperatureDelta"/>.
/// Ignored if heater.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float MinTemperature;
@@ -43,6 +61,7 @@ namespace Content.Server.Atmos.Piping.Unary.Components
/// <summary>
/// Current maximum temperature, calculated from <see cref="InitialMaxTemperature"/> and <see
/// cref="MaxTemperatureDelta"/>.
/// Ignored if freezer.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float MaxTemperature;