-
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.
possible to calc out pressure of valve (#897)
* possible to calc out pressure of valve * added test to pipeline flow * remove output * prepare version 2.5.16
- Loading branch information
Showing
8 changed files
with
130 additions
and
92 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
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
70 changes: 70 additions & 0 deletions
70
src/test/java/neqsim/processSimulation/processEquipment/pipeline/PipelineTest.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,70 @@ | ||
package neqsim.processSimulation.processEquipment.pipeline; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import neqsim.processSimulation.processEquipment.stream.Stream; | ||
|
||
public class PipelineTest { | ||
|
||
@Test | ||
public void testMain() { | ||
|
||
double flow = 60.0; | ||
double temperature = 20.0; | ||
double pressure = 200.0; | ||
|
||
double diameter = 1.0; | ||
double length = 700000.0; | ||
double elevation = 0; | ||
double wallroughness = 5e-6; | ||
|
||
neqsim.thermo.system.SystemInterface testSystem = | ||
new neqsim.thermo.system.SystemSrkEos((273.15 + temperature), pressure); | ||
testSystem.addComponent("methane", 0.9); | ||
testSystem.addComponent("ethane", 0.1); | ||
testSystem.setMixingRule("classic"); | ||
|
||
Stream stream_1 = new Stream("Stream1", testSystem); | ||
stream_1.setFlowRate(flow, "MSm3/day"); | ||
stream_1.setTemperature(temperature, "C"); | ||
stream_1.setPressure(pressure, "bara"); | ||
|
||
stream_1.run(); | ||
OnePhasePipeLine pipeline = new OnePhasePipeLine("pipeline", stream_1); | ||
pipeline.setNumberOfLegs(1); | ||
pipeline.setPipeDiameters(new double[] {diameter, diameter}); | ||
pipeline.setLegPositions(new double[] {0, length}); | ||
pipeline.setHeightProfile(new double[] {0, elevation}); | ||
pipeline.setPipeWallRoughness(new double[] {wallroughness, wallroughness}); | ||
pipeline.setOuterTemperatures(new double[] {temperature + 273.15, temperature + 273.15}); | ||
pipeline.setPipeOuterHeatTransferCoefficients(new double[] {15.0, 15.0}); | ||
pipeline.setPipeWallHeatTransferCoefficients(new double[] {15.0, 15.0}); | ||
|
||
AdiabaticPipe simplePipeline = new AdiabaticPipe("simplePipeline", stream_1); | ||
simplePipeline.setDiameter(diameter); | ||
simplePipeline.setLength(length); | ||
simplePipeline.setPipeWallRoughness(wallroughness); | ||
simplePipeline.setInletElevation(0); | ||
simplePipeline.setOutletElevation(elevation); | ||
|
||
PipeBeggsAndBrills beggsBrilsPipe = new PipeBeggsAndBrills("simplePipeline 2", stream_1); | ||
beggsBrilsPipe.setPipeWallRoughness(wallroughness); | ||
beggsBrilsPipe.setLength(length); | ||
beggsBrilsPipe.setElevation(elevation); | ||
beggsBrilsPipe.setDiameter(diameter); | ||
|
||
neqsim.processSimulation.processSystem.ProcessSystem operations = | ||
new neqsim.processSimulation.processSystem.ProcessSystem(); | ||
operations.add(stream_1); | ||
operations.add(pipeline); | ||
operations.add(simplePipeline); | ||
operations.add(beggsBrilsPipe); | ||
operations.run(); | ||
|
||
// pipeline.run(); | ||
|
||
Assertions.assertEquals(123.876927, pipeline.getOutletPressure("bara"), 0.1); | ||
Assertions.assertEquals(120.711887695240, simplePipeline.getOutletPressure(), 0.1); | ||
Assertions.assertEquals(113.983562217178, beggsBrilsPipe.getOutletPressure(), 0.1); | ||
} | ||
} |
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