Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refact mixer #438

Merged
merged 4 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,50 @@
* @version $Id: $Id
*/
public interface MixerInterface extends ProcessEquipmentInterface {
/**
* <p>
* addStream.
* </p>
*
* @param newStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
public void addStream(StreamInterface newStream);
/**
* <p>
* addStream.
* </p>
*
* @param newStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
public void addStream(StreamInterface newStream);

/**
* <p>
* getOutStream.
* </p>
*
* @return a {@link neqsim.processSimulation.processEquipment.stream.Stream} object
*/
public StreamInterface getOutStream();
/**
* <p>
* getOutStream.
* </p>
*
* @return a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface} object
*/
public StreamInterface getOutletStream();

/**
* <p>
* replaceStream.
* </p>
*
* @param i a int
* @param newStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
public void replaceStream(int i, StreamInterface newStream);
/**
* <p>
* getOutStream.
* </p>
*
* @deprecated use {@link #getOutletStream} instead
* @return a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface} object
*/
@Deprecated
default public StreamInterface getOutStream() {
return getOutletStream();
}

/** {@inheritDoc} */
@Override
public SystemInterface getThermoSystem();
/**
* <p>
* replaceStream.
* </p>
*
* @param i a int
* @param newStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
public void replaceStream(int i, StreamInterface newStream);

/** {@inheritDoc} */
@Override
public SystemInterface getThermoSystem();
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public StreamInterface getOilOutStream() {
@Override
public void run() {
inletStreamMixer.run();
thermoSystem = inletStreamMixer.getOutStream().getThermoSystem().clone();
thermoSystem = inletStreamMixer.getOutletStream().getThermoSystem().clone();

// double oilInWaterIn = 0.0001; //
// thermoSystem.getPhase("aqueous").getOilMolarConcentration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import java.util.ArrayList;
import java.util.Objects;

import neqsim.processSimulation.mechanicalDesign.separator.SeparatorMechanicalDesign;
import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.processSimulation.processEquipment.mixer.Mixer;
Expand Down Expand Up @@ -197,7 +196,7 @@ public SystemInterface getThermoSystem() {
@Override
public void run() {
inletStreamMixer.run();
thermoSystem2 = inletStreamMixer.getOutStream().getThermoSystem().clone();
thermoSystem2 = inletStreamMixer.getOutletStream().getThermoSystem().clone();
thermoSystem2.setPressure(thermoSystem2.getPressure() - pressureDrop);

if (thermoSystem2.hasPhaseType("gas")) {
Expand Down Expand Up @@ -295,20 +294,20 @@ public void runTransient(double dt) {
liquidOutStream.getThermoSystem().init(3);
double volume1 = thermoSystem.getVolume();
// System.out.println("volume1 " + volume1);
double deltaEnergy = inletStreamMixer.getOutStream().getThermoSystem().getEnthalpy()
double deltaEnergy = inletStreamMixer.getOutletStream().getThermoSystem().getEnthalpy()
- gasOutStream.getThermoSystem().getEnthalpy()
- liquidOutStream.getThermoSystem().getEnthalpy();
// System.out.println("enthalph delta " + deltaEnergy);
double newEnergy = thermoSystem.getInternalEnergy() + dt * deltaEnergy;
for (int i = 0; i < thermoSystem.getPhase(0).getNumberOfComponents(); i++) {
double dn = inletStreamMixer.getOutStream().getThermoSystem().getPhase(0).getComponent(i)
double dn = inletStreamMixer.getOutletStream().getThermoSystem().getPhase(0).getComponent(i)
.getNumberOfMolesInPhase()
+ inletStreamMixer.getOutStream().getThermoSystem().getPhase(1).getComponent(i)
+ inletStreamMixer.getOutletStream().getThermoSystem().getPhase(1).getComponent(i)
.getNumberOfMolesInPhase()
- gasOutStream.getThermoSystem().getPhase(0).getComponent(i).getNumberOfMolesInPhase()
- liquidOutStream.getThermoSystem().getPhase(0).getComponent(i).getNumberOfMolesInPhase();
// System.out.println("dn " + dn);
thermoSystem.addComponent(inletStreamMixer.getOutStream().getThermoSystem().getPhase(0)
thermoSystem.addComponent(inletStreamMixer.getOutletStream().getThermoSystem().getPhase(0)
.getComponent(i).getComponentNumber(), dn * dt);
}
ThermodynamicOperations thermoOps = new ThermodynamicOperations(thermoSystem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public StreamInterface getOilOutStream() {
@Override
public void run() {
inletStreamMixer.run();
thermoSystem = inletStreamMixer.getOutStream().getThermoSystem().clone();
thermoSystem = inletStreamMixer.getOutletStream().getThermoSystem().clone();

thermoSystem.setMultiPhaseCheck(true);
ThermodynamicOperations thermoOps = new ThermodynamicOperations(thermoSystem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void main(String[] args) {
feedGasMEGmixer.addStream(feedGasStream);
feedGasMEGmixer.addStream(MEGFeed);

Heater pipeline = new Heater("gas-MEG pipeline", feedGasMEGmixer.getOutStream());
Heater pipeline = new Heater("gas-MEG pipeline", feedGasMEGmixer.getOutletStream());
pipeline.setOutTemperature(273.15 + 35.5);
pipeline.setOutPressure(80.2);

Expand Down Expand Up @@ -119,7 +119,7 @@ public static void main(String[] args) {
MEGmixer1.addStream(slugCatcher.getGasOutStream());
MEGmixer1.addStream(MEGsplitter.getSplitStream(0));

ThrottlingValve DPvalve1 = new ThrottlingValve("DP valve 1", MEGmixer1.getOutStream());
ThrottlingValve DPvalve1 = new ThrottlingValve("DP valve 1", MEGmixer1.getOutletStream());
DPvalve1.setOutletPressure(70.0);

neqsim.processSimulation.processSystem.ProcessSystem onshoreOperations =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static void main(String args[]) {
mixer.addStream(stream_4);
mixer.addStream(stream_5);

NeqStream stream_6 = new NeqStream("after mixer stream", mixer.getOutStream());
NeqStream stream_6 = new NeqStream("after mixer stream", mixer.getOutletStream());

Pipeline pipe = new TwoPhasePipeLine("pipe", stream_6);
pipe.setOutputFileName("c:/tempAsgard.nc");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public static void main(String[] args) {
mixermp.addStream(mpseparator.getGasOutStream());

Compressor compressor2stage =
new Compressor("2nd stage recompressor", mixermp.getOutStream());
new Compressor("2nd stage recompressor", mixermp.getOutletStream());
compressor2stage.setIsentropicEfficiency(0.75);
// compressor2stage.setOutletPressure(75.0);

Expand All @@ -172,7 +172,7 @@ public static void main(String[] args) {
mixer.addStream(scrubbberfrom2ndstage.getGasOutStream());

Heater dewPointScrubberCooler =
new Heater("dew point scrubber cooler2", mixer.getOutStream());
new Heater("dew point scrubber cooler2", mixer.getOutletStream());
dewPointScrubberCooler.setOutTemperature(273.15 + 32.3);

Separator mpscrubber =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,24 @@ public static void main(String[] args) {
MEGmixer1.addStream(inletCompressor2ndstage.getOutletStream());
MEGmixer1.addStream(MEGsplitter1.getSplitStream(0));

Cooler inletGasCooler = new Cooler("dehydration cooler", MEGmixer1.getOutStream());
Cooler inletGasCooler = new Cooler("dehydration cooler", MEGmixer1.getOutletStream());
inletGasCooler.setOutTemperature(10.0, "C");

StaticMixer MEGmixer2 = new StaticMixer("MEG mixer 2");
MEGmixer2.addStream(inletGasCooler.getOutletStream());
MEGmixer2.addStream(MEGsplitter1.getSplitStream(1));

HeatExchanger heatEx =
new HeatExchanger("gas-gas heat exchanger", MEGmixer2.getOutStream());
new HeatExchanger("gas-gas heat exchanger", MEGmixer2.getOutletStream());
heatEx.setGuessOutTemperature(273.15 - 10.0);
heatEx.setUAvalue(30000.0);

StaticMixer MEGmixer3 = new StaticMixer("MEG mixer 3");
MEGmixer3.addStream(heatEx.getOutStream(0));
MEGmixer3.addStream(MEGsplitter1.getSplitStream(2));

ThrottlingValve presRedValveLT = new ThrottlingValve("JT valve", MEGmixer3.getOutStream());
ThrottlingValve presRedValveLT =
new ThrottlingValve("JT valve", MEGmixer3.getOutletStream());
presRedValveLT.setOutletPressure(92.0);

ThreePhaseSeparator mpseparator =
Expand Down Expand Up @@ -206,7 +207,7 @@ public static void main(String[] args) {
makeupMixer.addStream(leanMEGtoMixer);
makeupMixer.addStream(makeupMEG);

Stream streamToResycle = new Stream("streamToResycle", makeupMixer.getOutStream());
Stream streamToResycle = new Stream("streamToResycle", makeupMixer.getOutletStream());

Recycle resycleLeanMEG = new Recycle("lean MEG resycle");
resycleLeanMEG.addStream(streamToResycle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ public static void main(String args[]) {
MEGmixer1.addStream(MEGstream_1);
MEGmixer1.addStream(snohvitFormationWaterStream);

ThrottlingValve valve1 = new ThrottlingValve("snohvit valve", MEGmixer1.getOutStream());
ThrottlingValve valve1 =
new ThrottlingValve("snohvit valve", MEGmixer1.getOutletStream());
valve1.setOutletPressure(125.0);

// Albatross reservoir stream
Expand All @@ -275,12 +276,13 @@ public static void main(String args[]) {
mixer1.addStream(valve1.getOutletStream());
mixer1.addStream(valve2.getOutletStream());

WaterContentAnalyser waterAnalyser3 = new WaterContentAnalyser(mixer1.getOutStream());
WaterContentAnalyser waterAnalyser3 =
new WaterContentAnalyser(mixer1.getOutletStream());
waterAnalyser3.setName("Total Water Analyser");

// Pipeline
SimpleTPoutPipeline pipeLine1 =
new SimpleTPoutPipeline("snohvit pipeline", mixer1.getOutStream());
new SimpleTPoutPipeline("snohvit pipeline", mixer1.getOutletStream());
pipeLine1.setOutPressure(55.0);
pipeLine1.setOutTemperature(273.15 + 5.0);
pipeLine1.setNumberOfLegs(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static void main(String args[]) {
mix.addStream(reboiler.getOutletStream());
mix.addStream(mixStream);

StreamInterface ReboilLiqStream = mix.getOutStream();
StreamInterface ReboilLiqStream = mix.getOutletStream();
ReboilLiqStream.setName("ReboilLiqStream");

// Stream ReboilGasStream = reboiler.getOutStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static void main(String[] args) {
Mixer mixerTOreboiler = new Mixer("reboil mxer");
mixerTOreboiler.addStream(richGLycolHeater2.getOutletStream());

Heater heaterToReboiler = new Heater("heaterToReboiler", mixerTOreboiler.getOutStream());
Heater heaterToReboiler = new Heater("heaterToReboiler", mixerTOreboiler.getOutletStream());
heaterToReboiler.setOutTemperature(273.15 + 206.6);

Separator regenerator2 = new Separator("regenerator2", heaterToReboiler.getOutletStream());
Expand Down Expand Up @@ -191,7 +191,7 @@ public static void main(String[] args) {
makeupMixer.addStream(makeupTEG);

Recycle resycleLeanTEG = new Recycle("lean TEG resycle");
resycleLeanTEG.addStream(makeupMixer.getOutStream());
resycleLeanTEG.addStream(makeupMixer.getOutletStream());

neqsim.processSimulation.processSystem.ProcessSystem operations =
new neqsim.processSimulation.processSystem.ProcessSystem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public static void main(String[] args) {
makeupMixer.addStream(makeupTEG);

Recycle resycleLeanTEG = new Recycle("lean TEG resycle");
resycleLeanTEG.addStream(makeupMixer.getOutStream());
resycleLeanTEG.addStream(makeupMixer.getOutletStream());
resycleLeanTEG.setOutletStream(TEGFeed);
resycleLeanTEG.setPriority(200);
resycleLeanTEG.setDownstreamProperty("flow rate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public static void main(String[] args) {
makeupMixer.addStream(makeupTEG);

Recycle resycleLeanTEG = new Recycle("lean TEG resycle");
resycleLeanTEG.addStream(makeupMixer.getOutStream());
resycleLeanTEG.addStream(makeupMixer.getOutletStream());
resycleLeanTEG.setOutletStream(TEGFeed);
resycleLeanTEG.setPriority(200);
resycleLeanTEG.setDownstreamProperty("flow rate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public static neqsim.processSimulation.processSystem.ProcessSystem getProcess()
makeupMixer.addStream(makeupTEG);

Recycle resycleLeanTEG = new Recycle("lean TEG resycle");
resycleLeanTEG.addStream(makeupMixer.getOutStream());
resycleLeanTEG.addStream(makeupMixer.getOutletStream());
resycleLeanTEG.setOutletStream(TEGFeed);
resycleLeanTEG.setPriority(200);
resycleLeanTEG.setDownstreamProperty("flow rate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public neqsim.processSimulation.processSystem.ProcessSystem getProcess() {
makeupMixer.addStream(makeupTEG);

Recycle resycleLeanTEG = new Recycle("lean TEG resycle");
resycleLeanTEG.addStream(makeupMixer.getOutStream());
resycleLeanTEG.addStream(makeupMixer.getOutletStream());
resycleLeanTEG.setOutletStream(TEGFeed);
resycleLeanTEG.setPriority(200);
resycleLeanTEG.setDownstreamProperty("flow rate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public neqsim.processSimulation.processSystem.ProcessSystem getProcess() {
makeupMixer.addStream(makeupTEG);

Recycle resycleLeanTEG = new Recycle("lean TEG resycle");
resycleLeanTEG.addStream(makeupMixer.getOutStream());
resycleLeanTEG.addStream(makeupMixer.getOutletStream());
resycleLeanTEG.setOutletStream(TEGFeed);
resycleLeanTEG.setPriority(200);
resycleLeanTEG.setDownstreamProperty("flow rate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void main(String args[]) {
thirdStageMixer.addStream(secondStageSeparator.getGasOutStream());

Cooler thirdSstageCoooler =
new Cooler("thirdSstageCoooler", thirdStageMixer.getOutStream());
new Cooler("thirdSstageCoooler", thirdStageMixer.getOutletStream());
thirdSstageCoooler.setOutTemperature(273.15 + 30.0);

ThreePhaseSeparator thirdStageScrubber = new ThreePhaseSeparator(
Expand All @@ -93,7 +93,7 @@ public static void main(String args[]) {
Cooler oilCooler = new Cooler("oilCooler", thirdStageSeparator.getLiquidOutStream());
oilCooler.setOutTemperature(273.15 + 30.0);

Cooler inletGasCooler = new Cooler("inletGasCooler", HPgasMixer.getOutStream());
Cooler inletGasCooler = new Cooler("inletGasCooler", HPgasMixer.getOutletStream());
inletGasCooler.setOutTemperature(273.15 + 30.0);

Separator gasInletScrubber =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static void main(String[] args) {
wellStramMixer.addStream(wellStream_1);
wellStramMixer.addStream(wellStream_2);

Stream mixerdStream = new Stream("mixed stream", wellStramMixer.getOutStream());
Stream mixerdStream = new Stream("mixed stream", wellStramMixer.getOutletStream());

neqsim.processSimulation.processSystem.ProcessSystem operations =
new neqsim.processSimulation.processSystem.ProcessSystem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void main(String args[]) {

MixerInterface mixer = new StaticMixer("Mixer 1");
mixer.addStream(stream_1);
StreamInterface stream_3 = mixer.getOutStream();
StreamInterface stream_3 = mixer.getOutletStream();
stream_3.setName("stream3");

Separator separator = new Separator("Separator 1", stream_3);
Expand Down Expand Up @@ -77,7 +77,7 @@ public static void main(String args[]) {

MixerInterface mixer2 = new StaticMixer("Mixer 1");
mixer2.addStream(stream_22);
StreamInterface stream_32 = mixer2.getOutStream();
StreamInterface stream_32 = mixer2.getOutletStream();
stream_32.setName("stream32");

Separator separator2 = new Separator("Separator 1", stream_32);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) {
mix.addStream(stream_air);
// mix.addStream(stream_water);

Separator separator = new Separator("separator", mix.getOutStream());
Separator separator = new Separator("separator", mix.getOutletStream());

Heater heater1 = new Heater("heater1", separator.getLiquidOutStream());
heater1.setOutTemperature(273.15 + 20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void main(String args[]) {
MixerInterface mixer = new StaticMixer("Mixer 1");
mixer.addStream(heater.getOutletStream());

StreamInterface stream_3 = mixer.getOutStream();
StreamInterface stream_3 = mixer.getOutletStream();
stream_3.setName("stream3");

Separator separator = new Separator("Separator 1", stream_3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public static void main(String args[]) {
propMixer.addStream(compressor1.getOutletStream());
propMixer.addStream(medPresSep.getGasOutStream());

Compressor compressor2 = new Compressor("compressor2", propMixer.getOutStream());
Compressor compressor2 = new Compressor("compressor2", propMixer.getOutletStream());
compressor2.setOutletPressure(stream_1.getPressure());

Heater cooler3 = new Heater("Heater", compressor2.getOutletStream());
cooler3.setSpecification("out stream");
cooler3.setOutStream(stream_1);
cooler3.setOutletStream(stream_1);

neqsim.processSimulation.processSystem.ProcessSystem operations =
new neqsim.processSimulation.processSystem.ProcessSystem();
Expand Down
Loading