How to use the uwg.psychrometrics.psychrometrics function in uwg

To help you get started, we’ve selected a few uwg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chriswmackey / Dragonfly / uwg / uwg.py View on Github external
Uforc.wind = copy.copy(self.UCM.canWind)
            Uforc.temp = copy.copy(self.UCM.canTemp)
            self.USM.VDM(Uforc,Uroad,self.geoParam,self.simTime)
            """

            self.logger.info("dbT = {}".format(self.UCM.canTemp-273.15))
            if n > 0:
                logging.info("dpT = {}".format(self.UCM.Tdp))
                logging.info("RH  = {}".format(self.UCM.canRHum))

            if self.is_near_zero(self.simTime.secDay % self.simTime.timePrint) and n < self.N:

                self.logger.info("{0} ----sim time step = {1}----\n\n".format(__name__, n))

                self.WeatherData[n] = copy.copy(self.forc)
                _Tdb, _w, self.UCM.canRHum, _h, self.UCM.Tdp, _v = psychrometrics(
                    self.UCM.canTemp, self.UCM.canHum, self.forc.pres)

                self.UBLData[n] = copy.copy(self.UBL)
                self.UCMData[n] = copy.copy(self.UCM)
                self.RSMData[n] = copy.copy(self.RSM)

                self.logger.info("dbT = {}".format(self.UCMData[n].canTemp-273.15))
                self.logger.info("dpT = {}".format(self.UCMData[n].Tdp))
                self.logger.info("RH  = {}".format(self.UCMData[n].canRHum))

                n += 1

github chriswmackey / Dragonfly / uwg / building.py View on Github external
H2 = (wallArea*zac_in_wall +
            massArea*zac_in_mass +
            zac_in_ceil +
            winArea*self.uValue +
            volInfil * dens * parameter.cp +
            volVent * dens * parameter.cp)

        # Assumes air temperature of control volume is sum of surface boundary temperatures
        # weighted by area and heat transfer coefficient + generated heat
        self.indoorTemp = (H1 + Q)/H2

        self.indoorHum = self.indoorHum + (simTime.dt/(dens * parameter.lv * UCM.bldHeight)) * \
            (QLintload + QLinfil + QLvent - Qdehum)

        # Calculate relative humidity (Pw/Pws*100) using pressurce, indoor temperature, humidity
        _Tdb, _w, _phi, _h, _Tdp, _v = psychrometrics(self.indoorTemp, self.indoorHum, forc.pres)
        self.indoorRhum = _phi

        # These are used for element calculation (per m^2 of element area)
        self.fluxWall = zac_in_wall * (T_indoor - T_wall)
        self.fluxRoof = zac_in_ceil * (T_indoor - T_ceil)
        self.fluxMass = zac_in_mass * (T_indoor - T_mass) + self.intHeat * self.intHeatFRad/massArea

        # These are for record keeping only, per m^2 of floor area (W m-2)
        self.fluxSolar = winTrans/self.nFloor
        self.fluxWindow = winArea * self.uValue *(T_can - T_indoor)/self.nFloor
        self.fluxInterior = self.intHeat * self.intHeatFRad *(1.-self.intHeatFLat)/self.nFloor
        self.fluxInfil= volInfil * dens * parameter.cp *(T_can - T_indoor)/self.nFloor # volInfil = m3 s-1
        self.fluxVent = volVent * dens * parameter.cp *(T_can - T_indoor)/self.nFloor  # volVent = m3 s-1
        self.coolConsump = self.coolConsump/self.nFloor
        self.sensCoolDemand = self.sensCoolDemand/self.nFloor