Beispiel #1
0
    def peso(self):
        W_carcasa = pi / 4 * (self.De**2 - self.Di**2) * self.L * self.densidad

        if self.kwargs["cabeza"] == 3:
            W_cabeza = pi / 4 * self.Di**2 * self.espesor_cabeza * self.densidad
        else:
            ratio = self.De / self.espesor_cabeza
            if self.kwargs["cabeza"] == 0:
                if ratio > 20:
                    hb = 1.24
                else:
                    hb = 1.3
            elif self.kwargs["cabeza"] == 2:
                if ratio > 50:
                    hb = 1.09
                elif ratio > 30:
                    hb = 1.11
                else:
                    hb = 1.15
            else:
                if ratio > 30:
                    hb = 1.6
                elif ratio > 18:
                    hb = 1.65
                else:
                    hb = 1.70
            Do = hb * self.De + 2 * self.reborde
            W_cabeza = pi / 4 * Do**2 * self.espesor_cabeza * self.densidad

        self.W = unidades.Mass(W_carcasa + 2 * W_cabeza)
Beispiel #2
0
    def config(self):
        self.axes2D.set_autoscale_on(False)
        self.axes2D.set_xlabel("Tdb, " + unidades.Temperature(None).text())
        self.axes2D.set_ylabel(
            QtGui.QApplication.translate("pychemqt", "Absolute humidity") +
            ", " + unidades.Mass(None).text() + "/" +
            unidades.Mass(None).text())
        self.axes2D.yaxis.set_ticks_position("right")
        self.axes2D.yaxis.set_label_position("right")

        self.lx = self.axes2D.axhline(color='b')  # the horiz line
        self.ly = self.axes2D.axvline(color='b')  # the vert line

        tmin = unidades.Temperature(274).config()
        tmax = unidades.Temperature(329).config()

        self.axes2D.set_xlim(tmin, tmax)
        self.axes2D.set_ylim(0, 0.04)
Beispiel #3
0
    def __init__(self, equipment=None, parent=None):
        """
        equipment: Initial equipment instance to model
        """
        super(UI_equipment, self).__init__(Dryer, parent=parent)

        # Input tab
        self.addEntrada(
            QtWidgets.QApplication.translate("pychemqt", "Humid Solid"),
            "entradaSolido")
        self.addEntrada(QtWidgets.QApplication.translate("pychemqt", "Air"),
                        "entradaAire",
                        psychro=True)

        # Calculate tab
        lyt = QtWidgets.QGridLayout(self.tabCalculo)
        lyt.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "Mode")), 1, 1)
        self.mode = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_MODE:
            self.mode.addItem(txt)
        self.mode.currentIndexChanged.connect(
            partial(self.changeParams, "mode"))
        lyt.addWidget(self.mode, 1, 2, 1, 4)
        lyt.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Fixed,
                                  QtWidgets.QSizePolicy.Fixed), 2, 1, 1, 6)
        lyt.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt",
                                                 "Air Relative Humidity")), 3,
            1)
        self.HumedadAire = Entrada_con_unidades(float,
                                                max=1,
                                                spinbox=True,
                                                step=0.01)
        self.HumedadAire.valueChanged.connect(partial(self.changeParams, "HR"))
        lyt.addWidget(self.HumedadAire, 3, 2)
        lyt.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt",
                                                 "Product moisture fraction")),
            4, 1)
        self.HumedadSolido = Entrada_con_unidades(
            float,
            max=1.,
            spinbox=True,
            step=0.01,
            textounidad=unidades.Mass(None).text() + "/" +
            unidades.Mass(None).text())
        self.HumedadSolido.valueChanged.connect(
            partial(self.changeParams, "HumedadResidual"))
        lyt.addWidget(self.HumedadSolido, 4, 2)
        lyt.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt",
                                                 "Output Solid Temperature")),
            5, 1)
        self.temperatura = Entrada_con_unidades(unidades.Temperature)
        self.temperatura.valueChanged.connect(
            partial(self.changeParams, "TemperaturaSolid"))
        lyt.addWidget(self.temperatura, 5, 2)
        lyt.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "Heat Duty")), 6,
            1)
        self.Heat = Entrada_con_unidades(unidades.Power)
        self.Heat.valueChanged.connect(partial(self.changeParams, "Heat"))
        lyt.addWidget(self.Heat, 6, 2)
        lyt.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "Pressure Drop")),
            7, 1)
        self.DeltaP = Entrada_con_unidades(unidades.Pressure)
        self.DeltaP.valueChanged.connect(partial(self.changeParams, "DeltaP"))
        lyt.addWidget(self.DeltaP, 7, 2)

        lyt.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding), 8, 1, 1, 6)
        group = QtWidgets.QGroupBox(
            QtWidgets.QApplication.translate("pychemqt", "Results"))
        lyt.addWidget(group, 9, 1, 1, 5)
        layout = QtWidgets.QGridLayout(group)
        layout.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt",
                                                 "Output Temperature")), 1, 1)
        self.temperaturaCalculada = Entrada_con_unidades(unidades.Temperature,
                                                         retornar=False,
                                                         readOnly=True)
        layout.addWidget(self.temperaturaCalculada, 1, 2)
        layout.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate("pychemqt", "Air Flow")), 2,
            1)
        self.caudalVolumetrico = Entrada_con_unidades(unidades.VolFlow,
                                                      "QGas",
                                                      retornar=False,
                                                      readOnly=True)
        layout.addWidget(self.caudalVolumetrico, 2, 2)
        layout.addWidget(
            QtWidgets.QLabel(
                QtWidgets.QApplication.translate(
                    "pychemqt", "Output Air Relative Humidity")), 3, 1)
        self.HumedadCalculada = Entrada_con_unidades(float,
                                                     readOnly=True,
                                                     textounidad="%")
        layout.addWidget(self.HumedadCalculada, 3, 2)

        lyt.addItem(
            QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding), 11, 1, 1,
            6)

        # Output Tab
        self.addSalida(QtWidgets.QApplication.translate("pychemqt", "Air"),
                       psychro=True)
        self.addSalida(
            QtWidgets.QApplication.translate("pychemqt", "Dry solid"))

        if equipment:
            self.setEquipment(equipment)
