-
Notifications
You must be signed in to change notification settings - Fork 32
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
1 parent
ec8952b
commit b05a0b0
Showing
2 changed files
with
64 additions
and
56 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
48 changes: 48 additions & 0 deletions
48
...va/neqsim/thermodynamicOperations/flashOps/saturationOps/HydrateInhibitorwtFlashTest.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,48 @@ | ||
package neqsim.thermodynamicOperations.flashOps.saturationOps; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.thermo.system.SystemInterface; | ||
import neqsim.thermo.system.SystemSrkCPAstatoil; | ||
import neqsim.thermodynamicOperations.ThermodynamicOperations; | ||
|
||
public class HydrateInhibitorwtFlashTest { | ||
@Test | ||
void testRun() { | ||
SystemInterface testSystem = new SystemSrkCPAstatoil(273.15 + 0, 100.0); | ||
|
||
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem); | ||
|
||
testSystem.addComponent("nitrogen", 79.0); | ||
testSystem.addComponent("oxygen", 21.0); | ||
// testSystem.addComponent("ethane", 0.10); | ||
// testSystem.addComponent("propane", 0.050); | ||
// testSystem.addComponent("i-butane", 0.0050); | ||
testSystem.addComponent("MEG", 0.000001); | ||
testSystem.addComponent("water", 0.0010); | ||
testSystem.createDatabase(true); | ||
testSystem.setMixingRule(10); | ||
|
||
testSystem.init(0); | ||
testSystem.setMultiPhaseCheck(true); | ||
testSystem.setHydrateCheck(true); | ||
|
||
try { | ||
// creates HydrateInhibitorwtFlash object and calls run on it. | ||
testOps.hydrateInhibitorConcentrationSet("MEG", 0.99); | ||
double cons = 100 * testSystem.getPhase(0).getComponent("MEG").getNumberOfmoles() | ||
* testSystem.getPhase(0).getComponent("MEG").getMolarMass() | ||
/ (testSystem.getPhase(0).getComponent("MEG").getNumberOfmoles() | ||
* testSystem.getPhase(0).getComponent("MEG").getMolarMass() | ||
+ testSystem.getPhase(0).getComponent("water").getNumberOfmoles() | ||
* testSystem.getPhase(0).getComponent("water").getMolarMass()); | ||
assertEquals(98.54736778391424, cons); | ||
} catch (Exception ex) { | ||
ex.toString(); | ||
} | ||
// testSystem.display(); | ||
|
||
assertEquals(0.019690143220139962, | ||
testSystem.getPhase(0).getComponent("MEG").getNumberOfmoles()); | ||
} | ||
} |