Example #1
0
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")
fluid2.setTotalFlowRate(10625.0, 'kg/hr')

# demonstration of setting up a simple process calculation
clearProcess()
stream1 = stream(fluid1)
glycolstream = stream(fluid2)
separator1 = separator(stream1, "inlet separator")
compressor1 = compressor(separator1.getGasOutStream(), 75.0)

heater1 = heater(compressor1.getOutStream())
heater1.setOutTemperature(313.0)

mixer1 = mixer()
mixer1.addStream(heater1.getOutStream())
mixer1.addStream(glycolstream)

scrubberLP = separator(mixer1.getOutStream())
valve1 = valve(scrubberLP.getLiquidOutStream(), 10.0, "Glycol valve")
flashDrum = separator(valve1.getOutStream())
heater1 = heater(flashDrum.getLiquidOutStream())
Example #2
0
MEG = fluid(model)
MEG.addComponent('MEG', 60.0, 'kg/sec')
MEG.addComponent('water', 40.0, 'kg/sec')
MEG.setTemperature(T[0], "C")
MEG.setPressure(P[0], "bara")
MEG.setTotalFlowRate(MEG_rate / 24.0 * MEGwaterDensity, "kg/hr")
MEG.setMixingRule(mixrule)
MEG.setMultiPhaseCheck(True)
TPflash(MEG)
#printFrame(MEG)
#'''

clearProcess()

# INLET SEPARATOR (S1)
cond_in = stream(cond)
MEG_in = stream(MEG)
gas_in = stream(gas)
mix1 = mixer()
mix1.addStream(cond_in)
mix1.addStream(MEG_in)
mix1.addStream(gas_in)
TPflash(mix1.getOutStream().getThermoSystem())
S1 = separator3phase(mix1.getOutStream())
S1.setName("S1")

gas1 = S1.getGasOutStream()
MEG1 = S1.getWaterOutStream()
cond1 = S1.getOilOutStream()

# SECOND SEPARATOR (S2)
Example #3
0
from neqsim.thermo import fluid
from neqsim.process import clearProcess, stream, valve, separator, compressor, runProcess, viewProcess

# Start by creating a fluid in neqsim
fluid1 = fluid("srk")  # create a fluid using the SRK-EoS
fluid1.setTemperature(28.15, "C")
fluid1.setPressure(100.0, "bara")
fluid1.addComponent("nitrogen", 10.0, "mol/sec")
fluid1.addComponent("n-heptane", 5.0, "mol/sec")
fluid1.addComponent("water", 1.0, "kg/sec")
fluid1.setMixingRule(2)
fluid1.setMultiPhaseCheck(True)

# demonstration of setting up a simple process calculation
clearProcess()
stream1 = stream(fluid1)
inletValve = valve(stream1, 50.0)  # add valve and set outlet pressure
inletSeparator = separator(inletValve.getOutStream())
oilValve = valve(inletSeparator.getLiquidOutStream(), 1.0)
compressor1 = compressor(inletSeparator.getGasOutStream(),
                         100.0)  # add compressor and set out pressure

#sensoir to read from Omnia
#temperatureTranmitter1 = temperatureTransmitter(stream1, "PT20232")
#pressureTranmitter1 = pressureTransmitter(stream1,"TIP2030I")

#signals to calculate
#VTemperatureTransmitter1 = VtemperatureTransmitter(inletValve.getOutStream(),"VT20314")

runProcess()
viewProcess()
Example #4
0
fluid1.addComponent('nitrogen', 0.7)
fluid1.addComponent('CO2', 2.1)
fluid1.addComponent('methane', 70.0)
fluid1.addComponent('ethane', 10.0)
fluid1.addComponent('propane', 5.0)
fluid1.addComponent('i-butane', 3.0)
fluid1.addComponent('n-butane', 2.0)
fluid1.addComponent('i-pentane', 1.0)
fluid1.addComponent('n-pentane', 1.0)
fluid1.addTBPfraction(
    'C6', 1.49985, 86.3 / 1000.0, 0.7432
)  #adding oil component mol/ molar mass (kg/mol) / relative density (gr/gr)
fluid1.addTBPfraction('C7', 0.49985, 103.3 / 1000.0, 0.76432)
fluid1.addTBPfraction('C8', 0.39985, 125.0 / 1000.0, 0.78432)
fluid1.addTBPfraction('C9', 0.49985, 145.0 / 1000.0, 0.79432)
fluid1.addTBPfraction('C10', 0.149985, 165.0 / 1000.0, 0.81)
fluid1.setMixingRule('classic')
fluid1.setMultiPhaseCheck(True)

fluid1.setTemperature(55.0, 'C')
fluid1.setPressure(55.0, 'bara')

clearProcess()
feedStream = stream(fluid1, "feed fluid")

separator1 = separator(feedStream)
oilstream1 = separator1.getLiquidOutStream()
valve1 = valve(oilstream1, 10.0, 'valv1')

