from .utils import dHf, Sf, Gf


class CO2:
    def __init__(self, T_C):

        self.T_C = T_C
        self.T_K = self.T_C + 273
        if self.T_K < 298 or self.T_K > 1200:
            raise ValueError("Invalid temperature.")
        self.Hf_298 = -393.51  # kJ/mol
        self.thermo_params = {
            "A": 24.99735,
            "B": 55.18696,
            "C": -33.69137,
            "D": 7.948387,
            "E": -0.136638,
            "F": -403.6075,
            "G": 228.2431,
            "H": -393.5224,
        }

    def Hf(self):
        return self.Hf_298 + dHf(self)  # kJ/mol

    def Sf(self):
        return Sf(self)  # kJ/mol

    def Gf(self):
        return Gf(self)  # kJ/mol