Beispiel #4
0
 def peso(self):
     """Cálculo del peso de la carcasa"""
     return unidades.Mass(pi * self.kwargs["Di"] *
                          (self.kwargs["h"] + 0.8116 * self.kwargs["Di"]) *
                          0.5 * (self.kwargs["Wb"] + self.kwargs["W"]) *
                          self.densidad)
Beispiel #5
0
    def __init__(self, entradaSolido=None, entradaAire=None, parent=None):
        """entrada: Parametro opcional de clase corriente que indica la corriente de entrada"""
        super(UI_equipment, self).__init__(Dryer, parent=parent)
        self.entradaSolido = entradaSolido
        self.entradaAire = entradaAire
        self.Equipment = Dryer()

        #Pestaña entrada
        self.EntradaSolido = UI_corriente.Ui_corriente(self.entradaSolido)
        self.EntradaSolido.Changed.connect(self.cambiar_entrada)
        self.Entrada.addTab(
            self.EntradaSolido,
            QtGui.QApplication.translate("equipment", "Solido", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.EntradaAire = UI_corriente.Ui_psychrometry(self.entradaAire)
        self.EntradaAire.Changed.connect(self.cambiar_aire)
        self.Entrada.addTab(
            self.EntradaAire,
            QtGui.QApplication.translate("equipment", "Aire", None,
                                         QtGui.QApplication.UnicodeUTF8))

        #Pestaña calculo
        gridLayout_Calculo = QtGui.QGridLayout(self.tabCalculo)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment", "Tipo de cálculo:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            1, 1)
        self.TipoCalculo = QtGui.QComboBox()
        self.TipoCalculo.addItem(
            QtGui.QApplication.translate(
                "equipment",
                "Cálculo, conocido el flujo de vapor, calcular las corrientes de salida",
                None, QtGui.QApplication.UnicodeUTF8))
        self.TipoCalculo.addItem(
            QtGui.QApplication.translate(
                "equipment", "Diseño, calcular el flujo de aire necesario",
                None, QtGui.QApplication.UnicodeUTF8))
        self.TipoCalculo.currentIndexChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.TipoCalculo, 1, 2, 1, 4)
        gridLayout_Calculo.addItem(
            QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed,
                              QtGui.QSizePolicy.Fixed), 2, 1, 1, 6)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Humedad relativa en el aire:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            3, 1, 1, 1)
        self.HumedadAire = Entrada_con_unidades(float,
                                                max=1,
                                                spinbox=True,
                                                step=0.01)
        self.HumedadAire.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.HumedadAire, 3, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Humedad residual del sólido:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            4, 1, 1, 1)
        self.HumedadSolido = Entrada_con_unidades(
            float,
            max=1.,
            spinbox=True,
            step=0.01,
            textounidad=unidades.Mass(None).text() + "/" +
            unidades.Mass(None).text())
        self.HumedadSolido.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.HumedadSolido, 4, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate(
                    "equipment", "Temperatura del sólido a la salida:", None,
                    QtGui.QApplication.UnicodeUTF8)), 5, 1, 1, 1)
        self.temperatura = Entrada_con_unidades(unidades.Temperature)
        self.temperatura.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.temperatura, 5, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Intercambio de calor:", None,
                                             QtGui.QApplication.UnicodeUTF8)),
            6, 1, 1, 1)
        self.Heat = Entrada_con_unidades(unidades.Power)
        self.Heat.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.Heat, 6, 2, 1, 1)
        gridLayout_Calculo.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Pérdida de presión:", None,
                                             QtGui.QApplication.UnicodeUTF8)),
            7, 1, 1, 1)
        self.DeltaP = Entrada_con_unidades(unidades.Pressure)
        self.DeltaP.valueChanged.connect(self.calculo)
        gridLayout_Calculo.addWidget(self.DeltaP, 7, 2, 1, 1)

        gridLayout_Calculo.addItem(
            QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Expanding), 8, 1, 1, 6)
        self.groupBox_Calculo = QtGui.QGroupBox(
            QtGui.QApplication.translate("equipment", "Datos calculados", None,
                                         QtGui.QApplication.UnicodeUTF8))
        gridLayout_Calculo.addWidget(self.groupBox_Calculo, 9, 1, 1, 5)
        gridLayout_1 = QtGui.QGridLayout(self.groupBox_Calculo)
        gridLayout_1.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment",
                                             "Temperatura a la salida:", None,
                                             QtGui.QApplication.UnicodeUTF8)),
            1, 1, 1, 1)
        self.temperaturaCalculada = Entrada_con_unidades(unidades.Temperature,
                                                         retornar=False,
                                                         readOnly=True)
        gridLayout_1.addWidget(self.temperaturaCalculada, 1, 2, 1, 1)
        gridLayout_1.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment", "Caudal de aire:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            2, 1)
        self.caudalVolumetrico = Entrada_con_unidades(unidades.VolFlow,
                                                      "QGas",
                                                      retornar=False,
                                                      readOnly=True)
        gridLayout_1.addWidget(self.caudalVolumetrico, 2, 2, 1, 1)
        gridLayout_1.addWidget(
            QtGui.QLabel(
                QtGui.QApplication.translate("equipment", "Humedad del aire:",
                                             None,
                                             QtGui.QApplication.UnicodeUTF8)),
            3, 1)
        self.HumedadCalculada = Entrada_con_unidades(float,
                                                     readOnly=True,
                                                     textounidad="%")
        gridLayout_1.addWidget(self.HumedadCalculada, 3, 2, 1, 1)

        gridLayout_Calculo.addItem(
            QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Expanding), 11, 1, 1, 6)

        #Pestaña salida
        self.SalidaSolido = UI_corriente.Ui_corriente(readOnly=True)
        self.Salida.addTab(
            self.SalidaSolido,
            QtGui.QApplication.translate("equipment", "Sólido secado", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.SalidaAire = UI_corriente.Ui_psychrometry(readOnly=True)
        self.Salida.addTab(
            self.SalidaAire,
            QtGui.QApplication.translate("equipment", "Aire", None,
                                         QtGui.QApplication.UnicodeUTF8))