Ejemplo n.º 1
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for Methanol  (CH4O). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9,
            0.95, 1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.35)  # saturation pressure at Tr=0.35
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3191.715186959335 + psat)
                       )  # Fit Standard Deviation = 2.837118788145182e-07
        dsg_o_sgL.append(0.027616043627984255 * log10x +
                         0.02683968541176404 * log10x**2 +
                         0.01713538185956224 * log10x**3)

        psat = self.PvapAtTr(0.4)  # saturation pressure at Tr=0.4
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2655.177365208165 + psat)
                       )  # Fit Standard Deviation = 4.801888610778139e-07
        dsg_o_sgL.append(0.028768071331671797 * log10x +
                         0.027856084140237214 * log10x**2 +
                         0.018342824335801866 * log10x**3)

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2066.375197975173 + psat)
                       )  # Fit Standard Deviation = 8.865877559244185e-07
        dsg_o_sgL.append(0.026659034866233455 * log10x +
                         0.02579633769674572 * log10x**2 +
                         0.01821968148866191 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1553.1170152935774 + psat)
                       )  # Fit Standard Deviation = 1.6877012414566917e-06
        dsg_o_sgL.append(0.02375494146637885 * log10x +
                         0.022859601269758296 * log10x**2 +
                         0.017858556461887103 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1144.2862358209711 + psat)
                       )  # Fit Standard Deviation = 3.1713324845605746e-06
        dsg_o_sgL.append(0.02080985258260405 * log10x +
                         0.019662827028871052 * log10x**2 +
                         0.017496964450814452 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (817.5051334225126 + psat)
                       )  # Fit Standard Deviation = 5.913015205876159e-06
        dsg_o_sgL.append(0.017889720622633287 * log10x +
                         0.0161750381111185 * log10x**2 +
                         0.017114948902916167 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (547.1596400613786 + psat)
                       )  # Fit Standard Deviation = 1.1192232128330875e-05
        dsg_o_sgL.append(0.014931831953339296 * log10x +
                         0.012179120440580516 * log10x**2 +
                         0.016630805565163175 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4323.04250312209 + psat)
                       )  # Fit Standard Deviation = 2.039917054866528e-06
        dsg_o_sgL.append(0.13909272168886705 * log10x +
                         0.04603766491887147 * log10x**2 +
                         0.0002697145150835314 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3303.4863597105946 + psat)
                       )  # Fit Standard Deviation = 2.9086310844193335e-06
        dsg_o_sgL.append(0.13910040778242827 * log10x +
                         0.04480386602562593 * log10x**2 +
                         -0.0012443476675556976 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2294.5283064564173 + psat)
                       )  # Fit Standard Deviation = 4.204301217656713e-06
        dsg_o_sgL.append(0.1384849799280445 * log10x +
                         0.0435828031756756 * log10x**2 +
                         -0.003110219235934577 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1319.899549691 + psat)
                       )  # Fit Standard Deviation = 6.096221294895582e-06
        dsg_o_sgL.append(0.1374994841324965 * log10x +
                         0.04280551274187621 * log10x**2 +
                         -0.005477611223877531 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (402.27147840383395 + psat)
                       )  # Fit Standard Deviation = 1.1786722710970603e-05
        dsg_o_sgL.append(0.13528880666408333 * log10x +
                         0.04340147786947483 * log10x**2 +
                         -0.00815935338979355 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4.969200897313042e-06 + psat)
                       )  # Fit Standard Deviation = 0.00043297760566535107
        dsg_o_sgL.append(0.293573462248885 * log10x +
                         -0.10455194328330915 * log10x**2 +
                         0.04316028134505978 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1.4350024341074379e-08 + psat)
                       )  # Fit Standard Deviation = 0.028212264902254692
        dsg_o_sgL.append(2.258018439174332 * log10x +
                         -3.9109948315804117 * log10x**2 +
                         2.2807107666077533 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 2
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for Ethane  (C2H6). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85,
            0.9, 0.95, 1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.3)  # saturation pressure at Tr=0.3
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3640.730393562185 + psat)
                       )  # Fit Standard Deviation = 2.338719373192911e-07
        dsg_o_sgL.append(0.03233242402285083 * log10x +
                         0.03105309251929221 * log10x**2 +
                         0.01940732579311245 * log10x**3)

        psat = self.PvapAtTr(0.35)  # saturation pressure at Tr=0.35
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2664.6118783005377 + psat)
                       )  # Fit Standard Deviation = 4.972506613746668e-07
        dsg_o_sgL.append(0.028183492039283574 * log10x +
                         0.027651388597404753 * log10x**2 +
                         0.018866117493693955 * log10x**3)

        psat = self.PvapAtTr(0.4)  # saturation pressure at Tr=0.4
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1999.4696917908293 + psat)
                       )  # Fit Standard Deviation = 1.00850822811095e-06
        dsg_o_sgL.append(0.02524887845910932 * log10x +
                         0.024770721451089158 * log10x**2 +
                         0.018550522259343668 * log10x**3)

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (9302.184392870637 + psat)
                       )  # Fit Standard Deviation = 1.2374618622576555e-09
        dsg_o_sgL.append(0.1405162282784313 * log10x +
                         0.05677561546861795 * log10x**2 +
                         -0.006573234437047919 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1030.1735997955268 + psat)
                       )  # Fit Standard Deviation = 4.192528196052104e-06
        dsg_o_sgL.append(0.019106421198635815 * log10x +
                         0.01786663354847461 * log10x**2 +
                         0.017758610071341066 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (683.1359397268751 + psat)
                       )  # Fit Standard Deviation = 8.649118646587409e-06
        dsg_o_sgL.append(0.015866651522188028 * log10x +
                         0.013606611452907407 * log10x**2 +
                         0.017190383542933813 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (414.07373187605646 + psat)
                       )  # Fit Standard Deviation = 1.7935159184691528e-05
        dsg_o_sgL.append(0.012716241685388378 * log10x +
                         0.008747189923077771 * log10x**2 +
                         0.016468348440512814 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4290.420342533632 + psat)
                       )  # Fit Standard Deviation = 6.140859669964164e-07
        dsg_o_sgL.append(0.1550384752171683 * log10x +
                         0.04294567298682377 * log10x**2 +
                         -0.005085243259766905 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3160.148325387464 + psat)
                       )  # Fit Standard Deviation = 1.304080585859677e-06
        dsg_o_sgL.append(0.1520509551557447 * log10x +
                         0.042673119915774715 * log10x**2 +
                         -0.005738946829100536 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2193.292865845392 + psat)
                       )  # Fit Standard Deviation = 2.6377448489227672e-06
        dsg_o_sgL.append(0.1486216518466331 * log10x +
                         0.042613347313886996 * log10x**2 +
                         -0.006524667862620398 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1366.9743135274675 + psat)
                       )  # Fit Standard Deviation = 5.5236103708504305e-06
        dsg_o_sgL.append(0.14403365197032625 * log10x +
                         0.042945829272460594 * log10x**2 +
                         -0.007337012226269114 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (664.4967158205939 + psat)
                       )  # Fit Standard Deviation = 1.2416441933112653e-05
        dsg_o_sgL.append(0.1369130536367487 * log10x +
                         0.043852434777548 * log10x**2 +
                         -0.00802591376605673 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (80.45276890764484 + psat)
                       )  # Fit Standard Deviation = 2.641351263085312e-05
        dsg_o_sgL.append(0.12486797431961583 * log10x +
                         0.04551571888568812 * log10x**2 +
                         -0.00847374872206692 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (9.67519130413478e-07 + psat)
                       )  # Fit Standard Deviation = 0.0008449224734538883
        dsg_o_sgL.append(0.33889504570492773 * log10x +
                         -0.1513197501398535 * log10x**2 +
                         0.05610201840850644 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5.201356283849731e-09 + psat)
                       )  # Fit Standard Deviation = 0.03753927550797725
        dsg_o_sgL.append(2.322413741479554 * log10x +
                         -3.3886979410513347 * log10x**2 +
                         1.6206842930314775 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 3
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, Methanol"""

        self.dataSrc = 'RefProp'
        self.T = 527.67  # degR
        self.P = 1.89009076582  # psia
        self.Pvap = 1.89009076582  # psia
        self.Pc = 1175.31300195  # psia
        self.Tc = 922.68  # degR
        self.Zc = 0.221138723259  # Z at critical pt
        self.omega = 0.5646279527412872  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 0.790928353374  # SG
        self.visc = 0.00584983624524  # poise
        self.cond = 0.116984204459  # BTU/hr/ft/delF
        self.Tnbp = 607.7376  # degR
        self.Tfreeze = 316.098  # degR
        self.Ttriple = 316.098  # degR
        self.Cp = 0.598637435914  # BTU/lbm/delF
        self.MolWt = 32.04216  # g/gmole
        self.Hvap = 506.174659683  # BTU/lbm
        self.surf = 0.000129470848379  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 20
        self.trL = [
            0.3425868123293016, 0.3771875064172331, 0.41178820050516457,
            0.4463888945930961, 0.4809895886810276, 0.515590282768959,
            0.5501909768568906, 0.5847916709448221, 0.6193923650327535,
            0.6539930591206852, 0.6885937532086166, 0.723194447296548,
            0.7577951413844797, 0.7923958354724111, 0.8269965295603426,
            0.8615972236482741, 0.8961979177362055, 0.9307986118241371,
            0.9653993059120686, 1.0
        ]
        self.tL = [
            316.098, 348.0233684210526, 379.9487368421053, 411.87410526315796,
            443.79947368421057, 475.7248421052632, 507.65021052631585,
            539.5755789473685, 571.5009473684211, 603.4263157894738,
            635.3516842105264, 667.277052631579, 699.2024210526317,
            731.1277894736843, 763.053157894737, 794.9785263157896,
            826.9038947368422, 858.829263157895, 890.7546315789475,
            922.6800000000001
        ]

        self.log10pL = [
            -4.568041343682912, -3.426175897726996, -2.4886007425044743,
            -1.7067916935171517, -1.0463244796949103, -0.4821436269850317,
            0.0044388689379552025, 0.4276610322792718, 0.7985799444957368,
            1.1259270216407529, 1.4166946097649735, 1.6765515283455275,
            1.9101521698251016, 2.1213763832381582, 2.3135053212096905,
            2.4892644786941323, 2.6505645444723083, 2.798615708211274,
            2.937097307506557, 3.070179795161525
        ]
        self.log10viscL = [
            -0.892334045998053, -1.2374710079487936, -1.5019928180992934,
            -1.706457636945853, -1.8773785341227793, -2.0262432083025232,
            -2.1578660315256606, -2.274978081386827, -2.3798085429073748,
            -2.47447834411857, -2.561043617552284, -2.641478112047254,
            -2.717672806978498, -2.791464535821466, -2.864687985482856,
            -2.9392443693957877, -3.0172428589914166, -3.1018066773170285,
            -3.2030113883441436, -3.3938604777976664
        ]
        self.condL = [
            0.1565409232664758, 0.14773755562297144, 0.14001223289161926,
            0.13342170384734103, 0.12785099577070835, 0.12314300446136274,
            0.11916702931222166, 0.11578204263256975, 0.11285015702965055,
            0.11024582121465633, 0.10786030636292335, 0.10560203518074639,
            0.1033946313450882, 0.10117482013979259, 0.09889288767781239,
            0.09652078956620103, 0.09408230788341888, 0.09179174317977327,
            0.09117448091810589, 0.11335571013162729
        ]
        self.cpL = [
            0.5250477724988539, 0.5287886497383155, 0.5315210557396867,
            0.5390165492502057, 0.5500459735512088, 0.5648385414173157,
            0.5840998269083668, 0.6081885158808865, 0.6370587597060676,
            0.67050819119183, 0.7084446856734308, 0.7511064790261485,
            0.7992912170701368, 0.8547197625638148, 0.9207741368340593,
            1.004224349682646, 1.1204017834671147, 1.3182653766204302,
            1.9087965760148562, 20.234833703308066
        ]
        self.hvapL = [
            565.5046945735913, 557.8678338537848, 550.058366345057,
            541.8463784156847, 533.0302872159612, 523.4902424167067,
            513.1340335913362, 501.8473304237992, 489.4519644051585,
            475.6765769467351, 460.1420815247999, 442.35551125464315,
            421.7005519847231, 397.4240204315621, 368.6931250094674,
            335.1213219896233, 298.13759767845477, 257.112976376965,
            193.96908177644775, 0.0
        ]
        self.surfL = [
            0.0001956482012498527, 0.00018320677515381415,
            0.00017197599406819353, 0.0001617289855512758,
            0.0001522470548827114, 0.00014332044619874907,
            0.00013474925749869116, 0.00012634455753746218,
            0.0001179297733919466, 0.00010934245012341793,
            0.00010043653717080256, 9.108544675369582e-05,
            8.11862922534576e-05, 7.066602573059902e-05,
            5.9490838242498865e-05, 4.76816658439141e-05,
            3.534254576502414e-05, 2.2721173144693202e-05,
            1.0378256741858536e-05, 2.095199165621674e-07
        ]
        self.SG_liqL = [
            0.9045643806392595, 0.8869386863222748, 0.8692773155700391,
            0.8519013099045403, 0.8348083798865514, 0.8179759957120225,
            0.8013318944961002, 0.7847295913199116, 0.7679537522507351,
            0.7507358104144812, 0.7327647105971267, 0.7136852451488889,
            0.6930798133718477, 0.670428406022531, 0.6450362857477969,
            0.6159042195149915, 0.5814498027320545, 0.5385766465588984,
            0.4774099103577368, 0.2755629043704677
        ]
        self.log10SG_vapL = [
            -8.38828522270717, -7.287911920798633, -6.3880697781312445,
            -5.640525902322043, -5.011170701769704, -4.475190649642974,
            -4.014065738358517, -3.613626978710237, -3.2627637370935356,
            -2.952555546542785, -2.675674746597, -2.4259429374108614,
            -2.197958172744626, -1.986762973065808, -1.787705903832734,
            -1.5974069584948187, -1.4169243549658836, -1.243164823259537,
            -1.0328945835647714, -0.5597792465304997
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RefProp"
        data_srcD["T"] = "RefProp"  # degR
        data_srcD["P"] = "RefProp"  # psia
        data_srcD["Pvap"] = "RefProp"  # psia
        data_srcD["Pc"] = "RefProp"  # psia
        data_srcD["Tc"] = "RefProp"  # degR
        data_srcD["Zc"] = "RefProp"  # Z at critical pt
        data_srcD[
            "omega"] = "RefProp"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RefProp"  # SG
        data_srcD["visc"] = "RefProp"  # poise
        data_srcD["cond"] = "RefProp"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RefProp"  # degR
        data_srcD["Tfreeze"] = "RefProp"  # degR
        data_srcD["Ttriple"] = "RefProp"  # degR
        data_srcD["Cp"] = "RefProp"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RefProp"  # g/gmole
        data_srcD["Hvap"] = "RefProp"  # BTU/lbm
        data_srcD["surf"] = "RefProp"  # lbf/in

        data_srcD["trL"] = "RefProp"
        data_srcD["tL"] = "RefProp"

        data_srcD["log10pL"] = "RefProp"
        data_srcD["log10viscL"] = "RefProp"
        data_srcD["condL"] = "RefProp"
        data_srcD["cpL"] = "RefProp"
        data_srcD["hvapL"] = "RefProp"
        data_srcD["surfL"] = "RefProp"
        data_srcD["SG_liqL"] = "RefProp"
        data_srcD["log10SG_vapL"] = "RefProp"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 4
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for RP1  (RP-1). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9,
            0.95, 1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.35)  # saturation pressure at Tr=0.35
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2711.561322115711 + psat)
                       )  # Fit Standard Deviation = 4.763132787032469e-07
        dsg_o_sgL.append(0.02724310615509977 * log10x +
                         0.026740483033153184 * log10x**2 +
                         0.018216812890644998 * log10x**3)

        psat = self.PvapAtTr(0.4)  # saturation pressure at Tr=0.4
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2040.4902325716507 + psat)
                       )  # Fit Standard Deviation = 9.876899467924745e-07
        dsg_o_sgL.append(0.02448686368383292 * log10x +
                         0.024013865790125228 * log10x**2 +
                         0.018025544938689964 * log10x**3)

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1493.3108199595347 + psat)
                       )  # Fit Standard Deviation = 2.030085736877373e-06
        dsg_o_sgL.append(0.021576139097461217 * log10x +
                         0.02089595217529488 * log10x**2 +
                         0.017742951239720528 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1052.002751558613 + psat)
                       )  # Fit Standard Deviation = 4.16518926583506e-06
        dsg_o_sgL.append(0.018539119978294515 * log10x +
                         0.01732334486056667 * log10x**2 +
                         0.017357093895877092 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (704.5101941350781 + psat)
                       )  # Fit Standard Deviation = 8.55342648584307e-06
        dsg_o_sgL.append(0.01545924891133973 * log10x +
                         0.013244685906653656 * log10x**2 +
                         0.016852695354192166 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (440.42384110209616 + psat)
                       )  # Fit Standard Deviation = 1.7565956990829967e-05
        dsg_o_sgL.append(0.012484179284333494 * log10x +
                         0.008617201580771127 * log10x**2 +
                         0.016207201328548866 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (248.24024707271462 + psat)
                       )  # Fit Standard Deviation = 3.5953200282572224e-05
        dsg_o_sgL.append(0.009839984483811064 * log10x +
                         0.0033756171888542127 * log10x**2 +
                         0.015385963319585133 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (113.9807968641889 + psat)
                       )  # Fit Standard Deviation = 7.285264143428316e-05
        dsg_o_sgL.append(0.007912860028858817 * log10x +
                         -0.0027460160763761008 * log10x**2 +
                         0.014333100559937542 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2480.0946335890626 + psat)
                       )  # Fit Standard Deviation = 2.7488269257734393e-06
        dsg_o_sgL.append(0.15149782766607758 * log10x +
                         0.041430385932726105 * log10x**2 +
                         -0.007721122866799761 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1646.1257667871091 + psat)
                       )  # Fit Standard Deviation = 5.032507036728612e-06
        dsg_o_sgL.append(0.14654215864813608 * log10x +
                         0.04215689369860926 * log10x**2 +
                         -0.008196475263517985 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (958.8833015394819 + psat)
                       )  # Fit Standard Deviation = 9.042830900362289e-06
        dsg_o_sgL.append(0.1394777433784282 * log10x +
                         0.04332135672400373 * log10x**2 +
                         -0.008652045904215156 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (410.2119738004101 + psat)
                       )  # Fit Standard Deviation = 1.4622099515519596e-05
        dsg_o_sgL.append(0.1286973801384083 * log10x +
                         0.04506957932197583 * log10x**2 +
                         -0.009012163458480745 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (0.7015761950563051 + psat)
                       )  # Fit Standard Deviation = 1.1575269799302454e-05
        dsg_o_sgL.append(0.11153616968974724 * log10x +
                         0.046950279459703155 * log10x**2 +
                         -0.008957280109793223 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2.93642660132482e-07 + psat)
                       )  # Fit Standard Deviation = 0.004117348166031686
        dsg_o_sgL.append(0.579798365485937 * log10x +
                         -0.3952399797002273 * log10x**2 +
                         0.12696172184192014 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 5
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, Ethane"""

        self.dataSrc = 'RefProp'
        self.T = 332.2242  # degR
        self.P = 14.6959  # psia
        self.Pvap = 14.6962718391  # psia
        self.Pc = 706.65268194  # psia
        self.Tc = 549.5796  # degR
        self.Zc = 0.279968551854  # Z at critical pt
        self.omega = 0.09951478010449266  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 0.543828684994  # SG
        self.visc = 0.00166370428863  # poise
        self.cond = 0.0965367883076  # BTU/hr/ft/delF
        self.Tnbp = 332.2242  # degR
        self.Tfreeze = 162.6624  # degR
        self.Ttriple = 162.6624  # degR
        self.Cp = 0.5826612769139092  # BTU/lbm/delF
        self.MolWt = 30.06904  # g/gmole
        self.Hvap = 210.546545621  # BTU/lbm
        self.surf = 9.15614939259e-05  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 20
        self.trL = [
            0.2959760515128291, 0.33302994353846965, 0.3700838355641102,
            0.40713772758975075, 0.44419161961539133, 0.4812455116410319,
            0.5182994036666725, 0.5553532956923131, 0.5924071877179536,
            0.6294610797435943, 0.6665149717692348, 0.7035688637948754,
            0.740622755820516, 0.7776766478461565, 0.814730539871797,
            0.8517844318974376, 0.8888383239230783, 0.9258922159487188,
            0.9629461079743594, 1.0
        ]
        self.tL = [
            162.6624, 183.02646315789474, 203.39052631578946,
            223.7545894736842, 244.11865263157893, 264.4827157894737,
            284.8467789473684, 305.21084210526317, 325.5749052631579,
            345.93896842105266, 366.30303157894735, 386.6670947368421,
            407.03115789473685, 427.3952210526316, 447.7592842105263,
            468.12334736842104, 488.4874105263158, 508.85147368421053,
            529.2155368421053, 549.5796
        ]

        self.log10pL = [
            -3.780812731962593, -2.64252182427513, -1.751276386905904,
            -1.0373125420663174, -0.4545957850410371, 0.02858589473173526,
            0.43484439603175085, 0.7807464925282539, 1.078673162663614,
            1.338012930792127, 1.565977372700845, 1.7681789609465792,
            1.9490431452768753, 2.112103402896782, 2.2602170239327894,
            2.395729895828948, 2.520612827809801, 2.6365925750015977,
            2.7453417598026815, 2.849206009581995
        ]
        self.log10viscL = [
            -1.8925218868323843, -2.084380740499991, -2.2350468261362013,
            -2.3574102268224943, -2.459686044596319, -2.5475051563882163,
            -2.624850696871857, -2.694595612870186, -2.7588524866946886,
            -2.8192138103188262, -2.876922559764939, -2.9329990750540427,
            -2.9883448310924146, -3.0438439969289774, -3.1004921701710924,
            -3.159606992955197, -3.22324668138216, -3.295351119156506,
            -3.3865383689467046, -3.66157138014803
        ]
        self.condL = [
            0.14779051112192043, 0.1424677310343604, 0.1366861754466549,
            0.13056544998159134, 0.124232429821267, 0.11779437679490334,
            0.111334595706625, 0.10491514581055182, 0.09858095806838088,
            0.09238962425627897, 0.08635115178648532, 0.0804636339275741,
            0.0747394983250411, 0.06917931798334435, 0.06377381558734652,
            0.058500558105127755, 0.053318955618612406, 0.04816780933429772,
            0.04310087719435985, 0.06239969066527472
        ]
        self.cpL = [
            0.5558829408939255, 0.5447729776185293, 0.5434795482606309,
            0.5460940407095414, 0.5504363609427285, 0.5558591084015186,
            0.5623420161092066, 0.5701204838160393, 0.5795460593063466,
            0.5910544679028004, 0.605194166666527, 0.6227086918403848,
            0.6446995840090536, 0.6729504119650717, 0.710622641436089,
            0.7612190343824613, 0.8469243437630064, 1.0256826007777098,
            1.5741785220880637, 41.66084540188294
        ]
        self.hvapL = [
            255.87652986451843, 250.4331657563339, 245.20435242540498,
            240.04450840872212, 234.87280782574578, 229.62842410569644,
            224.24061287527624, 218.60753964633065, 212.60630686245707,
            206.11666988194781, 199.0255793031078, 191.20961342845158,
            182.51104710666715, 172.71544486301292, 161.52307589703162,
            148.49226584520005, 132.90143107269535, 113.36480667478513,
            86.29207566121292, 0.0
        ]
        self.surfL = [
            0.00018082019806916084, 0.00016992874839266185,
            0.00015905328343313225, 0.00014820686055231412,
            0.00013740355185362142, 0.00012665861594752744,
            0.00011598871405426533, 0.00010541218628954107,
            9.494941145996856e-05, 8.462328571989427e-05,
            7.445987550861224e-05, 6.448933518580844e-05,
            5.4747244129065145e-05, 4.5276644216937084e-05,
            3.613132669757283e-05, 2.7381549583116633e-05,
            1.9125083791150868e-05, 1.1512225076787946e-05,
            4.820672267051293e-06, 0.0
        ]
        self.SG_liqL = [
            0.6515305575928686, 0.6391061005944224, 0.6266826699205624,
            0.6141739497742428, 0.601525732217622, 0.5886877656773712,
            0.5756042595215314, 0.5622100626536362, 0.5484279223024336,
            0.5341650466819601, 0.5193078997140985, 0.5037139157453215,
            0.48719774380827136, 0.46950708338128594, 0.450277278228001,
            0.428939645161394, 0.40452043730707715, 0.3750813326095813,
            0.3353851937180192, 0.20618024569837898
        ]
        self.log10SG_vapL = [
            -7.340020286976712, -6.252944196573508, -5.407450189524555,
            -4.73470097449129, -4.1892356142757246, -3.7396626040540335,
            -3.3634917978658443, -3.044135721205785, -2.7691431192108014,
            -2.529070193637874, -2.3166547277247402, -2.126182295997105,
            -1.9530129910183773, -1.7932236561768977, -1.6432957379898119,
            -1.499750694813456, -1.3585327327417085, -1.2135383385079526,
            -1.0509436798704646, -0.6857529471764796
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RefProp"
        data_srcD["T"] = "RefProp"  # degR
        data_srcD["P"] = "RefProp"  # psia
        data_srcD["Pvap"] = "RefProp"  # psia
        data_srcD["Pc"] = "RefProp"  # psia
        data_srcD["Tc"] = "RefProp"  # degR
        data_srcD["Zc"] = "RefProp"  # Z at critical pt
        data_srcD[
            "omega"] = "RefProp"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RefProp"  # SG
        data_srcD["visc"] = "RefProp"  # poise
        data_srcD["cond"] = "RefProp"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RefProp"  # degR
        data_srcD["Tfreeze"] = "RefProp"  # degR
        data_srcD["Ttriple"] = "RefProp"  # degR
        data_srcD["Cp"] = "CoolProp"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RefProp"  # g/gmole
        data_srcD["Hvap"] = "RefProp"  # BTU/lbm
        data_srcD["surf"] = "RefProp"  # lbf/in

        data_srcD["trL"] = "RefProp"
        data_srcD["tL"] = "RefProp"

        data_srcD["log10pL"] = "RefProp"
        data_srcD["log10viscL"] = "RefProp"
        data_srcD["condL"] = "RefProp"
        data_srcD["cpL"] = "RefProp"
        data_srcD["hvapL"] = "RefProp"
        data_srcD["surfL"] = "RefProp"
        data_srcD["SG_liqL"] = "RefProp"
        data_srcD["log10SG_vapL"] = "RefProp"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 6
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, Ph2"""

        self.dataSrc = 'RefProp'
        self.T = 36.4878  # degR
        self.P = 14.6959  # psia
        self.Pvap = 14.6948534802  # psia
        self.Pc = 186.48947466  # psia
        self.Tc = 59.2884  # degR
        self.Zc = 0.30223885382  # Z at critical pt
        self.omega = -0.21860648262979798  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 0.0708306167316  # SG
        self.visc = 0.000133305601003  # poise
        self.cond = 0.0598114067754  # BTU/hr/ft/delF
        self.Tnbp = 36.4878  # degR
        self.Tfreeze = 24.912  # degR
        self.Ttriple = 24.84594  # degR
        self.Cp = 2.32517319167  # BTU/lbm/delF
        self.MolWt = 2.01594  # g/gmole
        self.Hvap = 191.896930123  # BTU/lbm
        self.surf = 1.09954126588e-05  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 20
        self.trL = [
            0.42018337482542956, 0.45070003930830166, 0.4812167037911738,
            0.5117333682740459, 0.5422500327569181, 0.5727666972397902,
            0.6032833617226623, 0.6338000262055344, 0.6643166906884066,
            0.6948333551712788, 0.7253500196541508, 0.7558666841370231,
            0.7863833486198951, 0.8169000131027673, 0.8474166775856393,
            0.8779333420685115, 0.9084500065513835, 0.9389666710342557,
            0.9694833355171278, 1.0
        ]
        self.tL = [
            24.912, 26.721284210526314, 28.53056842105263, 30.339852631578946,
            32.149136842105264, 33.95842105263158, 35.76770526315789,
            37.57698947368421, 39.38627368421053, 41.195557894736844,
            43.00484210526316, 44.81412631578948, 46.623410526315794,
            48.43269473684211, 50.24197894736842, 52.05126315789474,
            53.86054736842105, 55.66983157894737, 57.47911578947369, 59.2884
        ]

        self.log10pL = [
            0.0183795497220368, 0.25569436866676204, 0.4656541687171755,
            0.6531452670037352, 0.8219540250761733, 0.9750550455539113,
            1.1148153434864272, 1.243141546191338, 1.3615873382443904,
            1.4714328052800911, 1.573743747077011, 1.6694166229378438,
            1.7592131710742813, 1.843787687182169, 1.9237093538591126,
            1.9994819434039228, 2.071564151476475, 2.1403979185813897,
            2.206471856872957, 2.2706555340071013
        ]
        self.log10viscL = [
            -3.5888827820744003, -3.645414381849989, -3.696002455084552,
            -3.74202724756111, -3.7844231337031977, -3.8238825069149733,
            -3.860955778596873, -3.8961039443247816, -3.9297298343547413,
            -3.962200101087265, -3.9938639915869523, -4.025072843243994,
            -4.056204386369084, -4.087698373019526, -4.120116935110548,
            -4.154262257094689, -4.191445870396326, -4.234258026202778,
            -4.289814278226119, -4.454468207572155
        ]
        self.condL = [
            0.043693720648754285, 0.04802968647275226, 0.0515823631974751,
            0.054420964048780114, 0.056626600521574116, 0.05828105193718628,
            0.05945972599660808, 0.06022802905111303, 0.060639989332109144,
            0.06073812473678162, 0.06055382367832501, 0.0601077300746213,
            0.05940973041437389, 0.058458091383299854, 0.05723697139627078,
            0.05571049502213279, 0.0538080861183722, 0.05138075573773148,
            0.048006670673522225, 0.03969983725256325
        ]
        self.cpL = [
            1.6573229555362967, 1.7320059827742387, 1.8168950518256641,
            1.912192955537009, 2.01892405954122, 2.1376691836940407,
            2.269085192410681, 2.414490823536498, 2.576327142670081,
            2.758627473000995, 2.9677005268526893, 3.213321221005406,
            3.510981521371542, 3.8864528424502365, 4.385920909525083,
            5.101588754163036, 6.249690688710174, 8.490944062260024,
            15.297244339997382, 579.4510577037208
        ]
        self.hvapL = [
            193.64818249198999, 194.4999490390988, 195.01922721114093,
            195.15060596614228, 194.8352500902924, 194.01272150787955,
            192.62214887648298, 190.60149874636494, 187.88525304049583,
            184.40075668958573, 180.06310274010244, 174.76787964172198,
            168.38025664540868, 160.71722155331418, 151.515945678003,
            140.3710039705816, 126.59066267979279, 108.78969616047893,
            83.19176915527927, 0.0
        ]
        self.surfL = [
            1.702613486998123e-05, 1.607343514385187e-05,
            1.5124171226164977e-05, 1.4178531937119732e-05,
            1.3236728928522377e-05, 1.2299001153786636e-05,
            1.1365620596216198e-05, 1.0436899734495198e-05,
            9.51320146214372e-06, 8.594952566348148e-06, 7.682662531705947e-06,
            6.776950607821466e-06, 5.8785862820211825e-06,
            4.988552715693025e-06, 4.1081523303704155e-06,
            3.2391971005554998e-06, 2.38439180506815e-06,
            1.5482476505196292e-06, 7.400200459948761e-07, 0.0
        ]
        self.SG_liqL = [
            0.07694999921813274, 0.07612795793928442, 0.07526708894965375,
            0.07435717336714241, 0.07339251965424617, 0.07236888656493591,
            0.07128194403896836, 0.07012645202508123, 0.06889570405743818,
            0.06758098197545347, 0.06617084523428647, 0.06465006667848221,
            0.06299792075224173, 0.06118525812806352, 0.05916913046557844,
            0.05688190925088075, 0.05420602272469311, 0.050901512766566404,
            0.04630032685471787, 0.03132371304644032
        ]
        self.log10SG_vapL = [
            -3.892962704627715, -3.6828981758871127, -3.4973470515506637,
            -3.331602656753448, -3.1820268194683905, -3.0457662051643224,
            -2.920548827016541, -2.8045350615954012, -2.696206479578923,
            -2.5942805956282053, -2.497642432276209, -2.4052850871683815,
            -2.3162510848498066, -2.2295630309703873, -2.1441223717979834,
            -2.0585272431264334, -1.9706702356958115, -1.8766062334551399,
            -1.765819722024995, -1.504126763216845
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RefProp"
        data_srcD["T"] = "RefProp"  # degR
        data_srcD["P"] = "RefProp"  # psia
        data_srcD["Pvap"] = "RefProp"  # psia
        data_srcD["Pc"] = "RefProp"  # psia
        data_srcD["Tc"] = "RefProp"  # degR
        data_srcD["Zc"] = "RefProp"  # Z at critical pt
        data_srcD[
            "omega"] = "RefProp"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RefProp"  # SG
        data_srcD["visc"] = "RefProp"  # poise
        data_srcD["cond"] = "RefProp"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RefProp"  # degR
        data_srcD["Tfreeze"] = "RefProp"  # degR
        data_srcD["Ttriple"] = "RefProp"  # degR
        data_srcD["Cp"] = "RefProp"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RefProp"  # g/gmole
        data_srcD["Hvap"] = "RefProp"  # BTU/lbm
        data_srcD["surf"] = "RefProp"  # lbf/in

        data_srcD["trL"] = "RefProp"
        data_srcD["tL"] = "RefProp"

        data_srcD["log10pL"] = "RefProp"
        data_srcD["log10viscL"] = "RefProp"
        data_srcD["condL"] = "RefProp"
        data_srcD["cpL"] = "RefProp"
        data_srcD["hvapL"] = "RefProp"
        data_srcD["surfL"] = "RefProp"
        data_srcD["SG_liqL"] = "RefProp"
        data_srcD["log10SG_vapL"] = "RefProp"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 7
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, Oxygen"""

        self.dataSrc = 'RefProp'
        self.T = 162.33804  # degR
        self.P = 14.6959  # psia
        self.Pvap = 14.6959328435  # psia
        self.Pc = 731.4251211  # psia
        self.Tc = 278.2458  # degR
        self.Zc = 0.287942793955  # Z at critical pt
        self.omega = 0.022172611915116436  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 1.14117404803  # SG
        self.visc = 0.00194672186444  # poise
        self.cond = 0.0871744939303  # BTU/hr/ft/delF
        self.Tnbp = 162.33804  # degR
        self.Tfreeze = 97.8498  # degR
        self.Ttriple = 97.8498  # degR
        self.Cp = 0.4058864967465755  # BTU/lbm/delF
        self.MolWt = 31.9988  # g/gmole
        self.Hvap = 91.6588458138  # BTU/lbm
        self.surf = 7.52226710455e-05  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 20
        self.trL = [
            0.35166676370317185, 0.3857895656135312, 0.4199123675238906,
            0.45403516943425, 0.48815797134460936, 0.5222807732549688,
            0.5564035751653281, 0.5905263770756876, 0.6246491789860469,
            0.6587719808964062, 0.6928947828067656, 0.727017584717125,
            0.7611403866274844, 0.7952631885378437, 0.8293859904482032,
            0.8635087923585625, 0.8976315942689219, 0.9317543961792812,
            0.9658771980896407, 1.0
        ]
        self.tL = [
            97.8498, 107.34432631578947, 116.83885263157894,
            126.33337894736842, 135.8279052631579, 145.32243157894737,
            154.81695789473684, 164.31148421052632, 173.8060105263158,
            183.30053684210526, 192.79506315789473, 202.2895894736842,
            211.78411578947367, 221.27864210526315, 230.77316842105262,
            240.2676947368421, 249.76222105263156, 259.25674736842103,
            268.7512736842105, 278.2458
        ]

        self.log10pL = [
            -1.673341131133972, -1.018305651048643, -0.4785759383792178,
            -0.027202888953684393, 0.35527132408368406, 0.6832307481166809,
            0.9674989884468345, 1.216340083470871, 1.4361458036374772,
            1.6319197765311875, 1.8076246141897894, 1.9664343888761047,
            2.110920781127441, 2.2431924714835683, 2.365001794575694,
            2.4778293749114297, 2.5829564100327183, 2.6815383175272447,
            2.7747245638133577, 2.8641514270323496
        ]
        self.log10viscL = [
            -2.111469665354645, -2.230222749139041, -2.337479354409211,
            -2.4328625043228658, -2.5175141489859465, -2.5930299104892574,
            -2.661068467611863, -2.723193897212939, -2.7808142956888893,
            -2.835167337781597, -2.8873317487794776, -2.938254810250441,
            -2.988792583909965, -3.0397663339402614, -3.092050367647488,
            -3.1467353143912673, -3.205498261068823, -3.271635245868653,
            -3.3541490057145755, -3.6047667207303604
        ]
        self.condL = [
            0.11674653428718658, 0.11243148901053093, 0.10808932250912168,
            0.10374739446667904, 0.09940289378680718, 0.09504527233238817,
            0.09066484784655873, 0.08625544072606327, 0.08184407460772634,
            0.0774056850449846, 0.0729420730588843, 0.06846471300412509,
            0.06398470816028613, 0.05951408092384452, 0.05506459912530319,
            0.050644851651085, 0.04625472010482058, 0.04188281266216134,
            0.03762096550870005, 0.047440227244870924
        ]
        self.cpL = [
            0.3999080995028288, 0.39986470953448705, 0.4008502574944795,
            0.4010769482749897, 0.40127055281667323, 0.40207033298933803,
            0.40386353148751775, 0.40690269800942785, 0.41141351700179396,
            0.4176753044727583, 0.42609497603705204, 0.43730236638460057,
            0.4523091587286386, 0.472817812896814, 0.5018983203782212,
            0.5456821927836282, 0.6184084972761777, 0.7620401329843498,
            1.1805659609626207, 39.9744418582123
        ]
        self.hvapL = [
            104.42143519895221, 102.67348214855879, 100.90149896055726,
            99.10428047868746, 97.2701105764984, 95.36860837467255,
            93.35827761148636, 91.19416524853438, 88.83171550394385,
            86.22701718799784, 83.33457575145738, 80.10337550638823,
            76.47124152467183, 72.35646703406533, 67.64383632237869,
            62.15780440952316, 55.602425219431055, 47.39682473308241,
            36.02892069023571, 0.0
        ]
        self.surfL = [
            0.00012949864440348668, 0.0001211798572405094,
            0.0001129658243110163, 0.00010486127620720714,
            9.68714647103584e-05, 8.900225865081874e-05, 8.126026548862478e-05,
            7.365298802437037e-05, 6.61890301652283e-05, 5.887837296304487e-05,
            5.1732754369674534e-05, 4.4766207589693324e-05,
            3.799585252845024e-05, 3.1443112946526816e-05,
            2.513569891519111e-05, 1.9111090523097977e-05,
            1.3423343414674658e-05, 8.158693814977866e-06,
            3.4830186527611792e-06, 0.0
        ]
        self.SG_liqL = [
            1.3060789653692286, 1.2836038721174605, 1.260092771706973,
            1.2361076760176366, 1.211755580407437, 1.1869849976411773,
            1.1616841989357605, 1.1357131691613582, 1.108910637103779,
            1.0810900819646374, 1.0520288217425533, 1.0214498465584976,
            0.9889926238523316, 0.9541639296526844, 0.9162483316524143,
            0.8741273278080032, 0.8258609834492318, 0.7675315006141954,
            0.6888052251690647, 0.43614416372475523
        ]
        self.log10SG_vapL = [
            -4.984718637591657, -4.369661407295961, -3.8662145910164427,
            -3.447786009065347, -3.0950973177466357, -2.7938286286079363,
            -2.533166226208821, -2.30483838965894, -2.1024387978938464,
            -1.920935197773639, -1.7563040880617609, -1.605251759001329,
            -1.4649911337785313, -1.333045882860113, -1.2070460553642963,
            -1.084450902099389, -0.9620367755386742, -0.834587658343251,
            -0.6897356663169578, -0.36036993467294526
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RefProp"
        data_srcD["T"] = "RefProp"  # degR
        data_srcD["P"] = "RefProp"  # psia
        data_srcD["Pvap"] = "RefProp"  # psia
        data_srcD["Pc"] = "RefProp"  # psia
        data_srcD["Tc"] = "RefProp"  # degR
        data_srcD["Zc"] = "RefProp"  # Z at critical pt
        data_srcD[
            "omega"] = "RefProp"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RefProp"  # SG
        data_srcD["visc"] = "RefProp"  # poise
        data_srcD["cond"] = "RefProp"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RefProp"  # degR
        data_srcD["Tfreeze"] = "RefProp"  # degR
        data_srcD["Ttriple"] = "RefProp"  # degR
        data_srcD["Cp"] = "CoolProp"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RefProp"  # g/gmole
        data_srcD["Hvap"] = "RefProp"  # BTU/lbm
        data_srcD["surf"] = "RefProp"  # lbf/in

        data_srcD["trL"] = "RefProp"
        data_srcD["tL"] = "RefProp"

        data_srcD["log10pL"] = "RefProp"
        data_srcD["log10viscL"] = "RefProp"
        data_srcD["condL"] = "RefProp"
        data_srcD["cpL"] = "RefProp"
        data_srcD["hvapL"] = "RefProp"
        data_srcD["surfL"] = "RefProp"
        data_srcD["SG_liqL"] = "RefProp"
        data_srcD["log10SG_vapL"] = "RefProp"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 8
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for N2O  (Dinitrogen Oxide, NitrousOxide). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (880.2154163609767 + psat)
                       )  # Fit Standard Deviation = 5.585070150619566e-06
        dsg_o_sgL.append(0.016655284302163644 * log10x +
                         0.015113129814281591 * log10x**2 +
                         0.01671363509253497 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (6940.958368522281 + psat)
                       )  # Fit Standard Deviation = 2.7892920848102335e-07
        dsg_o_sgL.append(0.1642041392386537 * log10x +
                         0.038655502210612584 * log10x**2 +
                         -0.008018867529841921 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5212.923491702651 + psat)
                       )  # Fit Standard Deviation = 5.231662167617468e-07
        dsg_o_sgL.append(0.16444796778586074 * log10x +
                         0.03906723346032002 * log10x**2 +
                         -0.008770652312788351 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3704.1348206583607 + psat)
                       )  # Fit Standard Deviation = 1.053132696313498e-06
        dsg_o_sgL.append(0.16365551800678563 * log10x +
                         0.039815711748955714 * log10x**2 +
                         -0.009477462938988712 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2392.4044731311988 + psat)
                       )  # Fit Standard Deviation = 2.38619320968346e-06
        dsg_o_sgL.append(0.1611222070272661 * log10x +
                         0.04104304688934062 * log10x**2 +
                         -0.010063321760446912 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1259.5435595038346 + psat)
                       )  # Fit Standard Deviation = 6.362161653844991e-06
        dsg_o_sgL.append(0.15538667515291557 * log10x +
                         0.04290389050001555 * log10x**2 +
                         -0.010366368069385791 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (294.87664066389266 + psat)
                       )  # Fit Standard Deviation = 1.986169922356495e-05
        dsg_o_sgL.append(0.1432675331853062 * log10x +
                         0.045439901911218154 * log10x**2 +
                         -0.010107116905703392 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (7.513626163952091e-08 + psat)
                       )  # Fit Standard Deviation = 0.0004890188457035044
        dsg_o_sgL.append(0.3128749390446353 * log10x +
                         -0.12251729690202048 * log10x**2 +
                         0.05085358866170666 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4.077241698382011e-07 + psat)
                       )  # Fit Standard Deviation = 0.04105812781926922
        dsg_o_sgL.append(2.6971637860324242 * log10x +
                         -4.67932236532584 * log10x**2 +
                         2.640471639851386 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 9
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, MHF3"""

        self.dataSrc = 'RocketProps'
        self.T = 527.67  # degR
        self.P = 14.6959  # psia
        self.Pvap = 0.7493486372133038  # psia
        self.Pc = 1373  # psia
        self.Tc = 1076.67  # degR
        self.Zc = 0.27370789973182236  # Z at critical pt
        self.omega = 0.2522409042478171  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 0.8948129886444842  # SG
        self.visc = 0.00941388813416724  # poise
        self.cond = 0.16074004753960566  # BTU/hr/ft/delF
        self.Tnbp = 653.07  # degR
        self.Tfreeze = 394.67  # degR
        self.Ttriple = 394.67  # degR
        self.Cp = 0.7176629642526471  # BTU/lbm/delF
        self.MolWt = 43.412  # g/gmole
        self.Hvap = 370.00018121582707  # BTU/lbm
        self.surf = 0.00020386476428192377  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 21
        self.trL = [
            0.36656542859000435, 0.3982371571605041, 0.42990888573100394,
            0.4615806143015037, 0.4932523428720035, 0.5249240714425032,
            0.556595800013003, 0.5882675285835028, 0.6199392571540026,
            0.6516109857245024, 0.6832827142950022, 0.7149544428655019,
            0.7466261714360017, 0.7782979000065016, 0.8099696285770013,
            0.8416413571475011, 0.8733130857180009, 0.9049848142885006,
            0.9366565428590004, 0.9683282714295003, 1.0
        ]
        self.tL = [
            394.67, 428.77, 462.87000000000006, 496.97, 531.07, 565.17, 599.27,
            633.37, 667.47, 701.57, 735.6700000000001, 769.77, 803.87,
            837.9700000000001, 872.07, 906.1700000000001, 940.2700000000001,
            974.37, 1008.47, 1042.5700000000002, 1076.67
        ]

        self.log10pL = [
            -2.3536302384781065, -1.6585005082248108, -1.0597964688187924,
            -0.5390283494544632, -0.08234509031776199, 0.32085746189117065,
            0.6788528883214686, 0.998204168790244, 1.2841931598422436,
            1.5411242348354752, 1.7725426918070812, 1.9813940288612057,
            2.170141140238441, 2.340850607731237, 2.49525516553194,
            2.6347960905864887, 2.760645552168551, 2.873702313609776,
            2.9745355776238855, 3.0631709869746855, 3.137670537236755
        ]
        self.log10viscL = [
            -0.5566843404790347, -1.2915949634370973, -1.6538301892025917,
            -1.8718474180777849, -2.041492720200839, -2.1784114884962866,
            -2.2962061668646667, -2.3974218663987785, -2.491765232953522,
            -2.5846007789536354, -2.6751296508328646, -2.760595416760874,
            -2.841807652187691, -2.9191693423699467, -2.99302965602023,
            -3.0636913287159326, -3.1314204437344024, -3.196450304470829,
            -3.2589881925752806, -3.3192178133578407, -3.3773036621600885
        ]
        self.condL = [
            0.17528459370877955, 0.17194953012081146, 0.16850038479042675,
            0.16461490190458106, 0.16028982829138788, 0.15552505617896736,
            0.14912476778416062, 0.14407278608183519, 0.13854470465277569,
            0.13205030344699653, 0.12548830092926744, 0.118818708774929,
            0.11201172556534375, 0.10503076218415859, 0.09782477393924792,
            0.09031895914913379, 0.08239626661110779, 0.07385503545608221,
            0.06427698549523214, 0.06520506387461866, 0.07466492338290213
        ]
        self.cpL = [
            0.6932399135238326, 0.697032018563982, 0.7040702538961863,
            0.7111805126795013, 0.7184403606767857, 0.727138037798523,
            0.7388038854812384, 0.7542818143596177, 0.7684247082753282,
            0.7837535278887428, 0.8004572457290187, 0.8188670337821706,
            0.8395288626937414, 0.863341893635176, 0.8918373408247865,
            0.9277915782643477, 0.9767526951963058, 1.0515962942662314,
            1.1906566064893118, 1.5841700765290057, 24.853651103540983
        ]
        self.hvapL = [
            401.94652820523237, 394.14879100718, 386.09533745902155,
            377.762781042564, 369.1240620998886, 360.14759904135514,
            350.7961719520985, 341.0254283683915, 330.78184323530604,
            319.99986943053216, 308.59785098790576, 296.47197669890005,
            283.4869965935696, 269.46131184269984, 254.14165059545036,
            237.1568673951032, 217.92524765813326, 195.44191439843348,
            167.6799689715828, 129.13365933468006, 0.0
        ]
        self.surfL = [
            0.00024399760691236385, 0.00023505435132472458,
            0.0002243815174316999, 0.00021362500565832952,
            0.0002027791842237302, 0.00019183764804854016,
            0.00018079306728265102, 0.0001696370132322921,
            0.00015835959765360082, 0.00014694924981470807,
            0.00013539198284220427, 0.00012367097854209527,
            0.0001117650983063049, 9.964781707232982e-05,
            8.728386167308722e-05, 7.462573300615587e-05,
            6.160402775776805e-05, 4.811194854558135e-05,
            3.395870389385227e-05, 1.8727002496563563e-05,
            2.041903151468603e-08
        ]
        self.SG_liqL = [
            0.9594020982020899, 0.9433469619887201, 0.9269635551414349,
            0.9102214943646774, 0.893085640099638, 0.8755149991004092,
            0.8574612811188177, 0.8388669671484125, 0.8196626719040259,
            0.7997634593479678, 0.7790635571718194, 0.7574285341502258,
            0.7346832833218557, 0.7105927081221362, 0.6848288856473294,
            0.656911076147374, 0.6260851195404782, 0.5910460258199831,
            0.5491529338601719, 0.4931810174796308, 0.3019710076154732
        ]
        self.log10SG_vapL = [
            -6.138130847629917, -5.478862315602451, -4.913090199355217,
            -4.422551435938386, -3.9934438865407027, -3.615033723623284,
            -3.2787469649473895, -2.977570738922501, -2.705656701456016,
            -2.4580557974490853, -2.2305365722489645, -2.019455845064008,
            -1.8216636424893284, -1.6344352751522389, -1.4554342230310722,
            -1.282723985889619, -1.1148737359552856, -0.9512614331614736,
            -0.792823798998496, -0.6439542414824684, -0.5200347518674954
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RocketProps"
        data_srcD["T"] = "RocketProps"  # degR
        data_srcD["P"] = "RocketProps"  # psia
        data_srcD["Pvap"] = "RocketProps"  # psia
        data_srcD["Pc"] = "RocketProps"  # psia
        data_srcD["Tc"] = "RocketProps"  # degR
        data_srcD["Zc"] = "RocketProps"  # Z at critical pt
        data_srcD[
            "omega"] = "RocketProps"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RocketProps"  # SG
        data_srcD["visc"] = "RocketProps"  # poise
        data_srcD["cond"] = "RocketProps"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RocketProps"  # degR
        data_srcD["Tfreeze"] = "RocketProps"  # degR
        data_srcD["Ttriple"] = "RocketProps"  # degR
        data_srcD["Cp"] = "RocketProps"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RocketProps"  # g/gmole
        data_srcD["Hvap"] = "RocketProps"  # BTU/lbm
        data_srcD["surf"] = "RocketProps"  # lbf/in

        data_srcD["trL"] = "RocketProps"
        data_srcD["tL"] = "RocketProps"

        data_srcD["log10pL"] = "RocketProps"
        data_srcD["log10viscL"] = "RocketProps"
        data_srcD["condL"] = "RocketProps"
        data_srcD["cpL"] = "RocketProps"
        data_srcD["hvapL"] = "RocketProps"
        data_srcD["surfL"] = "RocketProps"
        data_srcD["SG_liqL"] = "RocketProps"
        data_srcD["log10SG_vapL"] = "RocketProps"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 10
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for Ethanol  (C2H6O). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9,
            0.95, 1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.35)  # saturation pressure at Tr=0.35
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (6716.9084776444615 + psat)
                       )  # Fit Standard Deviation = 6.754122768654532e-08
        dsg_o_sgL.append(0.05685195731369135 * log10x +
                         0.050750720270686556 * log10x**2 +
                         0.022718619050779532 * log10x**3)

        psat = self.PvapAtTr(0.4)  # saturation pressure at Tr=0.4
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3337.8766756666514 + psat)
                       )  # Fit Standard Deviation = 2.7605661701663134e-07
        dsg_o_sgL.append(0.0336388914607049 * log10x +
                         0.032437639185754166 * log10x**2 +
                         0.019440445350163257 * log10x**3)

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2174.803798135084 + psat)
                       )  # Fit Standard Deviation = 7.874965453614401e-07
        dsg_o_sgL.append(0.02592002322579428 * log10x +
                         0.025335974155103597 * log10x**2 +
                         0.017796940591427977 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1520.6162373238344 + psat)
                       )  # Fit Standard Deviation = 1.7363504697431384e-06
        dsg_o_sgL.append(0.021364448690808155 * log10x +
                         0.02070280082754 * log10x**2 +
                         0.01700110816084074 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1088.4955499867824 + psat)
                       )  # Fit Standard Deviation = 3.5469367564177814e-06
        dsg_o_sgL.append(0.018138567625080027 * log10x +
                         0.017067014190050755 * log10x**2 +
                         0.016529659517177137 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (759.0144976029792 + psat)
                       )  # Fit Standard Deviation = 7.033779098241361e-06
        dsg_o_sgL.append(0.015317724535069126 * log10x +
                         0.013439803889556732 * log10x**2 +
                         0.01616216263390056 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (495.3561207579135 + psat)
                       )  # Fit Standard Deviation = 1.40799175203111e-05
        dsg_o_sgL.append(0.012659513677177202 * log10x +
                         0.009406476615758396 * log10x**2 +
                         0.015768432289839956 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (281.96816482020256 + psat)
                       )  # Fit Standard Deviation = 2.8933669074538373e-05
        dsg_o_sgL.append(0.010177039546444847 * log10x +
                         0.004660155161066048 * log10x**2 +
                         0.0152472451495923 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4038.2634629559325 + psat)
                       )  # Fit Standard Deviation = 3.237127033069103e-07
        dsg_o_sgL.append(0.16225494232540924 * log10x +
                         0.03815355436212424 * log10x**2 +
                         -0.009841182106666643 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2841.6891496878966 + psat)
                       )  # Fit Standard Deviation = 7.929121454707049e-07
        dsg_o_sgL.append(0.16221234599011614 * log10x +
                         0.03905799399215637 * log10x**2 +
                         -0.01084265816194678 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1706.3152631460016 + psat)
                       )  # Fit Standard Deviation = 2.4344710361886877e-06
        dsg_o_sgL.append(0.1587461070574572 * log10x +
                         0.040876988199883314 * log10x**2 +
                         -0.011408627923251225 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (661.3283555015076 + psat)
                       )  # Fit Standard Deviation = 8.462028160039289e-06
        dsg_o_sgL.append(0.1490240844714985 * log10x +
                         0.043712185008529025 * log10x**2 +
                         -0.011367120217619441 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1.711228203578035e-06 + psat)
                       )  # Fit Standard Deviation = 0.00012990817434083986
        dsg_o_sgL.append(0.2131462428955479 * log10x +
                         -0.014290539004323 * log10x**2 +
                         0.006480702467154469 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2.95999575302026e-08 + psat)
                       )  # Fit Standard Deviation = 0.04220889947135327
        dsg_o_sgL.append(2.6659848974693507 * log10x +
                         -4.330179836514001 * log10x**2 +
                         2.2786363053116867 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 11
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, MON30"""

        self.dataSrc = 'RocketProps'
        self.T = 527.7  # degR
        self.P = 86.34441183625188  # psia
        self.Pvap = 86.34441183625188  # psia
        self.Pc = 2142.5245822424185  # psia
        self.Tc = 721.0  # degR
        self.Zc = 0.5220141197964717  # Z at critical pt
        self.omega = 0.6411706852345824  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 1.3813202531514739  # SG
        self.visc = 0.004851065341953962  # poise
        self.cond = 0.12819468114844268  # BTU/hr/ft/delF
        self.Tnbp = 462.6700000000002  # degR
        self.Tfreeze = 345.87000000000023  # degR
        self.Ttriple = 345.87000000000023  # degR
        self.Cp = 0.47075109219072686  # BTU/lbm/delF
        self.MolWt = 79.32133165547617  # g/gmole
        self.Hvap = 149.72811268063035  # BTU/lbm
        self.surf = 0.00022268698896467574  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 21
        self.trL = [
            0.47970873786407797, 0.505723300970874, 0.5317378640776702,
            0.5577524271844663, 0.5837669902912623, 0.6097815533980585,
            0.6357961165048546, 0.6618106796116507, 0.6878252427184468,
            0.7138398058252429, 0.7398543689320389, 0.7658689320388351,
            0.7918834951456312, 0.8178980582524273, 0.8439126213592234,
            0.8699271844660195, 0.8959417475728155, 0.9219563106796117,
            0.9479708737864078, 0.9739854368932039, 1.0
        ]
        self.tL = [
            345.87000000000023, 364.6265000000002, 383.3830000000002,
            402.13950000000017, 420.89600000000013, 439.6525000000002,
            458.40900000000016, 477.1655000000002, 495.92200000000014,
            514.6785000000001, 533.4350000000001, 552.1915000000001,
            570.9480000000001, 589.7045000000002, 608.4610000000001,
            627.2175000000001, 645.974, 664.7305, 683.487, 702.2435, 721.0
        ]

        self.log10pL = [
            -1.0740267015837957, -0.6019099362464798, -0.18256826020299288,
            0.19209039057074156, 0.5286488521695581, 0.832506278224053,
            1.1081237631224548, 1.3592120327017876, 1.5888765377775134,
            1.7997308135286876, 1.993985909757506, 2.173521572217568,
            2.3399433555088898, 2.4946287715737374, 2.638764787335171,
            2.773378378526653, 2.8993613262130062, 3.017489842773828,
            3.1284384031691648, 3.2327823646622704, 3.3309258134988484
        ]
        self.log10viscL = [
            -1.5916350547649434, -1.6827826809035984, -1.7691078473695405,
            -1.8510957867585587, -1.9291609555361358, -2.003662273207911,
            -2.074910391748643, -2.143178081266847, -2.2087043082032656,
            -2.2731836885416916, -2.331820947492808, -2.389245327879379,
            -2.4460825856690223, -2.5030220068408093, -2.560863090780951,
            -2.62059532722868, -2.6835431093462017, -2.7516431911948604,
            -2.8197432730435184, -2.887843354892177, -2.9559434367408355
        ]
        self.condL = [
            0.14722186071778695, 0.14525913018051365, 0.14329639964324034,
            0.141333669105967, 0.13937093856869368, 0.13740820803142037,
            0.13544547749414707, 0.1334827469568738, 0.13152001641960046,
            0.12955728588232712, 0.12759455534505384, 0.12563182480778048,
            0.12366909427050722, 0.12170636373323386, 0.11974363319596056,
            0.11778090265868725, 0.11581817212141393, 0.11385544158414065,
            0.11189271104686732, 0.10992998050959399, 0.10796724997232068
        ]
        self.cpL = [
            0.44947337608768384, 0.4479490485280091, 0.44743705505363185,
            0.4478190011467268, 0.44901188546215276, 0.45096489134549067,
            0.453658746392956, 0.4571078591588523, 0.46136596219108145,
            0.46653679674878507, 0.47279280398241547, 0.48040756510053706,
            0.48981356105799717, 0.5017100536264966, 0.5172788155876517,
            0.5386572822845754, 0.5701162140150757, 0.621575792088477,
            0.72260910769644, 1.0201840998726743, 15.69790988106092
        ]
        self.hvapL = [
            195.48949985020565, 191.48977299388986, 187.3636877267264,
            183.09984818129342, 178.68508418034173, 174.10404386061543,
            169.3386585249141, 164.36742732170867, 159.16444199911464,
            153.6980267578219, 147.92879066713, 141.80675128655932,
            135.26692685098752, 128.22227205242416, 120.55170841350748,
            112.07834663964141, 102.52593094380711, 91.41932757630343,
            77.80557969360716, 59.117703717723735, 0.0
        ]
        self.surfL = [
            0.0005007669324131924, 0.0004703367764885092,
            0.00044026060008029117, 0.0004105536197370731,
            0.0003812326356001904, 0.000352316305119621, 0.0003238254854371492,
            0.00029578366779499826, 0.0002682175376844743,
            0.00024115771064716875, 0.00021463971981150042,
            0.00018870537515305633, 0.0001634046914677408,
            0.0001387987244427357, 0.00011496393513784139,
            9.199930414483907e-05, 7.003884426534181e-05,
            4.9276070821012826e-05, 3.002018890622394e-05,
            1.2867313151986454e-05, 0.0
        ]
        self.SG_liqL = [
            1.569288214554281, 1.5522601717340458, 1.5347827136081926,
            1.5168259255969663, 1.4983566018802357, 1.4793377280531748,
            1.4597278558838422, 1.439480341608653, 1.4185424098782948,
            1.3968539924657555, 1.374346272441854, 1.350939838026982,
            1.3265423114778376, 1.301045260235205, 1.2743201085787959,
            1.2462126283332593, 1.2165353614423775, 1.1850569503711326,
            1.1514866989759769, 1.1154515031290357, 1.076460033129462
        ]
        self.log10SG_vapL = [
            -4.539306501912008, -4.089893807775316, -3.6919013528636837,
            -3.337227485715143, -3.0192284422910087, -2.732397171551507,
            -2.472124795123362, -2.2345217770139945, -2.0162821826859356,
            -1.8145789338062417, -1.6269813504245376, -1.4513888251372629,
            -1.2859763652247251, -1.1291491009555203, -0.9795038230242835,
            -0.8357963259399962, -0.696913991556343, -0.5618540326523406,
            -0.42971038455255683, -0.29968308392814375, -0.17124684400807227
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RocketProps"
        data_srcD["T"] = "RocketProps"  # degR
        data_srcD["P"] = "RocketProps"  # psia
        data_srcD["Pvap"] = "RocketProps"  # psia
        data_srcD["Pc"] = "RocketProps"  # psia
        data_srcD["Tc"] = "RocketProps"  # degR
        data_srcD["Zc"] = "RocketProps"  # Z at critical pt
        data_srcD[
            "omega"] = "RocketProps"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RocketProps"  # SG
        data_srcD["visc"] = "RocketProps"  # poise
        data_srcD["cond"] = "RocketProps"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RocketProps"  # degR
        data_srcD["Tfreeze"] = "RocketProps"  # degR
        data_srcD["Ttriple"] = "RocketProps"  # degR
        data_srcD["Cp"] = "RocketProps"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RocketProps"  # g/gmole
        data_srcD["Hvap"] = "RocketProps"  # BTU/lbm
        data_srcD["surf"] = "RocketProps"  # lbf/in

        data_srcD["trL"] = "RocketProps"
        data_srcD["tL"] = "RocketProps"

        data_srcD["log10pL"] = "RocketProps"
        data_srcD["log10viscL"] = "RocketProps"
        data_srcD["condL"] = "RocketProps"
        data_srcD["cpL"] = "RocketProps"
        data_srcD["hvapL"] = "RocketProps"
        data_srcD["surfL"] = "RocketProps"
        data_srcD["SG_liqL"] = "RocketProps"
        data_srcD["log10SG_vapL"] = "RocketProps"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 12
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, Ethanol"""

        self.dataSrc = 'RefProp'
        self.T = 527.67  # degR
        self.P = 0.859280396363  # psia
        self.Pvap = 0.859280396363  # psia
        self.Pc = 891.6917796  # psia
        self.Tc = 925.02  # degR
        self.Zc = 0.240228835494  # Z at critical pt
        self.omega = 0.6441084599084665  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 0.789590003732  # SG
        self.visc = 0.0119518602784  # poise
        self.cond = 0.0961559585666  # BTU/hr/ft/delF
        self.Tnbp = 632.502  # degR
        self.Tfreeze = 286.29  # degR
        self.Ttriple = 286.2  # degR
        self.Cp = 0.600415436505  # BTU/lbm/delF
        self.MolWt = 46.06844  # g/gmole
        self.Hvap = 398.635729849  # BTU/lbm
        self.surf = 0.000127987775828  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 20
        self.trL = [
            0.48678947482216606, 0.5138005550946836, 0.5408116353672012,
            0.5678227156397188, 0.5948337959122364, 0.6218448761847539,
            0.6488559564572715, 0.6758670367297891, 0.7028781170023066,
            0.7298891972748242, 0.7569002775473418, 0.7839113578198594,
            0.810922438092377, 0.8379335183648946, 0.8649445986374121,
            0.8919556789099296, 0.9189667591824472, 0.9459778394549648,
            0.9729889197274824, 1.0
        ]
        self.tL = [
            450.29, 475.2757894736842, 500.26157894736843, 525.2473684210527,
            550.2331578947369, 575.218947368421, 600.2047368421053,
            625.1905263157895, 650.1763157894736, 675.1621052631579,
            700.1478947368421, 725.1336842105263, 750.1194736842106,
            775.1052631578948, 800.0910526315789, 825.076842105263,
            850.0626315789473, 875.0484210526315, 900.0342105263157, 925.02
        ]

        self.log10pL = [
            -1.401087700193988, -0.9178912291521807, -0.4869492655722022,
            -0.10110645598090445, 0.24554860377516544, 0.5580011408259609,
            0.840514496522542, 1.0967651418700168, 1.3299363911974271,
            1.5427880523004585, 1.7377120573406577, 1.9167794962974611,
            2.0817817821861304, 2.2342673493215677, 2.375574880190049,
            2.5068643614787898, 2.629148498444035, 2.7433304429199343,
            2.8502670105147385, 2.9502147630508158
        ]
        self.log10viscL = [
            -1.5047208970599042, -1.6514843160731318, -1.7863842644796888,
            -1.9109826784373027, -2.0265350296428832, -2.13410891565285,
            -2.2346612236214076, -2.329083530209076, -2.418224244263965,
            -2.5028956347308373, -2.5838736885715488, -2.6618986957182447,
            -2.737685193016377, -2.811953030260887, -2.885500959341479,
            -2.959373033124009, -3.0352649388161153, -3.11671731616373,
            -3.2139411701750054, -3.511522997375527
        ]
        self.condL = [
            0.10295228112506566, 0.10051841789233044, 0.09834265855391512,
            0.09634298647447403, 0.09445628008026882, 0.09263688764188444,
            0.09085325597142939, 0.08908478458349274, 0.08731929670576852,
            0.08555115772857026, 0.08377999118192843, 0.08200999585107609,
            0.08025005668347653, 0.07851529824488465, 0.07683190811585959,
            0.07525064083582626, 0.07388776185427595, 0.07306856738956324,
            0.0737808612033847, 0.08752147808355934
        ]
        self.cpL = [
            0.485978261932733, 0.5177757514284722, 0.5558391800678898,
            0.596439584257601, 0.6372616227158867, 0.6769933037229069,
            0.7149986568057448, 0.7510927572417216, 0.7843565390397178,
            0.8176118653848417, 0.850394114413171, 0.8825753584244883,
            0.916179948523236, 0.9502651245514139, 0.9974939075395666,
            1.0555067630512822, 1.1423890113918245, 1.3015943579777618,
            1.7351676611911142, 10.734672762393409
        ]
        self.hvapL = [
            412.6185136579695, 408.88203148367, 404.45193054529915,
            399.1929420685968, 393.026326175303, 385.8985676930854,
            377.7617940221355, 368.56294996522763, 358.23815209517375,
            346.7090483513246, 333.87875004407323, 319.6254096453961,
            303.79131012634144, 286.1638202530751, 266.4402998925415,
            244.1572726698435, 218.526916731523, 187.97448382751907,
            148.28203223948844, 0.0
        ]
        self.surfL = [
            0.0001601522525834626, 0.00014960526258306998,
            0.00013920959027455187, 0.00012897177960645198,
            0.00011889908178151342, 0.00010899958370285987,
            9.928237055393625e-05, 8.975773490134745e-05,
            8.043745061431876e-05, 7.133513940816689e-05,
            6.246677373301538e-05, 5.385138754826308e-05,
            4.5512117786489784e-05, 3.747780004568466e-05,
            2.9785556575249417e-05, 2.2485321593004948e-05,
            1.5648629032451656e-05, 9.388610213390157e-06,
            3.920157484711962e-06, 0.0
        ]
        self.SG_liqL = [
            0.8250123608410154, 0.8135474853603035, 0.8021822275393701,
            0.7907142628978503, 0.778964437074446, 0.7667757955909226,
            0.7540083920378612, 0.7405327352868347, 0.7262226707371285,
            0.7109474320551499, 0.6945618591420409, 0.6768929076730881,
            0.6577190663007355, 0.6367361370605923, 0.6134953285939753,
            0.587279200008803, 0.5568149059345211, 0.519452795969785,
            0.46784871547051216, 0.2759963529269803
        ]
        self.log10SG_vapL = [
            -5.217059566841733, -4.757101288293936, -4.347988145677314,
            -3.982551298536135, -3.6548099770463134, -3.3596627849725347,
            -3.092696254243818, -2.850062885764845, -2.6283969011932835,
            -2.424747726922287, -2.2365195866183973, -2.061410365364967,
            -1.8973439816635962, -1.7423872625214147, -1.5946318194970532,
            -1.4519926963007015, -1.3117864922168945, -1.1696014939911799,
            -1.014887294050611, -0.5590966567541754
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RefProp"
        data_srcD["T"] = "RefProp"  # degR
        data_srcD["P"] = "RefProp"  # psia
        data_srcD["Pvap"] = "RefProp"  # psia
        data_srcD["Pc"] = "RefProp"  # psia
        data_srcD["Tc"] = "RefProp"  # degR
        data_srcD["Zc"] = "RefProp"  # Z at critical pt
        data_srcD[
            "omega"] = "RefProp"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RefProp"  # SG
        data_srcD["visc"] = "RefProp"  # poise
        data_srcD["cond"] = "RefProp"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RefProp"  # degR
        data_srcD["Tfreeze"] = "RefProp"  # degR
        data_srcD["Ttriple"] = "RefProp"  # degR
        data_srcD["Cp"] = "RefProp"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RefProp"  # g/gmole
        data_srcD["Hvap"] = "RefProp"  # BTU/lbm
        data_srcD["surf"] = "RefProp"  # lbf/in

        data_srcD["trL"] = "RefProp"
        data_srcD["tL"] = "RefProp"

        data_srcD["log10pL"] = "RefProp"
        data_srcD["log10viscL"] = "RefProp"
        data_srcD["condL"] = "RefProp"
        data_srcD["cpL"] = "RefProp"
        data_srcD["hvapL"] = "RefProp"
        data_srcD["surfL"] = "RefProp"
        data_srcD["SG_liqL"] = "RefProp"
        data_srcD["log10SG_vapL"] = "RefProp"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 13
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for NH3  (Ammonia). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5252.722609769466 + psat)
                       )  # Fit Standard Deviation = 1.0060591140468756e-07
        dsg_o_sgL.append(0.03955024781090233 * log10x +
                         0.03841900363177283 * log10x**2 +
                         0.022733169326533433 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3699.338649125036 + psat)
                       )  # Fit Standard Deviation = 2.575464755722122e-07
        dsg_o_sgL.append(0.035417470267759404 * log10x +
                         0.03451853242582196 * log10x**2 +
                         0.021696457571681073 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2568.34452368028 + psat)
                       )  # Fit Standard Deviation = 6.381842229711579e-07
        dsg_o_sgL.append(0.03126974890307171 * log10x +
                         0.030548098142950127 * log10x**2 +
                         0.020943063472069215 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (11023.427975836727 + psat)
                       )  # Fit Standard Deviation = 3.223070789814432e-07
        dsg_o_sgL.append(0.17083847023929066 * log10x +
                         0.05234552332521625 * log10x**2 +
                         -0.00016140267657862908 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (8013.20108871707 + psat)
                       )  # Fit Standard Deviation = 5.80537351011035e-07
        dsg_o_sgL.append(0.16404692571669116 * log10x +
                         0.05112375912269118 * log10x**2 +
                         -0.0001510833371681649 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5529.756820835035 + psat)
                       )  # Fit Standard Deviation = 1.1015989006083535e-06
        dsg_o_sgL.append(0.15757930003880885 * log10x +
                         0.04944912274596679 * log10x**2 +
                         -0.0007002548242401284 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3458.1587714116017 + psat)
                       )  # Fit Standard Deviation = 2.207970494977422e-06
        dsg_o_sgL.append(0.15096615932535035 * log10x +
                         0.04751238124431654 * log10x**2 +
                         -0.0017379888803756194 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1734.2647126892991 + psat)
                       )  # Fit Standard Deviation = 4.610654751817515e-06
        dsg_o_sgL.append(0.14363909991873663 * log10x +
                         0.045697164705484815 * log10x**2 +
                         -0.0032817099721452426 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (321.9813487004404 + psat)
                       )  # Fit Standard Deviation = 9.59383673184999e-06
        dsg_o_sgL.append(0.13427847151966282 * log10x +
                         0.04476939260186801 * log10x**2 +
                         -0.005318843288404176 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1.3492304727740898e-05 + psat)
                       )  # Fit Standard Deviation = 0.0004980169388843503
        dsg_o_sgL.append(0.35746238120735674 * log10x +
                         -0.19730558987435537 * log10x**2 +
                         0.09686252402959622 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3.167366164032964e-07 + psat)
                       )  # Fit Standard Deviation = 0.050554171087399576
        dsg_o_sgL.append(3.6330583412824033 * log10x +
                         -7.926411876008353 * log10x**2 +
                         5.518271069017113 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 14
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, Ammonia"""

        self.dataSrc = 'RefProp'
        self.T = 431.6814  # degR
        self.P = 14.6959  # psia
        self.Pvap = 14.6955372969  # psia
        self.Pc = 1643.7122541  # psia
        self.Tc = 729.72  # degR
        self.Zc = 0.254547225787  # Z at critical pt
        self.omega = 0.25601362767424973  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 0.681972543378  # SG
        self.visc = 0.00255483891753  # poise
        self.cond = 0.38488260463  # BTU/hr/ft/delF
        self.Tnbp = 431.6814  # degR
        self.Tfreeze = 351.891  # degR
        self.Ttriple = 351.891  # degR
        self.Cp = 1.06306557784  # BTU/lbm/delF
        self.MolWt = 17.03026  # g/gmole
        self.Hvap = 589.172863882  # BTU/lbm
        self.surf = 0.000255547117299  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 20
        self.trL = [
            0.4822274296990627, 0.5094786176096383, 0.536729805520214,
            0.5639809934307897, 0.5912321813413652, 0.6184833692519409,
            0.6457345571625166, 0.6729857450730922, 0.7002369329836678,
            0.7274881208942436, 0.7547393088048191, 0.7819904967153949,
            0.8092416846259706, 0.8364928725365461, 0.8637440604471216,
            0.8909952483576975, 0.9182464362682731, 0.9454976241788486,
            0.9727488120894244, 1.0
        ]
        self.tL = [
            351.891, 371.77673684210527, 391.66247368421057, 411.5482105263158,
            431.43394736842106, 451.31968421052636, 471.2054210526316,
            491.09115789473685, 510.97689473684215, 530.8626315789475,
            550.7483684210526, 570.634105263158, 590.5198421052633,
            610.4055789473684, 630.2913157894736, 650.177052631579,
            670.0627894736842, 689.9485263157894, 709.8342631578948, 729.72
        ]

        self.log10pL = [
            -0.05381458886880206, 0.3064605763259402, 0.6255074271296022,
            0.909682763236478, 1.1641864493415108, 1.3933100206406897,
            1.600619894073728, 1.7890968205631343, 1.961244970981564,
            2.1191790176711374, 2.264694638747961, 2.399326209576734,
            2.5243945284816443, 2.6410469739290354, 2.7502924491538785,
            2.8530340689456057, 2.9501046701255738, 3.042316830945455,
            3.1305624151410907, 3.2160687707730786
        ]
        self.log10viscL = [
            -2.2521475542297074, -2.352908529169169, -2.442021401291909,
            -2.521121054826769, -2.59180342403545, -2.655585094028812,
            -2.7138471709886955, -2.7677988113778165, -2.818469104914135,
            -2.8667226511423602, -2.913290938081187, -2.9588136876996294,
            -3.0038885276222813, -3.049132902448691, -3.0952710732631754,
            -3.1432797638038394, -3.194693273736083, -3.2524708112409275,
            -3.324940672011833, -3.5680697451747507
        ]
        self.condL = [
            0.47352165425056825, 0.4510574752026766, 0.4287334497475356,
            0.40671690662191917, 0.38514773059849766, 0.36412254299592084,
            0.3436954155095086, 0.32388460108278766, 0.3046802829159328,
            0.28605129744209135, 0.26795014270852757, 0.250316057468931,
            0.23307598498602128, 0.21614310695203626, 0.19941262902620865,
            0.1827550985320198, 0.16601029183305838, 0.14900262852756446,
            0.1318849463073428, 0.17091071907731123
        ]
        self.cpL = [
            1.0043608293091513, 1.0192687448873325, 1.0345621890929355,
            1.0491887817115357, 1.0628999082834947, 1.0759867626832256,
            1.089065303797449, 1.1029535425181, 1.1186336198290927,
            1.1372864919569932, 1.1604010037798371, 1.1899852786366532,
            1.2289572401527582, 1.2819016903304377, 1.3566811129511132,
            1.468365966386273, 1.6509884875843546, 2.005924484173869,
            3.0641573632380874, 81.85567348239823
        ]
        self.hvapL = [
            638.5948034012747, 627.3191863460634, 615.404216679329,
            602.7702798939755, 589.3452159124756, 575.0538487434458,
            559.8114065878315, 543.5187065296889, 526.0569461124499,
            507.28039261185484, 487.00542718200575, 464.9939262809358,
            440.9274781143907, 414.3655538485129, 384.6729489909846,
            350.8815112393444, 311.38762410140083, 263.12646317525713,
            198.19083145960178, 0.0
        ]
        self.surfL = [
            0.00035550987396459167, 0.0003295508872986226,
            0.0003042817013189555, 0.0002797087812682051,
            0.00025583966866075903, 0.00023268319528594697,
            0.0002102497563779353, 0.00018855166491079896,
            0.00016760361959325688, 0.0001474233363076754,
            0.00012803242156848296, 0.0001094576171665837,
            9.17326387487608e-05, 7.49010156822168e-05, 5.9020734203588606e-05,
            4.4172422145395724e-05, 3.0475372485965522e-05,
            1.812430968682644e-05, 7.500968674669963e-06, 0.0
        ]
        self.SG_liqL = [
            0.7329042288061083, 0.7210032741531567, 0.7085505182084572,
            0.6955855037892353, 0.6821427339566717, 0.6682397997704058,
            0.65387264391951, 0.6390135970331171, 0.6236096770380921,
            0.6075795988419361, 0.590808213235135, 0.573136793293114,
            0.554346596926947, 0.5341309186184889, 0.5120457900037902,
            0.48741628228342665, 0.459132126911124, 0.4250732542859667,
            0.3795509075914059, 0.2250006571867121
        ]
        self.log10SG_vapL = [
            -4.19318538788404, -3.855409696062982, -3.5569642605423155,
            -3.2914589044181977, -3.0536449236553183, -2.8391729535260146,
            -2.6444116942671134, -2.4663056868275954, -2.30225885744369,
            -2.1500354088240985, -2.0076718189386558, -1.8733938700965964,
            -1.7455307669919646, -1.6224132803320472, -1.5022302948142061,
            -1.3827848000499834, -1.2609868841308849, -1.1315099616822726,
            -0.9814851457177797, -0.6478162133902116
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RefProp"
        data_srcD["T"] = "RefProp"  # degR
        data_srcD["P"] = "RefProp"  # psia
        data_srcD["Pvap"] = "RefProp"  # psia
        data_srcD["Pc"] = "RefProp"  # psia
        data_srcD["Tc"] = "RefProp"  # degR
        data_srcD["Zc"] = "RefProp"  # Z at critical pt
        data_srcD[
            "omega"] = "RefProp"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RefProp"  # SG
        data_srcD["visc"] = "RefProp"  # poise
        data_srcD["cond"] = "RefProp"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RefProp"  # degR
        data_srcD["Tfreeze"] = "RefProp"  # degR
        data_srcD["Ttriple"] = "RefProp"  # degR
        data_srcD["Cp"] = "RefProp"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RefProp"  # g/gmole
        data_srcD["Hvap"] = "RefProp"  # BTU/lbm
        data_srcD["surf"] = "RefProp"  # lbf/in

        data_srcD["trL"] = "RefProp"
        data_srcD["tL"] = "RefProp"

        data_srcD["log10pL"] = "RefProp"
        data_srcD["log10viscL"] = "RefProp"
        data_srcD["condL"] = "RefProp"
        data_srcD["cpL"] = "RefProp"
        data_srcD["hvapL"] = "RefProp"
        data_srcD["surfL"] = "RefProp"
        data_srcD["SG_liqL"] = "RefProp"
        data_srcD["log10SG_vapL"] = "RefProp"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 15
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, UDMH"""
        
        self.dataSrc = 'RocketProps'        
        self.T       = 527.67 # degR
        self.P       = 14.6959 # psia
        self.Pvap    = 2.5749567850999577 # psia
        self.Pc      = 867 # psia
        self.Tc      = 941.6700000000001 # degR
        self.Zc      = 0.29851217871530905 # Z at critical pt
        self.omega   = 0.3499236187886665 # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG      = 0.7904440144318352 # SG
        self.visc    = 0.0055330849434126715 # poise
        self.cond    = 0.0918906797422783 # BTU/hr/ft/delF
        self.Tnbp    = 603.85 # degR
        self.Tfreeze = 388.73 # degR
        self.Ttriple = 388.73 # degR
        self.Cp      = 0.6651120126449406 # BTU/lbm/delF
        self.MolWt   = 60.09946 # g/gmole
        self.Hvap    = 250.54995212763518 # BTU/lbm
        self.surf    = 0.0001406549239868261 # lbf/in
    
        # ======= saturation curves =========
        self.NsatPts = 21
        self.trL = [0.4128091581976701, 0.4421687002877866, 0.4715282423779031, 0.5008877844680196, 0.5302473265581361, 0.5596068686482526, 0.5889664107383691, 0.6183259528284856, 0.6476854949186021, 0.6770450370087187, 0.7064045790988351, 0.7357641211889516, 0.7651236632790681, 0.7944832053691846, 0.8238427474593011, 0.8532022895494176, 0.8825618316395341, 0.9119213737296505, 0.941280915819767, 0.9706404579098835, 1.0]
        self.tL = [388.73, 416.377, 444.02400000000006, 471.67100000000005, 499.3180000000001, 526.965, 554.6120000000001, 582.259, 609.9060000000001, 637.5530000000001, 665.2000000000002, 692.8470000000001, 720.4940000000001, 748.1410000000001, 775.7880000000001, 803.4350000000001, 831.0820000000001, 858.729, 886.3760000000001, 914.023, 941.6700000000001]
        
        self.log10pL  = [-2.0322822887443923, -1.3723693243810342, -0.8187480588073967, -0.34909152396327636, 0.053613890249281704, 0.4024814143706068, 0.7077142389393332, 0.9773136846969005, 1.217594731299083, 1.4335673713461905, 1.629222812865501, 1.8077510905556542, 1.971708484039811, 2.1231476881776468, 2.2637199656205884, 2.3947559258171043, 2.5173297146791933, 2.632309954545235, 2.7403993498057018, 2.8421621713166347, 2.9380190974762104]
        self.log10viscL = [-1.2526344512487293, -1.5659200080942153, -1.7986194181571824, -1.9838868134810053, -2.133891995833604, -2.2543453307794854, -2.3486771670679616, -2.4310401352148907, -2.5097647192694916, -2.58664967543945, -2.660074938576418, -2.7303385924767976, -2.797701811611523, -2.8623943580117777, -2.9246202397723096, -2.9845603507875147, -3.0423769950661086, -3.098215216933693, -3.152206172807487, -3.204468017370492, -3.255108173130664]
        self.condL = [0.11013502982148698, 0.10698577708738044, 0.10335845838910211, 0.09968781014699712, 0.09576007865198413, 0.09198422544277202, 0.08839727508104021, 0.08430237892234284, 0.08018234371974098, 0.07713285252920075, 0.07340030549168984, 0.06970896154765932, 0.06586241700161026, 0.0619331585027207, 0.05785679615482195, 0.053587574811767215, 0.04904823693008731, 0.04411265025960606, 0.03849170183944253, 0.04056789420306039, 0.04590814144475609]
        self.cpL = [0.596682416565721, 0.6103155460138874, 0.6241743876327678, 0.6384156848223458, 0.651245467475526, 0.6647605782293551, 0.6787767741950571, 0.6921808942554468, 0.7057171657329365, 0.7204759113106828, 0.7372229903603524, 0.755368507379479, 0.7756231456327168, 0.7988747781829404, 0.826638095579527, 0.8616786076988383, 0.909577916901148, 0.9834418828461458, 1.1227772651027683, 1.5259308047187978, 24.124474686887325]
        self.hvapL = [280.4029919470376, 274.85963655993044, 269.1368963538311, 263.21844576868864, 257.0854028853986, 250.71574001587535, 244.08350879920948, 237.15780351152554, 229.90134637257043, 222.2685125645629, 214.20249925645928, 205.63113970399294, 196.4604805594875, 186.5644740445938, 175.7674848608997, 163.81240601953147, 150.29675650109337, 134.52631462489472, 115.10349942322331, 88.24278170008648, 0.0]
        self.surfL = [0.00018891404585190917, 0.00017929093492706028, 0.00016967733303595796, 0.00016007376306388782, 0.00015048080338199616, 0.00014089910408160149, 0.00013132940756255593, 0.00012177254925933399, 0.0001122295079829853, 0.00010270140948461738, 9.3189592246569e-05, 8.369566514727349e-05, 7.422157189527021e-05, 6.476977918371853e-05, 5.5343407023631096e-05, 4.59466693081835e-05, 3.658545713849554e-05, 2.7268606384324793e-05, 1.8011276180111286e-05, 8.844408722859965e-06, 0.0]    
        self.SG_liqL = [0.861758079678825, 0.8482932839217563, 0.8344990221000811, 0.8203468430742434, 0.8058038724216394, 0.7908317952485838, 0.7753855190124295, 0.7594113846424005, 0.7428447252190753, 0.7256064571540607, 0.7075981923698685, 0.6886950076133296, 0.6687343421649681, 0.6474981622160516, 0.6246826517477513, 0.5998428663155424, 0.5722815204607544, 0.5407933064404191, 0.5029417191139957, 0.4520686510242297, 0.2767475209543379]
        self.log10SG_vapL = [-5.668878776377086, -5.03854793632041, -4.512262171083802, -4.067688454518944, -3.687704092426336, -3.359013807808756, -3.071189602477149, -2.8159849794898553, -2.5868298642625307, -2.3784477797764425, -2.1865586086191184, -2.00764295088866, -1.8387510172431065, -1.6773424457445258, -1.5211445602034095, -1.3680155397324938, -1.2157947522652914, -1.0621122046121503, -0.9041053944255878, -0.7379370970738628, -0.5579162607497765]
        
        # ========== save dataSrc for each value ===========
        data_srcD = {} # index=parameter, value=data source
        data_srcD["main"]    = "RocketProps"
        data_srcD["T"]       = "RocketProps" # degR
        data_srcD["P"]       = "RocketProps" # psia
        data_srcD["Pvap"]    = "RocketProps" # psia
        data_srcD["Pc"]      = "RocketProps" # psia
        data_srcD["Tc"]      = "RocketProps" # degR
        data_srcD["Zc"]      = "RocketProps" # Z at critical pt
        data_srcD["omega"]   = "RocketProps" # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"]      = "RocketProps" # SG
        data_srcD["visc"]    = "RocketProps" # poise
        data_srcD["cond"]    = "RocketProps" # BTU/hr/ft/delF
        data_srcD["Tnbp"]    = "RocketProps" # degR
        data_srcD["Tfreeze"] = "RocketProps" # degR
        data_srcD["Ttriple"] = "RocketProps" # degR
        data_srcD["Cp"]      = "RocketProps" # BTU/lbm/delF
        data_srcD["MolWt"]   = "RocketProps" # g/gmole
        data_srcD["Hvap"]    = "RocketProps" # BTU/lbm
        data_srcD["surf"]    = "RocketProps" # lbf/in

        data_srcD["trL"]     = "RocketProps"
        data_srcD["tL"]      = "RocketProps"

        data_srcD["log10pL"]      = "RocketProps"
        data_srcD["log10viscL"]   = "RocketProps"
        data_srcD["condL"]        = "RocketProps"
        data_srcD["cpL"]          = "RocketProps"
        data_srcD["hvapL"]        = "RocketProps"
        data_srcD["surfL"]        = "RocketProps"    
        data_srcD["SG_liqL"]      = "RocketProps"
        data_srcD["log10SG_vapL"] = "RocketProps"
        self.data_srcD = data_srcD
        
        
        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL, self.log10viscL, extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL, self.log10SG_vapL, extrapOK=False)
Ejemplo n.º 16
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for Methane  (CH4). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''
        
        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr( Tr )
        dP = max(0.0, Ppsia - Psat) # don't let dP fall below zero
        
        trL = [0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0]
        
        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []
        
        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr( 0.5 ) # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (642.8300880368608 + psat))  # Fit Standard Deviation = 1.0431457273911057e-05
        dsg_o_sgL.append(  0.016731927978062618*log10x + 0.01406162241000191*log10x**2 + 0.018536635429924807*log10x**3  )

        psat = self.PvapAtTr( 0.55 ) # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (402.5444900434918 + psat))  # Fit Standard Deviation = 2.0523848534424355e-05
        dsg_o_sgL.append(  0.013347517078576645*log10x + 0.008889198993672217*log10x**2 + 0.01757528372584917*log10x**3  )

        psat = self.PvapAtTr( 0.6 ) # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (225.33964090905388 + psat))  # Fit Standard Deviation = 3.952579538147984e-05
        dsg_o_sgL.append(  0.010565623648638058*log10x + 0.0034661392306444805*log10x**2 + 0.01656428201172605*log10x**3  )

        psat = self.PvapAtTr( 0.65 ) # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3379.234403367386 + psat))  # Fit Standard Deviation = 1.6089577688060532e-06
        dsg_o_sgL.append(  0.1631682148295521*log10x + 0.04476371272509037*log10x**2 + -0.006577099813849565*log10x**3  )

        psat = self.PvapAtTr( 0.7 ) # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2491.5205839527553 + psat))  # Fit Standard Deviation = 3.0322427891496145e-06
        dsg_o_sgL.append(  0.15915557207905132*log10x + 0.044612160920540725*log10x**2 + -0.0071531259114979645*log10x**3  )

        psat = self.PvapAtTr( 0.75 ) # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1715.6890386005036 + psat))  # Fit Standard Deviation = 5.656846077421953e-06
        dsg_o_sgL.append(  0.15410683139033435*log10x + 0.04479162003568072*log10x**2 + -0.007677795524310365*log10x**3  )

        psat = self.PvapAtTr( 0.8 ) # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1044.0401983314557 + psat))  # Fit Standard Deviation = 1.0288985181922773e-05
        dsg_o_sgL.append(  0.14750108942219073*log10x + 0.04533331075413714*log10x**2 + -0.008166904625588901*log10x**3  )

        psat = self.PvapAtTr( 0.85 ) # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (471.3805075969267 + psat))  # Fit Standard Deviation = 1.797920570626269e-05
        dsg_o_sgL.append(  0.13844366943551326*log10x + 0.046313450429621525*log10x**2 + -0.008604666577912383*log10x**3  )

        psat = self.PvapAtTr( 0.9 ) # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (0.0010161682988999521 + psat))  # Fit Standard Deviation = 3.0778351517173445e-05
        dsg_o_sgL.append(  0.1271044003229242*log10x + 0.04667006286229852*log10x**2 + -0.0086368866144908*log10x**3  )

        psat = self.PvapAtTr( 0.95 ) # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1.1008801654267633e-05 + psat))  # Fit Standard Deviation = 0.0011568060929140654
        dsg_o_sgL.append(  0.3829243336248461*log10x + -0.1940680963015701*log10x**2 + 0.07150521691662466*log10x**3  )

        psat = self.PvapAtTr( 1.0 ) # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3.573967670366063e-09 + psat))  # Fit Standard Deviation = 0.036662642942756195
        dsg_o_sgL.append(  2.267371554275571*log10x + -3.2204824105127243*log10x**2 + 1.5051337648894572*log10x**3  )

        sgratio_terp = InterpProp( trL, dsg_o_sgL, extrapOK=True )
        
        SGratio = sgratio_terp( Tr )
        SGsat = self.SGLiqAtTr( Tr )
        SG = SGsat / ( 1.0 - SGratio )
        
        return SG
Ejemplo n.º 17
0
    def set_std_state(self):
        """Set properties and standard state of Propellant, CLF5"""

        self.dataSrc = 'RocketProps'
        self.T = 468.20824117597454  # degR
        self.P = 14.695900000005908  # psia
        self.Pvap = 14.695900000005908  # psia
        self.Pc = 771  # psia
        self.Tc = 749.0699999999999  # degR
        self.Zc = 0.28125762405570104  # Z at critical pt
        self.omega = 0.22425053808315965  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        self.SG = 1.9099796506185258  # SG
        self.visc = 0.004647417632611833  # poise
        self.cond = 0.058735542785699764  # BTU/hr/ft/delF
        self.Tnbp = 466.97  # degR
        self.Tfreeze = 306.27  # degR
        self.Ttriple = 306.27  # degR
        self.Cp = 0.28284373300151516  # BTU/lbm/delF
        self.MolWt = 130.445  # g/gmole
        self.Hvap = 76.03994509997979  # BTU/lbm
        self.surf = 0.00012040859346238442  # lbf/in

        # ======= saturation curves =========
        self.NsatPts = 21
        self.trL = [
            0.4088669950738916, 0.43842364532019706, 0.46798029556650245,
            0.4975369458128079, 0.5270935960591133, 0.5566502463054187,
            0.5862068965517242, 0.6157635467980296, 0.645320197044335,
            0.6748768472906403, 0.7044334975369457, 0.7339901477832512,
            0.7635467980295567, 0.7931034482758621, 0.8226600985221675,
            0.8522167487684729, 0.8817733990147782, 0.9113300492610836,
            0.9408866995073892, 0.9704433497536946, 1.0
        ]
        self.tL = [
            306.27, 328.40999999999997, 350.54999999999995, 372.69, 394.83,
            416.96999999999997, 439.11, 461.25, 483.38999999999993,
            505.5299999999999, 527.6699999999998, 549.81, 571.95,
            594.0899999999999, 616.2299999999999, 638.3699999999999,
            660.5099999999999, 682.6499999999999, 704.79, 726.93,
            749.0699999999999
        ]

        self.log10pL = [
            -0.9527302966638411, -0.6323405705111577, -0.31195084435847437,
            0.00847282937737443, 0.3166800600366749, 0.585342931968776,
            0.8556330043231708, 1.0890231863795712, 1.3100255016481859,
            1.510270847743631, 1.6891881040396126, 1.8630442220101817,
            2.0171478734381783, 2.1602358994316844, 2.294836662126627,
            2.41839865536697, 2.533438043671308, 2.6399619714896727,
            2.7290745710222195, 2.8085317886262495, 2.884455663804013
        ]
        self.log10viscL = [
            -1.719058452778134, -1.8132931703304112, -1.9075278878826882,
            -2.0017626054349655, -2.088993149286505, -2.1690357636785755,
            -2.2426119393761748, -2.311607866713249, -2.3780932132113026,
            -2.441602202039906, -2.501418924090836, -2.557227959268781,
            -2.6101667661912784, -2.6608707640761002, -2.710106698672409,
            -2.758533122222819, -2.8065282624110672, -2.8549699688827217,
            -2.904000699878612, -2.9530314308745016, -3.0020621618703913
        ]
        self.condL = [
            0.0750461885894282, 0.07281621687013475, 0.07058624515084128,
            0.0683562734315478, 0.06612630171225434, 0.06389632999296087,
            0.06166635827366741, 0.05943638655437395, 0.057206414835080495,
            0.054976443115787026, 0.05274647139649358, 0.05051649967720009,
            0.048286527957906604, 0.04605655623861316, 0.0438265845193197,
            0.041596612800026224, 0.03936664108073277, 0.037136669361439306,
            0.03490669764214582, 0.03267672592285237, 0.030446754203558895
        ]
        self.cpL = [
            0.25598091203135653, 0.25931285676017213, 0.2626448014889877,
            0.2659767462178033, 0.2693086909466189, 0.2725264225818321,
            0.2762554514867955, 0.2810977587694013, 0.2869117166849509,
            0.29281245884035134, 0.29803479800619276, 0.30197239083754923,
            0.3060083362219219, 0.3107696526035751, 0.3177613729964591,
            0.32942565807189256, 0.3477283814977893, 0.37874746060891273,
            0.4412563346411675, 0.6294374933519366, 11.419372730927384
        ]
        self.hvapL = [
            90.35161903058628, 88.61129219940915, 86.81360398446348,
            84.95329874919959, 83.02429445770603, 81.01949155104705,
            78.9305215274404, 76.74741037561144, 74.45811898252151,
            72.04790106370838, 69.49838210315123, 66.78619633591491,
            63.88089348526563, 60.741575899973405, 57.31118514987563,
            53.506075098587914, 49.195083278613644, 44.15150897281414,
            37.9177564540135, 29.249538651769203, 0.0
        ]
        self.surfL = [
            0.0002100431143421424, 0.00019727940270979446,
            0.00018466416525822642, 0.00017220378446007535,
            0.00015990530701467216, 0.00014777655865619643,
            0.00013582628776385042, 0.00012406434757145793,
            0.0001125019311178139, 0.00010115187987324484,
            9.002909795476085e-05, 7.915112225810002e-05,
            6.853893113230043e-05, 5.82181339494154e-05, 4.82208017550484e-05,
            3.8588451251704295e-05, 2.9377293152172886e-05,
            2.0668496076433098e-05, 1.2591753893605465e-05,
            5.3971026294300425e-06, 0.0
        ]
        self.SG_liqL = [
            2.1892669747118028, 2.1539402478573155, 2.1178556486567897,
            2.0809438618197205, 2.0431247276251305, 2.004304739872869,
            1.9643737551365341, 1.9232005882237877, 1.8806269981911734,
            1.8364592867043636, 1.7904562448321912, 1.7423113128275083,
            1.6916251723706461, 1.637861691299692, 1.5802730132143865,
            1.5177626808330171, 1.4486104120467505, 1.369838889027787,
            1.2754212832604956, 1.1488614979989529, 0.712705266924602
        ]
        self.log10SG_vapL = [
            -4.147943971754535, -3.8572756414324942, -3.564200806610678,
            -3.2686098089156643, -2.9825930343485694, -2.733763938074105,
            -2.4796408918993165, -2.259631924576451, -2.0478672515504717,
            -1.852901460145374, -1.6755723853836184, -1.4966732084179792,
            -1.333392113075166, -1.1750223108666622, -1.0173792261420107,
            -0.8635903233656822, -0.7090645293940606, -0.5527209043501118,
            -0.41696986359325766, -0.29001476531054665, -0.15625986094361854
        ]

        # ========== save dataSrc for each value ===========
        data_srcD = {}  # index=parameter, value=data source
        data_srcD["main"] = "RocketProps"
        data_srcD["T"] = "RocketProps"  # degR
        data_srcD["P"] = "RocketProps"  # psia
        data_srcD["Pvap"] = "RocketProps"  # psia
        data_srcD["Pc"] = "RocketProps"  # psia
        data_srcD["Tc"] = "RocketProps"  # degR
        data_srcD["Zc"] = "RocketProps"  # Z at critical pt
        data_srcD[
            "omega"] = "RocketProps"  # define: omega = -1.0 - log10( Pvap(0.7 * Tc) / Pc )
        data_srcD["SG"] = "RocketProps"  # SG
        data_srcD["visc"] = "RocketProps"  # poise
        data_srcD["cond"] = "RocketProps"  # BTU/hr/ft/delF
        data_srcD["Tnbp"] = "RocketProps"  # degR
        data_srcD["Tfreeze"] = "RocketProps"  # degR
        data_srcD["Ttriple"] = "RocketProps"  # degR
        data_srcD["Cp"] = "RocketProps"  # BTU/lbm/delF
        data_srcD["MolWt"] = "RocketProps"  # g/gmole
        data_srcD["Hvap"] = "RocketProps"  # BTU/lbm
        data_srcD["surf"] = "RocketProps"  # lbf/in

        data_srcD["trL"] = "RocketProps"
        data_srcD["tL"] = "RocketProps"

        data_srcD["log10pL"] = "RocketProps"
        data_srcD["log10viscL"] = "RocketProps"
        data_srcD["condL"] = "RocketProps"
        data_srcD["cpL"] = "RocketProps"
        data_srcD["hvapL"] = "RocketProps"
        data_srcD["surfL"] = "RocketProps"
        data_srcD["SG_liqL"] = "RocketProps"
        data_srcD["log10SG_vapL"] = "RocketProps"
        self.data_srcD = data_srcD

        # ========== initialize saturation interpolators ===========
        self.log10p_terp = InterpProp(self.trL, self.log10pL, extrapOK=False)
        try:
            self.log10visc_terp = InterpProp(self.trL,
                                             self.log10viscL,
                                             extrapOK=False)
        except:
            pass
        try:
            self.cond_terp = InterpProp(self.trL, self.condL, extrapOK=False)
        except:
            pass
        self.cp_terp = InterpProp(self.trL, self.cpL, extrapOK=False)
        self.hvap_terp = InterpProp(self.trL, self.hvapL, extrapOK=False)
        self.surf_terp = InterpProp(self.trL, self.surfL, extrapOK=False)
        self.SG_liq_terp = InterpProp(self.trL, self.SG_liqL, extrapOK=False)
        self.log10SG_vap_terp = InterpProp(self.trL,
                                           self.log10SG_vapL,
                                           extrapOK=False)
Ejemplo n.º 18
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for N2H4  (Hydrazine). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (8181.896689786365 + psat)
                       )  # Fit Standard Deviation = 1.4599035737477177e-08
        dsg_o_sgL.append(0.03596905386776402 * log10x +
                         0.03422481406799366 * log10x**2 +
                         0.018145043285356762 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (6607.514842625012 + psat)
                       )  # Fit Standard Deviation = 3.1433495619389054e-08
        dsg_o_sgL.append(0.03437703084358101 * log10x +
                         0.03299822756277037 * log10x**2 +
                         0.0181965020224925 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5279.604261167696 + psat)
                       )  # Fit Standard Deviation = 6.760225695068379e-08
        dsg_o_sgL.append(0.03272644737039378 * log10x +
                         0.031690217687700514 * log10x**2 +
                         0.018313362913823957 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4136.3415644247825 + psat)
                       )  # Fit Standard Deviation = 1.4700650514058681e-07
        dsg_o_sgL.append(0.030891497541985467 * log10x +
                         0.030153880468657034 * log10x**2 +
                         0.01844613469521949 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3126.1480995468896 + psat)
                       )  # Fit Standard Deviation = 3.296154819246511e-07
        dsg_o_sgL.append(0.028689751180799503 * log10x +
                         0.02817271484776563 * log10x**2 +
                         0.018527726453631897 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2214.445872131976 + psat)
                       )  # Fit Standard Deviation = 7.801830942730602e-07
        dsg_o_sgL.append(0.02589796085872186 * log10x +
                         0.025452075384908113 * log10x**2 +
                         0.018473547000763958 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (11431.54122850591 + psat)
                       )  # Fit Standard Deviation = 1.1515271283872017e-07
        dsg_o_sgL.append(0.16870593148164548 * log10x +
                         0.04255520755424098 * log10x**2 +
                         -0.0052824769955791455 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (7984.986840949949 + psat)
                       )  # Fit Standard Deviation = 2.591867733349267e-07
        dsg_o_sgL.append(0.16207224342366308 * log10x +
                         0.043354666526977254 * log10x**2 +
                         -0.0043665640101013545 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4875.595046225594 + psat)
                       )  # Fit Standard Deviation = 6.056574182999508e-07
        dsg_o_sgL.append(0.15204774064362592 * log10x +
                         0.043330697093828995 * log10x**2 +
                         -0.0036021468562124994 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2164.111453664107 + psat)
                       )  # Fit Standard Deviation = 1.466119713153005e-06
        dsg_o_sgL.append(0.1377965307867554 * log10x +
                         0.04216208023869644 * log10x**2 +
                         -0.003325937895888776 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (0.00022108777662191456 + psat)
                       )  # Fit Standard Deviation = 3.908764250469068e-06
        dsg_o_sgL.append(0.12663981792607898 * log10x +
                         0.03386707348486395 * log10x**2 +
                         -0.0021506009690383126 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (7.675709569359322e-08 + psat)
                       )  # Fit Standard Deviation = 0.050001476377369306
        dsg_o_sgL.append(3.504026320642934 * log10x +
                         -7.994261024646266 * log10x**2 +
                         5.766505717449902 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 19
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for PH2  (H2(L), Hydrogen, ParaHydrogen). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (743.7242590074275 + psat)
                       )  # Fit Standard Deviation = 2.461980515021304e-05
        dsg_o_sgL.append(0.1389949270885777 * log10x +
                         0.08827915233091083 * log10x**2 +
                         -0.0232010061734211 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (682.100357574733 + psat)
                       )  # Fit Standard Deviation = 1.9714700249336247e-05
        dsg_o_sgL.append(0.14648859861837418 * log10x +
                         0.08125199456822575 * log10x**2 +
                         -0.020308797617120317 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (615.0314831994513 + psat)
                       )  # Fit Standard Deviation = 1.6339532969061507e-05
        dsg_o_sgL.append(0.1543833160963508 * log10x +
                         0.07406606565948373 * log10x**2 +
                         -0.017835332070525508 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (688.2772065821217 + psat)
                       )  # Fit Standard Deviation = 9.886514092538638e-06
        dsg_o_sgL.append(0.20579567526534367 * log10x +
                         0.04090400541334042 * log10x**2 +
                         -0.00998872240943502 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (499.03873077839035 + psat)
                       )  # Fit Standard Deviation = 1.129922852510562e-05
        dsg_o_sgL.append(0.18433172135031553 * log10x +
                         0.05017865631778303 * log10x**2 +
                         -0.011407984482752978 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (354.1827568734911 + psat)
                       )  # Fit Standard Deviation = 1.4207328775577287e-05
        dsg_o_sgL.append(0.170194616230476 * log10x +
                         0.053737838732422036 * log10x**2 +
                         -0.011506415721801572 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (234.5329803253944 + psat)
                       )  # Fit Standard Deviation = 1.831674778694238e-05
        dsg_o_sgL.append(0.1601601366509197 * log10x +
                         0.05423136009448475 * log10x**2 +
                         -0.01105300472835858 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (129.8217972853021 + psat)
                       )  # Fit Standard Deviation = 2.4065632480753247e-05
        dsg_o_sgL.append(0.1517623707908696 * log10x +
                         0.053057957989809924 * log10x**2 +
                         -0.01033426908283744 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (36.141723451535164 + psat)
                       )  # Fit Standard Deviation = 3.310285592515163e-05
        dsg_o_sgL.append(0.1438146504157458 * log10x +
                         0.05052910781146872 * log10x**2 +
                         -0.009372391930922425 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1.3129657197463574e-08 + psat)
                       )  # Fit Standard Deviation = 0.0002785766610145244
        dsg_o_sgL.append(0.21998931357139223 * log10x +
                         -0.0008032008105722168 * log10x**2 +
                         0.001188759569309543 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3.416419371125169e-08 + psat)
                       )  # Fit Standard Deviation = 0.002530396350661312
        dsg_o_sgL.append(0.45733458833360624 * log10x +
                         -0.19942349709805463 * log10x**2 +
                         0.052837918204109165 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2.728910777494507e-08 + psat)
                       )  # Fit Standard Deviation = 0.024084857641403196
        dsg_o_sgL.append(1.5247611676133936 * log10x +
                         -1.3519631789435367 * log10x**2 +
                         0.4119847628502448 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 20
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for F2  (Fluorine). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
            1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.4)  # saturation pressure at Tr=0.4
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4074.8818151923874 + psat)
                       )  # Fit Standard Deviation = 2.0521622020578788e-07
        dsg_o_sgL.append(0.0565279040938761 * log10x +
                         0.018896978922127022 * log10x**2 +
                         0.03378149312746902 * log10x**3)

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2508.028818646614 + psat)
                       )  # Fit Standard Deviation = 1.426078917747848e-06
        dsg_o_sgL.append(0.039507805997920996 * log10x +
                         0.03131932108726925 * log10x**2 +
                         0.02026704618516518 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (808.7392335774572 + psat)
                       )  # Fit Standard Deviation = 1.0124870340883487e-05
        dsg_o_sgL.append(0.015961735865797202 * log10x +
                         0.01342251424354341 * log10x**2 +
                         0.017030661463301233 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (357.74088307027955 + psat)
                       )  # Fit Standard Deviation = 3.249878267111269e-05
        dsg_o_sgL.append(0.009760851504483166 * log10x +
                         0.004186407362717191 * log10x**2 +
                         0.015100116223993244 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (158.1278954111362 + psat)
                       )  # Fit Standard Deviation = 7.320817190185947e-05
        dsg_o_sgL.append(0.00729124480965539 * log10x +
                         -0.0021727627968333493 * log10x**2 +
                         0.013640819986155683 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5800.866819771327 + psat)
                       )  # Fit Standard Deviation = 5.220697117028062e-06
        dsg_o_sgL.append(0.22529095736235033 * log10x +
                         -0.004449560891564454 * log10x**2 +
                         -0.04667262645527269 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4235.043394889023 + psat)
                       )  # Fit Standard Deviation = 8.03281977354538e-06
        dsg_o_sgL.append(0.21728628893306 * log10x +
                         0.005251523537582371 * log10x**2 +
                         -0.04186449948044654 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2903.8327297063124 + psat)
                       )  # Fit Standard Deviation = 1.692953619803671e-05
        dsg_o_sgL.append(0.20635954029374265 * log10x +
                         0.016726303592368985 * log10x**2 +
                         -0.035822790225732 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1779.3236758744283 + psat)
                       )  # Fit Standard Deviation = 3.871192872031938e-05
        dsg_o_sgL.append(0.1917246079908458 * log10x +
                         0.028170658859916282 * log10x**2 +
                         -0.0292500972609483 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (848.231065500521 + psat)
                       )  # Fit Standard Deviation = 8.530247563811843e-05
        dsg_o_sgL.append(0.17226102937594362 * log10x +
                         0.03825845615789056 * log10x**2 +
                         -0.02276351871524869 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (112.78561796474095 + psat)
                       )  # Fit Standard Deviation = 0.00017488377329919762
        dsg_o_sgL.append(0.1465883709392945 * log10x +
                         0.046118510674935595 * log10x**2 +
                         -0.01702641277899482 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2.8421589652799907e-06 + psat)
                       )  # Fit Standard Deviation = 0.0012322697935482226
        dsg_o_sgL.append(0.37792616550654434 * log10x +
                         -0.18978361574128644 * log10x**2 +
                         0.06590092494306225 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5.01456935698613e-10 + psat)
                       )  # Fit Standard Deviation = 0.03401186694264974
        dsg_o_sgL.append(2.225686420341324 * log10x +
                         -3.2719534724189114 * log10x**2 +
                         1.5892402149170106 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 21
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for LOX  (O2(L), Oxygen). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''

        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr(Tr)
        dP = max(0.0, Ppsia - Psat)  # don't let dP fall below zero

        trL = [
            0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
            1.0
        ]

        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []

        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr(0.4)  # saturation pressure at Tr=0.4
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1565.4989622746668 + psat)
                       )  # Fit Standard Deviation = 2.5421176827074696e-06
        dsg_o_sgL.append(0.024504159303010187 * log10x +
                         0.023741862618903847 * log10x**2 +
                         0.020817741894599135 * log10x**3)

        psat = self.PvapAtTr(0.45)  # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1142.1300319742031 + psat)
                       )  # Fit Standard Deviation = 4.613549831506936e-06
        dsg_o_sgL.append(0.021321693699385746 * log10x +
                         0.020002061700427617 * log10x**2 +
                         0.020043152801078424 * log10x**3)

        psat = self.PvapAtTr(0.5)  # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (796.5687033622493 + psat)
                       )  # Fit Standard Deviation = 8.541961101318089e-06
        dsg_o_sgL.append(0.01811359731714677 * log10x +
                         0.015875840682873083 * log10x**2 +
                         0.019250979505716838 * log10x**3)

        psat = self.PvapAtTr(0.55)  # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (522.9800210245902 + psat)
                       )  # Fit Standard Deviation = 1.599677382531878e-05
        dsg_o_sgL.append(0.014990784899862174 * log10x +
                         0.011327287371128309 * log10x**2 +
                         0.018413377773129975 * log10x**3)

        psat = self.PvapAtTr(0.6)  # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (310.29181302084805 + psat)
                       )  # Fit Standard Deviation = 3.0169599984360245e-05
        dsg_o_sgL.append(0.012096012292934225 * log10x +
                         0.006284575360468623 * log10x**2 +
                         0.017474976759937387 * log10x**3)

        psat = self.PvapAtTr(0.65)  # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4004.6669573193412 + psat)
                       )  # Fit Standard Deviation = 3.4708600730533275e-06
        dsg_o_sgL.append(0.1713660039223299 * log10x +
                         0.0450593359607568 * log10x**2 +
                         -0.00749484493950303 * log10x**3)

        psat = self.PvapAtTr(0.7)  # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2911.3976340013637 + psat)
                       )  # Fit Standard Deviation = 5.620466770884779e-06
        dsg_o_sgL.append(0.16484689527618201 * log10x +
                         0.04533974289559379 * log10x**2 +
                         -0.007300765306905699 * log10x**3)

        psat = self.PvapAtTr(0.75)  # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1984.744853689273 + psat)
                       )  # Fit Standard Deviation = 9.191497687438977e-06
        dsg_o_sgL.append(0.1578349378171348 * log10x +
                         0.04562013483534058 * log10x**2 +
                         -0.0073238565261411715 * log10x**3)

        psat = self.PvapAtTr(0.8)  # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1200.5214990673778 + psat)
                       )  # Fit Standard Deviation = 1.5077659151545371e-05
        dsg_o_sgL.append(0.14963859606514818 * log10x +
                         0.046024143574883505 * log10x**2 +
                         -0.007506374630562695 * log10x**3)

        psat = self.PvapAtTr(0.85)  # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (542.1018884237864 + psat)
                       )  # Fit Standard Deviation = 2.450039511581722e-05
        dsg_o_sgL.append(0.1391153704301389 * log10x +
                         0.04670003611350748 * log10x**2 +
                         -0.007774992503905318 * log10x**3)

        psat = self.PvapAtTr(0.9)  # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (0.022818172715366222 + psat)
                       )  # Fit Standard Deviation = 3.8208321246162495e-05
        dsg_o_sgL.append(0.12413335126920151 * log10x +
                         0.047660180616607734 * log10x**2 +
                         -0.007950389489123157 * log10x**3)

        psat = self.PvapAtTr(0.95)  # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1.42084172191136e-06 + psat)
                       )  # Fit Standard Deviation = 0.0011154051331061098
        dsg_o_sgL.append(0.3827636571040357 * log10x +
                         -0.19946283054948838 * log10x**2 +
                         0.07661525362239033 * log10x**3)

        psat = self.PvapAtTr(1.0)  # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2.8615834935979536e-06 + psat)
                       )  # Fit Standard Deviation = 0.037367390648883274
        dsg_o_sgL.append(2.340023173056651 * log10x +
                         -3.4531382789431726 * log10x**2 +
                         1.6738282493779768 * log10x**3)

        sgratio_terp = InterpProp(trL, dsg_o_sgL, extrapOK=True)

        SGratio = sgratio_terp(Tr)
        SGsat = self.SGLiqAtTr(Tr)
        SG = SGsat / (1.0 - SGratio)

        return SG
Ejemplo n.º 22
0
    def SG_compressed(self, TdegR, Ppsia):
        '''Calculates compressed-liquid specific gravity from curve fit of 
        RefProp calculations for MMH  (MonoMethylHydrazine). 
        
        The fitted equation is a modified, polynomial version of the Tait equation
        see: equation 4-12.2 in the 5th Ed. of Gases and Liquids.
        or: https://en.wikipedia.org/wiki/Tait_equation

        :param TdegR: temperature in degR
        :param Ppsia: pressure in psia
        :type TdegR: float
        :type Ppsia: float
        :return: specific gravity at (TdegR, Ppsia) in g/ml
        '''
        
        Tr = TdegR / self.Tc
        Psat = self.PvapAtTr( Tr )
        dP = max(0.0, Ppsia - Psat) # don't let dP fall below zero
        
        trL = [0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0]
        
        # build a list of (SG - SGsat)/SG vs Tr
        dsg_o_sgL = []
        
        # build interpolator for (SG - SGsat)/SG vs Tr at Ppsia

        psat = self.PvapAtTr( 0.4 ) # saturation pressure at Tr=0.4
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (10589.569810046796 + psat))  # Fit Standard Deviation = 5.412853307430722e-09
        dsg_o_sgL.append(  0.03637202072794378*log10x + 0.03433360832953265*log10x**2 + 0.01755389602818833*log10x**3  )

        psat = self.PvapAtTr( 0.45 ) # saturation pressure at Tr=0.45
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (8209.80212388197 + psat))  # Fit Standard Deviation = 1.3732567299692015e-08
        dsg_o_sgL.append(  0.03424745204142822*log10x + 0.0326132859006542*log10x**2 + 0.017305252406757534*log10x**3  )

        psat = self.PvapAtTr( 0.5 ) # saturation pressure at Tr=0.5
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (6177.069852339128 + psat))  # Fit Standard Deviation = 3.649801671155937e-08
        dsg_o_sgL.append(  0.031731611035634225*log10x + 0.030522365461474306*log10x**2 + 0.017017316090043155*log10x**3  )

        psat = self.PvapAtTr( 0.55 ) # saturation pressure at Tr=0.55
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4463.447278953207 + psat))  # Fit Standard Deviation = 1.0250653986950578e-07
        dsg_o_sgL.append(  0.028755239731389402*log10x + 0.027958102774981296*log10x**2 + 0.01668944740664264*log10x**3  )

        psat = self.PvapAtTr( 0.6 ) # saturation pressure at Tr=0.6
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (3051.3681793762908 + psat))  # Fit Standard Deviation = 3.0549534026969583e-07
        dsg_o_sgL.append(  0.02526304170957798*log10x + 0.024783327342416634*log10x**2 + 0.01631462420624741*log10x**3  )

        psat = self.PvapAtTr( 0.65 ) # saturation pressure at Tr=0.65
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (1924.4267211664935 + psat))  # Fit Standard Deviation = 9.661687227198927e-07
        dsg_o_sgL.append(  0.021233944430324954*log10x + 0.0208076386225839*log10x**2 + 0.015868935317814522*log10x**3  )

        psat = self.PvapAtTr( 0.7 ) # saturation pressure at Tr=0.7
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (9663.41884523568 + psat))  # Fit Standard Deviation = 7.925895276324919e-08
        dsg_o_sgL.append(  0.14427357034611538*log10x + 0.03617415930108113*log10x**2 + -0.00496049708979845*log10x**3  )

        psat = self.PvapAtTr( 0.75 ) # saturation pressure at Tr=0.75
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (6561.907880284143 + psat))  # Fit Standard Deviation = 2.1772650245162727e-07
        dsg_o_sgL.append(  0.14187820777474008*log10x + 0.03594946846548841*log10x**2 + -0.005501754517593817*log10x**3  )

        psat = self.PvapAtTr( 0.8 ) # saturation pressure at Tr=0.8
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (4085.12881682702 + psat))  # Fit Standard Deviation = 6.299833364242372e-07
        dsg_o_sgL.append(  0.13926949995690333*log10x + 0.03608588889026804*log10x**2 + -0.006229042313223188*log10x**3  )

        psat = self.PvapAtTr( 0.85 ) # saturation pressure at Tr=0.85
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (2149.871388014923 + psat))  # Fit Standard Deviation = 1.9123738833081077e-06
        dsg_o_sgL.append(  0.13561384760517012*log10x + 0.036899881106801515*log10x**2 + -0.0071107633320449636*log10x**3  )

        psat = self.PvapAtTr( 0.9 ) # saturation pressure at Tr=0.9
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (682.8908382720118 + psat))  # Fit Standard Deviation = 5.984463062913862e-06
        dsg_o_sgL.append(  0.12877682269857624*log10x + 0.03887229569815003*log10x**2 + -0.0080205562404789*log10x**3  )

        psat = self.PvapAtTr( 0.95 ) # saturation pressure at Tr=0.95
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (5.920969290175338e-07 + psat))  # Fit Standard Deviation = 0.00017512560120193173
        dsg_o_sgL.append(  0.2245552477733884*log10x + -0.045290544198862547*log10x**2 + 0.0192201152457745*log10x**3  )

        psat = self.PvapAtTr( 1.0 ) # saturation pressure at Tr=1.0
        dp = max(0.0, Ppsia - psat)
        log10x = log10(1 + dp / (9.225720702300927e-09 + psat))  # Fit Standard Deviation = 0.04316871431359113
        dsg_o_sgL.append(  2.778463860710788*log10x + -4.862787854598258*log10x**2 + 2.7425312824163206*log10x**3  )

        sgratio_terp = InterpProp( trL, dsg_o_sgL, extrapOK=True )
        
        SGratio = sgratio_terp( Tr )
        SGsat = self.SGLiqAtTr( Tr )
        SG = SGsat / ( 1.0 - SGratio )
        
        return SG