From a528a35f0426caf94dce7760b0e1bf9ad6d1fa6c Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:27:19 +0100 Subject: [PATCH] fix set lp limit (#885) --- .../processEquipment/reservoir/SimpleReservoir.java | 11 +++++++++++ .../reservoir/SimpleReservoirTest.java | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java index 0498b5b9b5..622308a51b 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java @@ -15,6 +15,7 @@ import neqsim.thermo.ThermodynamicConstantsInterface; import neqsim.thermo.system.SystemInterface; import neqsim.thermodynamicOperations.ThermodynamicOperations; +import neqsim.util.unit.PressureUnit; /** *

@@ -858,4 +859,14 @@ public double getOGIP(String unit) { public double getTime() { return time; } + + public void setLowPressureLimit(double value, String unit) { + PressureUnit conver = new PressureUnit(value, unit); + lowPressureLimit = conver.getValue("bara"); + } + + public double getLowPressureLimit(String unit) { + PressureUnit conver = new PressureUnit(lowPressureLimit, "bara"); + return conver.getValue(unit); + } } diff --git a/src/test/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoirTest.java b/src/test/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoirTest.java index b26f243b70..51ae93546f 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoirTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoirTest.java @@ -60,5 +60,9 @@ void testRun2() { } Assertions.assertEquals(352.274030, reservoirOps.getReservoirFluid().getPressure("bara"), 0.1); Assertions.assertEquals(11.698, reservoirOps.getWaterProdution("Sm3/day"), 0.1); + + reservoirOps.setLowPressureLimit(52.0e5, "Pa"); + Assertions.assertEquals(52.0, reservoirOps.getLowPressureLimit("bara"), 0.1); + Assertions.assertEquals(52.0e5, reservoirOps.getLowPressureLimit("Pa"), 0.1); } }