2 Commits

Author SHA1 Message Date
25736638eb feat: Begins manual d core models. 2025-12-18 21:38:12 -05:00
5d6e50a983 feat: Initial commit. 2025-12-18 21:38:12 -05:00
8 changed files with 96 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
.DS_Store
/.build
/Packages
xcuserdata/
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc

23
Package.swift Normal file
View File

@@ -0,0 +1,23 @@
// swift-tools-version: 6.2
import PackageDescription
let package = Package(
name: "swift-manual-d",
products: [
.library(name: "swift-manual-d", targets: ["swift-manual-d"]),
.library(name: "ManualDCore", targets: ["ManualDCore"]),
],
targets: [
.target(
name: "swift-manual-d"
),
.target(
name: "ManualDCore"
),
.testTarget(
name: "swift-manual-dTests",
dependencies: ["swift-manual-d"]
),
]
)

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
}
}

View File

@@ -0,0 +1,2 @@
// The Swift Programming Language
// https://docs.swift.org/swift-book

View File

@@ -0,0 +1,6 @@
import Testing
@testable import swift_manual_d
@Test func example() async throws {
// Write your test here and use APIs like `#expect(...)` to check expected conditions.
}