Skip to content

Commit

Permalink
Update component property doc (#614)
Browse files Browse the repository at this point in the history
* added possibility to update table

* addd ammonia

* update

* Update AmmoniaTest.java

* Update NewComponentTest.java
  • Loading branch information
EvenSol committed May 22, 2023
1 parent c7974cc commit 43d71fd
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
14 changes: 13 additions & 1 deletion src/main/java/neqsim/thermo/component/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/neqsim/thermo/component/ComponentInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure,

/**
* <p>
* getx.
* The mole fraction of a component in the actual phase
* </p>
*
* @return a double
Expand All @@ -772,7 +772,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure,

/**
* <p>
* getz.
* The mole fraction of a component in the total fluid
* </p>
*
* @return a double
Expand All @@ -781,7 +781,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure,

/**
* <p>
* getK.
* The distribution coefficient y/x between gas and lidquid for a component
* </p>
*
* @return a double
Expand All @@ -790,7 +790,7 @@ public void Finit(PhaseInterface phase, double temperature, double pressure,

/**
* <p>
* getTC.
* Returns the critical temperature of the component
* </p>
*
* @return a double
Expand Down Expand Up @@ -1075,7 +1075,9 @@ public void Finit(PhaseInterface phase, double temperature, double pressure,

/**
* <p>
* 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.
* </p>
*
* @param temperature a double
Expand Down Expand Up @@ -1300,7 +1302,8 @@ public void Finit(PhaseInterface phase, double temperature, double pressure,

/**
* <p>
* getDebyeDipoleMoment.
* This function handles the retrieval of a chemical’s dipole moment. Dipole moment, [debye] as a
* double
* </p>
*
* @return a double
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/neqsim/thermo/component/AmmoniaTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions src/test/java/neqsim/thermo/component/NewComponentTest.java
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 43d71fd

Please sign in to comment.