diff --git a/neqsim/lib/libj8/neqsim-2.4.0-Java8.jar b/neqsim/lib/libj8/neqsim-2.4.0-Java8.jar index f86499c..ce9b782 100644 Binary files a/neqsim/lib/libj8/neqsim-2.4.0-Java8.jar and b/neqsim/lib/libj8/neqsim-2.4.0-Java8.jar differ diff --git a/neqsim/lib/neqsim-2.4.0.jar b/neqsim/lib/neqsim-2.4.0.jar index 377ce04..3e29f9a 100644 Binary files a/neqsim/lib/neqsim-2.4.0.jar and b/neqsim/lib/neqsim-2.4.0.jar differ diff --git a/tests/process/test_ProcessTools.py b/tests/process/test_ProcessTools.py index 9ddbfbb..e1ee662 100644 --- a/tests/process/test_ProcessTools.py +++ b/tests/process/test_ProcessTools.py @@ -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 @@ -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 \ No newline at end of file + 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()) \ No newline at end of file