feat: Initial interpolation calculations, requires tests.
This commit is contained in:
@@ -37,6 +37,7 @@ public enum Capacity {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Remove.
|
||||
public struct ManufacturersCooling: Codable, Equatable, Sendable {
|
||||
|
||||
public let airflow: Int
|
||||
@@ -87,18 +88,15 @@ public enum Capacity {
|
||||
public let wetBulb: Int
|
||||
public let totalCapacity: Int
|
||||
public let sensibleCapacity: Int
|
||||
public let adjustmentMultipliers: AdjustmentMultiplier?
|
||||
|
||||
public init(
|
||||
wetBulb: Int,
|
||||
totalCapacity: Int,
|
||||
sensibleCapacity: Int,
|
||||
adjustmentMultipliers: AdjustmentMultiplier? = nil
|
||||
sensibleCapacity: Int
|
||||
) {
|
||||
self.wetBulb = wetBulb
|
||||
self.totalCapacity = totalCapacity
|
||||
self.sensibleCapacity = sensibleCapacity
|
||||
self.adjustmentMultipliers = adjustmentMultipliers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,18 @@ public enum Interpolate {
|
||||
public let designInfo: DesignInfo
|
||||
public let houseLoad: HouseLoad
|
||||
public let systemType: SystemType
|
||||
public let manufacturersCapacity: Capacity.ManufacturersCooling
|
||||
public let interpolation: InterpolationRequest
|
||||
|
||||
public init(
|
||||
designInfo: DesignInfo,
|
||||
houseLoad: HouseLoad,
|
||||
systemType: SystemType,
|
||||
manufacturersCapacity: Capacity.ManufacturersCooling
|
||||
interpolation: InterpolationRequest
|
||||
) {
|
||||
self.designInfo = designInfo
|
||||
self.houseLoad = houseLoad
|
||||
self.systemType = systemType
|
||||
self.manufacturersCapacity = manufacturersCapacity
|
||||
self.interpolation = interpolation
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ public enum Interpolate {
|
||||
|
||||
public let failed: Bool
|
||||
public let failures: [String]?
|
||||
public let interpolationType: InterpolationType
|
||||
public let interpolatedCapacity: Capacity.Cooling
|
||||
public let excessLatent: Int
|
||||
public let finalCapacityAtDesign: Capacity.Cooling
|
||||
@@ -34,7 +33,6 @@ public enum Interpolate {
|
||||
|
||||
public init(
|
||||
failures: [String]? = nil,
|
||||
interpolationType: InterpolationType,
|
||||
interpolatedCapacity: Capacity.Cooling,
|
||||
excessLatent: Int,
|
||||
finalCapacityAtDesign: Capacity.Cooling,
|
||||
@@ -44,7 +42,6 @@ public enum Interpolate {
|
||||
) {
|
||||
self.failed = failures != nil ? failures!.count > 0 : false
|
||||
self.failures = failures
|
||||
self.interpolationType = interpolationType
|
||||
self.interpolatedCapacity = interpolatedCapacity
|
||||
self.excessLatent = excessLatent
|
||||
self.finalCapacityAtDesign = finalCapacityAtDesign
|
||||
@@ -54,10 +51,11 @@ public enum Interpolate {
|
||||
}
|
||||
}
|
||||
|
||||
public enum InterpolationType2: Codable, Equatable, Sendable {
|
||||
case noInterpolation(Capacity.ManufacturersCooling)
|
||||
public enum InterpolationRequest: Codable, Equatable, Sendable {
|
||||
case noInterpolation(Capacity.ManufacturersCooling, AdjustmentMultiplier? = nil)
|
||||
case oneWayIndoor(OneWayIndoor)
|
||||
case oneWayOutdoor(OneWayOutdoor)
|
||||
case twoWay(TwoWay)
|
||||
}
|
||||
|
||||
public struct OneWayIndoor: Codable, Equatable, Sendable {
|
||||
@@ -136,13 +134,54 @@ public enum Interpolate {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum InterpolationType: String, CaseIterable, Codable, Equatable, Sendable {
|
||||
case noInterpolation
|
||||
case oneWayIndoor
|
||||
case oneWayOutdoor
|
||||
case twoWay
|
||||
public struct TwoWay: Codable, Equatable, Sendable {
|
||||
|
||||
public let airflow: Int
|
||||
public let capacities: Capacities
|
||||
public let adjustmentMultipliers: AdjustmentMultiplier?
|
||||
|
||||
public init(
|
||||
airflow: Int,
|
||||
capacities: Interpolate.TwoWay.Capacities,
|
||||
adjustmentMultipliers: AdjustmentMultiplier? = nil
|
||||
) {
|
||||
self.airflow = airflow
|
||||
self.capacities = capacities
|
||||
self.adjustmentMultipliers = adjustmentMultipliers
|
||||
}
|
||||
|
||||
public struct Capacities: Codable, Equatable, Sendable {
|
||||
|
||||
public let above: CapacityContainer
|
||||
public let below: CapacityContainer
|
||||
|
||||
public init(
|
||||
above: Interpolate.TwoWay.Capacities.CapacityContainer,
|
||||
below: Interpolate.TwoWay.Capacities.CapacityContainer
|
||||
) {
|
||||
self.above = above
|
||||
self.below = below
|
||||
}
|
||||
|
||||
public struct CapacityContainer: Codable, Equatable, Sendable {
|
||||
|
||||
public let outdoorTemperature: Int
|
||||
public let aboveDewPoint: Capacity.ManufacturersContainer
|
||||
public let belowDewPoint: Capacity.ManufacturersContainer
|
||||
|
||||
public init(
|
||||
outdoorTemperature: Int,
|
||||
aboveDewPoint: Capacity.ManufacturersContainer,
|
||||
belowDewPoint: Capacity.ManufacturersContainer
|
||||
) {
|
||||
self.outdoorTemperature = outdoorTemperature
|
||||
self.aboveDewPoint = aboveDewPoint
|
||||
self.belowDewPoint = belowDewPoint
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user