From 0ccc9ec15ffb0740f249bd5853f767381e66a81d Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:06:27 +0000 Subject: [PATCH] solvepipedyn --- .../pipeFlowSystem/PipeFlowSystem.java | 2 +- .../pipeFlowSystem/PipeFlowSystemTest.java | 34 ++++++++----------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/main/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystem.java b/src/main/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystem.java index c54558ced2..8d61a01697 100644 --- a/src/main/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystem.java +++ b/src/main/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystem.java @@ -103,7 +103,7 @@ public void solveTransient(int type, UUID id) { // System.out.println("time step: " + i + " " + // this.getTimeSeries().getTimeStep()[i]); // System.out.println("time: " + i + " " + this.getTimeSeries().getTime()[i]); - // flowSolver.solveTDMA(); + flowSolver.solveTDMA(); display.setNextData(this, this.getTimeSeries().getTime(i)); } calcIdentifier = id; diff --git a/src/test/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystemTest.java b/src/test/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystemTest.java index 075bc77fe4..48e836f6ca 100644 --- a/src/test/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystemTest.java +++ b/src/test/java/neqsim/fluidMechanics/flowSystem/onePhaseFlowSystem/pipeFlowSystem/PipeFlowSystemTest.java @@ -91,39 +91,35 @@ void testSolveSteadyState() { @Test void testSolveTransient() { testInit(); + pipe.solveSteadyState(10); // transient solver double[] times = {0, 10000, 20000}; // , 30000, 40000, 50000}; //, 60000, 70000, 80000, // 90000}; pipe.getTimeSeries().setTimes(times); - - SystemInterface testSystem = new neqsim.thermo.system.SystemSrkEos(285.15, 200.0); - testSystem.addComponent("methane", 0.9); - testSystem.addComponent("ethane", 0.1); - - SystemInterface testSystem2 = new neqsim.thermo.system.SystemSrkEos(315.15, 200.0); - testSystem2.addComponent("methane", 26000.0); - testSystem2.addComponent("ethane", 1.10); + SystemInterface testSystem2 = new neqsim.thermo.system.SystemSrkEos(285.15, 200.0); + testSystem2.addComponent("methane", 0.9); + testSystem2.addComponent("ethane", 0.1); + testSystem2.createDatabase(true); testSystem2.init(0); testSystem2.init(3); testSystem2.initPhysicalProperties(); + testSystem2.setTotalFlowRate(80.0, "MSm3/day"); - SystemInterface testSystem3 = new neqsim.thermo.system.SystemSrkEos(285.15, 200.0); - testSystem3.addComponent("methane", 29000.0); - testSystem3.addComponent("ethane", 1221.10); - testSystem3.init(0); - - SystemInterface[] systems = {testSystem, testSystem2, testSystem2}; // , testSystem2, + SystemInterface[] systems = {testSystem2, testSystem2}; // , + // testSystem2, // testSystem2, // testSystem2}; //,testSystem2,testSystem2,testSystem2,testSystem2,testSystem2}; pipe.getTimeSeries().setInletThermoSystems(systems); pipe.getTimeSeries().setNumberOfTimeStepsInInterval(10); - // double[] outletFlowRates = {0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, - // 0.01, 0.01, 0.01}; + // double[] outletFlowRates = {0.01, 0.01, 0.01};// , 0.01, 0.01, 0.01, 0.01, 0.01, + // 0.01, 0.01, 0.01};s // pipe.getTimeSeries().setOutletMolarFlowRate(outletFlowRates); - - // pipe.solveTransient(20); + // System.out.println("pressure " + + // pipe.getTimeSeries().getThermoSystem()[1].getPressure("bara"); + pipe.solveTransient(20); + System.out.println("pressure " + pipe.getNode(10).getBulkSystem().getPressure("bara")); // pipe.getDisplay().displayResult("composition"); - // pipe.getDisplay().displayResult("pressure"); + pipe.getDisplay().displayResult("pressure"); // pipe.getDisplay().displayResult("composition"); // pipe.getDisplay(1).displayResult(); }