Skip to content

Commit b5a3b7c

Browse files
authored
update UMR for Pseudo components (#1224)
* update UMR * update * update * update * update
1 parent 0986c9c commit b5a3b7c

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

src/main/java/neqsim/pvtsimulation/simulation/WaxFractionSim.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public static void main(String[] args) {
171171
tempSystem.setMultiPhaseCheck(true);
172172
tempSystem.init(0);
173173
tempSystem.init(1);
174-
174+
NeqSimDataBase.setCreateTemporaryTables(false);
175175
WaxFractionSim sepSim = new WaxFractionSim(tempSystem);
176176
double[] temps = {293.15, 283.15, 273.15, 264.15, 263, 262, 261};
177177
double[] pres = {5, 5, 5.0, 5.0, 5.0, 5.0, 5.0};

src/main/java/neqsim/thermo/system/SystemThermo.java

-1
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,6 @@ public void createDatabase(boolean reset) {
13921392

13931393
try (neqsim.util.database.NeqSimDataBase database = new neqsim.util.database.NeqSimDataBase()) {
13941394
String names = new String();
1395-
13961395
for (int k = 0; k < getPhase(0).getNumberOfComponents() - 1; k++) {
13971396
names += "'" + this.getComponentNames()[k] + "', ";
13981397
}

src/test/java/neqsim/pvtsimulation/simulation/WaxFractionSimTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ void testRunCalc() {
2121
tempSystem.addSolidComplexPhase("wax");
2222
tempSystem.setMultiphaseWaxCheck(true);
2323
tempSystem.setMultiPhaseCheck(true);
24+
NeqSimDataBase.setCreateTemporaryTables(false);
2425
WaxFractionSim sepSim = new WaxFractionSim(tempSystem);
2526
double[] temps = {293.15, 283.15, 273.15, 264.15, 263, 262, 261};
2627
double[] pres = {5, 5, 5.0, 5.0, 5.0, 5.0, 5.0};
@@ -43,6 +44,7 @@ void testRunCalc2() {
4344
tempSystem.addSolidComplexPhase("wax");
4445
tempSystem.setMultiphaseWaxCheck(true);
4546
tempSystem.setMultiPhaseCheck(true);
47+
NeqSimDataBase.setCreateTemporaryTables(false);
4648
tempSystem.init(0);
4749
tempSystem.init(1);
4850
WaxFractionSim sepSim = new WaxFractionSim(tempSystem);

src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java

+28
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.junit.jupiter.api.Test;
1111
import neqsim.pvtsimulation.simulation.SaturationPressure;
1212
import neqsim.thermodynamicoperations.ThermodynamicOperations;
13+
import neqsim.util.database.NeqSimDataBase;
1314

1415
class SystemUMRPRUMCEosNewTest extends neqsim.NeqSimTest {
1516
static Logger logger = LogManager.getLogger(SystemUMRPRUMCEosNewTest.class);
@@ -273,4 +274,31 @@ public void checkPhaseEnvelope2() throws Exception {
273274
satPresSim.run();
274275
assertEquals(104.7532901763, satPresSim.getThermoSystem().getPressure(), 0.001);
275276
}
277+
278+
/**
279+
* <p>
280+
* checkPhaseEnvelope2.
281+
* </p>
282+
*
283+
* @throws Exception
284+
*/
285+
@Test
286+
@DisplayName("test UMR with pseudo comp")
287+
public void testPseudoComptest() {
288+
NeqSimDataBase.setCreateTemporaryTables(true);
289+
SystemInterface testSystem = new SystemUMRPRUMCEos(273.15 + 15, 10.0);
290+
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem);
291+
testSystem.addComponent("methane", 80);
292+
testSystem.addTBPfraction("C7", .0010, 85.5 / 1000.0, 0.66533);
293+
testSystem.createDatabase(true);
294+
testSystem.setMixingRule("HV", "UNIFAC_UMRPRU");
295+
NeqSimDataBase.setCreateTemporaryTables(false);
296+
try {
297+
testOps.TPflash();
298+
} catch (Exception ex) {
299+
logger.error(ex.getMessage(), ex);
300+
}
301+
testSystem.initPhysicalProperties("density");
302+
assertEquals(6.84959007, testSystem.getDensity("kg/m3"), 0.00001);
303+
}
276304
}

src/test/java/neqsim/thermodynamicoperations/flashops/TPsolidFlash.java

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ void testSolidFLash2() {
6767
testSystem.addTBPfraction("C20", 0.0005, 263.65 / 1000.0, 0.918);
6868
testSystem.addTBPfraction("C21", 0.0009, 301.65 / 1000.0, 0.945);
6969
testSystem.addComponent("S8", 1.0e-5);
70+
testSystem.createDatabase(true);
7071
testSystem.setMixingRule("classic");
7172
testSystem.setMultiPhaseCheck(true);
7273
testSystem.setTotalFlowRate(1.0, "MSm3/hr");

0 commit comments

Comments
 (0)