-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added pH analyser * Update pHProbe.java * updated pHprobe and separator response
- Loading branch information
Showing
3 changed files
with
228 additions
and
84 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
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
79 changes: 79 additions & 0 deletions
79
src/test/java/neqsim/processSimulation/measurementDevice/pHProbeTest.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,79 @@ | ||
package neqsim.processSimulation.measurementDevice; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.processSimulation.processEquipment.stream.Stream; | ||
import neqsim.thermo.system.SystemInterface; | ||
import neqsim.thermo.system.SystemSrkCPAstatoil; | ||
import neqsim.thermo.system.SystemSrkEos; | ||
|
||
class pHProbeTest { | ||
|
||
@BeforeAll | ||
static void setUpBeforeClass() throws Exception {} | ||
|
||
@Test | ||
void testGetMeasuredValue() { | ||
SystemInterface testFluid = new SystemSrkCPAstatoil(318.15, 50.0); | ||
testFluid.addComponent("nitrogen", 1.205); | ||
testFluid.addComponent("CO2", 1.340); | ||
testFluid.addComponent("methane", 87.974); | ||
testFluid.addComponent("ethane", 5.258); | ||
testFluid.addComponent("propane", 3.283); | ||
testFluid.addComponent("i-butane", 0.082); | ||
testFluid.addComponent("n-butane", 0.487); | ||
testFluid.addComponent("i-pentane", 0.056); | ||
testFluid.addComponent("n-pentane", 1.053); | ||
testFluid.addComponent("nC10", 14.053); | ||
testFluid.addComponent("water", 141.053); | ||
testFluid.setMixingRule(10); | ||
testFluid.setMultiPhaseCheck(true); | ||
|
||
Stream stream_1 = new Stream("Stream1", testFluid); | ||
stream_1.run(); | ||
|
||
pHProbe phmeasurement = new pHProbe(stream_1); | ||
phmeasurement.run(); | ||
System.out.println("pH " + phmeasurement.getMeasuredValue()); | ||
assertEquals(4.079098133484792, phmeasurement.getMeasuredValue(),0.01); | ||
} | ||
|
||
@Test | ||
void testGetMeasuredValueWithAlkanility() { | ||
SystemInterface testFluid = new SystemSrkCPAstatoil(318.15, 50.0); | ||
testFluid.addComponent("nitrogen", 1.205); | ||
testFluid.addComponent("CO2", 1.340); | ||
testFluid.addComponent("methane", 87.974); | ||
testFluid.addComponent("ethane", 5.258); | ||
testFluid.addComponent("propane", 3.283); | ||
testFluid.addComponent("i-butane", 0.082); | ||
testFluid.addComponent("n-butane", 0.487); | ||
testFluid.addComponent("i-pentane", 0.056); | ||
testFluid.addComponent("n-pentane", 1.053); | ||
testFluid.addComponent("nC10", 14.053); | ||
testFluid.addComponent("water", 141.053); | ||
testFluid.setMixingRule(10); | ||
testFluid.setMultiPhaseCheck(true); | ||
|
||
Stream stream_1 = new Stream("Stream1", testFluid); | ||
stream_1.run(); | ||
|
||
pHProbe phmeasurement = new pHProbe(stream_1); | ||
phmeasurement.setAlkanility(50.0); | ||
phmeasurement.run(); | ||
System.out.println("pH " + phmeasurement.getMeasuredValue()); | ||
assertEquals(5.629055432357595, phmeasurement.getMeasuredValue(),0.01); | ||
} | ||
|
||
@Test | ||
void testPHProbe() { | ||
//fail("Not yet implemented"); | ||
} | ||
|
||
@Test | ||
void testPHProbeStreamInterface() { | ||
//fail("Not yet implemented"); | ||
} | ||
|
||
} |