Skip to content

Commit

Permalink
refact: Eclipse cleanup (#959)
Browse files Browse the repository at this point in the history
* refact: Eclipse cleanup
* style: whitespace
  • Loading branch information
asmfstatoil authored Mar 18, 2024
1 parent 2f3e165 commit 995d633
Show file tree
Hide file tree
Showing 87 changed files with 178 additions and 293 deletions.
1 change: 0 additions & 1 deletion src/main/java/neqsim/MathLib/generalMath/TDMAsolve.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* @version $Id: $Id
*/
public final class TDMAsolve {

/**
* Dummy constructor, not for use. Class is to be considered static.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void run() {
/*
* double totalAccumulatedVolumeAtStadardConditions =
* slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume();
*
*
* if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) {
* totalAccumulatedVolumeAtStadardConditions =
* slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); }
Expand All @@ -192,11 +192,11 @@ public void run() {
/*
* double totalAccumulatedVolumeAtStadardConditions =
* slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume();
*
*
* if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) {
* totalAccumulatedVolumeAtStadardConditions =
* slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); }
*
*
* System.out.println("accumulated VOlume " + totalAccumulatedVolumeAtStadardConditions +
* " total reference volume " + totalReferenceNodeVolumeAtStadardConditions);
* System.out.println("oil recovery ratio" + totalAccumulatedVolumeAtStadardConditions /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public boolean solveChemEq(int phase, int type) {
// System.out.println("pressure1");
calcChemRefPot(phase);
// System.out.println("pressure2");
if (firsttime == true || type == 0) {
if (firsttime || type == 0) {
try {
// System.out.println("Calculating initial estimates");
nVector = calcNVector();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,12 @@ public boolean reactantsContains(String[] names) {
test = false;
}
}
if (test == false) {
if (!test) {
break;
}
}

if (test == false) {
if (!test) {
for (int j = 0; j < productNames.length; j++) {
for (int i = 0; i < names.length; i++) {
if (names[i].equals(productNames[j])) {
Expand All @@ -391,7 +391,7 @@ public boolean reactantsContains(String[] names) {
test = false;
}
}
if (test == false) {
if (!test) {
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/neqsim/fluidMechanics/flowNode/FlowNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public void setBulkSystem(SystemInterface bulkSystem) {
/** {@inheritDoc} */
@Override
public FlowNodeInterface getNextNode() {
return (FlowNodeInterface) this.clone();
return this.clone();
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/**
* * Abstract class for Viscosity property.
*
*
* @author Even Solbraa
*/
abstract class Viscosity extends
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ public double getKinematicViscosity() {
}

/** {@inheritDoc} */
@Override
public double getDiffusionCoefficient(int i, int j) {
return diffusivityCalc.getMaxwellStefanBinaryDiffusionCoefficient(i, j);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ public SimulationBaseClass(String name) {
}

/** {@inheritDoc} */
@Override
public UUID getCalculationIdentifier() {
return calcIdentifier;
}

/** {@inheritDoc} */
@Override
public void setCalculationIdentifier(UUID value) {
if (this.calcIdentifier == null || this.calcIdentifier != value) {
this.calcIdentifier = value;
Expand All @@ -58,16 +60,19 @@ public void setCalculateSteadyState(boolean steady) {
}

/** {@inheritDoc} */
@Override
public double getTime() {
return this.time;
}

/** {@inheritDoc} */
@Override
public void setTime(double value) {
this.time = value;
}

/** {@inheritDoc} */
@Override
public void increaseTime(double dt) {
if (dt < 0) {
throw new RuntimeException(new InvalidInputException(this, "increaseTime", "dt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import neqsim.processSimulation.processEquipment.stream.StreamInterface;

public class CombustionEmissionsCalculator extends StreamMeasurementDeviceBaseClass {
private static final long serialVersionUID = 1L;

// Composition of natural gas (in mole percent)
private static final Map<String, Double> NATURAL_GAS_COMPOSITION = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public void readDesignSpecifications() {
// design")).getLiquidRetentionTime("API12J", this);
} else {
System.out.println("no separator process design specified......");
return;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public String getConditionAnalysisMessage() {
*
* @return an array of {@link java.lang.String} objects
*/
@Override
public String[][] getResultTable() {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public SimpleTEGAbsorber(String name) {
public void addStream(StreamInterface newStream) {
streams.add(newStream);
if (numberOfInputStreams == 0) {
mixedStream = (Stream) streams.get(0).clone();
mixedStream = streams.get(0).clone();
mixedStream.getThermoSystem().setNumberOfPhases(2);
mixedStream.getThermoSystem().init(0);
mixedStream.getThermoSystem().init(3);
Expand All @@ -87,8 +87,8 @@ public void addStream(StreamInterface newStream) {
*/
public void addGasInStream(StreamInterface newStream) {
// TODO: fail if gasInStream is not null?
gasInStream = (Stream) newStream;
gasOutStream = (Stream) newStream.clone();
gasInStream = newStream;
gasOutStream = newStream.clone();
addStream(newStream);
}

Expand All @@ -102,8 +102,8 @@ public void addGasInStream(StreamInterface newStream) {
*/
public void addSolventInStream(StreamInterface newStream) {
// TODO: fail if solventInStream is not null?
solventInStream = (Stream) newStream;
solventOutStream = (Stream) newStream.clone();
solventInStream = newStream;
solventOutStream = newStream.clone();
addStream(newStream);
solventStreamNumber = streams.size() - 1;
}
Expand All @@ -118,7 +118,7 @@ public void addSolventInStream(StreamInterface newStream) {
*/
public void replaceSolventInStream(StreamInterface newStream) {
// TODO: fails if solventStreamNumber is 0, i.e. no solventinstream set?
solventInStream = (Stream) newStream;
solventInStream = newStream;
streams.set(solventStreamNumber, solventInStream);
}

Expand Down Expand Up @@ -430,6 +430,7 @@ public void run(UUID id) {
*
* @return a double
*/
@Override
public double getGasLoadFactor() {
double intArea = 3.14 * getInternalDiameter() * getInternalDiameter() / 4.0;
double vs = getGasOutStream().getThermoSystem().getFlowRate("m3/sec") / intArea;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public WaterStripperColumn(String name) {
public void addStream(StreamInterface newStream) {
streams.add(newStream);
if (numberOfInputStreams == 0) {
mixedStream = (Stream) streams.get(0).clone();
mixedStream = streams.get(0).clone();
mixedStream.getThermoSystem().setNumberOfPhases(2);
mixedStream.getThermoSystem().init(0);
mixedStream.getThermoSystem().init(3);
Expand All @@ -88,8 +88,8 @@ public void addStream(StreamInterface newStream) {
* object
*/
public void addGasInStream(StreamInterface newStream) {
gasInStream = (Stream) newStream;
gasOutStream = (Stream) newStream.clone();
gasInStream = newStream;
gasOutStream = newStream.clone();
addStream(newStream);
}

Expand All @@ -102,8 +102,8 @@ public void addGasInStream(StreamInterface newStream) {
* object
*/
public void addSolventInStream(StreamInterface newStream) {
solventInStream = (Stream) newStream;
solventOutStream = (Stream) newStream.clone();
solventInStream = newStream;
solventOutStream = newStream.clone();
addStream(newStream);
solventStreamNumber = streams.size() - 1;
}
Expand All @@ -117,7 +117,7 @@ public void addSolventInStream(StreamInterface newStream) {
* object
*/
public void replaceSolventInStream(StreamInterface newStream) {
solventInStream = (Stream) newStream;
solventInStream = newStream;
streams.set(solventStreamNumber, solventInStream);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public SimpleAdsorber(StreamInterface inStream1) {
this("SimpleAdsorber");
this.inStream[0] = inStream1;
this.inStream[1] = inStream1;
outStream[0] = (Stream) inStream1.clone();
outStream[1] = (Stream) inStream1.clone();
outStream[0] = inStream1.clone();
outStream[1] = inStream1.clone();

SystemInterface systemOut1 = inStream1.getThermoSystem().clone();
outStream[0].setThermoSystem(systemOut1);
Expand Down Expand Up @@ -98,8 +98,8 @@ public SimpleAdsorber(String name, StreamInterface inStream1) {
this(name);
this.inStream[0] = inStream1;
this.inStream[1] = inStream1;
outStream[0] = (Stream) inStream1.clone();
outStream[1] = (Stream) inStream1.clone();
outStream[0] = inStream1.clone();
outStream[1] = inStream1.clone();
setName(name);

SystemInterface systemOut1 = inStream1.getThermoSystem().clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public CompressorMechanicalDesign getMechanicalDesign() {
*
* @return a {@link neqsim.processSimulation.processSystem.ProcessSystem} object
*/
@Override
public Compressor copy() {
return (Compressor) super.copy();
}
Expand Down Expand Up @@ -204,6 +205,7 @@ public void setOutletPressure(double pressure, String unit) {
*
* @return a double
*/
@Override
public double getOutletPressure() {
return pressure;
}
Expand Down Expand Up @@ -1006,6 +1008,7 @@ public boolean isSurge(double flow, double head) {
return getAntiSurge().isSurge();
}

@Override
public double getDistanceToSurge() {
return (getInletStream().getFlowRate("m3/hr")
- getCompressorChart().getSurgeCurve().getSurgeFlow(getPolytropicFluidHead()))
Expand Down Expand Up @@ -1391,18 +1394,22 @@ public boolean equals(Object obj) {
&& useRigorousPolytropicMethod == other.useRigorousPolytropicMethod;
}

@Override
public void setMaximumSpeed(double maxSpeed) {
this.maxspeed = maxSpeed;
}

@Override
public void setMinimumSpeed(double minspeed) {
this.minspeed = minspeed;
}

@Override
public double getMaximumSpeed() {
return maxspeed;
}

@Override
public double getMinimumSpeed() {
return minspeed;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Compressor chart generator.
*/
public class CompressorChartGenerator {

Compressor compressor = null;

public CompressorChartGenerator(Compressor inpcompressor) {
Expand All @@ -16,7 +15,6 @@ public CompressorChartGenerator(Compressor inpcompressor) {
* @return a {@link neqsim.processSimulation.processEquipment.compressor.CompressorChart} object
*/
public CompressorChart generateCompressorChart(String generationOption) {

// Generation compressor chart
double[] chartConditions = new double[3];
chartConditions[0] = compressor.getOutletStream().getFluid().getMolarMass("kg/mol");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public double getDuty() {
*
* @return a {@link neqsim.processSimulation.processEquipment.stream.Stream} object
*/
@Override
public StreamInterface getGasOutStream() {
if (totalCondenser) {
return new Stream("", mixedStreamSplitter.getSplitStream(1));
Expand All @@ -105,6 +106,7 @@ public StreamInterface getProductOutStream() {
*
* @return a {@link neqsim.processSimulation.processEquipment.stream.Stream} object
*/
@Override
public StreamInterface getLiquidOutStream() {
if (totalCondenser) {
return new Stream("", mixedStreamSplitter.getSplitStream(0));
Expand Down
Loading

0 comments on commit 995d633

Please sign in to comment.