runProcess()
valve1.displayResults()
Example #5
0
fluid1.addComponent("CO2", 2.0)
fluid1.addComponent("methane", 85.0)
fluid1.addComponent("ethane", 5.0)
fluid1.addComponent("propane", 3.0)
fluid1.addComponent("i-butane", 2.0)
fluid1.addComponent("n-butane", 2.0)
fluid1.setMixingRule(2)
fluid1.setTemperature(88.15, "C")
fluid1.setPressure(50.0, "bara")
fluid1.setTotalFlowRate(10.0, "MSm3/day")

fluid2 = fluid("srk")
fluid2.addComponent("water", 0.1)
fluid2.setMixingRule(2)
fluid2.setTemperature(28.15, "C")
fluid2.setPressure(3.0, "bara")
fluid2.setTotalFlowRate(2700.0, "m^3/hr")

# demonstration of setting up a simple process calculation
clearProcess()
stream1 = stream(fluid1)
stream2 = stream(fluid2)

heatExchanger1 = heatExchanger(stream1, stream2, "exchanger1")
runProcess()

#heatExchanger1.displayResult()

temp1 = heatExchanger1.getOutStream(0).getTemperature() - 273.15
temp2 = heatExchanger1.getOutStream(1).getTemperature() - 273.15
Example #6
0
@author: ESOL
"""

import neqsim
from neqsim.thermo.thermoTools import *
from neqsim.process import stream,clearProcess,runProcess, pump, heater, cooler, expander, valve, compressor, heater

fluid_1 = fluid("srk")
fluid_1.addComponent("propane", 1.0)

fluid_1.setPressure(15.0, "bara")
fluid_1.setTemperature(30.0, "C")
fluid_1.setTotalFlowRate(1000.0, "kg/hr")

clearProcess()
stream_1 = stream(fluid_1)
stream_1.setSpecification("bubT")

JTvalve = valve(stream_1, 1.0)

cooler_1 = cooler(JTvalve.getOutStream())
cooler_1.setSpecification("out stream")

stream_2 = stream(cooler_1.getOutStream())
stream_2.setSpecification("dewP")

cooler_1.setOutStream(stream_2)
JTvalve.setOutletPressure(stream_2.getPressure());

compressor_1 = compressor(stream_2, 10.0);
compressor_1.setSpecification("out stream")
Example #7
0
        "nitrogen", "CO2", "H2S", "methane", "ethane", "propane", "i-butane",
        "n-butane", "i-pentane", "n-pentane", "n-hexane", "benzene",
        "n-heptane", "toluene", "n-octane", "m-Xylene", "MEG", "water"
    ],
    'MolarComposition[-]': [
        0.34, 0.84, 0.0001, 90.4, 5.199, 2.06, 0.36, 0.55, 0.14, 0.097, 0.014,
        0.008, 0.01, 0.001, 0.001, 0.0001, 0.0, 0.1
    ]
}

naturalgasdf = pd.DataFrame(naturalgas)
naturalgasFluid = fluid_df(naturalgasdf)

#2. Setting up glycol process
clearProcess()
feedStream = stream(naturalgasFluid)
feedStream.setPressure(50.0, 'bara')
feedStream.setTemperatue(30.0, 'C')
#Adding gas scrubber
feedGasScrubber = separator(feedStream, "inlet gas scrubber")
# Adding glycol dehydration module
glycolmodule = glycoldehydrationlmodule(feedGasScrubber.getGasOutSteam())

#3. Adding transmitters and controllers
feedTemperatureT = temperaturetransmitter(feedStream, name='TT2987', unit="C")
feedTemperatureController = controller(leanGlycolFlowRateT, 'TC2987')
feedStream.setController(feedTemperatureController)

feedGasFlowRateT = flowtransmitter(feedStream, 'FT2878', unit='kg/hr')
feedGasFlowRateController = controller(feedGasFlowRateT, 'FC2878')
feedStream.setController(feedGasFlowRateController)
Example #8
0
import pandas as pd

# Create a gas-condensate fluid
naturalgas = {
    'ComponentName': [
        "nitrogen", "CO2", "methane", "ethane", "propane", "i-butane",
        "n-butane", "i-pentane", "n-pentane", "n-hexane"
    ],
    'MolarComposition[-]':
    [0.633, 1.371, 85.697, 6.914, 3.086, 0.475, 0.886, 0.242, 0.254, 0.016]
}
naturalgasFluid = fluid_df(pd.DataFrame(naturalgas))

#Setting up a process with an inpu stream and a compressor
clearProcess()
stream1 = stream(naturalgasFluid)
compressor2 = compressor(stream1)

#setting up the compressor performance
MW = 19.7
inlepPres = 60.0
inletTemp = 22.9
Zinlet = 0.851
curveConditions = [MW, inlepPres, inletTemp, Zinlet]

speed = [11533.0]
flow = [[4327.9175, 4998.517, 5505.8851, 6027.6167, 6506.9064, 6908.2832]]
polytropicheadmeter = [[
    18882.3055, 18235.1912, 17531.6259, 16489.7195, 15037.1474, 13618.7919
]]
polytropicefficiency = [[72.54, 74.44, 74.5, 74.66, 72.66, 70.19]]