Skip to content

Commit

Permalink
refact: construct named objects
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Sep 25, 2024
1 parent f48492c commit 4557d1f
Show file tree
Hide file tree
Showing 28 changed files with 497 additions and 602 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public void DistillationColumnTest() throws Exception {
gasToReboilerStream.setPressure(1.12, "bara");
gasToReboilerStream.run();

DistillationColumn column = new DistillationColumn(1, true, true);
column.setName("TEG regeneration column");
DistillationColumn column = new DistillationColumn("TEG regeneration column", 1, true, true);
column.addFeedStream(richTEGStream, 1);
column.getReboiler().setOutTemperature(273.15 + 202);
column.getCondenser().setOutTemperature(273.15 + 88.165861);
Expand Down Expand Up @@ -143,8 +142,7 @@ public void deethanizerTest() throws Exception {

// gasToDeethanizerStream.getFluid().prettyPrint();

DistillationColumn column = new DistillationColumn(5, true, false);
column.setName("Deethanizer");
DistillationColumn column = new DistillationColumn("Deethanizer", 5, true, false);
column.addFeedStream(gasToDeethanizerStream, 5);
column.getReboiler().setOutTemperature(105.0 + 273.15);
column.setTopPressure(30.0);
Expand Down Expand Up @@ -189,8 +187,7 @@ public void debutanizerTest() throws Exception {

// gasToDebutanizerStream.getFluid().prettyPrint();

DistillationColumn column = new DistillationColumn(1, true, true);
column.setName("Deethanizer");
DistillationColumn column = new DistillationColumn("Deethanizer", 1, true, true);
column.addFeedStream(gasToDebutanizerStream, 1);
((Condenser) column.getCondenser()).setRefluxRatio(0.1);
((Condenser) column.getCondenser()).setTotalCondenser(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public void setUpBeforeClass() throws Exception {
testSystem = new SystemSrkEos(298.0, 10.0);
testSystem.addComponent("methane", 100.0);
processOps = new ProcessSystem();
Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ void testRun() {
SystemSrkEos testSystem2 = testSystem.clone();
testSystem2.setMolarComposition(new double[] {0.1, 0.4, 0.4});

Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(10.0, "bara");
inletStream.setTemperature(20.0, "C");
inletStream.setFlowRate(3.0, "MSm3/day");
inletStream.run();

Stream inletStream2 = new Stream("inletStream", testSystem2);
inletStream2.setName("inlet stream");
Stream inletStream2 = new Stream("inlet stream", testSystem2);
inletStream2.setPressure(10.0, "bara");
inletStream2.setTemperature(20.0, "C");
inletStream2.setFlowRate(2.0, "MSm3/day");
Expand Down Expand Up @@ -55,14 +53,12 @@ void testRun2() {

ProcessSystem processOps = new ProcessSystem();

Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(10.0, "bara");
inletStream.setTemperature(20.0, "C");
inletStream.setFlowRate(3.0, "MSm3/day");

Stream inletStream2 = new Stream("inletStream", testSystem2);
inletStream2.setName("inlet stream");
Stream inletStream2 = new Stream("inlet stream", testSystem2);
inletStream2.setPressure(10.0, "bara");
inletStream2.setTemperature(20.0, "C");
inletStream2.setFlowRate(2.0, "MSm3/day");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testPipeLineBeggsAndBrills() {
Stream stream_1 = new Stream("Stream1", testSystem);
stream_1.setFlowRate(massFlowRate, "kg/hr");

PipeBeggsAndBrills pipe = new PipeBeggsAndBrills(stream_1);
PipeBeggsAndBrills pipe = new PipeBeggsAndBrills("pipe1", stream_1);
pipe.setPipeWallRoughness(5e-6);
pipe.setLength(10.0);
pipe.setAngle(0);
Expand Down Expand Up @@ -166,7 +166,7 @@ public void testPipeLineBeggsAndBrills3() {
Stream stream_1 = new Stream("Stream1", testSystem);
stream_1.setFlowRate(massFlowRate, "kg/hr");

PipeBeggsAndBrills pipe = new PipeBeggsAndBrills(stream_1);
PipeBeggsAndBrills pipe = new PipeBeggsAndBrills("pipe1", stream_1);
pipe.setPipeWallRoughness(0);
pipe.setLength(410.0);
pipe.setElevation(300);
Expand Down Expand Up @@ -229,7 +229,7 @@ public void testPipeLineBeggsAndBrills4() {
Stream stream_1 = new Stream("Stream1", testSystem);
stream_1.setFlowRate(massFlowRate, "kg/hr");

PipeBeggsAndBrills pipe = new PipeBeggsAndBrills(stream_1);
PipeBeggsAndBrills pipe = new PipeBeggsAndBrills("pipe1", stream_1);
pipe.setPipeWallRoughness(0);
pipe.setLength(1500.0);
pipe.setElevation(-1000);
Expand Down Expand Up @@ -284,7 +284,7 @@ public void testPipeLineBeggsAndBrills4() {
Stream stream_2 = new Stream("Stream1", testSystem2);
stream_2.setFlowRate(massFlowRate, "kg/hr");

PipeBeggsAndBrills pipe2 = new PipeBeggsAndBrills(stream_2);
PipeBeggsAndBrills pipe2 = new PipeBeggsAndBrills("pipe2", stream_2);
pipe2.setPipeWallRoughness(0);
pipe2.setLength(1500.0);
pipe2.setElevation(-1000);
Expand Down Expand Up @@ -323,7 +323,7 @@ public void testPipeLineBeggsAndBrills4() {
Stream stream_3 = new Stream("Stream1", testSystem3);
stream_3.setFlowRate(massFlowRate, "kg/hr");

PipeBeggsAndBrills pipe3 = new PipeBeggsAndBrills(stream_3);
PipeBeggsAndBrills pipe3 = new PipeBeggsAndBrills("pipe3", stream_3);
pipe3.setPipeWallRoughness(0);
pipe3.setLength(10000.0);
pipe3.setElevation(1500);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void testRunTransientRes2() {
wellflow.setWellProductionIndex(producxtionIndex);

neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills pipe =
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills(
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills("pipe",
wellflow.getOutletStream());
pipe.setPipeWallRoughness(5e-6);
pipe.setLength(170.0);
Expand All @@ -85,7 +85,7 @@ void testRunTransientRes2() {
compressor.setCompressionRatio(2.0);

neqsim.processSimulation.processEquipment.heatExchanger.Cooler intercooler =
new neqsim.processSimulation.processEquipment.heatExchanger.Cooler(
new neqsim.processSimulation.processEquipment.heatExchanger.Cooler("cooler",
compressor.getOutletStream());
intercooler.setOutTemperature(25.0, "C");

Expand All @@ -103,7 +103,7 @@ void testRunTransientRes2() {
cooler1.setOutTemperature(30.0, "C");

neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills pipeline =
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills(
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills("pipeline",
cooler1.getOutletStream());
pipeline.setPipeWallRoughness(50e-6);
pipeline.setLength(50 * 1e3);
Expand Down Expand Up @@ -161,13 +161,13 @@ void testRunTransient() {
wellflow.setInletStream(producedGasStream);
wellflow.setWellProductionIndex(10.000100751427403E-3);

PipeBeggsAndBrills pipe = new PipeBeggsAndBrills(wellflow.getOutletStream());
PipeBeggsAndBrills pipe = new PipeBeggsAndBrills("pipe", wellflow.getOutletStream());
pipe.setPipeWallRoughness(5e-6);
pipe.setLength(300.0);
pipe.setElevation(300);
pipe.setDiameter(0.625);

PipeBeggsAndBrills pipeline = new PipeBeggsAndBrills(pipe.getOutletStream());
PipeBeggsAndBrills pipeline = new PipeBeggsAndBrills("pipeline", pipe.getOutletStream());
pipeline.setPipeWallRoughness(5e-6);
pipeline.setLength(60000.0);
pipeline.setElevation(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public void setUpBeforeClass() throws Exception {
testSystem.addComponent("ethane", 10.0);
testSystem.addComponent("propane", 10.0);
processOps = new ProcessSystem();
Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand All @@ -55,8 +54,7 @@ public void configSplitter() {
testSystem.addComponent("ethane", 10.0);
testSystem.addComponent("propane", 10.0);
processOps = new ProcessSystem();
Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down Expand Up @@ -87,8 +85,7 @@ public void testRunSplitter() {
testSystem.addComponent("ethane", 10.0);
testSystem.addComponent("propane", 10.0);
processOps = new ProcessSystem();
Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down Expand Up @@ -133,8 +130,7 @@ public void testRunSplitter2() {

processOps = new ProcessSystem();

Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(55.0, "bara");
inletStream.setTemperature(25.0, "C");
inletStream.setFlowRate(5.0, "MSm3/day");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public void setUpBeforeClass() throws Exception {
testSystem = new SystemSrkEos(298.0, 10.0);
testSystem.addComponent("methane", 100.0);
processOps = new ProcessSystem();
Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public void setUpBeforeClass() throws Exception {
testSystem.addComponent("methane", 100.0);
testSystem.addComponent("ethane", 100.0);
processOps = new ProcessSystem();
inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ void testRun() {
fluid1.setMixingRule("classic");

neqsim.processSimulation.processEquipment.stream.Stream stream1 =
new neqsim.processSimulation.processEquipment.stream.Stream(fluid1.clone());
new neqsim.processSimulation.processEquipment.stream.Stream("light oil", fluid1.clone());
stream1.setFlowRate(1.5, "MSm3/day");
stream1.setPressure(bottomholepressure, "bara");
stream1.setTemperature(75.0, "C");

neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills flowline1 =
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills(stream1);
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills("flowline",
stream1);
flowline1.setDiameter(0.25);
flowline1.setPipeWallRoughness(15e-6);
flowline1.setLength(1200);
Expand Down Expand Up @@ -54,13 +55,14 @@ void testRun2() {
fluid1.setMixingRule("classic");

neqsim.processSimulation.processEquipment.stream.Stream stream1 =
new neqsim.processSimulation.processEquipment.stream.Stream(fluid1.clone());
new neqsim.processSimulation.processEquipment.stream.Stream("light oil", fluid1.clone());
stream1.setFlowRate(4.0, "MSm3/day");
stream1.setPressure(170, "bara");
stream1.setTemperature(75.0, "C");

neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills flowline1 =
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills(stream1);
new neqsim.processSimulation.processEquipment.pipeline.PipeBeggsAndBrills("flowline",
stream1);
flowline1.setDiameter(0.25);
flowline1.setPipeWallRoughness(15e-6);
flowline1.setLength(1200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void testProcessWithFlowSetter() {

StreamInterface feedStream = flowset.getOutletStream();

ThreePhaseSeparator separator = new ThreePhaseSeparator(feedStream);
ThreePhaseSeparator separator = new ThreePhaseSeparator("sep", feedStream);

StreamInterface gasFromSepStream = separator.getGasOutStream();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ void testRun() {
neqsim.thermo.system.SystemInterface testSystem = new SystemSrkEos(298.0, 100.0);
testSystem.addComponent("methane", 100.0);

Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ void testRun() {
testSystem.addComponent("methane", 100.0);
testSystem.addComponent("water", 1.0);

Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down Expand Up @@ -67,8 +66,7 @@ void testNeedRecalculation() {
testSystem.addComponent("methane", 100.0);
testSystem.addComponent("water", 1.0);

Stream inletStream = new Stream("inletStream", testSystem);
inletStream.setName("inlet stream");
Stream inletStream = new Stream("inlet stream", testSystem);
inletStream.setPressure(pressure_inlet, "bara");
inletStream.setTemperature(temperature_inlet, "C");
inletStream.setFlowRate(gasFlowRate, "MSm3/day");
Expand Down
Loading

0 comments on commit 4557d1f

Please sign in to comment.