-
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
2 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
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
41 changes: 41 additions & 0 deletions
41
src/test/java/neqsim/thermodynamicoperations/flashops/TPgradientFlashTest.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,41 @@ | ||
package neqsim.thermodynamicoperations.flashops; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.thermo.system.SystemInterface; | ||
import neqsim.thermo.system.SystemSrkEos; | ||
import neqsim.thermodynamicoperations.ThermodynamicOperations; | ||
|
||
public class TPgradientFlashTest { | ||
static Logger logger = LogManager.getLogger(TPgradientFlashTest.class); | ||
|
||
@Test | ||
void testRun() { | ||
SystemInterface testSystem = new SystemSrkEos(345, 80.0); | ||
|
||
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem); | ||
testSystem.addComponent("hydrogen", 1.0); | ||
testSystem.addComponent("methane", 8.0); | ||
testSystem.addComponent("propane", 1.0); | ||
|
||
testSystem.createDatabase(true); | ||
testSystem.setMixingRule(2); | ||
|
||
SystemInterface newSystem = null; | ||
try { | ||
try { | ||
newSystem = testOps.TPgradientFlash(1000, 355).phaseToSystem(0); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
// newSystem.prettyPrint(); | ||
} catch (Exception ex) { | ||
logger.error(ex.getMessage(), ex); | ||
} | ||
|
||
assertEquals(0.0987274603, newSystem.getComponent("hydrogen").getx(), 1e-2); | ||
} | ||
|
||
} |