Esempio n. 1
0
    def readStatefromJSON(self, state):
        """Load instance parameter from saved file"""
        self.Tout = unidades.Temperature(state["Tout"])
        self.Pout = unidades.Pressure(state["Pout"])
        self.VaporMolarFlow = unidades.MassFlow(state["VaporMolarFlow"])
        self.VaporVolFlow = unidades.VolFlow(state["VaporVolFlow"])
        self.VaporMolarComposition = [
            unidades.MolarFlow(p) for p in state["VaporMolarComposition"]
        ]
        self.VaporMassComposition = [
            unidades.MassFlow(p) for p in state["VaporMassComposition"]
        ]
        self.LiquidMolarFlow = unidades.MolarFlow(state["LiquidMolarFlow"])
        self.LiquidVolFlow = unidades.VolFlow(state["LiquidVolFlow"])
        self.LiquidMolarComposition = [
            unidades.MolarFlow(p) for p in state["LiquidMolarComposition"]
        ]
        self.LiquidMassComposition = [
            unidades.MassFlow(p) for p in state["LiquidMassComposition"]
        ]

        self.statusCoste = state["statusCoste"]
        if self.statusCoste:
            self.C_adq = unidades.Currency(state["C_adq"])
            self.C_inst = unidades.Currency(state["C_inst"])
        self.salida = [None]
Esempio n. 2
0
 def readStatefromJSON(self, state):
     """Load instance parameter from saved file"""
     self.criterio = state["criterio"]
     self.Pout = unidades.Pressure(state["Pout"])
     self.outT = unidades.Temperature(state["outT"])
     self.outX = unidades.Dimensionless(state["outX"])
     self.outMolarFlow = unidades.MolarFlow(state["outMolarFlow"])
     self.outMassFlow = unidades.MassFlow(state["outMassFlow"])
     self.outVolFlow = unidades.VolFlow(state["outVolFlow"])
     self.salida = [None]
Esempio n. 3
0
 def readStatefromJSON(self, state):
     """Load instance parameter from saved file"""
     self.criterio = state["criterio"]
     self.split = (unidades.Dimensionless(x) for x in state["split"])
     self.deltaP = unidades.DeltaP(state["deltaP"])
     self.inputMolarFlow = unidades.MolarFlow(state["inputMolarFlow"])
     self.inputMassFlow = unidades.MassFlow(state["inputMassFlow"])
     self.inputVolFlow = unidades.VolFlow(state["inputVolFlow"])
     self.inputT = unidades.Temperature(state["inputT"])
     self.inputP = unidades.Pressure(state["inputP"])
     self.output = unidades.Dimensionless(state["output"])
     self.salida = [None]*self.kwargs["salidas"]
Esempio n. 4
0
    def readStatefromJSON(self, fluid):
        if fluid:
            self._bool = True

            self.M = unidades.Dimensionless(fluid["M"])
            self.v = unidades.SpecificVolume(fluid["v"])
            self.rho = unidades.Density(1 / self.v)

            self.h = unidades.Enthalpy(fluid["h"])
            self.s = unidades.SpecificHeat(fluid["s"])
            self.u = unidades.Enthalpy(fluid["u"])
            self.a = unidades.Enthalpy(fluid["a"])
            self.g = unidades.Enthalpy(fluid["g"])

            self.cv = unidades.SpecificHeat(fluid["cv"])
            self.cp = unidades.SpecificHeat(fluid["cp"])
            self.cp_cv = unidades.Dimensionless(fluid["cp/cv"])
            self.w = unidades.Speed(fluid["w"])

            self.Z = unidades.Dimensionless(fluid["Z"])
            self.alfav = unidades.InvTemperature(fluid["alfav"])
            self.kappa = unidades.InvPressure(fluid["kappa"])
            self.kappas = unidades.InvPressure(fluid["kappas"])

            self.mu = unidades.Viscosity(fluid["mu"])
            self.k = unidades.ThermalConductivity(fluid["k"])
            self.nu = unidades.Diffusivity(fluid["nu"])
            self.Prandt = unidades.Dimensionless(fluid["Prandt"])

            self.alfa = unidades.Diffusivity(fluid["alfa"])
            self.joule = unidades.TemperaturePressure(fluid["joule"])
            self.deltat = unidades.EnthalpyPressure(fluid["deltat"])
            self.gamma = unidades.Dimensionless(fluid["gamma"])

            self.alfap = unidades.Dimensionless(fluid["alfap"])
            self.betap = unidades.Dimensionless(fluid["betap"])
            self.fi = [unidades.Dimensionless(f) for f in fluid["fi"]]
            self.f = [unidades.Pressure(f) for f in fluid["f"]]

            self.Q = unidades.VolFlow(fluid["volFlow"])
            self.caudalmasico = unidades.MassFlow(fluid["massFlow"])
            self.caudalmolar = unidades.MolarFlow(fluid["molarFlow"])
            self.fraccion = [
                unidades.Dimensionless(x) for x in fluid["fraction"]
            ]
            self.fraccion_masica = [
                unidades.Dimensionless(x) for x in fluid["massFraction"]
            ]
            self.caudalunitariomasico = [
                unidades.MassFlow(x) for x in fluid["massUnitFlow"]
            ]
            self.caudalunitariomolar = [
                unidades.MolarFlow(x) for x in fluid["molarUnitFlow"]
            ]

            self.rhoM = unidades.MolarDensity(self.rho / self.M)
            self.hM = unidades.MolarEnthalpy(self.h / self.M)
            self.sM = unidades.MolarSpecificHeat(self.s / self.M)
            self.uM = unidades.MolarEnthalpy(self.u / self.M)
            self.aM = unidades.MolarEnthalpy(self.a / self.M)
            self.gM = unidades.MolarEnthalpy(self.g / self.M)
            self.cvM = unidades.MolarSpecificHeat(self.cv / self.M)
            self.cpM = unidades.MolarSpecificHeat(self.cp / self.M)