From 599bebc0ffee732e6fa00bc09a59ffdd84ad97ce Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Mon, 27 May 2024 15:52:53 +0200 Subject: [PATCH] fix bug change composition to all phases (#1022) --- .../PVTsimulation/simulation/ConstantVolumeDepletion.java | 1 + .../simulation/ConstantVolumeDepletionTest.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletion.java b/src/main/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletion.java index fd4ba27150..ddd8419898 100644 --- a/src/main/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletion.java +++ b/src/main/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletion.java @@ -168,6 +168,7 @@ public void runCalc() { logger.debug(e.getMessage()); } } + getThermoSystem().init(0); for (int j = 0; j < getThermoSystem().getPhase(0).getNumberOfComponents(); j++) { try { getThermoSystem().addComponent(j, -change[j]); diff --git a/src/test/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletionTest.java b/src/test/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletionTest.java index 8bf4519742..767d95f903 100644 --- a/src/test/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletionTest.java +++ b/src/test/java/neqsim/PVTsimulation/simulation/ConstantVolumeDepletionTest.java @@ -60,7 +60,8 @@ void testRunEclipseInput() { ConstantVolumeDepletion CVDsim = new ConstantVolumeDepletion(fluid1); CVDsim.setTemperature(90.0, "C"); - CVDsim.setPressures(new double[] {220., 185.94064077, 151.88128153, 117.8219223}); + CVDsim.setPressures( + new double[] {200.0, 154.0, 139.0, 127.0, 117.0, 108.0, 91.0, 82.0, 62.0, 38.0}); CVDsim.runCalc(); CVDsim.getThermoSystem().initPhysicalProperties("density"); double gasdens = CVDsim.getThermoSystem().getPhase("gas").getDensity("kg/m3"); @@ -68,7 +69,7 @@ void testRunEclipseInput() { SystemInterface gasFluid = CVDsim.getThermoSystem().phaseToSystem("gas"); gasFluid.initPhysicalProperties("density"); - // gasFluid.prettyPrint(); + assertEquals(gasdens, gasFluid.getDensity("kg/m3"), 0.01); SystemInterface oilFluid = CVDsim.getThermoSystem().phaseToSystem("oil");