Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated library #177

Merged
merged 3 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified neqsim/lib/libj8/neqsim-2.4.0-Java8.jar
Binary file not shown.
Binary file modified neqsim/lib/neqsim-2.4.0.jar
Binary file not shown.
57 changes: 55 additions & 2 deletions 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, hydrateEquilibriumTemperatureAnalyser, clearProcess, newProcess, runProcess, stream, runProcessAsThread)
from neqsim.process.processTools import (compsplitter, waterDewPointAnalyser, hydrateEquilibriumTemperatureAnalyser, clearProcess, newProcess, runProcess, stream, runProcessAsThread, mixer, compressor, recycle2, splitter, valve)
from neqsim.thermo import (TPflash, fluid, printFrame)
from numpy import isnan
from pytest import approx
Expand Down Expand Up @@ -88,4 +88,57 @@ def test_newprocess():
runProcess()
TPflash(splittcomp.getSplitStream(0).getFluid())
printFrame(splittcomp.getSplitStream(0).getFluid())
assert splittcomp.getSplitStream(0).getFluid().getViscosity('kg/msec') > 1e-19
assert splittcomp.getSplitStream(0).getFluid().getViscosity('kg/msec') > 1e-19

def test_flowSplitter():
temperature_inlet = 35.0
pressure_inlet = 55.0
pressure_outlet = 100.0
gasFlowRate = 5.0

splitfactors = [0.9, 0.1]

fluid1 = fluid('srk')
fluid1.addComponent("methane", 1.0)

clearProcess()

stream1 = stream(fluid1)
stream1.setPressure(pressure_inlet, 'bara')
stream1.setTemperature(temperature_inlet, 'C')
stream1.setFlowRate(gasFlowRate, "MSm3/day")

streamresycl = stream(stream1.clone())
streamresycl.setFlowRate(0.1, "MSm3/day")

mixerStream = mixer()
mixerStream.addStream(stream1)
mixerStream.addStream(streamresycl)

compressor_1 = compressor(mixerStream.getOutletStream(), pressure_outlet)

stream2 = stream(compressor_1.getOutStream())

streamSplit = splitter(stream2,splitfactors)
streamSplit.setFlowRates([5.0, 0.1], 'MSm3/day')

resycStream1 = stream(streamSplit.getSplitStream(1))

valve1 = valve(resycStream1)
valve1.setOutletPressure(pressure_inlet, 'bara')

resycleOp = recycle2()
resycleOp.addStream(valve1.getOutletStream())
resycleOp.setOutletStream(streamresycl)

exportStream = stream(streamSplit.getSplitStream(0))

runProcess()

assert exportStream.getFlowRate('MSm3/day') == 5.0
print('export flow ' , exportStream.getFlowRate('MSm3/day'))
print('recycle flow ' , resycStream1.getFlowRate('MSm3/day'))
print('flow to compressor ' , mixerStream.getOutStream().getFlowRate('MSm3/day'))
print('power ', compressor_1.getPower('kW'), ' kW')
print('valve Cv ', valve1.getCv())
print('valve Cv ', valve1.getPercentValveOpening())