コード例 #1
0
import pandas as pd


naturalgas = {'ComponentName':  ["nitrogen", "CO2", "methane", "ethane", "propane", "i-butane", "n-butane","i-pentane", "n-pentane","2-m-C5", "3-m-C5", "n-hexane", "benzene", "c-hexane", "n-heptane", "toluene", "c-C7", "n-octane", "m-Xylene", "c-C8", "n-nonane", "m-Xylene","nC10","nC11","nC12"], 
       'MolarComposition[-]':  [1.192,0.5102,95.3303,2.1102,0.3217,0.1278,0.0846,0.0694,0.0340,0.0335,0.0109,0.0181,0.0017,0.0661,0.0207,0.0045,0.0530,0.0061,0.0033,0.000103,0.0032, 0.00354, 0.00597,0.0000597,0.000001]
} 


naturalgasdf = pd.DataFrame(naturalgas) 
print("Natural Gas Fluid:\n")
print(naturalgasdf.head(30).to_string())

naturalgasFluid = fluid_df(naturalgasdf).setModel("UMR-PRU-EoS")
naturalgasFluid.autoSelectMixingRule()
TPflash(naturalgasFluid)
printFrame(naturalgasFluid)

gasPhaseEnvelope = phaseenvelope(naturalgasFluid,True)
cricobar = gasPhaseEnvelope.get("cricondenbar")
print("cricoP ",  cricobar[1], "  [bara] ", " cricoT ", cricobar[0], " °C")



naturalgasFluid.setTemperature(-10.0, "C")
naturalgasFluid.setPressure(21.0, "bara")
TPflash(naturalgasFluid)
printFrame(naturalgasFluid)


naturalgasFluid.setPressure(21.0, "bara")
dewPointT =dewt(naturalgasFluid)-273.15
コード例 #2
0
ファイル: createFluid.py プロジェクト: equinor/neqsimpython
# -*- coding: utf-8 -*-
"""
The current python script demonstrates simple ways of creating fluids in neqsim
@author: esol
"""
from neqsim.thermo import fluid, fluid_df, addOilFractions, printFrame, dataFrame, fluidcreator, createfluid, createfluid2, TPflash, phaseenvelope
import pandas as pd
# Start by creating a fluid in neqsim uing a predifined fluid (dry gas, rich gas, light oil, black oil)
#Set temperature and pressure and do a TPflash. Show results in a dataframe.
fluidcreator.setHasWater(False)
fluid1 = createfluid('dry gas')
fluid1.setPressure(10.0, "bara")
fluid1.setTemperature(22.3, "C")
TPflash(fluid1)
print('results of TPflash for fluid 1')
printFrame(fluid1)

#Calculate and display the phase envelope of various fluid types
fluid1 = createfluid('black oil')
print('phase envelope for black oil')
phaseenvelope(fluid1, True)

fluid2 = createfluid('dry gas')
print('phase envelope for fluid 2')
phaseenvelope(fluid2, True)

fluid3 = createfluid('rich gas')
print('phase envelope for fluid 3')
phaseenvelope(fluid3, True)

#Demonstration of a simple way of generating a fluid when component names and comosition are given as list
コード例 #3
0
Created on Tue Jun 23 10:37:26 2020

@author: ESOL
"""
from neqsim.thermo import fluid, TPflash, printFrame, PHflash, PHsolidflash, TPsolidflash, dewt, bubt

fluid1 = fluid('srk')
fluid1.addComponent("CO2", 100.0)

fluid1.setTemperature(-25.0, "C")
fluid1.setPressure(18.0, "bara")
fluid1.setMultiPhaseCheck(True)
fluid1.setSolidPhaseCheck("CO2")

TPflash(fluid1)
#dewt(fluid1)
bubt(fluid1)
printFrame(fluid1)

print("temperature before deprezurization ", fluid1.getTemperature("C"))
fluid1.initProperties()
enthalpy = fluid1.getEnthalpy()

fluid1.setPressure(1.0, "bara")
PHflash(fluid1, enthalpy)
#TPsolidflash(fluid1)
printFrame(fluid1)
print("temperature after deprezurization ", fluid1.getTemperature("C"))

#TPsolidflash(fluid1)
#printFrame(fluid1)
コード例 #4
0
Created on Wed Jun  3 23:45:38 2020

@author: ESOL
"""

from neqsim.thermo import fluid, fluid_df, addOilFractions, printFrame, dataFrame, fluidcreator, createfluid, createfluid2, TPflash, phaseenvelope
import pandas as pd

reservoirfluid = fluid('Electrolyte-CPA-EoS')
reservoirfluid.addComponent("H2S", 0.12)
reservoirfluid.addComponent("nitrogen", 1.0)
reservoirfluid.addComponent("methane", 70.0)
reservoirfluid.addComponent("ethane", 4.3)
reservoirfluid.addComponent("propane", 1.2)
reservoirfluid.addComponent("nC10", 1.2)
reservoirfluid.addComponent("water", 5.0, "kg/sec")
reservoirfluid.addComponent("Na+", 0.010)
reservoirfluid.addComponent("Cl-", 0.01)
reservoirfluid.addComponent("OH-", 0.0001)

reservoirfluid.chemicalReactionInit()
reservoirfluid.setMultiPhaseCheck(True)
reservoirfluid.setMixingRule(10)

reservoirfluid.setTotalFlowRate(1.0, "MSm3/day")
reservoirfluid.setTemperature(55.0, "C")
reservoirfluid.setPressure(15.0, "bara")

TPflash(reservoirfluid)
printFrame(reservoirfluid)