Skip to content

Commit

Permalink
update UMR for Pseudo components (#1224)
Browse files Browse the repository at this point in the history
* update UMR

* update

* update

* update

* update
  • Loading branch information
EvenSol authored Dec 31, 2024
1 parent 0986c9c commit b5a3b7c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public static void main(String[] args) {
tempSystem.setMultiPhaseCheck(true);
tempSystem.init(0);
tempSystem.init(1);

NeqSimDataBase.setCreateTemporaryTables(false);
WaxFractionSim sepSim = new WaxFractionSim(tempSystem);
double[] temps = {293.15, 283.15, 273.15, 264.15, 263, 262, 261};
double[] pres = {5, 5, 5.0, 5.0, 5.0, 5.0, 5.0};
Expand Down
1 change: 0 additions & 1 deletion src/main/java/neqsim/thermo/system/SystemThermo.java
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,6 @@ public void createDatabase(boolean reset) {

try (neqsim.util.database.NeqSimDataBase database = new neqsim.util.database.NeqSimDataBase()) {
String names = new String();

for (int k = 0; k < getPhase(0).getNumberOfComponents() - 1; k++) {
names += "'" + this.getComponentNames()[k] + "', ";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ void testRunCalc() {
tempSystem.addSolidComplexPhase("wax");
tempSystem.setMultiphaseWaxCheck(true);
tempSystem.setMultiPhaseCheck(true);
NeqSimDataBase.setCreateTemporaryTables(false);
WaxFractionSim sepSim = new WaxFractionSim(tempSystem);
double[] temps = {293.15, 283.15, 273.15, 264.15, 263, 262, 261};
double[] pres = {5, 5, 5.0, 5.0, 5.0, 5.0, 5.0};
Expand All @@ -43,6 +44,7 @@ void testRunCalc2() {
tempSystem.addSolidComplexPhase("wax");
tempSystem.setMultiphaseWaxCheck(true);
tempSystem.setMultiPhaseCheck(true);
NeqSimDataBase.setCreateTemporaryTables(false);
tempSystem.init(0);
tempSystem.init(1);
WaxFractionSim sepSim = new WaxFractionSim(tempSystem);
Expand Down
28 changes: 28 additions & 0 deletions src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.junit.jupiter.api.Test;
import neqsim.pvtsimulation.simulation.SaturationPressure;
import neqsim.thermodynamicoperations.ThermodynamicOperations;
import neqsim.util.database.NeqSimDataBase;

class SystemUMRPRUMCEosNewTest extends neqsim.NeqSimTest {
static Logger logger = LogManager.getLogger(SystemUMRPRUMCEosNewTest.class);
Expand Down Expand Up @@ -273,4 +274,31 @@ public void checkPhaseEnvelope2() throws Exception {
satPresSim.run();
assertEquals(104.7532901763, satPresSim.getThermoSystem().getPressure(), 0.001);
}

/**
* <p>
* checkPhaseEnvelope2.
* </p>
*
* @throws Exception
*/
@Test
@DisplayName("test UMR with pseudo comp")
public void testPseudoComptest() {
NeqSimDataBase.setCreateTemporaryTables(true);
SystemInterface testSystem = new SystemUMRPRUMCEos(273.15 + 15, 10.0);
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem);
testSystem.addComponent("methane", 80);
testSystem.addTBPfraction("C7", .0010, 85.5 / 1000.0, 0.66533);
testSystem.createDatabase(true);
testSystem.setMixingRule("HV", "UNIFAC_UMRPRU");
NeqSimDataBase.setCreateTemporaryTables(false);
try {
testOps.TPflash();
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
}
testSystem.initPhysicalProperties("density");
assertEquals(6.84959007, testSystem.getDensity("kg/m3"), 0.00001);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void testSolidFLash2() {
testSystem.addTBPfraction("C20", 0.0005, 263.65 / 1000.0, 0.918);
testSystem.addTBPfraction("C21", 0.0009, 301.65 / 1000.0, 0.945);
testSystem.addComponent("S8", 1.0e-5);
testSystem.createDatabase(true);
testSystem.setMixingRule("classic");
testSystem.setMultiPhaseCheck(true);
testSystem.setTotalFlowRate(1.0, "MSm3/hr");
Expand Down

0 comments on commit b5a3b7c

Please sign in to comment.