# 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() print("compressor power ", compressor1.getPower())
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()) heater1.setOutTemperature(273.15+195.0) stripper = separator(heater1.getOutStream())
from neqsim.thermo import fluid, phaseenvelope, TPflash from neqsim.process import clearProcess, stream, valve, separator, compressor, runProcess, viewProcess, heater # Start by creating a fluid in neqsim fluid1 = fluid("srk") # create a fluid using the SRK-EoS fluid1.addComponent("methane", 99.0) fluid1.addComponent("nC10", 1.0) fluid1.setMixingRule(2) fluid1.setTemperature(50.0, "C") fluid1.setPressure(50.0, "bara") fluid1.setTotalFlowRate(10.0, "MSm3/day") clearProcess() stream1 = stream(fluid1) separator1 = separator(stream1, "inlet separator") cooler1 = heater(separator1.getGasOutStream()) cooler1.setOutTemperature(273.15+30.0) scrubber1 = separator(cooler1.getOutStream(), "inlet separator") runProcess() separator1.getMechanicalDesign().calcDesign(); separartorInnerDiameter = separator1.getMechanicalDesign().getInnerDiameter(); Ks = 0.1; import math Vtmax = Ks * math.sqrt((separator1.getThermoSystem().getPhase('oil').getDensity()-separator1.getThermoSystem().getPhase('gas').getDensity())/separator1.getThermoSystem().getPhase('gas').getDensity()); diameter = math.sqrt(separator1.getThermoSystem().getFlowRate("m3/sec")/Vtmax/3.14*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()
fluid1.addComponent("i-butane", 2.0) fluid1.addComponent("n-butane", 2.0) fluid1.addComponent("n-hexane", 1.1) fluid1.addComponent("n-heptane", 2.1) fluid1.addComponent("n-octane", 1.1) fluid1.addComponent("n-nonane", 0.51) fluid1.addComponent("nC10", 5.1) fluid1.setMixingRule('classic') fluid1.setTemperature(35.15, "C") fluid1.setPressure(feedPressure, "bara") fluid1.setTotalFlowRate(10.0, "MSm3/day") # demonstration of setting up a simple process calculation clearProcess() stream1 = stream(fluid1) separator1 = separator(stream1, "inlet separator") valve1 = valve(separator1.getLiquidOutStream(), MPpressure, "HP oil valve") separator2 = separator(valve1.getOutStream(), "MP separator") valve2 = valve(separator2.getLiquidOutStream(), LPpressure) separator3 = separator(valve2.getOutStream(), "LP separator") compressorLP1 = compressor(separator3.getGasOutStream(), MPpressure) coolerMP1 = heater(compressorLP1.getOutStream()) coolerMP1.setOutTemperature(303.0) scrubberLP = separator(coolerMP1.getOutStream()) recycleLP = recycle(scrubberLP.getLiquidOutStream()) #separator2.addStream(recycleLP.getOutStream()) mixerLP = mixer() mixerLP.addStream(scrubberLP.getGasOutStream())
'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) leanGlycolFlowRateT = flowtransmitter(leanGlycolStream, 'FT9878', unit='kg/hr') leanGlycolFlowRateController = controller(leanGlycolFlowRateT, 'FC9879') leanGLycolFeedStream.setController(leanGlycolFlowRateController)
from neqsim.process import clearProcess, expander, stream, valve, separator, compressor, runProcess, viewProcess, heater # Start by creating a fluid in neqsim fluid1 = fluid("srk") # create a fluid using the SRK-EoS fluid1.addComponent("nitrogen", 1.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(28.15, "C") fluid1.setPressure(80.0, "bara") fluid1.setTotalFlowRate(10.0, "MSm3/day") # demonstration of setting up a simple process calculation clearProcess() stream1 = stream(fluid1) expander1 = expander(stream1, 40.0) separartor1 = separator(expander1.getOutStream()) runProcess() print("temperature in separartor", expander1.getOutStream().getTemperature() - 273.15, " °C") print("expander power ", expander1.getPower() / 1e6, " MW") separartor1.displayResult() methods(expander1)