feat: Adds cooling interpolation tests.

This commit is contained in:
2025-03-13 09:10:52 -04:00
parent ec58ca6364
commit c23e4c5f61
7 changed files with 287 additions and 112 deletions

View File

@@ -1,20 +1,23 @@
public enum Interpolate {
public enum CoolingInterpolation {
public struct Request: Codable, Equatable, Sendable {
public let designInfo: DesignInfo
public let houseLoad: HouseLoad
public let elevation: Int?
public let summerDesignInfo: DesignInfo.Summer
public let coolingLoad: Models.Capacity.Cooling
public let systemType: SystemType
public let interpolation: InterpolationRequest
public init(
designInfo: DesignInfo,
houseLoad: HouseLoad,
elevation: Int? = nil,
summerDesignInfo: DesignInfo.Summer,
coolingLoad: Capacity.Cooling,
systemType: SystemType,
interpolation: InterpolationRequest
) {
self.designInfo = designInfo
self.houseLoad = houseLoad
self.elevation = elevation
self.summerDesignInfo = summerDesignInfo
self.coolingLoad = coolingLoad
self.systemType = systemType
self.interpolation = interpolation
}
@@ -24,18 +27,18 @@ public enum Interpolate {
public let failed: Bool
public let failures: [String]?
public let interpolatedCapacity: Capacity.Cooling
public let interpolatedCapacity: Models.Capacity.Cooling
public let excessLatent: Int
public let finalCapacityAtDesign: Capacity.Cooling
public let finalCapacityAtDesign: Models.Capacity.Cooling
public let altitudeDerating: AdjustmentMultiplier?
public let capacityAsPercentOfLoad: Capacity.Cooling
public let capacityAsPercentOfLoad: Models.Capacity.Cooling
public let sizingLimits: SizingLimits.Response
public init(
failures: [String]? = nil,
interpolatedCapacity: Capacity.Cooling,
interpolatedCapacity: Models.Capacity.Cooling,
excessLatent: Int,
finalCapacityAtDesign: Capacity.Cooling,
finalCapacityAtDesign: Models.Capacity.Cooling,
altitudeDerating: AdjustmentMultiplier? = nil,
capacityAsPercentOfLoad: Capacity.Cooling,
sizingLimits: SizingLimits.Response
@@ -52,7 +55,7 @@ public enum Interpolate {
}
public enum InterpolationRequest: Codable, Equatable, Sendable {
case noInterpolation(Capacity.ManufacturersCooling, AdjustmentMultiplier? = nil)
case noInterpolation(Models.Capacity.ManufacturersCooling, AdjustmentMultiplier? = nil)
case oneWayIndoor(OneWayIndoor)
case oneWayOutdoor(OneWayOutdoor)
case twoWay(TwoWay)
@@ -68,7 +71,7 @@ public enum Interpolate {
public init(
airflow: Int,
outdoorTemperature: Int,
capacities: Interpolate.OneWayIndoor.Capacities,
capacities: CoolingInterpolation.OneWayIndoor.Capacities,
adjustmentMultipliers: AdjustmentMultiplier? = nil
) {
self.airflow = airflow
@@ -79,10 +82,13 @@ public enum Interpolate {
public struct Capacities: Codable, Equatable, Sendable {
public let aboveDewpoint: Capacity.ManufacturersContainer
public let belowDewpoint: Capacity.ManufacturersContainer
public let aboveDewpoint: Models.Capacity.ManufacturersContainer
public let belowDewpoint: Models.Capacity.ManufacturersContainer
public init(aboveDewpoint: Capacity.ManufacturersContainer, belowDewpoint: Capacity.ManufacturersContainer) {
public init(
aboveDewpoint: Models.Capacity.ManufacturersContainer,
belowDewpoint: Models.Capacity.ManufacturersContainer
) {
self.aboveDewpoint = aboveDewpoint
self.belowDewpoint = belowDewpoint
}
@@ -99,7 +105,7 @@ public enum Interpolate {
public init(
airflow: Int,
wetBulb: Int,
capacities: Interpolate.OneWayOutdoor.Capacities,
capacities: CoolingInterpolation.OneWayOutdoor.Capacities,
adjustmentMultipliers: AdjustmentMultiplier? = nil
) {
self.airflow = airflow
@@ -114,8 +120,8 @@ public enum Interpolate {
public let belowOutdoor: Capacity
public init(
aboveOutdoor: Interpolate.OneWayOutdoor.Capacities.Capacity,
belowOutdoor: Interpolate.OneWayOutdoor.Capacities.Capacity
aboveOutdoor: CoolingInterpolation.OneWayOutdoor.Capacities.Capacity,
belowOutdoor: CoolingInterpolation.OneWayOutdoor.Capacities.Capacity
) {
self.aboveOutdoor = aboveOutdoor
self.belowOutdoor = belowOutdoor
@@ -144,7 +150,7 @@ public enum Interpolate {
public init(
airflow: Int,
capacities: Interpolate.TwoWay.Capacities,
capacities: CoolingInterpolation.TwoWay.Capacities,
adjustmentMultipliers: AdjustmentMultiplier? = nil
) {
self.airflow = airflow
@@ -158,8 +164,8 @@ public enum Interpolate {
public let below: CapacityContainer
public init(
above: Interpolate.TwoWay.Capacities.CapacityContainer,
below: Interpolate.TwoWay.Capacities.CapacityContainer
above: CoolingInterpolation.TwoWay.Capacities.CapacityContainer,
below: CoolingInterpolation.TwoWay.Capacities.CapacityContainer
) {
self.above = above
self.below = below
@@ -168,13 +174,13 @@ public enum Interpolate {
public struct CapacityContainer: Codable, Equatable, Sendable {
public let outdoorTemperature: Int
public let aboveDewPoint: Capacity.ManufacturersContainer
public let belowDewPoint: Capacity.ManufacturersContainer
public let aboveDewPoint: Models.Capacity.ManufacturersContainer
public let belowDewPoint: Models.Capacity.ManufacturersContainer
public init(
outdoorTemperature: Int,
aboveDewPoint: Capacity.ManufacturersContainer,
belowDewPoint: Capacity.ManufacturersContainer
aboveDewPoint: Models.Capacity.ManufacturersContainer,
belowDewPoint: Models.Capacity.ManufacturersContainer
) {
self.outdoorTemperature = outdoorTemperature
self.aboveDewPoint = aboveDewPoint

View File

@@ -3,11 +3,11 @@ public enum SizingLimits {
public struct Request: Codable, Equatable, Sendable {
public let systemType: SystemType
public let houseLoad: HouseLoad?
public let coolingLoad: Capacity.Cooling?
public init(systemType: SystemType, houseLoad: HouseLoad? = nil) {
public init(systemType: SystemType, coolingLoad: Capacity.Cooling? = nil) {
self.systemType = systemType
self.houseLoad = houseLoad
self.coolingLoad = coolingLoad
}
}