diff --git a/HP_Model.py b/HP_Model.py index 84761eb1f8eef42676e15f1fa4c582df78c50dec..b87ec06db69b0e3d1b7c199a162a318dd0879eea 100644 --- a/HP_Model.py +++ b/HP_Model.py @@ -212,3 +212,23 @@ def getCOP(self, T_source_in: float, T_sink_out: float, Q_dot_H: float, K: int = return (Q_dot_H / self.getElectricalPower(T_source_in, T_sink_out, Q_dot_H, K)) + # ==================================================================================================== + + def getEta_II(self, T_source_in: float, T_sink_out: float, Q_dot_H: float, K: int = 3) -> float: + """ + Calculates the interpolated second law efficiency value at the specified coordinate point. + + Args: + T_source_in (float): Source temerature (in). + T_sink_out (float): Sink temperature (out). + Q_dot_H (float): Heating power. + K (int, optional): Number of neighbors to consider. Defaults to 3. + + Returns: + float: Interpolated second law efficiency value. + """ + + COP = self.getCOP(T_source_in, T_sink_out, Q_dot_H, K) + COP_Carnot = (T_sink_out + 273.15) / (T_sink_out - T_source_in) # in Kelvin! + + return (COP / COP_Carnot)