diff --git a/src/main/java/neqsim/standards/gasquality/Standard_ISO6976.java b/src/main/java/neqsim/standards/gasquality/Standard_ISO6976.java index 1df4d2deba..8b2bb40461 100644 --- a/src/main/java/neqsim/standards/gasquality/Standard_ISO6976.java +++ b/src/main/java/neqsim/standards/gasquality/Standard_ISO6976.java @@ -245,7 +245,6 @@ public void calculate() { Zmix20 -= Math.pow(Zmixtemp20, 2.0); molRefm3 = volRefP * 1.0e5 * 1.0 / (R * (getVolRefT() + 273.15) * getValue("CompressionFactor")); - // System.out.println("molRefm3 " + molRefm3); } /** {@inheritDoc} */ diff --git a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java index 1812a018ed..8ffd5708f2 100644 --- a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java +++ b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java @@ -5,6 +5,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import neqsim.process.equipment.stream.Stream; import neqsim.thermo.system.SystemInterface; import neqsim.thermo.system.SystemSrkEos; import neqsim.thermodynamicoperations.ThermodynamicOperations; @@ -164,6 +165,44 @@ void testCalculate2() { */ } + + @Test + void testCalculate3() { + SystemInterface testSystem = new SystemSrkEos(273.15, 1.0); + testSystem.addComponent("methane", 0.92470); + testSystem.addComponent("ethane", 0.035); + testSystem.addComponent("propane", 0.0098); + testSystem.addComponent("n-butane", 0.00220); + testSystem.addComponent("i-butane", 0.0034); + testSystem.addComponent("n-pentane", 0.0006); + testSystem.addComponent("nitrogen", 0.0175); + testSystem.addComponent("CO2", 0.0068); + testSystem.createDatabase(true); + testSystem.setMixingRule(2); + + testSystem.init(0); + Standard_ISO6976 standard = new Standard_ISO6976(testSystem, 15, 15, "volume"); + standard.setReferenceState("real"); + standard.setReferenceType("volume"); + standard.calculate(); + Assertions.assertEquals(0.99764929782, standard.getValue("CompressionFactor"), 1e-3); + Assertions.assertEquals(35144.8789915, standard.getValue("InferiorCalorificValue"), 5); + Assertions.assertEquals(38959.473378295, standard.getValue("GCV"), 1e-5); + + Assertions.assertEquals(50107.49824498, standard.getValue("SuperiorWobbeIndex"), 1e-5); + Assertions.assertEquals(45201.380041, standard.getValue("InferiorWobbeIndex"), 1e-5); + + Assertions.assertEquals(0.60453397833045, standard.getValue("RelativeDensity"), 1e-5); + Assertions.assertEquals(0.99770997554, standard.getValue("CompressionFactor"), 1e-5); + Assertions.assertEquals(17.477845, standard.getValue("MolarMass"), 1e-5); + + Stream testStream = new Stream("testStream", testSystem); + testStream.run(); + Assertions.assertEquals(50107.49824498, testStream.getWI("volume", 15, 15) / 1e3, 1e-5); + Assertions.assertEquals(38959.473378, testStream.getGCV("volume", 15, 15) / 1e3, 1e-5); + + } + @Test @Disabled void testDisplay() { diff --git a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java index 06f7ba3383..66b7272980 100644 --- a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java +++ b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java @@ -132,6 +132,37 @@ void testCalculate2() { */ } + @Test + void testCalculate3() { + SystemInterface testSystem = new SystemSrkEos(273.15, 1.0); + testSystem.addComponent("methane", 0.92470); + testSystem.addComponent("ethane", 0.035); + testSystem.addComponent("propane", 0.0098); + testSystem.addComponent("n-butane", 0.00220); + testSystem.addComponent("i-butane", 0.0034); + testSystem.addComponent("n-pentane", 0.0006); + testSystem.addComponent("nitrogen", 0.0175); + testSystem.addComponent("CO2", 0.0068); + testSystem.createDatabase(true); + testSystem.setMixingRule(2); + + testSystem.init(0); + Standard_ISO6976_2016 standard = new Standard_ISO6976_2016(testSystem, 15, 15, "volume"); + standard.setReferenceState("real"); + standard.setReferenceType("volume"); + standard.calculate(); + Assertions.assertEquals(0.99764929782, standard.getValue("CompressionFactor"), 1e-3); + Assertions.assertEquals(35144.8789915, standard.getValue("InferiorCalorificValue"), 5); + Assertions.assertEquals(38956.94693, standard.getValue("GCV"), 1e-5); + + Assertions.assertEquals(50105.17975854, standard.getValue("SuperiorWobbeIndex"), 1e-5); + Assertions.assertEquals(45201.5624460, standard.getValue("InferiorWobbeIndex"), 1e-5); + + Assertions.assertEquals(0.6045115156, standard.getValue("RelativeDensity"), 1e-5); + Assertions.assertEquals(0.99773023373, standard.getValue("CompressionFactor"), 1e-5); + Assertions.assertEquals(17.477288925, standard.getValue("MolarMass"), 1e-5); + } + @Test @Disabled void testDisplay() {