-
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.
bugfix: assure correct initialization of in and outstream (#364)
chore: added test files for SimpleAbsorber, SimpleAdsorber and HeatExchanger
- Loading branch information
1 parent
f5de02b
commit 63d5aaa
Showing
9 changed files
with
188 additions
and
188 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
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
37 changes: 37 additions & 0 deletions
37
src/test/java/neqsim/processSimulation/processEquipment/absorber/SimpleAbsorberTest.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,37 @@ | ||
package neqsim.processSimulation.processEquipment.absorber; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.processSimulation.processEquipment.stream.Stream; | ||
|
||
public class SimpleAbsorberTest { | ||
neqsim.thermo.system.SystemFurstElectrolyteEos testSystem; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
testSystem = new neqsim.thermo.system.SystemFurstElectrolyteEos((273.15 + 80.0), 50.00); | ||
testSystem.addComponent("methane", 120.00); | ||
testSystem.addComponent("CO2", 20.0); | ||
testSystem.createDatabase(true); | ||
testSystem.setMixingRule(4); | ||
} | ||
|
||
@Test | ||
void testRun() { | ||
Stream stream_Hot = new Stream("Stream1", testSystem); | ||
neqsim.processSimulation.processEquipment.absorber.SimpleAbsorber absorber1 = | ||
new neqsim.processSimulation.processEquipment.absorber.SimpleAbsorber("absorber", | ||
stream_Hot); | ||
absorber1.setAproachToEquilibrium(0.75); | ||
|
||
// todo: Test is not well behaved | ||
/* | ||
* neqsim.processSimulation.processSystem.ProcessSystem operations = new | ||
* neqsim.processSimulation.processSystem.ProcessSystem(); operations.add(stream_Hot); | ||
* operations.add(absorber1); | ||
* | ||
* operations.run(); | ||
*/ | ||
// operations.displayResult(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/test/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorberTest.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,37 @@ | ||
package neqsim.processSimulation.processEquipment.adsorber; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.processSimulation.processEquipment.stream.Stream; | ||
|
||
public class SimpleAdsorberTest { | ||
neqsim.thermo.system.SystemFurstElectrolyteEos testSystem; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
testSystem = new neqsim.thermo.system.SystemFurstElectrolyteEos((273.15 + 80.0), 50.00); | ||
testSystem.addComponent("methane", 120.00); | ||
testSystem.addComponent("CO2", 20.0); | ||
testSystem.createDatabase(true); | ||
testSystem.setMixingRule(4); | ||
} | ||
|
||
@Test | ||
void testRun() { | ||
Stream stream_Hot = new Stream("Stream1", testSystem); | ||
neqsim.processSimulation.processEquipment.adsorber.SimpleAdsorber adsorber1 = | ||
new neqsim.processSimulation.processEquipment.adsorber.SimpleAdsorber("adsorber", | ||
stream_Hot); | ||
adsorber1.setAproachToEquilibrium(0.75); | ||
|
||
// todo: Test is not well behaved | ||
/* | ||
* neqsim.processSimulation.processSystem.ProcessSystem operations = new | ||
* neqsim.processSimulation.processSystem.ProcessSystem(); operations.add(stream_Hot); | ||
* operations.add(adsorber1); | ||
* | ||
* operations.run(); | ||
*/ | ||
// operations.displayResult(); | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
src/test/java/neqsim/processSimulation/processEquipment/heatExchanger/HeatExchangerTest.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,102 @@ | ||
package neqsim.processSimulation.processEquipment.heatExchanger; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.processSimulation.processEquipment.separator.Separator; | ||
import neqsim.processSimulation.processEquipment.stream.Stream; | ||
import neqsim.processSimulation.processEquipment.util.Recycle; | ||
import neqsim.processSimulation.processEquipment.valve.ThrottlingValve; | ||
import neqsim.thermodynamicOperations.ThermodynamicOperations; | ||
|
||
/** | ||
* <p> | ||
* HeatExchanger Test class. | ||
* </p> | ||
* | ||
* @author asmund | ||
* @version $Id: $Id | ||
* @since 2.2.3 | ||
*/ | ||
public class HeatExchangerTest { | ||
static neqsim.thermo.system.SystemInterface testSystem; | ||
static Stream gasStream; | ||
|
||
@BeforeEach | ||
static void setUp() { | ||
neqsim.thermo.system.SystemInterface testSystem = | ||
new neqsim.thermo.system.SystemSrkEos((273.15 + 60.0), 20.00); | ||
testSystem.addComponent("methane", 120.00); | ||
testSystem.addComponent("ethane", 120.0); | ||
testSystem.addComponent("n-heptane", 3.0); | ||
testSystem.createDatabase(true); | ||
testSystem.setMixingRule(2); | ||
ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem); | ||
testOps.TPflash(); | ||
} | ||
|
||
@Test | ||
public static void test_Run1(String args[]) { | ||
Stream stream_Hot = new Stream("Stream1", testSystem); | ||
Stream stream_Cold = new Stream("Stream1", testSystem.clone()); | ||
|
||
HeatExchanger heatEx = new HeatExchanger("heatEx"); | ||
heatEx.setFeedStream(0, stream_Hot); | ||
heatEx.setFeedStream(1, stream_Cold);// resyc.getOutStream()); | ||
|
||
Separator sep = new Separator("sep", stream_Hot); | ||
|
||
Stream oilOutStream = new Stream("oilOutStream", sep.getLiquidOutStream()); | ||
|
||
ThrottlingValve valv1 = new ThrottlingValve("valv1", oilOutStream); | ||
valv1.setOutletPressure(5.0); | ||
|
||
Recycle resyc = new Recycle("resyc"); | ||
resyc.addStream(valv1.getOutStream()); | ||
resyc.setOutletStream(stream_Cold); | ||
|
||
neqsim.processSimulation.processSystem.ProcessSystem operations = | ||
new neqsim.processSimulation.processSystem.ProcessSystem(); | ||
operations.add(stream_Hot); | ||
operations.add(heatEx); | ||
operations.add(sep); | ||
operations.add(oilOutStream); | ||
operations.add(valv1); | ||
operations.add(resyc); | ||
|
||
operations.run(); | ||
|
||
// heatEx.getOutStream(0).displayResult(); | ||
// resyc.getOutStream().displayResult(); | ||
} | ||
|
||
@Test | ||
public static void test_Run2(String args[]) { | ||
Stream stream_Hot = new Stream("Stream1", testSystem); | ||
|
||
neqsim.thermo.system.SystemInterface testSystem2 = | ||
new neqsim.thermo.system.SystemSrkEos((273.15 + 40.0), 20.00); | ||
testSystem2.addComponent("methane", 220.00); | ||
testSystem2.addComponent("ethane", 120.0); | ||
// testSystem2.createDatabase(true); | ||
testSystem2.setMixingRule(2); | ||
ThermodynamicOperations testOps2 = new ThermodynamicOperations(testSystem2); | ||
testOps2.TPflash(); | ||
|
||
Stream stream_Cold = new Stream("Stream2", testSystem2); | ||
|
||
neqsim.processSimulation.processEquipment.heatExchanger.HeatExchanger heatExchanger1 = | ||
new neqsim.processSimulation.processEquipment.heatExchanger.HeatExchanger("heatEx", | ||
stream_Hot, stream_Cold); | ||
|
||
neqsim.processSimulation.processSystem.ProcessSystem operations = | ||
new neqsim.processSimulation.processSystem.ProcessSystem(); | ||
operations.add(stream_Hot); | ||
operations.add(stream_Cold); | ||
operations.add(heatExchanger1); | ||
|
||
operations.run(); | ||
// operations.displayResult(); | ||
// heatExchanger1.getOutStream(0).displayResult(); | ||
// heatExchanger1.getOutStream(1).displayResult(); | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
src/test/java/neqsim/processSimulation/util/example/AbsorberTest.java
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
src/test/java/neqsim/processSimulation/util/example/HeatExchanger.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.