-
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.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashCPATest.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,45 @@ | ||
package neqsim.thermodynamicOperations.flashOps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.thermodynamicOperations.ThermodynamicOperations; | ||
|
||
/** | ||
* @author ESOL | ||
*/ | ||
class PHFlashCPATest { | ||
static neqsim.thermo.system.SystemInterface testSystem = null; | ||
static ThermodynamicOperations testOps = null; | ||
|
||
@Test | ||
void testRun() { | ||
testSystem = new neqsim.thermo.system.SystemSrkCPAstatoil(323.15, 100.0); | ||
testSystem.addComponent("CO2", 9.0); | ||
testSystem.addComponent("methane", 90.0); | ||
testSystem.addComponent("ethane", 12.0); | ||
testSystem.addComponent("propane", 1.0); | ||
testSystem.addComponent("i-butane", 1.0); | ||
testSystem.addComponent("n-butane", 1.0); | ||
testSystem.addComponent("i-pentane", 1.0); | ||
testSystem.addComponent("n-pentane", 1.0); | ||
testSystem.addComponent("n-hexane", 0.001); | ||
testSystem.addComponent("water", 10.0); | ||
testSystem.addComponent("MEG", 10.0); | ||
testSystem.setMixingRule(10); | ||
testSystem.setMultiPhaseCheck(true); | ||
|
||
testOps = new ThermodynamicOperations(testSystem); | ||
testOps.TPflash(); | ||
testSystem.initProperties(); | ||
double enthalpy = testSystem.getEnthalpy(); | ||
double entropy = testSystem.getEntropy(); | ||
testSystem.setPressure(50.0); | ||
testOps.PHflash(enthalpy); | ||
assertEquals(enthalpy, testSystem.getEnthalpy(), 1e-2); | ||
assertEquals(307.5036701214, testSystem.getTemperature(), 1e-2); | ||
testOps.PSflash(entropy); | ||
assertEquals(287.0197047, testSystem.getTemperature(), 1e-2); | ||
} | ||
|
||
|
||
} |