-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests for saturation calculations (#991)
- Loading branch information
Showing
4 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...a/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointPressureFlashTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package neqsim.thermodynamicOperations.flashOps.saturationOps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.thermo.system.SystemSrkEos; | ||
import neqsim.thermodynamicOperations.ThermodynamicOperations; | ||
|
||
public class bubblePointPressureFlashTest { | ||
@Test | ||
void testRun() { | ||
|
||
SystemSrkEos fluid0_HC = new SystemSrkEos(); | ||
fluid0_HC.addComponent("methane", 0.7); | ||
fluid0_HC.addComponent("ethane", 0.1); | ||
fluid0_HC.addComponent("propane", 0.1); | ||
fluid0_HC.addComponent("n-butane", 0.1); | ||
fluid0_HC.setMixingRule("classic"); | ||
|
||
fluid0_HC.setPressure(10.0, "bara"); | ||
fluid0_HC.setTemperature(-50.0, "C"); | ||
|
||
ThermodynamicOperations ops = new ThermodynamicOperations(fluid0_HC); | ||
try { | ||
ops.bubblePointPressureFlash(false); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
assertEquals(65.150271897839, fluid0_HC.getPressure(), 1e-2); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...eqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureFlashTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package neqsim.thermodynamicOperations.flashOps.saturationOps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.thermo.system.SystemSrkEos; | ||
import neqsim.thermodynamicOperations.ThermodynamicOperations; | ||
|
||
public class bubblePointTemperatureFlashTest { | ||
@Test | ||
void testRun() { | ||
SystemSrkEos fluid0_HC = new SystemSrkEos(); | ||
fluid0_HC.addComponent("methane", 0.7); | ||
fluid0_HC.addComponent("ethane", 0.1); | ||
fluid0_HC.addComponent("propane", 0.1); | ||
fluid0_HC.addComponent("n-butane", 0.1); | ||
fluid0_HC.setMixingRule("classic"); | ||
|
||
fluid0_HC.setPressure(10.0, "bara"); | ||
fluid0_HC.setTemperature(-150.0, "C"); | ||
|
||
ThermodynamicOperations ops = new ThermodynamicOperations(fluid0_HC); | ||
try { | ||
ops.bubblePointTemperatureFlash(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
assertEquals(-117.7205968083, fluid0_HC.getTemperature("C"), 1e-2); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...java/neqsim/thermodynamicOperations/flashOps/saturationOps/dewPointPressureFlashTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package neqsim.thermodynamicOperations.flashOps.saturationOps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.thermo.system.SystemSrkEos; | ||
import neqsim.thermodynamicOperations.ThermodynamicOperations; | ||
|
||
public class dewPointPressureFlashTest { | ||
@Test | ||
void testRun() { | ||
|
||
|
||
SystemSrkEos fluid0_HC = new SystemSrkEos(); | ||
fluid0_HC.addComponent("methane", 0.7); | ||
fluid0_HC.addComponent("ethane", 0.1); | ||
fluid0_HC.addComponent("propane", 0.1); | ||
fluid0_HC.addComponent("n-butane", 0.1); | ||
fluid0_HC.setMixingRule("classic"); | ||
|
||
fluid0_HC.setPressure(10.0, "bara"); | ||
fluid0_HC.setTemperature(0.0, "C"); | ||
|
||
ThermodynamicOperations ops = new ThermodynamicOperations(fluid0_HC); | ||
try { | ||
ops.dewPointPressureFlash(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
assertEquals(9.332383561, fluid0_HC.getPressure(), 1e-2); | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...a/neqsim/thermodynamicOperations/flashOps/saturationOps/dewPointTemperatureFlashTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package neqsim.thermodynamicOperations.flashOps.saturationOps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.thermo.system.SystemSrkEos; | ||
import neqsim.thermodynamicOperations.ThermodynamicOperations; | ||
|
||
public class dewPointTemperatureFlashTest { | ||
@Test | ||
void testRun() { | ||
SystemSrkEos fluid0_HC = new SystemSrkEos(); | ||
fluid0_HC.addComponent("methane", 0.7); | ||
fluid0_HC.addComponent("ethane", 0.1); | ||
fluid0_HC.addComponent("propane", 0.1); | ||
fluid0_HC.addComponent("n-butane", 0.1); | ||
fluid0_HC.setMixingRule("classic"); | ||
|
||
fluid0_HC.setPressure(10.0, "bara"); | ||
fluid0_HC.setTemperature(0.0, "C"); | ||
|
||
ThermodynamicOperations ops = new ThermodynamicOperations(fluid0_HC); | ||
try { | ||
ops.dewPointTemperatureFlash(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
assertEquals(1.7007677589821242, fluid0_HC.getTemperature("C"), 1e-2); | ||
|
||
} | ||
} |