Skip to content

Commit

Permalink
fix: ensure that getters return
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Oct 28, 2024
1 parent 06386f5 commit d8bb9f5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ public SimpleAbsorber(String name, StreamInterface inStream1) {
outStream[1].run();
}

/** {@inheritDoc} */
@Override
public AbsorberMechanicalDesign getMechanicalDesign() {
return new AbsorberMechanicalDesign(this);
}

/** {@inheritDoc} */
@Override
public void setName(String name) {
Expand Down Expand Up @@ -160,24 +154,26 @@ public void setOutTemperature(double temperature) {

/**
* <p>
* getOutTemperature.
* Get temperature of outstream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getOutTemperature(int i) {
outStream[i].getThermoSystem().getTemperature();
public double getOutTemperature(int i) {
return outStream[i].getThermoSystem().getTemperature();
}

/**
* <p>
* getInTemperature.
* * Get temperature of instream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getInTemperature(int i) {
inStream[i].getThermoSystem().getTemperature();
public double getInTemperature(int i) {
return inStream[i].getThermoSystem().getTemperature();
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -371,4 +367,10 @@ public double getWettingRate() {
double intArea = 3.14 * getInternalDiameter() * getInternalDiameter() / 4.0;
return getLiquidOutStream().getThermoSystem().getFlowRate("m3/hr") / intArea;
}

/** {@inheritDoc} */
@Override
public AbsorberMechanicalDesign getMechanicalDesign() {
return new AbsorberMechanicalDesign(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ public SimpleAdsorber(String name, StreamInterface inStream1) {
outStream[1].run();
}

/** {@inheritDoc} */
@Override
public AdsorberMechanicalDesign getMechanicalDesign() {
return new AdsorberMechanicalDesign(this);
}

/** {@inheritDoc} */
@Override
public void setName(String name) {
Expand Down Expand Up @@ -125,24 +119,24 @@ public void setOutTemperature(double temperature) {

/**
* <p>
* getOutTemperature.
* Get temperature of outstream i.
* </p>
*
* @param i a int
*/
public void getOutTemperature(int i) {
outStream[i].getThermoSystem().getTemperature();
public double getOutTemperature(int i) {
return outStream[i].getThermoSystem().getTemperature();
}

/**
* <p>
* getInTemperature.
* Get temperature of instream i.
* </p>
*
* @param i a int
*/
public void getInTemperature(int i) {
inStream[i].getThermoSystem().getTemperature();
public double getInTemperature(int i) {
return inStream[i].getThermoSystem().getTemperature();
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -316,4 +310,10 @@ public double getNTU() {
public void setNTU(double NTU) {
this.NTU = NTU;
}

/** {@inheritDoc} */
@Override
public AdsorberMechanicalDesign getMechanicalDesign() {
return new AdsorberMechanicalDesign(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class HeatExchanger extends Heater implements HeatExchangerInterface {
public double thermalEffectiveness = 0.0;
private String flowArrangement = "concentric tube counterflow";
private boolean useDeltaT = false;
private double deltaT = 1.0;

/**
* Constructor for HeatExchanger.
Expand All @@ -64,11 +65,7 @@ public HeatExchanger(String name) {
* @param inStream1 input stream
*/
public HeatExchanger(String name, StreamInterface inStream1) {
this(name);
this.inStream[0] = inStream1;
this.inStream[1] = inStream1;
outStream[0] = inStream1.clone();
outStream[1] = inStream1.clone();
this(name, inStream1, inStream1);
}

/**
Expand All @@ -84,23 +81,26 @@ public HeatExchanger(String name, StreamInterface inStream1, StreamInterface inS
this.inStream[1] = inStream2;
outStream[0] = inStream1.clone();
outStream[1] = inStream2.clone();
setName(name);
}

/**
* <p>
* addInStream.
* Add inlet stream.
* </p>
*
* @param inStream a {@link neqsim.processsimulation.processequipment.stream.StreamInterface}
* object
*/
public void addInStream(StreamInterface inStream) {
// todo: this is probably intended to specifically set the second stream. should be deprecated
// and replaced by setFeedStream?
this.inStream[1] = inStream;
}

/**
* <p>
* setFeedStream.
* setFeedStream. Will also set name of outstreams.
* </p>
*
* @param number a int
Expand All @@ -110,6 +110,7 @@ public void addInStream(StreamInterface inStream) {
public void setFeedStream(int number, StreamInterface inStream) {
this.inStream[number] = inStream;
outStream[number] = inStream.clone();
setName(getName());
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -152,24 +153,26 @@ public void setOutTemperature(double temperature) {

/**
* <p>
* getOutTemperature.
* Get temperature of outstream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getOutTemperature(int i) {
outStream[i].getThermoSystem().getTemperature();
public double getOutTemperature(int i) {
return outStream[i].getThermoSystem().getTemperature();
}

/**
* <p>
* getInTemperature.
* Get temperature of instream i.
* </p>
*
* @param i a int
* @return a double
*/
public void getInTemperature(int i) {
inStream[i].getThermoSystem().getTemperature();
public double getInTemperature(int i) {
return inStream[i].getThermoSystem().getTemperature();
}

/**
Expand Down Expand Up @@ -225,13 +228,12 @@ public void runSpecifiedStream(UUID id) {

/**
* <p>
* runSpecifiedStream.
* runDeltaT.
* </p>
*
* @param id UUID of run
*/
public void runDeltaT(UUID id) {

if (getSpecification().equals("out stream")) {
runSpecifiedStream(id);
} else if (firstTime) {
Expand Down Expand Up @@ -704,18 +706,20 @@ public String toJson() {
}

/**
* <p>Setter for the field <code>useDeltaT</code>.</p>
* <p>
* Setter for the field <code>useDeltaT</code>.
* </p>
*
* @param useDeltaT a boolean
*/
public void setUseDeltaT(boolean useDeltaT) {
this.useDeltaT = useDeltaT;
}

private double deltaT = 1.0;

/**
* <p>Getter for the field <code>deltaT</code>.</p>
* <p>
* Getter for the field <code>deltaT</code>.
* </p>
*
* @return a double
*/
Expand All @@ -724,7 +728,9 @@ public double getDeltaT() {
}

/**
* <p>Setter for the field <code>deltaT</code>.</p>
* <p>
* Setter for the field <code>deltaT</code>.
* </p>
*
* @param deltaT a double
*/
Expand Down

0 comments on commit d8bb9f5

Please sign in to comment.