From c5e5772d0c46c055e34a421da18f397de0855c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Tue, 27 Feb 2024 21:24:49 +0100 Subject: [PATCH 1/4] test: add tests --- .../thermo/phase/PhasePCSAFTRahmatTest.java | 490 +++++++++++++++++- .../thermo/system/SystemPCSAFTTest.java | 21 + 2 files changed, 510 insertions(+), 1 deletion(-) create mode 100644 src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java diff --git a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java index fc8c74a00d..3d95a4a708 100644 --- a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java +++ b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java @@ -1,19 +1,32 @@ package neqsim.thermo.phase; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import neqsim.thermo.system.SystemPCSAFT; public class PhasePCSAFTRahmatTest { static PhasePCSAFTRahmat p; + static SystemPCSAFT testSystem; @BeforeEach void setUp() { - p = new PhasePCSAFTRahmat(); + testSystem = new SystemPCSAFT(150.0, 10.0); + testSystem.addComponent("methane", 1.0); + testSystem.addComponent("n-hexane", 10.0001); + testSystem.setMixingRule(1); + testSystem.createDatabase(true); + testSystem.init(0); + testSystem.init(3); + + p = (PhasePCSAFTRahmat) testSystem.getPhase(0); } @Test void testAddcomponent() { + p = new PhasePCSAFTRahmat(); + Assertions.assertEquals(0, p.getNumberOfComponents()); p.addComponent("ethane", 0, 0, 0); @@ -22,4 +35,479 @@ void testAddcomponent() { p.addComponent("methane", 0, 0, 0); Assertions.assertEquals(2, p.getNumberOfComponents()); } + + @Test + void testF_DISP1_SAFT() { + double value = p.F_DISP1_SAFT(); + assertEquals(-3.4043342994822865, value); + } + + @Test + void testF_DISP2_SAFT() { + double value = p.F_DISP2_SAFT(); + assertEquals(-3.814909891308209, value); + } + + @Test + void testF_HC_SAFT() { + double value = p.F_HC_SAFT(); + assertEquals(0.6241746766202064, value); + } + + @Test + void testCalcF1dispI1() { + double value = p.calcF1dispI1(); + assertEquals(0.6987233400953171, value); + } + + @Test + void testCalcF1dispI1dN() { + double value = p.calcF1dispI1dN(); + assertEquals(0.8636251080330241, value); + } + + @Test + void testCalcF1dispI1dNdN() { + double value = p.calcF1dispI1dNdN(); + assertEquals(1.7511845029582653, value); + } + + @Test + void testCalcF1dispI1dNdNdN() { + double value = p.calcF1dispI1dNdNdN(); + assertEquals(-67.25771342213771, value); + } + + @Test + void testCalcF1dispI1dm() { + double value = p.calcF1dispI1dm(); + assertEquals(-0.05419441760656525, value); + } + + @Test + void testCalcF1dispSumTerm() { + double value = p.calcF1dispSumTerm(); + assertEquals(7.022496186615598E-28, value); + } + + @Test + void testCalcF2dispI2() { + double value = p.calcF2dispI2(); + assertEquals(0.3898434802348004, value); + } + + @Test + void testCalcF2dispI2dN() { + double value = p.calcF2dispI2dN(); + assertEquals(2.584338688968146, value); + } + + @Test + void testCalcF2dispI2dNdN() { + double value = p.calcF2dispI2dNdN(); + assertEquals(-7.8201230061788705, value); + } + + @Test + void testCalcF2dispI2dNdNdN() { + double value = p.calcF2dispI2dNdNdN(); + assertEquals(-139.85014225523986, value); + } + + @Test + void testCalcF2dispI2dm() { + double value = p.calcF2dispI2dm(); + assertEquals(-0.05060155476938381, value); + } + + @Test + void testCalcF2dispSumTerm() { + double value = p.calcF2dispSumTerm(); + assertEquals(1.0974433985688316E-27, value); + } + + @Test + void testCalcF2dispZHC() { + double value = p.calcF2dispZHC(); + assertEquals(0.8954508454156733, value); + } + + @Test + void testCalcF2dispZHCdN() { + double value = p.calcF2dispZHCdN(); + assertEquals(-11.876697166471468, value); + } + + @Test + void testCalcF2dispZHCdNdN() { + double value = p.calcF2dispZHCdNdN(); + assertEquals(194.1247342386087, value); + } + + @Test + void testCalcF2dispZHCdNdNdN() { + double value = p.calcF2dispZHCdNdNdN(); + assertEquals(2459111.1880325177, value); + } + + @Test + void testCalcF2dispZHCdm() { + double value = p.calcF2dispZHCdm(); + assertEquals(-0.02097670842244946, value); + } + + @Test + void testCalcdF1dispI1dT() { + double value = p.calcdF1dispI1dT(); + assertEquals(-3.275063704056996E-25, value); + } + + @Test + void testCalcdF1dispSumTermdT() { + double value = p.calcdF1dispSumTermdT(); + assertEquals(-4.681664124410399E-30, value); + } + + @Test + void testCalcdF2dispI2dT() { + double value = p.calcdF2dispI2dT(); + assertEquals(-9.800402698465971E-25, value); + } + + @Test + void testCalcdF2dispSumTermdT() { + double value = p.calcdF2dispSumTermdT(); + assertEquals(-1.4632578647584427E-29, value); + } + + @Test + void testCalcdF2dispZHCdT() { + double value = p.calcdF2dispZHCdT(); + assertEquals(4.503913592732077E-24, value); + } + + @Test + void testCalcdSAFT() { + double value = p.calcdSAFT(); + assertEquals(1.5637594774229341E-28, value); + } + + @Test + void testCalcdmeanSAFT() { + double value = p.calcdmeanSAFT(); + assertEquals(3.790836816021272E-10, value); + } + + @Test + void testCalcmSAFT() { + double value = p.calcmSAFT(); + assertEquals(2.8705471550258634, value); + } + + @Test + void testCalcmdSAFT() { + double value = p.calcmdSAFT(); + assertEquals(1.5637594774229341E-28, value); + } + + @Test + void testCalcmmin1SAFT() { + double value = p.calcmmin1SAFT(); + assertEquals(1.8705471550258634, value); + } + + @Test + void testDF_DISP1_SAFTdT() { + + } + + @Test + void testDF_DISP1_SAFTdV() { + + } + + @Test + void testDF_DISP1_SAFTdVdV() { + + } + + @Test + void testDF_DISP1_SAFTdVdVdV() { + + } + + @Test + void testDF_DISP2_SAFTdT() { + + } + + @Test + void testDF_DISP2_SAFTdV() { + + } + + @Test + void testDF_DISP2_SAFTdVdV() { + + } + + @Test + void testDF_DISP2_SAFTdVdVdV() { + + } + + @Test + void testDF_HC_SAFTdT() { + + } + + @Test + void testDF_HC_SAFTdV() { + + } + + @Test + void testDF_HC_SAFTdVdV() { + + } + + @Test + void testDF_HC_SAFTdVdVdV() { + + } + + @Test + void testDFdT() { + + } + + @Test + void testDFdV() { + + } + + @Test + void testDFdVdV() { + + } + + @Test + void testDFdVdVdV() { + + } + + @Test + void testGetAHSSAFT() { + + } + + @Test + void testGetDSAFT() { + + } + + @Test + void testGetDgHSSAFTdN() { + + } + + @Test + void testGetDmeanSAFT() { + + } + + @Test + void testGetDnSAFTdV() { + + } + + @Test + void testGetF() { + + } + + @Test + void testGetF1dispI1() { + + } + + @Test + void testGetF1dispSumTerm() { + + } + + @Test + void testGetF1dispVolTerm() { + + } + + @Test + void testGetF2dispI2() { + + } + + @Test + void testGetF2dispSumTerm() { + + } + + @Test + void testGetF2dispZHC() { + + } + + @Test + void testGetF2dispZHCdN() { + + } + + @Test + void testGetF2dispZHCdm() { + + } + + @Test + void testGetGhsSAFT() { + + } + + @Test + void testGetMmin1SAFT() { + + } + + @Test + void testGetNSAFT() { + + } + + @Test + void testGetNmSAFT() { + + } + + @Test + void testGetVolumeSAFT() { + + } + + @Test + void testGetaSAFT() { + + } + + @Test + void testGetaSAFTdm() { + + } + + @Test + void testGetdDSAFTdT() { + + } + + @Test + void testGetmSAFT() { + + } + + @Test + void testGetmdSAFT() { + + } + + @Test + void testInit() { + p.init(); + } + + @Test + void testMolarVolume() { + + } + + @Test + void testSetAHSSAFT() { + + } + + @Test + void testSetDSAFT() { + + } + + @Test + void testSetDgHSSAFTdN() { + + } + + @Test + void testSetDmeanSAFT() { + + } + + @Test + void testSetDnSAFTdV() { + + } + + @Test + void testSetF1dispVolTerm() { + + } + + @Test + void testSetF2dispI2() { + + } + + @Test + void testSetF2dispSumTerm() { + + } + + @Test + void testSetF2dispZHC() { + + } + + @Test + void testSetF2dispZHCdm() { + + } + + @Test + void testSetGhsSAFT() { + + } + + @Test + void testSetMmin1SAFT() { + + } + + @Test + void testSetNSAFT() { + + } + + @Test + void testSetNmSAFT() { + + } + + @Test + void testSetVolumeSAFT() { + + } + + @Test + void testSetmSAFT() { + + } + + @Test + void testSetmdSAFT() { + + } } diff --git a/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java b/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java new file mode 100644 index 0000000000..23f35d9032 --- /dev/null +++ b/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java @@ -0,0 +1,21 @@ +package neqsim.thermo.system; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; + +public class SystemPCSAFTTest { + + @Test + public void testInit() { + SystemInterface testSystem = new SystemPCSAFT(150.0, 10.0); + testSystem.addComponent("methane", 1.0); + testSystem.addComponent("n-hexane", 10.0001); + testSystem.setMixingRule(1); + testSystem.createDatabase(true); + testSystem.init(0); + testSystem.init(3); + System.out.println("test"); + double cp = testSystem.getCp(); + assertEquals(870.7344058905189, cp); + } +} From 4075262ee865a58164050f751de64d9c542e6ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Tue, 27 Feb 2024 22:51:06 +0100 Subject: [PATCH 2/4] update tests --- .../thermo/phase/PhasePCSAFTRahmatTest.java | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java index 3d95a4a708..f7bcc49690 100644 --- a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java +++ b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java @@ -13,8 +13,8 @@ public class PhasePCSAFTRahmatTest { @BeforeEach void setUp() { testSystem = new SystemPCSAFT(150.0, 10.0); - testSystem.addComponent("methane", 1.0); - testSystem.addComponent("n-hexane", 10.0001); + testSystem.addComponent("methane", 100.0); + testSystem.addComponent("n-hexane", 1000.0001); testSystem.setMixingRule(1); testSystem.createDatabase(true); testSystem.init(0); @@ -39,181 +39,181 @@ void testAddcomponent() { @Test void testF_DISP1_SAFT() { double value = p.F_DISP1_SAFT(); - assertEquals(-3.4043342994822865, value); + assertEquals(-593.232372549217, value); } @Test void testF_DISP2_SAFT() { double value = p.F_DISP2_SAFT(); - assertEquals(-3.814909891308209, value); + assertEquals(-633.8617101154254, value); } @Test void testF_HC_SAFT() { double value = p.F_HC_SAFT(); - assertEquals(0.6241746766202064, value); + assertEquals(109.10070086992114, value); } @Test void testCalcF1dispI1() { double value = p.calcF1dispI1(); - assertEquals(0.6987233400953171, value); + assertEquals(0.7039321962898899, value); } @Test void testCalcF1dispI1dN() { double value = p.calcF1dispI1dN(); - assertEquals(0.8636251080330241, value); + assertEquals(0.8729608222468556, value); } @Test void testCalcF1dispI1dNdN() { double value = p.calcF1dispI1dNdN(); - assertEquals(1.7511845029582653, value); + assertEquals(1.3690787135656468, value); } @Test void testCalcF1dispI1dNdNdN() { double value = p.calcF1dispI1dNdNdN(); - assertEquals(-67.25771342213771, value); + assertEquals(-60.233815812511885, value); } @Test void testCalcF1dispI1dm() { double value = p.calcF1dispI1dm(); - assertEquals(-0.05419441760656525, value); + assertEquals(-0.053549895709883576, value); } @Test void testCalcF1dispSumTerm() { double value = p.calcF1dispSumTerm(); - assertEquals(7.022496186615598E-28, value); + assertEquals(7.022486947548597E-28, value); } @Test void testCalcF2dispI2() { double value = p.calcF2dispI2(); - assertEquals(0.3898434802348004, value); + assertEquals(0.40519775405102854, value); } @Test void testCalcF2dispI2dN() { double value = p.calcF2dispI2dN(); - assertEquals(2.584338688968146, value); + assertEquals(2.535051300634048, value); } @Test void testCalcF2dispI2dNdN() { double value = p.calcF2dispI2dNdN(); - assertEquals(-7.8201230061788705, value); + assertEquals(-8.594085139826845, value); } @Test void testCalcF2dispI2dNdNdN() { double value = p.calcF2dispI2dNdNdN(); - assertEquals(-139.85014225523986, value); + assertEquals(-118.18119091396187, value); } @Test void testCalcF2dispI2dm() { double value = p.calcF2dispI2dm(); - assertEquals(-0.05060155476938381, value); + assertEquals(-0.0505631231034932, value); } @Test void testCalcF2dispSumTerm() { double value = p.calcF2dispSumTerm(); - assertEquals(1.0974433985688316E-27, value); + assertEquals(1.0974418484311756E-27, value); } @Test void testCalcF2dispZHC() { double value = p.calcF2dispZHC(); - assertEquals(0.8954508454156733, value); + assertEquals(0.8275770986522495, value); } @Test void testCalcF2dispZHCdN() { double value = p.calcF2dispZHCdN(); - assertEquals(-11.876697166471468, value); + assertEquals(-10.778804485725638, value); } @Test void testCalcF2dispZHCdNdN() { double value = p.calcF2dispZHCdNdN(); - assertEquals(194.1247342386087, value); + assertEquals(172.4903319088591, value); } @Test void testCalcF2dispZHCdNdNdN() { double value = p.calcF2dispZHCdNdNdN(); - assertEquals(2459111.1880325177, value); + assertEquals(1869552.2739122098, value); } @Test void testCalcF2dispZHCdm() { double value = p.calcF2dispZHCdm(); - assertEquals(-0.02097670842244946, value); + assertEquals(-0.03234376503647885, value); } @Test void testCalcdF1dispI1dT() { double value = p.calcdF1dispI1dT(); - assertEquals(-3.275063704056996E-25, value); + assertEquals(-5.726124600545992E-25, value); } @Test void testCalcdF1dispSumTermdT() { double value = p.calcdF1dispSumTermdT(); - assertEquals(-4.681664124410399E-30, value); + assertEquals(-4.6816579650323984E-30, value); } @Test void testCalcdF2dispI2dT() { double value = p.calcdF2dispI2dT(); - assertEquals(-9.800402698465971E-25, value); + assertEquals(-1.6628489213118322E-24, value); } @Test void testCalcdF2dispSumTermdT() { double value = p.calcdF2dispSumTermdT(); - assertEquals(-1.4632578647584427E-29, value); + assertEquals(-1.4632557979082342E-29, value); } @Test void testCalcdF2dispZHCdT() { double value = p.calcdF2dispZHCdT(); - assertEquals(4.503913592732077E-24, value); + assertEquals(7.070270274051911E-24, value); } @Test void testCalcdSAFT() { double value = p.calcdSAFT(); - assertEquals(1.5637594774229341E-28, value); + assertEquals(1.5637585192262192E-28, value); } @Test void testCalcdmeanSAFT() { double value = p.calcdmeanSAFT(); - assertEquals(3.790836816021272E-10, value); + assertEquals(3.7908367828047096E-10, value); } @Test void testCalcmSAFT() { double value = p.calcmSAFT(); - assertEquals(2.8705471550258634, value); + assertEquals(2.8705454715504115, value); } @Test void testCalcmdSAFT() { double value = p.calcmdSAFT(); - assertEquals(1.5637594774229341E-28, value); + assertEquals(1.5637585192262194E-28, value); } @Test void testCalcmmin1SAFT() { double value = p.calcmmin1SAFT(); - assertEquals(1.8705471550258634, value); + assertEquals(1.8705454715504115, value); } @Test From 902046ed80d86e9f93bddb6b78a4e5552ee6b8ad Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Wed, 28 Feb 2024 19:13:54 +0100 Subject: [PATCH 3/4] Update PhasePCSAFTRahmatTest.java --- .../thermo/phase/PhasePCSAFTRahmatTest.java | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java index f7bcc49690..aa8247ef35 100644 --- a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java +++ b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java @@ -8,6 +8,7 @@ public class PhasePCSAFTRahmatTest { static PhasePCSAFTRahmat p; + static PhasePCSAFTRahmat p2; static SystemPCSAFT testSystem; @BeforeEach @@ -25,63 +26,63 @@ void setUp() { @Test void testAddcomponent() { - p = new PhasePCSAFTRahmat(); + p2 = new PhasePCSAFTRahmat(); - Assertions.assertEquals(0, p.getNumberOfComponents()); + Assertions.assertEquals(0, p2.getNumberOfComponents()); - p.addComponent("ethane", 0, 0, 0); - Assertions.assertEquals(1, p.getNumberOfComponents()); + p2.addComponent("ethane", 0, 0, 0); + Assertions.assertEquals(1, p2.getNumberOfComponents()); - p.addComponent("methane", 0, 0, 0); - Assertions.assertEquals(2, p.getNumberOfComponents()); + p2.addComponent("methane", 0, 0, 0); + Assertions.assertEquals(2, p2.getNumberOfComponents()); } @Test void testF_DISP1_SAFT() { double value = p.F_DISP1_SAFT(); - assertEquals(-593.232372549217, value); + assertEquals(-2656.5606478696354, value); } @Test void testF_DISP2_SAFT() { double value = p.F_DISP2_SAFT(); - assertEquals(-633.8617101154254, value); + assertEquals(-1929.2979666587207, value); } @Test void testF_HC_SAFT() { double value = p.F_HC_SAFT(); - assertEquals(109.10070086992114, value); + assertEquals(501.428925899878, value); } @Test void testCalcF1dispI1() { double value = p.calcF1dispI1(); - assertEquals(0.7039321962898899, value); + assertEquals(0.7447173911719432, value); } @Test void testCalcF1dispI1dN() { double value = p.calcF1dispI1dN(); - assertEquals(0.8729608222468556, value); + assertEquals(0.8885712115632445, value); } @Test void testCalcF1dispI1dNdN() { double value = p.calcF1dispI1dNdN(); - assertEquals(1.3690787135656468, value); + assertEquals(-0.3783996289387171, value); } @Test void testCalcF1dispI1dNdNdN() { double value = p.calcF1dispI1dNdNdN(); - assertEquals(-60.233815812511885, value); + assertEquals(-19.504810659834753, value); } @Test void testCalcF1dispI1dm() { double value = p.calcF1dispI1dm(); - assertEquals(-0.053549895709883576, value); + assertEquals(-0.04871346995167202, value); } @Test @@ -93,31 +94,31 @@ void testCalcF1dispSumTerm() { @Test void testCalcF2dispI2() { double value = p.calcF2dispI2(); - assertEquals(0.40519775405102854, value); + assertEquals(0.5114103946892024, value); } @Test void testCalcF2dispI2dN() { double value = p.calcF2dispI2dN(); - assertEquals(2.535051300634048, value); + assertEquals(2.075396158614915, value); } @Test void testCalcF2dispI2dNdN() { double value = p.calcF2dispI2dNdN(); - assertEquals(-8.594085139826845, value); + assertEquals(-10.085652314796853, value); } @Test void testCalcF2dispI2dNdNdN() { double value = p.calcF2dispI2dNdNdN(); - assertEquals(-118.18119091396187, value); + assertEquals(53.904528812197945, value); } @Test void testCalcF2dispI2dm() { double value = p.calcF2dispI2dm(); - assertEquals(-0.0505631231034932, value); + assertEquals(-0.05282097926626965, value); } @Test @@ -129,37 +130,37 @@ void testCalcF2dispSumTerm() { @Test void testCalcF2dispZHC() { double value = p.calcF2dispZHC(); - assertEquals(0.8275770986522495, value); + assertEquals(0.47149436306641834, value); } @Test void testCalcF2dispZHCdN() { double value = p.calcF2dispZHCdN(); - assertEquals(-10.778804485725638, value); + assertEquals(-5.447711889103666, value); } @Test void testCalcF2dispZHCdNdN() { double value = p.calcF2dispZHCdNdN(); - assertEquals(172.4903319088591, value); + assertEquals(75.24049982033125, value); } @Test void testCalcF2dispZHCdNdNdN() { double value = p.calcF2dispZHCdNdNdN(); - assertEquals(1869552.2739122098, value); + assertEquals(279935.2725213402, value, 0.001); } @Test void testCalcF2dispZHCdm() { double value = p.calcF2dispZHCdm(); - assertEquals(-0.03234376503647885, value); + assertEquals(-0.06098259714, value, 0.001); } @Test void testCalcdF1dispI1dT() { double value = p.calcdF1dispI1dT(); - assertEquals(-5.726124600545992E-25, value); + assertEquals(-2.467132676347459E-24, value, 1e-20); } @Test @@ -171,7 +172,7 @@ void testCalcdF1dispSumTermdT() { @Test void testCalcdF2dispI2dT() { double value = p.calcdF2dispI2dT(); - assertEquals(-1.6628489213118322E-24, value); + assertEquals(-5.762371785911064E-24, value); } @Test @@ -183,7 +184,7 @@ void testCalcdF2dispSumTermdT() { @Test void testCalcdF2dispZHCdT() { double value = p.calcdF2dispZHCdT(); - assertEquals(7.070270274051911E-24, value); + assertEquals(1.51244510048084E-23, value); } @Test From 2df497532bf2de209eeb9766e41f2347545b8cb6 Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Wed, 28 Feb 2024 19:17:34 +0100 Subject: [PATCH 4/4] Update SystemPCSAFTTest.java --- .../neqsim/thermo/system/SystemPCSAFTTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java b/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java index 23f35d9032..0febde2fdc 100644 --- a/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java +++ b/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java @@ -2,20 +2,22 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; +import neqsim.thermodynamicOperations.ThermodynamicOperations; public class SystemPCSAFTTest { @Test public void testInit() { - SystemInterface testSystem = new SystemPCSAFT(150.0, 10.0); + SystemInterface testSystem = new SystemPCSAFT(250.0, 10.0); testSystem.addComponent("methane", 1.0); - testSystem.addComponent("n-hexane", 10.0001); + testSystem.addComponent("n-hexane", 1.0); testSystem.setMixingRule(1); - testSystem.createDatabase(true); - testSystem.init(0); - testSystem.init(3); + ThermodynamicOperations ops = new ThermodynamicOperations(testSystem); + ops.TPflash(); + testSystem.initProperties(); System.out.println("test"); double cp = testSystem.getCp(); - assertEquals(870.7344058905189, cp); + assertEquals(208.85116193406583, cp); + } }