feat: Begins manual d core models.

This commit is contained in:
2025-12-18 21:36:46 -05:00
parent 5d6e50a983
commit 25736638eb
5 changed files with 74 additions and 20 deletions

View File

@@ -0,0 +1,7 @@
import Foundation
public typealias ComponentPressureLosses = [String: Double]
extension ComponentPressureLosses {
public var totalLosses: Double { values.reduce(0) { $0 + $1 } }
}

View File

@@ -0,0 +1,13 @@
import Foundation
public struct CoolingLoad: Codable, Equatable {
public let total: Double
public let sensible: Double
public var latent: Double { total - sensible }
public var shr: Double { sensible / total }
public init(total: Double, sensible: Double) {
self.total = total
self.sensible = sensible
}
}

View File

@@ -0,0 +1,17 @@
import Foundation
public struct EquipmentInfo: Codable, Equatable {
public let staticPressure: Double
public let heatingCFM: Int
public let coolingCFM: Int
public init(
staticPressure: Double = 0.5,
heatingCFM: Int,
coolingCFM: Int
) {
self.staticPressure = staticPressure
self.heatingCFM = heatingCFM
self.coolingCFM = coolingCFM
}
}

View File

@@ -0,0 +1,20 @@
import Foundation
public struct Room: Codable, Equatable {
public let name: String
public let heatingLoad: Double
public let coolingLoad: CoolingLoad
public let registerCount: Int
public init(
name: String,
heatingLoad: Double,
coolingLoad: CoolingLoad,
registerCount: Int = 1
) {
self.name = name
self.heatingLoad = heatingLoad
self.coolingLoad = coolingLoad
self.registerCount = registerCount
}
}