Spaces:
Sleeping
Sleeping
Update utils/heat_transfer.py
Browse files- utils/heat_transfer.py +10 -2
utils/heat_transfer.py
CHANGED
|
@@ -7,6 +7,7 @@ infiltration, and solar geometry, with improved modularity and error handling.
|
|
| 7 |
from typing import Optional, Tuple
|
| 8 |
import math
|
| 9 |
import numpy as np
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
class SolarCalculations:
|
|
@@ -209,8 +210,9 @@ class HeatTransferCalculations:
|
|
| 209 |
"""Class for heat transfer calculations."""
|
| 210 |
|
| 211 |
def __init__(self):
|
| 212 |
-
"""Initialize heat transfer calculations with solar calculations."""
|
| 213 |
self.solar = SolarCalculations()
|
|
|
|
| 214 |
|
| 215 |
def validate_inputs(self, temp: float, area: float = 0.0, flow_rate: float = 0.0) -> None:
|
| 216 |
"""
|
|
@@ -497,4 +499,10 @@ if __name__ == "__main__":
|
|
| 497 |
area = 20.0 # m²
|
| 498 |
delta_t = 10.0 # °C
|
| 499 |
conduction = heat_transfer_calculator.conduction_heat_transfer(u_value, area, delta_t)
|
| 500 |
-
print(f"Conduction Heat Transfer: {conduction:.2f} W")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
from typing import Optional, Tuple
|
| 8 |
import math
|
| 9 |
import numpy as np
|
| 10 |
+
from utils.psychrometrics import Psychrometrics
|
| 11 |
|
| 12 |
|
| 13 |
class SolarCalculations:
|
|
|
|
| 210 |
"""Class for heat transfer calculations."""
|
| 211 |
|
| 212 |
def __init__(self):
|
| 213 |
+
"""Initialize heat transfer calculations with solar and psychrometric calculations."""
|
| 214 |
self.solar = SolarCalculations()
|
| 215 |
+
self.psychrometrics = Psychrometrics()
|
| 216 |
|
| 217 |
def validate_inputs(self, temp: float, area: float = 0.0, flow_rate: float = 0.0) -> None:
|
| 218 |
"""
|
|
|
|
| 499 |
area = 20.0 # m²
|
| 500 |
delta_t = 10.0 # °C
|
| 501 |
conduction = heat_transfer_calculator.conduction_heat_transfer(u_value, area, delta_t)
|
| 502 |
+
print(f"Conduction Heat Transfer: {conduction:.2f} W")
|
| 503 |
+
|
| 504 |
+
# Example psychrometric calculation
|
| 505 |
+
temp = 25.0 # °C
|
| 506 |
+
rh = 50.0 # %
|
| 507 |
+
humidity_ratio = heat_transfer_calculator.psychrometrics.humidity_ratio(temp, rh)
|
| 508 |
+
print(f"Humidity Ratio: {humidity_ratio:.6f} kg/kg")
|