Add FixedRLayer and move the existing Layer into a hierarchy

This commit is contained in:
2026-06-08 21:58:40 +02:00
parent 51f4d8d2b6
commit db0dc7c6e9
+20 -6
View File
@@ -1,17 +1,31 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
@dataclass
class Layer:
thermal_coefficient: float
thickness: float
class Layer(ABC):
@property
@abstractmethod
def R(self) -> float: ...
class MaterialLayer(Layer):
def __init__(self, thermal_coefficient: float, thickness: float):
self.thermal_coefficient = thermal_coefficient
self.thickness = thickness
@property
def R(self):
def R(self) -> float:
return self.thickness / self.thermal_coefficient
class FixedRLayer(Layer):
def __init__(self, r_value: float):
self.r_value = r_value
@property
def R(self) -> float:
return self.r_value
class Interface(ABC):
@property
@abstractmethod