Skip to content

Commit

Permalink
Merge branch 'master' into interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil authored Nov 14, 2022
2 parents be89d57 + ada227f commit fd34be7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Binary file modified neqsim/lib/neqsim-2.4.0.jar
Binary file not shown.
9 changes: 8 additions & 1 deletion neqsim/process/processTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,11 @@ def waterDewPointAnalyser(teststream, name=""):
teststream)
waterDewPointAnalyser.setName(name)
processoperations.add(waterDewPointAnalyser)
return waterDewPointAnalyser
return waterDewPointAnalyser

def hydrateEquilibriumTemperatureAnalyser(teststream, name=""):
hydrateEquilibriumTemperatureAnalyser = jNeqSim.processSimulation.measurementDevice.HydrateEquilibriumTemperatureAnalyser(
teststream)
hydrateEquilibriumTemperatureAnalyser.setName(name)
processoperations.add(hydrateEquilibriumTemperatureAnalyser)
return hydrateEquilibriumTemperatureAnalyser
18 changes: 17 additions & 1 deletion tests/process/test_ProcessTools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# import the package
from neqsim.process.processTools import (compsplitter, waterDewPointAnalyser, clearProcess, newProcess, runProcess, stream, runProcessAsThread)
from neqsim.process.processTools import (compsplitter, waterDewPointAnalyser, hydrateEquilibriumTemperatureAnalyser, clearProcess, newProcess, runProcess, stream, runProcessAsThread)
from neqsim.thermo import (TPflash, fluid, printFrame)
from numpy import isnan
from pytest import approx
Expand Down Expand Up @@ -32,6 +32,22 @@ def test_waterDewPointAnalyser():
runProcess()
assert waterDewPoint.getMeasuredValue('C') == approx(-11.828217379989212, rel= 0.001)

def test_hydrateEquilibriumTemperatureAnalyser():
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("methane", 5, "mol/sec")
fluid1.addComponent("ethane", 1, "mol/sec")
fluid1.addComponent("propane", 1, "mol/sec")
fluid1.addComponent("water", 50e-6, "mol/sec")
fluid1.setMixingRule(2)
clearProcess()
stream1 = stream(fluid1)
hydrateDewPoint = hydrateEquilibriumTemperatureAnalyser(stream1)
runProcess()
assert hydrateDewPoint.getMeasuredValue("C") == approx(-25.204324, rel= 0.001)

def test_runProcessAsThread():
"""
In the test_runProcessAsThread() we set up a process and run it as a thread.
Expand Down

0 comments on commit fd34be7

Please sign in to comment.