diff --git a/src/main/java/neqsim/thermo/component/Component.java b/src/main/java/neqsim/thermo/component/Component.java index 719f11215..9f79fd447 100644 --- a/src/main/java/neqsim/thermo/component/Component.java +++ b/src/main/java/neqsim/thermo/component/Component.java @@ -1203,7 +1203,19 @@ public double getAntoineVaporPressure(double temp) { // gases // (poling // 5th ed) - } else if (antoineLiqVapPresType.equals("exp") || antoineLiqVapPresType.equals("log")) { + } else if (antoineLiqVapPresType.equals("pow10KPa")) { + return Math.pow(10.0, AntoineA - (AntoineB / (temp + AntoineC)))/1.0e5; // equation + // and + // parameter + // from + // properties + // o liquids + // and + // gases + // (poling + // 5th ed) + } + else if (antoineLiqVapPresType.equals("exp") || antoineLiqVapPresType.equals("log")) { return Math.exp(AntoineA - (AntoineB / (temp + AntoineC))); // equation and parameter // from properties o // liquids and gases (poling diff --git a/src/main/java/neqsim/thermo/component/ComponentInterface.java b/src/main/java/neqsim/thermo/component/ComponentInterface.java index 3eab71b9d..dd10dfafa 100644 --- a/src/main/java/neqsim/thermo/component/ComponentInterface.java +++ b/src/main/java/neqsim/thermo/component/ComponentInterface.java @@ -763,7 +763,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure, /** *

- * getx. + * The mole fraction of a component in the actual phase *

* * @return a double @@ -772,7 +772,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure, /** *

- * getz. + * The mole fraction of a component in the total fluid *

* * @return a double @@ -781,7 +781,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure, /** *

- * getK. + * The distribution coefficient y/x between gas and lidquid for a component *

* * @return a double @@ -790,7 +790,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure, /** *

- * getTC. + * Returns the critical temperature of the component *

* * @return a double @@ -1075,7 +1075,9 @@ public void Finit(PhaseInterface phase, double temperature, double pressure, /** *

- * getCp0. + * Return the ideal-gas molar heat capacity of a chemical using polynomial regressed coefficients + * as described by Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: + * McGraw-Hill Professional, 2000. *

* * @param temperature a double @@ -1300,7 +1302,8 @@ public void Finit(PhaseInterface phase, double temperature, double pressure, /** *

- * getDebyeDipoleMoment. + * This function handles the retrieval of a chemical’s dipole moment. Dipole moment, [debye] as a + * double *

* * @return a double diff --git a/src/test/java/neqsim/thermo/component/AmmoniaTest.java b/src/test/java/neqsim/thermo/component/AmmoniaTest.java index 5346ec676..6e35cc548 100644 --- a/src/test/java/neqsim/thermo/component/AmmoniaTest.java +++ b/src/test/java/neqsim/thermo/component/AmmoniaTest.java @@ -1,7 +1,6 @@ package neqsim.thermo.component; import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import neqsim.thermo.system.SystemInterface; @@ -29,7 +28,7 @@ public void bublePointTemperatureTest() { } catch (Exception e) { e.printStackTrace(); } - assertEquals(-33.03983, thermoSystem.getTemperature("C"), 0.01); + assertEquals(-33.039831, thermoSystem.getTemperature("C"), 0.01); } @Test diff --git a/src/test/java/neqsim/thermo/component/NewComponentTest.java b/src/test/java/neqsim/thermo/component/NewComponentTest.java new file mode 100644 index 000000000..da7f5bdc9 --- /dev/null +++ b/src/test/java/neqsim/thermo/component/NewComponentTest.java @@ -0,0 +1,26 @@ +package neqsim.thermo.component; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import neqsim.thermo.system.SystemInterface; +import neqsim.thermo.system.SystemSrkEos; + +public class NewComponentTest extends neqsim.NeqSimTest { + static SystemInterface thermoSystem = null; + + /** + * @throws java.lang.Exception + */ + @BeforeAll + static void setUpBeforeClass() throws Exception {} + + @Test + public void newComponentTest() { + thermoSystem = new SystemSrkEos(298.0, 1.01325); + thermoSystem.addComponent("ammonia", 1.0); + thermoSystem.init(0); + assertEquals(0.01703052, thermoSystem.getMolarMass("kg/mol"), 0.01); + assertEquals(405.4, thermoSystem.getComponent(0).getTC(), 0.01); + } +}