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

updated TwoPhaseSeparator #1255

Merged
merged 1 commit into from
Jan 13, 2025
Merged
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
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() {}
}
Loading