예제 #1
0
def test_TPflash1():
    fluid1 = fluid("srk")  # create a fluid using the SRK-EoS
    fluid1.setTemperature(28.15, "C")
    fluid1.setPressure(100.0, "bara")
    fluid1.addComponent("nitrogen", 1.0, "mol/sec")
    fluid1.addComponent("CO2", 2.3, "mol/sec")
    fluid1.addComponent("methane", 80.0, "mol/sec")
    fluid1.addComponent("ethane", 6.0, "mol/sec")
    fluid1.addComponent("propane", 3.0, "mol/sec")
    fluid1.addComponent("i-butane", 1.0, "mol/sec")
    fluid1.addComponent("n-butane", 1.0, "mol/sec")
    fluid1.addComponent("i-pentane", 0.4, "mol/sec")
    fluid1.addComponent("n-pentane", 0.2, "mol/sec")
    fluid1.addComponent("n-hexane", 0.1, "mol/sec")
    fluid1.setMixingRule("classic")  # classic will use binary kij
    fluid1.setMultiPhaseCheck(
        True)  #True if more than two phases could be present
    fluidcomposition = [
        0.01, 0.02, 0.9, 0.1, 0.03, 0.02, 0.01, 0.01, 0.01, 0.003
    ]
    fluidComposition(fluid1, fluidcomposition)
    fluid1.setPressure(101.0, "bara")
    fluid1.setTemperature(22.3, "C")
    TPflash(fluid1)
    fluid1.initThermoProperties()
    fluid1.initPhysicalProperties()
    assert fluid1.getViscosity('kg/msec') == 1.574354015664789e-05
예제 #2
0

feedPressure = 50.0
feedTemperature = 30.0
fluid1 = fluid("cpa")  # create a fluid using the SRK-EoS
fluid1.addComponent("CO2",1e-10)
fluid1.addComponent("methane",1e-10)
fluid1.addComponent("ethane",1e-10)
fluid1.addComponent("propane",1e-10)
fluid1.addComponent("water",1e-10)
fluid1.addComponent("TEG",1e-10)
fluid1.setMixingRule(10)
fluid1.setMultiPhaseCheck(True) 
fluidcomposition = [0.031, 0.9297, 0.0258, 0.0135, 6.48413454028242e-002,
                    1.0e-15]
fluidComposition(fluid1, fluidcomposition)
fluid1.setTemperature(feedTemperature, "C")
fluid1.setPressure(feedPressure, "bara")
fluid1.setTotalFlowRate(5.0, "MSm3/day")

fluid2= fluid("cpa")
fluid2.addComponent("CO2", 1.0e-10)
fluid2.addComponent("methane", 1.0e-10)
fluid2.addComponent("ethane", 1.0e-10)
fluid2.addComponent("propane", 1.0e-10)
fluid2.addComponent("water", 1.0, 'kg/sec')
fluid2.addComponent("TEG", 99.0, 'kg/sec')
fluid2.setMixingRule(10)
fluid2.setMultiPhaseCheck(True)
fluid2.setTemperature(313.15, "K")
fluid2.setPressure(75.0, "bara")