diff --git a/examples/jupyter/examplesInPython.ipynb b/examples/jupyter/examplesInPython.ipynb index 1bfc45d..8f39c47 100644 --- a/examples/jupyter/examplesInPython.ipynb +++ b/examples/jupyter/examplesInPython.ipynb @@ -57,14 +57,14 @@ } ], "source": [ - "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0,10.0)\n", + "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0, 10.0)\n", "thermoSystem.addComponent(\"methane\", 10.0)\n", "thermoSystem.addComponent(\"water\", 4.0)\n", "\n", "thermoOps = jneqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem)\n", "thermoOps.TPflash()\n", "\n", - "#thermoSystem.display()\n", + "# thermoSystem.display()\n", "\n", "gasEnthalpy = thermoSystem.getPhase(0).getEnthalpy()\n", "\n", @@ -101,7 +101,7 @@ } ], "source": [ - "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0,10.0)\n", + "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0, 10.0)\n", "thermoSystem.addComponent(\"nitrogen\", 1.0)\n", "thermoSystem.addComponent(\"methane\", 70.0)\n", "thermoSystem.addComponent(\"ethane\", 4.0)\n", @@ -112,11 +112,19 @@ "thermoOps = jneqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem)\n", "thermoOps.calcPTphaseEnvelope()\n", "\n", - "plt.plot(list(thermoOps.getOperation().get(\"dewT\")),list(thermoOps.getOperation().get(\"dewP\")), label=\"dew point\")\n", - "plt.plot(list(thermoOps.getOperation().get(\"bubT\")),list(thermoOps.getOperation().get(\"bubP\")), label=\"bubble point\")\n", - "plt.title('PT envelope')\n", - "plt.xlabel('Temperature [\\u00B0C]')\n", - "plt.ylabel('Pressure [bar]')\n", + "plt.plot(\n", + " list(thermoOps.getOperation().get(\"dewT\")),\n", + " list(thermoOps.getOperation().get(\"dewP\")),\n", + " label=\"dew point\",\n", + ")\n", + "plt.plot(\n", + " list(thermoOps.getOperation().get(\"bubT\")),\n", + " list(thermoOps.getOperation().get(\"bubP\")),\n", + " label=\"bubble point\",\n", + ")\n", + "plt.title(\"PT envelope\")\n", + "plt.xlabel(\"Temperature [\\u00B0C]\")\n", + "plt.ylabel(\"Pressure [bar]\")\n", "plt.legend()\n", "plt.show()" ] @@ -142,16 +150,16 @@ } ], "source": [ - "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0,60.0)\n", + "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0, 60.0)\n", "thermoSystem.addComponent(\"methane\", 90.0)\n", "thermoSystem.addComponent(\"ethane\", 10.0)\n", "thermoSystem.addComponent(\"propane\", 1.0)\n", "thermoSystem.addComponent(\"water\", 4.0)\n", - "thermoSystem.setHydrateCheck(True);\n", + "thermoSystem.setHydrateCheck(True)\n", "thermoOps = jneqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem)\n", "thermoOps.hydrateFormationTemperature()\n", "\n", - "print(\"Hydrate equilibrium temperature \", thermoSystem.getTemperature()-273.15, \" C\")" + "print(\"Hydrate equilibrium temperature \", thermoSystem.getTemperature() - 273.15, \" C\")" ] }, { @@ -188,25 +196,25 @@ } ], "source": [ - "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0,60.0)\n", + "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0, 60.0)\n", "thermoSystem.addComponent(\"nitrogen\", 2.0)\n", "thermoSystem.addComponent(\"CO2\", 1.0)\n", "thermoSystem.addComponent(\"methane\", 10.0)\n", "thermoSystem.addComponent(\"ethane\", 10.0)\n", "thermoSystem.addComponent(\"propane\", 1.0)\n", - "thermoSystem.addTBPfraction(\"C6\", 0.428, 86.178 / 1000.0, 0.664);\n", - "thermoSystem.addTBPfraction(\"C7\", 0.626, 96.00 / 1000.0, 0.738);\n", - "thermoSystem.addTBPfraction(\"C8\", 0.609, 107.0 / 1000.0, 0.765);\n", - "thermoSystem.addTBPfraction(\"C9\", 0.309, 121.0 / 1000.0, 0.781);\n", - "thermoSystem.addPlusFraction(\"C10\", 5.137, 231.0 / 1000.0, 0.8301);\n", - "thermoSystem.getCharacterization().getLumpingModel().setNumberOfLumpedComponents(12);\n", - "thermoSystem.getCharacterization().characterisePlusFraction();\n", + "thermoSystem.addTBPfraction(\"C6\", 0.428, 86.178 / 1000.0, 0.664)\n", + "thermoSystem.addTBPfraction(\"C7\", 0.626, 96.00 / 1000.0, 0.738)\n", + "thermoSystem.addTBPfraction(\"C8\", 0.609, 107.0 / 1000.0, 0.765)\n", + "thermoSystem.addTBPfraction(\"C9\", 0.309, 121.0 / 1000.0, 0.781)\n", + "thermoSystem.addPlusFraction(\"C10\", 5.137, 231.0 / 1000.0, 0.8301)\n", + "thermoSystem.getCharacterization().getLumpingModel().setNumberOfLumpedComponents(12)\n", + "thermoSystem.getCharacterization().characterisePlusFraction()\n", "thermoSystem.setMixingRule(2)\n", "\n", "thermoOps = jneqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem)\n", "thermoOps.TPflash()\n", "\n", - "#thermoSystem.display()\n", + "# thermoSystem.display()\n", "\n", "thermoSystem.initPhysicalProperties(\"Density\")\n", "gasDensity = thermoSystem.getPhase(\"gas\").getDensity(\"kg/m3\")\n", @@ -218,11 +226,19 @@ "thermoOps = jneqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem)\n", "thermoOps.calcPTphaseEnvelope()\n", "\n", - "plt.plot(list(thermoOps.getOperation().get(\"dewT\")),list(thermoOps.getOperation().get(\"dewP\")), label=\"dew point\")\n", - "plt.plot(list(thermoOps.getOperation().get(\"bubT\")),list(thermoOps.getOperation().get(\"bubP\")), label=\"bubble point\")\n", - "plt.title('PT envelope')\n", - "plt.xlabel('Temperature [\\u00B0C]')\n", - "plt.ylabel('Pressure [bar]')\n", + "plt.plot(\n", + " list(thermoOps.getOperation().get(\"dewT\")),\n", + " list(thermoOps.getOperation().get(\"dewP\")),\n", + " label=\"dew point\",\n", + ")\n", + "plt.plot(\n", + " list(thermoOps.getOperation().get(\"bubT\")),\n", + " list(thermoOps.getOperation().get(\"bubP\")),\n", + " label=\"bubble point\",\n", + ")\n", + "plt.title(\"PT envelope\")\n", + "plt.xlabel(\"Temperature [\\u00B0C]\")\n", + "plt.ylabel(\"Pressure [bar]\")\n", "plt.legend()\n", "plt.show()" ] @@ -251,67 +267,73 @@ "source": [ "processequipment = jneqsim.processsimulation.processequipment\n", "\n", - "testSystem = jneqsim.thermo.system.SystemSrkEos((273.15+50.0),50.00);\n", - "testSystem.addComponent(\"methane\", 900.00);\n", - "testSystem.addComponent(\"ethane\", 200.00);\n", - "testSystem.addComponent(\"n-hexane\", 200.0);\n", - "testSystem.addComponent(\"n-nonane\", 200.0);\n", - "testSystem.addComponent(\"nC10\", 20.0);\n", - "testSystem.addComponent(\"nC13\", 10.0);\n", - "testSystem.setMixingRule(2);\n", - "\n", - "stream_1 = processequipment.stream.Stream(\"Stream1\", testSystem);\n", - " \n", - "mixerHP = processequipment.mixer.StaticMixer(\"Mixer HP\");\n", - "mixerHP.addStream(stream_1);\n", - " \n", - "separator = processequipment.separator.Separator(\"Separator 1\", mixerHP.getOutStream());\n", - " \n", - "LP_valve = processequipment.valve.ThrottlingValve(\"LPventil\", separator.getLiquidOutStream());\n", - "LP_valve.setOutletPressure(5.0);\n", - " \n", - "LPseparator = processequipment.separator.Separator(\"Separator 1\", LP_valve.getOutStream());\n", - " \n", - "LPcompressor = processequipment.compressor.Compressor(LPseparator.getGasOutStream());\n", - "LPcompressor.setOutletPressure(50.0);\n", - " \n", - "heaterLP = processequipment.heatExchanger.Heater(LPcompressor.getOutStream());\n", - "heaterLP.setOutTemperature(270.25);\n", - " \n", - "stream_2 = processequipment.stream.Stream(\"cooled gas\",heaterLP.getOutStream());\n", - " \n", - "gasScrubber = processequipment.separator.GasScrubberSimple(\"Scrubber\", stream_2);\n", + "testSystem = jneqsim.thermo.system.SystemSrkEos((273.15 + 50.0), 50.00)\n", + "testSystem.addComponent(\"methane\", 900.00)\n", + "testSystem.addComponent(\"ethane\", 200.00)\n", + "testSystem.addComponent(\"n-hexane\", 200.0)\n", + "testSystem.addComponent(\"n-nonane\", 200.0)\n", + "testSystem.addComponent(\"nC10\", 20.0)\n", + "testSystem.addComponent(\"nC13\", 10.0)\n", + "testSystem.setMixingRule(2)\n", + "\n", + "stream_1 = processequipment.stream.Stream(\"Stream1\", testSystem)\n", + "\n", + "mixerHP = processequipment.mixer.StaticMixer(\"Mixer HP\")\n", + "mixerHP.addStream(stream_1)\n", + "\n", + "separator = processequipment.separator.Separator(\"Separator 1\", mixerHP.getOutStream())\n", + "\n", + "LP_valve = processequipment.valve.ThrottlingValve(\n", + " \"LPventil\", separator.getLiquidOutStream()\n", + ")\n", + "LP_valve.setOutletPressure(5.0)\n", + "\n", + "LPseparator = processequipment.separator.Separator(\n", + " \"Separator 1\", LP_valve.getOutStream()\n", + ")\n", + "\n", + "LPcompressor = processequipment.compressor.Compressor(LPseparator.getGasOutStream())\n", + "LPcompressor.setOutletPressure(50.0)\n", + "\n", + "heaterLP = processequipment.heatexchanger.Heater(LPcompressor.getOutStream())\n", + "heaterLP.setOutTemperature(270.25)\n", + "\n", + "stream_2 = processequipment.stream.Stream(\"cooled gas\", heaterLP.getOutStream())\n", + "\n", + "gasScrubber = processequipment.separator.GasScrubberSimple(\"Scrubber\", stream_2)\n", "gasScrubber.setInletStream(stream_2)\n", - " \n", - "stream_3 = processequipment.stream.Stream(\"liq from scrubber gas\",gasScrubber.getLiquidOutStream());\n", - " \n", - "mixerHP.addStream(stream_3);\n", - " \n", - "mixer = processequipment.mixer.StaticMixer(\"Mixer export\");\n", - "mixer.addStream(separator.getGasOutStream());\n", - "mixer.addStream(gasScrubber.getGasOutStream());\n", - " \n", - "HPcompressor = processequipment.compressor.Compressor(mixer.getOutStream());\n", - "HPcompressor.setOutletPressure(200.0);\n", - " \n", - "operations = jneqsim.processsimulation.processsystem.ProcessSystem();\n", - "operations.add(stream_1);\n", - "operations.add(mixerHP);\n", - "operations.add(separator);\n", - "operations.add(LP_valve);\n", - "operations.add(LPseparator);\n", - "operations.add(LPcompressor);\n", - "operations.add(heaterLP);\n", - "operations.add(stream_2);\n", - "operations.add(gasScrubber);\n", - "operations.add(stream_3);\n", - "operations.add(mixer);\n", - "operations.add(HPcompressor);\n", - " \n", - "operations.run();\n", - "\n", - "print(\"LP compressor power \", LPcompressor.getPower()/1000.0, \" kW\")\n", - "print(\"HP compressor power \", HPcompressor.getPower()/1000.0, \" kW\")" + "\n", + "stream_3 = processequipment.stream.Stream(\n", + " \"liq from scrubber gas\", gasScrubber.getLiquidOutStream()\n", + ")\n", + "\n", + "mixerHP.addStream(stream_3)\n", + "\n", + "mixer = processequipment.mixer.StaticMixer(\"Mixer export\")\n", + "mixer.addStream(separator.getGasOutStream())\n", + "mixer.addStream(gasScrubber.getGasOutStream())\n", + "\n", + "HPcompressor = processequipment.compressor.Compressor(mixer.getOutStream())\n", + "HPcompressor.setOutletPressure(200.0)\n", + "\n", + "operations = jneqsim.processsimulation.processsystem.ProcessSystem()\n", + "operations.add(stream_1)\n", + "operations.add(mixerHP)\n", + "operations.add(separator)\n", + "operations.add(LP_valve)\n", + "operations.add(LPseparator)\n", + "operations.add(LPcompressor)\n", + "operations.add(heaterLP)\n", + "operations.add(stream_2)\n", + "operations.add(gasScrubber)\n", + "operations.add(stream_3)\n", + "operations.add(mixer)\n", + "operations.add(HPcompressor)\n", + "\n", + "operations.run()\n", + "\n", + "print(\"LP compressor power \", LPcompressor.getPower() / 1000.0, \" kW\")\n", + "print(\"HP compressor power \", HPcompressor.getPower() / 1000.0, \" kW\")" ] }, { @@ -351,37 +373,39 @@ } ], "source": [ - "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0,10.0)\n", + "thermoSystem = jneqsim.thermo.system.SystemSrkEos(280.0, 10.0)\n", "thermoSystem.addComponent(\"methane\", 10.0)\n", "thermoSystem.addComponent(\"ethane\", 4.0)\n", "\n", "thermoOps = jneqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem)\n", "thermoOps.TPflash()\n", "\n", + "\n", "def enthalpy(P):\n", " thermoSystem.setPressure(P)\n", " thermoSystem.init(3)\n", " return thermoSystem.getEnthalpy(\"kJ/kg\")\n", "\n", + "\n", "def entropy(P):\n", " thermoSystem.setPressure(P)\n", " thermoSystem.init(3)\n", " return thermoSystem.getEntropy(\"kJ/kgK\")\n", "\n", + "\n", "pressure = np.arange(1.0, 200.0, 5.0)\n", "enthalpy = [enthalpy(P) for P in pressure]\n", "entropy = [entropy(P) for P in pressure]\n", "\n", "plt.subplot(2, 1, 1)\n", "plt.plot(pressure, enthalpy)\n", - "plt.xlabel('Pressure [bara]')\n", - "plt.ylabel('Enthalpy [kJ/kg]')\n", + "plt.xlabel(\"Pressure [bara]\")\n", + "plt.ylabel(\"Enthalpy [kJ/kg]\")\n", "\n", "plt.subplot(2, 1, 2)\n", "plt.plot(pressure, entropy)\n", - "plt.xlabel('Pressure [bara]')\n", - "plt.ylabel('Entropy [kJ/kgK]')\n", - " " + "plt.xlabel(\"Pressure [bara]\")\n", + "plt.ylabel(\"Entropy [kJ/kgK]\")" ] }, { @@ -406,10 +430,10 @@ } ], "source": [ - "fluid1 = fluid('srk')\n", - "fluid1.addComponent('methane',10.0)\n", - "fluid1.addComponent('n-heptane',2.0)\n", - "fluid1.addComponent('water',3.0)\n", + "fluid1 = fluid(\"srk\")\n", + "fluid1.addComponent(\"methane\", 10.0)\n", + "fluid1.addComponent(\"n-heptane\", 2.0)\n", + "fluid1.addComponent(\"water\", 3.0)\n", "fluid1.setMixingRule(2)\n", "fluid1.setMultiPhaseCheck(True)\n", "TPflash(fluid1)\n", @@ -422,13 +446,13 @@ "metadata": {}, "outputs": [], "source": [ - "fluid1 = fluid('srk')\n", - "fluid1.addComponent('methane',10.0)\n", - "fluid1.addComponent('n-heptane',2.0)\n", + "fluid1 = fluid(\"srk\")\n", + "fluid1.addComponent(\"methane\", 10.0)\n", + "fluid1.addComponent(\"n-heptane\", 2.0)\n", "fluid1.setMixingRule(2)\n", "TPflash(fluid1)\n", "\n", - "print('density ',fluid1.getPhase('gas').getDensity(),' kg/m3')" + "print(\"density \", fluid1.getPhase(\"gas\").getDensity(), \" kg/m3\")" ] }, { @@ -449,27 +473,27 @@ } ], "source": [ - "fluid1 = fluid('srk')\n", - "fluid1.addComponent('n-heptane',49.39)\n", - "#fluid1.addComponent('methane',50.61)\n", + "fluid1 = fluid(\"srk\")\n", + "fluid1.addComponent(\"n-heptane\", 49.39)\n", + "# fluid1.addComponent('methane',50.61)\n", "fluid1.setMixingRule(2)\n", "fluid1.setTemperature(267.12)\n", "fluid1.setPressure(17.91)\n", - "#fluid1.useVolumeCorrection(True)\n", + "# fluid1.useVolumeCorrection(True)\n", "TPflash(fluid1)\n", "fluid1.initPhysicalProperties()\n", "\n", - "print('density ',fluid1.getPhase('oil').getDensity(),' kg/m3')\n", - "print('conductivity ',fluid1.getPhase('oil').getConductivity())\n", - "fluid1.getPhase(0).getPhysicalProperties().setConductivityModel(\"PFCT\");\n", + "print(\"density \", fluid1.getPhase(\"oil\").getDensity(), \" kg/m3\")\n", + "print(\"conductivity \", fluid1.getPhase(\"oil\").getConductivity())\n", + "fluid1.getPhase(0).getPhysicalProperties().setConductivityModel(\"PFCT\")\n", "fluid1.initPhysicalProperties()\n", - "print('conductivity ',fluid1.getPhase('oil').getConductivity())" + "print(\"conductivity \", fluid1.getPhase(\"oil\").getConductivity())" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "neqsim", "language": "python", "name": "python3" }, @@ -483,7 +507,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.12.1" } }, "nbformat": 4, diff --git a/neqsim/lib/java11/neqsim-3.0.0.jar b/neqsim/lib/java11/neqsim-3.0.2.jar similarity index 95% rename from neqsim/lib/java11/neqsim-3.0.0.jar rename to neqsim/lib/java11/neqsim-3.0.2.jar index 689aad4..86f174b 100644 Binary files a/neqsim/lib/java11/neqsim-3.0.0.jar and b/neqsim/lib/java11/neqsim-3.0.2.jar differ diff --git a/neqsim/lib/java8/neqsim-3.0.0-Java8.jar b/neqsim/lib/java8/neqsim-3.0.2-Java8.jar similarity index 95% rename from neqsim/lib/java8/neqsim-3.0.0-Java8.jar rename to neqsim/lib/java8/neqsim-3.0.2-Java8.jar index 1b8bd6c..4fff51d 100644 Binary files a/neqsim/lib/java8/neqsim-3.0.0-Java8.jar and b/neqsim/lib/java8/neqsim-3.0.2-Java8.jar differ diff --git a/neqsim/process/processTools.py b/neqsim/process/processTools.py index 0529d5b..021384b 100644 --- a/neqsim/process/processTools.py +++ b/neqsim/process/processTools.py @@ -275,7 +275,7 @@ def splitter(name, teststream, splitfactors=[]): def heater(name, teststream): - heater = jneqsim.processsimulation.processequipment.heatExchanger.Heater( + heater = jneqsim.processsimulation.processequipment.heatexchanger.Heater( name, teststream ) heater.setName(name) @@ -297,7 +297,7 @@ def simplereservoir( def cooler(name, teststream): - cooler = jneqsim.processsimulation.processequipment.heatExchanger.Cooler( + cooler = jneqsim.processsimulation.processequipment.heatexchanger.Cooler( name, teststream ) cooler.setName(name) @@ -307,11 +307,11 @@ def cooler(name, teststream): def heatExchanger(name, stream1, stream2=None): if stream2 is None: - heater = jneqsim.processsimulation.processequipment.heatExchanger.HeatExchanger( + heater = jneqsim.processsimulation.processequipment.heatexchanger.HeatExchanger( name, stream1 ) else: - heater = jneqsim.processsimulation.processequipment.heatExchanger.HeatExchanger( + heater = jneqsim.processsimulation.processequipment.heatexchanger.HeatExchanger( name, stream1, stream2 ) heater.setName(name) @@ -330,7 +330,7 @@ def distillationColumn(name, trays=5, reboil=True, condenser=True): def neqheater(name, teststream): - neqheater = jneqsim.processsimulation.processequipment.heatExchanger.NeqHeater( + neqheater = jneqsim.processsimulation.processequipment.heatexchanger.NeqHeater( name, teststream ) processoperations.add(neqheater) @@ -450,7 +450,7 @@ def waterDewPointAnalyser(name, teststream): def hydrateEquilibriumTemperatureAnalyser(name, teststream): hydrateEquilibriumTemperatureAnalyser = jneqsim.processsimulation.measurementdevice.HydrateEquilibriumTemperatureAnalyser( - teststream + name, teststream ) hydrateEquilibriumTemperatureAnalyser.setName(name) processoperations.add(hydrateEquilibriumTemperatureAnalyser)