Skip to content

Commit

Permalink
Split-test (#722)
Browse files Browse the repository at this point in the history
* initial work

* added more implementations

* added methods for stream and saturator

* added test for recalculation to process module

* added calc check heater/cooler

* style

* Update Heater.java

* revert

* Update Stream.java

* added check for null

* update

* fixed database parameters

* fixed db table

* added test and fixed bugs

* added test for recalc for mxer

* add test

* fixed bug

* set private

* update

* update

* use solved property remove isUpdated

* testelectrolyteEos

* added updates to test

* remove logging

* fixed error

* fix error

* fix

* fix

* fix splitter bug added test

* update test

---------

Co-authored-by: Åsmund Våge Fannemel <34712686+asmfstatoil@users.noreply.github.com>
  • Loading branch information
EvenSol and asmfstatoil authored Jun 4, 2023
1 parent 8177128 commit 1edd007
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public void setSplitNumber(int i) {
splitNumber = i;
splitFactor = new double[splitNumber];
splitFactor[0] = 1.0;
setInletStream(inletStream);
if (inletStream != null) {
setInletStream(inletStream);
}
}

/**
Expand Down Expand Up @@ -147,7 +149,9 @@ public void setFlowRates(double[] flowRates, String flowUnit) {
}

/**
* <p>calcSplitFactors.</p>
* <p>
* calcSplitFactors.
* </p>
*/
public void calcSplitFactors() {
double sum = 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ public void setUpBeforeClass() throws Exception {
processOps.add(stream2);
}

@Test
public void configSplitter() {
testSystem = new SystemSrkEos(298.0, 10.0);
testSystem.addComponent("methane", 100.0);
testSystem.addComponent("ethane", 10.0);
testSystem.addComponent("propane", 10.0);
processOps = new ProcessSystem();
Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
inletStream.run();
Splitter splitter = new Splitter("splitter", inletStream, 3);
splitter.run();
assertEquals(0.815104472498348, splitter.getSplitStream(0).getFluid().getPhase(0).getZ(), 0.01);
assertEquals(0.815104472498348, splitter.getSplitStream(1).getFluid().getPhase(0).getZ(), 0.01);
assertEquals(0.815104472498348, splitter.getSplitStream(2).getFluid().getPhase(0).getZ(), 0.01);
}


@Test
public void testRun() {
processOps.run();
Expand Down

0 comments on commit 1edd007

Please sign in to comment.