Skip to content

Pragmatic naming #331

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

Merged
merged 7 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -3,12 +3,6 @@
import neqsim.util.NamedBaseClass;

public abstract class SimulationBaseClass extends NamedBaseClass implements SimulationInterface {

@Deprecated
public SimulationBaseClass() {
super("");
}

public SimulationBaseClass(String name) {
super(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;

import org.apache.commons.lang.SerializationUtils;

import neqsim.processSimulation.SimulationBaseClass;
import neqsim.processSimulation.controllerDevice.ControllerDeviceInterface;
import neqsim.processSimulation.mechanicalDesign.MechanicalDesign;
Expand Down Expand Up @@ -38,9 +36,6 @@ public abstract class ProcessEquipmentBaseClass extends SimulationBaseClass
public EnergyStream energyStream = new EnergyStream();
private boolean isSetEnergyStream = false;

public ProcessEquipmentBaseClass() {
}

/**
* <p>
* Constructor for ProcessEquipmentBaseClass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ public class SimpleAdsorber extends ProcessEquipmentBaseClass {
* Constructor for SimpleAdsorber.
* </p>
*/
@Deprecated
public SimpleAdsorber() {
this("SimpleAdsorber");
}

public SimpleAdsorber(String name) {
super(name);
}

/**
Expand All @@ -47,6 +53,7 @@ public SimpleAdsorber() {
* object
*/
public SimpleAdsorber(StreamInterface inStream1) {
this();
outStream = new Stream[2];
inStream = new Stream[2];
this.inStream[0] = inStream1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
import java.text.DecimalFormat;
import java.text.FieldPosition;
import java.util.Objects;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import neqsim.processSimulation.mechanicalDesign.compressor.CompressorMechanicalDesign;
import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
Expand Down Expand Up @@ -61,7 +58,13 @@ public class Compressor extends ProcessEquipmentBaseClass implements CompressorI
* Constructor for Compressor.
* </p>
*/
@Deprecated
public Compressor() {
this("Compressor");
}

public Compressor(String name) {
super(name);
}

/**
Expand All @@ -87,8 +90,7 @@ public Compressor(StreamInterface inletStream) {
* object
*/
public Compressor(String name, StreamInterface inletStream) {
this();
this.name = name;
this(name);
setInletStream(inletStream);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ public class Condenser extends SimpleTray {
* <p>
* Constructor for Condenser.
* </p>
*
* @param name
*/
public Condenser() {}
public Condenser(String name) {
super(name);
}

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.processSimulation.processEquipment.heatExchanger.Heater;
import neqsim.processSimulation.processEquipment.mixer.Mixer;
Expand Down Expand Up @@ -39,6 +38,7 @@ public class DistillationColumn extends ProcessEquipmentBaseClass implements Dis
Heater heater;
Separator separator2;


/**
* <p>
* Constructor for DistillationColumn.
Expand All @@ -49,19 +49,20 @@ public class DistillationColumn extends ProcessEquipmentBaseClass implements Dis
* @param hasCondenser a boolean
*/
public DistillationColumn(int numberOfTraysLocal, boolean hasReboiler, boolean hasCondenser) {
super("DistillationColumn");
this.hasReboiler = hasReboiler;
this.hasCondenser = hasCondenser;
distoperations = new neqsim.processSimulation.processSystem.ProcessSystem();
this.numberOfTrays = numberOfTraysLocal;
if (hasReboiler) {
trays.add(new Reboiler());
trays.add(new Reboiler("Reboiler"));
this.numberOfTrays++;
}
for (int i = 0; i < numberOfTraysLocal; i++) {
trays.add(new SimpleTray());
trays.add(new SimpleTray("SimpleTray" + i + 1));
}
if (hasCondenser) {
trays.add(new Condenser());
trays.add(new Condenser("Condenser"));
this.numberOfTrays++;
}
for (int i = 0; i < this.numberOfTrays; i++) {
Expand Down Expand Up @@ -226,7 +227,7 @@ public void setNumberOfTrays(int number) {

if (change > 0) {
for (int i = 0; i < change; i++) {
trays.add(1, new SimpleTray());
trays.add(1, new SimpleTray("SimpleTray" + oldNumberOfTrays + i + 1));
}
} else if (change < 0) {
for (int i = 0; i > change; i--) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ public class Reboiler extends neqsim.processSimulation.processEquipment.distilla
* <p>
* Constructor for Reboiler.
* </p>
*
* @param name
*/
public Reboiler() {}
public Reboiler(String name) {
super(name);
}

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ public class SimpleTray extends neqsim.processSimulation.processEquipment.mixer.
* <p>
* Constructor for SimpleTray.
* </p>
*
* @param name
*/
public SimpleTray() {}
public SimpleTray(String name) {
super(name);
}

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ public class VLSolidTray extends SimpleTray {
* <p>
* Constructor for VLSolidTray.
* </p>
*
* @param name
*/
public VLSolidTray() {}
public VLSolidTray(String name) {
super(name);
}

/** {@inheritDoc} */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public class ExpanderOld extends ProcessEquipmentBaseClass implements ExpanderIn
* Constructor for ExpanderOld.
* </p>
*/
public ExpanderOld() {}
public ExpanderOld() {
super("ExpanderOld");
}

/**
* <p>
Expand All @@ -46,7 +48,9 @@ public ExpanderOld() {}
*
* @param inletStream a {@link neqsim.processSimulation.processEquipment.stream.Stream} object
*/
@Deprecated
public ExpanderOld(Stream inletStream) {
this();
setInletStream(inletStream);
}

Expand All @@ -60,7 +64,7 @@ public ExpanderOld(Stream inletStream) {
* object
*/
public ExpanderOld(String name, StreamInterface inletStream) {
this.name = name;
super(name);
setInletStream(inletStream);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@ public class Filter extends ProcessEquipmentBaseClass {
* @param inStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
@Deprecated
public Filter(StreamInterface inStream) {
this("Filter", inStream);
}

/**
* <p>
* Constructor for Filter.
* </p>
*
* @param name
* @param inStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
public Filter(String name, StreamInterface inStream) {
super(name);
this.inStream = inStream;
outStream = (Stream) inStream.clone();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public class Heater extends ProcessEquipmentBaseClass implements HeaterInterface
* Constructor for Heater.
* </p>
*/
public Heater() {}
@Deprecated
public Heater() {
super("Heater");
}

/**
* <p>
Expand All @@ -49,10 +52,9 @@ public Heater() {}
* @param inStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
@Deprecated
public Heater(StreamInterface inStream) {
this.inStream = inStream;
system = inStream.getThermoSystem().clone();
outStream = new Stream(system);
this("Heater", inStream);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public class ReBoiler extends ProcessEquipmentBaseClass {
* Constructor for ReBoiler.
* </p>
*/
public ReBoiler() {}
@Deprecated
public ReBoiler() {
super("Reboiler");
}

/**
* <p>
Expand All @@ -37,7 +40,23 @@ public ReBoiler() {}
* @param inStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
@Deprecated
public ReBoiler(StreamInterface inStream) {
this();
this.inStream = inStream;
outStream = inStream.clone();
}

/**
* <p>
* Constructor for ReBoiler.
* </p>
*
* @param inStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
public ReBoiler(String name, StreamInterface inStream) {
super(name);
this.inStream = inStream;
outStream = inStream.clone();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
import java.text.FieldPosition;
import java.util.ArrayList;
import java.util.Objects;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.processSimulation.processEquipment.stream.Stream;
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
Expand Down Expand Up @@ -44,7 +41,9 @@ public class Mixer extends ProcessEquipmentBaseClass implements MixerInterface {
* Constructor for Mixer.
* </p>
*/
public Mixer() {}
public Mixer() {
super("Mixer");
}

/**
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public class Pipeline extends ProcessEquipmentBaseClass implements PipeLineInter
* Constructor for Pipeline.
* </p>
*/
@Deprecated
public Pipeline() {
super("Pipeline");
}

/**
Expand All @@ -59,6 +61,7 @@ public Pipeline() {
* @param inStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
@Deprecated
public Pipeline(StreamInterface inStream) {
this();
this.inStream = inStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import neqsim.processSimulation.mechanicalDesign.compressor.CompressorMechanicalDesign;
import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass;
import neqsim.processSimulation.processEquipment.compressor.Compressor;
Expand Down Expand Up @@ -45,6 +44,7 @@ public class GasTurbine extends ProcessEquipmentBaseClass {
* </p>
*/
public GasTurbine() {
super("GasTurbine");
// needs to be changed to gas tubing mechanical design
SystemInterface airThermoSystem = neqsim.thermo.Fluid.create("air");
airThermoSystem.addComponent("CO2", 0.0);
Expand All @@ -65,6 +65,7 @@ public GasTurbine() {
* @param inletStream a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface}
* object
*/
@Deprecated
public GasTurbine(StreamInterface inletStream) {
this();
setInletStream(inletStream);
Expand Down
Loading