Skip to content

Commit

Permalink
updated TwoPhaseSeparator (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored Jan 13, 2025
1 parent 2b1a76c commit 540fed8
Showing 1 changed file with 3 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ public class TwoPhaseSeparator extends Separator {
/** Serialization version UID. */
private static final long serialVersionUID = 1000;

SystemInterface thermoSystem;

SystemInterface gasSystem;
SystemInterface waterSystem;
SystemInterface liquidSystem;
SystemInterface thermoSystemCloned;

StreamInterface inletStream;
StreamInterface gasOutStream;
StreamInterface liquidOutStream;

/**
* Constructor for TwoPhaseSeparator.
*
Expand All @@ -43,68 +32,12 @@ public TwoPhaseSeparator(String name) {
* Constructor for TwoPhaseSeparator.
* </p>
*
* @param name a {@link java.lang.String} object
* @param inletStream a {@link neqsim.process.equipment.stream.StreamInterface} object
* @param name a {@link java.lang.String} object
* @param inletStream a {@link neqsim.process.equipment.stream.StreamInterface}
* object
*/
public TwoPhaseSeparator(String name, StreamInterface inletStream) {
super(name, inletStream);
}

/** {@inheritDoc} */
@Override
public void setInletStream(StreamInterface inletStream) {
this.inletStream = inletStream;

thermoSystem = inletStream.getThermoSystem().clone();
gasSystem = thermoSystem.phaseToSystem(thermoSystem.getPhases()[0]);
gasOutStream = new Stream("gasOutStream", gasSystem);

thermoSystem = inletStream.getThermoSystem().clone();
liquidSystem = thermoSystem.phaseToSystem(thermoSystem.getPhases()[1]);
liquidOutStream = new Stream("liquidOutStream", liquidSystem);
}

/** {@inheritDoc} */
@Override
public StreamInterface getLiquidOutStream() {
return liquidOutStream;
}

/** {@inheritDoc} */
@Override
public StreamInterface getGasOutStream() {
return gasOutStream;
}

/** {@inheritDoc} */
@Override
public StreamInterface getGas() {
return getGasOutStream();
}

/** {@inheritDoc} */
@Override
public StreamInterface getLiquid() {
return getLiquidOutStream();
}

/** {@inheritDoc} */
@Override
public void run(UUID id) {
thermoSystem = inletStream.getThermoSystem().clone();
gasSystem = thermoSystem.phaseToSystem(thermoSystem.getPhases()[0]);
gasSystem.setNumberOfPhases(1);
gasOutStream.setThermoSystem(gasSystem);

thermoSystem = inletStream.getThermoSystem().clone();
liquidSystem = thermoSystem.phaseToSystem(thermoSystem.getPhases()[1]);
liquidSystem.setNumberOfPhases(1);
liquidOutStream.setThermoSystem(liquidSystem);
setCalculationIdentifier(id);
}

/** {@inheritDoc} */
@Override
@ExcludeFromJacocoGeneratedReport
public void displayResult() {}
}

0 comments on commit 540fed8

Please sign in to comment.