From 995d633b5bf75a4110ba55b723f65fef628b25f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?=
<34712686+asmfstatoil@users.noreply.github.com>
Date: Mon, 18 Mar 2024 15:50:33 +0100
Subject: [PATCH] refact: Eclipse cleanup (#959)
* refact: Eclipse cleanup
* style: whitespace
---
.../neqsim/MathLib/generalMath/TDMAsolve.java | 1 -
.../PVTsimulation/simulation/SlimTubeSim.java | 6 +-
.../ChemicalReactionOperations.java | 2 +-
.../chemicalReaction/ChemicalReaction.java | 6 +-
.../fluidMechanics/flowNode/FlowNode.java | 2 +-
.../viscosity/Viscosity.java | 2 +-
.../PhysicalProperties.java | 1 +
.../SimulationBaseClass.java | 5 +
.../CombustionEmissionsCalculator.java | 1 +
.../separator/SeparatorMechanicalDesign.java | 1 -
.../ProcessEquipmentBaseClass.java | 1 +
.../absorber/SimpleTEGAbsorber.java | 13 +-
.../absorber/WaterStripperColumn.java | 12 +-
.../adsorber/SimpleAdsorber.java | 8 +-
.../compressor/Compressor.java | 7 +
.../compressor/CompressorChartGenerator.java | 2 -
.../distillation/Condenser.java | 2 +
.../distillation/DistillationColumn.java | 17 +-
.../distillation/SimpleTray.java | 1 -
.../heatExchanger/Heater.java | 2 -
.../processEquipment/mixer/Mixer.java | 2 +-
.../pipeline/AdiabaticPipe.java | 2 +-
.../pipeline/OnePhasePipeLine.java | 2 +-
.../pipeline/PipeBeggsAndBrills.java | 3 -
.../powerGeneration/GasTurbine.java | 1 +
.../reservoir/SimpleReservoir.java | 1 +
.../separator/GasScrubberSimple.java | 1 +
.../separator/NeqGasScrubber.java | 1 +
.../processEquipment/separator/Separator.java | 3 +-
.../processEquipment/splitter/Splitter.java | 3 -
.../processEquipment/stream/Stream.java | 3 +-
.../stream/StreamInterface.java | 1 +
.../processEquipment/tank/Tank.java | 2 +-
.../processEquipment/util/FlowSetter.java | 2 +-
.../processEquipment/util/GORfitter.java | 2 +
.../util/MoleFractionControllerUtil.java | 1 +
.../processEquipment/util/NeqSimUnit.java | 1 +
.../processEquipment/util/Recycle.java | 4 +-
.../util/StreamSaturatorUtil.java | 1 +
.../processSystem/ProcessModule.java | 2 +-
.../processSystem/ProcessModuleBaseClass.java | 2 +
.../processSystem/ProcessSystem.java | 11 +-
.../AdsorptionDehydrationlModule.java | 2 +-
.../processModules/CO2RemovalModule.java | 6 +-
.../processModules/MEGReclaimerModule.java | 6 +-
.../processModules/PropaneCoolingModule.java | 2 +-
.../gasQuality/Standard_ISO15403.java | 1 -
src/main/java/neqsim/thermo/Fluid.java | 6 +-
.../neqsim/thermo/ThermodynamicModelTest.java | 2 +-
.../neqsim/thermo/atomElement/Element.java | 1 -
.../thermo/atomElement/UNIFACgroup.java | 1 +
.../neqsim/thermo/component/Component.java | 1 +
.../ComponentGEUniquacmodifiedHV.java | 2 +-
.../thermo/component/ComponentPrCPA.java | 2 +-
src/main/java/neqsim/thermo/phase/Phase.java | 2 +-
.../java/neqsim/thermo/phase/PhaseEos.java | 1 -
.../java/neqsim/thermo/phase/PhaseGE.java | 2 +-
.../java/neqsim/thermo/phase/PhasePrCPA.java | 2 +-
.../neqsim/thermo/phase/PhasePrEosvolcor.java | 2 +
.../neqsim/thermo/system/SystemThermo.java | 6 +-
.../java/neqsim/thermo/util/GERG/DETAIL.java | 2 -
.../neqsim/thermo/util/GERG/GERG2008.java | 1 -
.../thermo/util/GERG/NeqSimAGA8Detail.java | 2 +-
.../thermo/util/GERG/NeqSimGERG2008.java | 2 +-
.../thermo/util/readwrite/TablePrinter.java | 1 +
.../ThermodynamicOperations.java | 4 +-
.../flashOps/PSFlashGERG2008.java | 1 -
.../bubblePointTemperatureNoDer.java | 1 -
.../pTphaseEnvelope.java | 7 +-
.../pTphaseEnvelopeMay.java | 6 +-
.../sysNewtonRhapsonPhaseEnvelope.java | 2 +-
.../simulation/ConstantMassExpansionTest.java | 1 -
.../DifferentialLiberationTest.java | 1 -
.../ChemicalReactionOperationsTest.java | 1 -
.../shipSystem/LNGshipTest.java | 1 -
.../ControllerDeviceBaseClassTest.java | 1 -
.../distillation/DistillationColumnTest.java | 2 -
.../pipeline/PipelineTest.java | 1 -
.../util/PressureDropTest.java | 1 -
.../processSystem/OilGasProcessTest.java | 1 -
.../gasQuality/Standard_ISO15403Test.java | 1 -
.../datasmoothing/DataSmootherTest.java | 1 -
.../thermo/atomElement/ElementTest.java | 1 -
.../thermo/phase/PhasePCSAFTRahmatTest.java | 232 +++++-------------
.../thermo/system/SystemPCSAFTTest.java | 1 -
.../flashOps/Degasser.java | 5 +-
.../neqsim/util/unit/PressureUnitTest.java | 1 -
87 files changed, 178 insertions(+), 293 deletions(-)
diff --git a/src/main/java/neqsim/MathLib/generalMath/TDMAsolve.java b/src/main/java/neqsim/MathLib/generalMath/TDMAsolve.java
index 8b31b22c30..a4ffb42d3c 100644
--- a/src/main/java/neqsim/MathLib/generalMath/TDMAsolve.java
+++ b/src/main/java/neqsim/MathLib/generalMath/TDMAsolve.java
@@ -15,7 +15,6 @@
* @version $Id: $Id
*/
public final class TDMAsolve {
-
/**
* Dummy constructor, not for use. Class is to be considered static.
*/
diff --git a/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java b/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java
index c8c9b0d851..a8056b34d3 100644
--- a/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java
+++ b/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java
@@ -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(); }
@@ -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 /
diff --git a/src/main/java/neqsim/chemicalReactions/ChemicalReactionOperations.java b/src/main/java/neqsim/chemicalReactions/ChemicalReactionOperations.java
index f455b2b5d4..9b0198c65f 100644
--- a/src/main/java/neqsim/chemicalReactions/ChemicalReactionOperations.java
+++ b/src/main/java/neqsim/chemicalReactions/ChemicalReactionOperations.java
@@ -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();
diff --git a/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java b/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java
index 642e3542a0..5572bef6c2 100644
--- a/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java
+++ b/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java
@@ -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])) {
@@ -391,7 +391,7 @@ public boolean reactantsContains(String[] names) {
test = false;
}
}
- if (test == false) {
+ if (!test) {
break;
}
}
diff --git a/src/main/java/neqsim/fluidMechanics/flowNode/FlowNode.java b/src/main/java/neqsim/fluidMechanics/flowNode/FlowNode.java
index 81b63de148..0bedd2fd53 100644
--- a/src/main/java/neqsim/fluidMechanics/flowNode/FlowNode.java
+++ b/src/main/java/neqsim/fluidMechanics/flowNode/FlowNode.java
@@ -444,7 +444,7 @@ public void setBulkSystem(SystemInterface bulkSystem) {
/** {@inheritDoc} */
@Override
public FlowNodeInterface getNextNode() {
- return (FlowNodeInterface) this.clone();
+ return this.clone();
}
/** {@inheritDoc} */
diff --git a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java
index 7f90709fd0..042da61106 100644
--- a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java
+++ b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java
@@ -5,7 +5,7 @@
/**
* * Abstract class for Viscosity property.
- *
+ *
* @author Even Solbraa
*/
abstract class Viscosity extends
diff --git a/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalProperties.java b/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalProperties.java
index 3ff1399a68..068e104245 100644
--- a/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalProperties.java
+++ b/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalProperties.java
@@ -339,6 +339,7 @@ public double getKinematicViscosity() {
}
/** {@inheritDoc} */
+ @Override
public double getDiffusionCoefficient(int i, int j) {
return diffusivityCalc.getMaxwellStefanBinaryDiffusionCoefficient(i, j);
}
diff --git a/src/main/java/neqsim/processSimulation/SimulationBaseClass.java b/src/main/java/neqsim/processSimulation/SimulationBaseClass.java
index e2489859a6..307646b6bb 100644
--- a/src/main/java/neqsim/processSimulation/SimulationBaseClass.java
+++ b/src/main/java/neqsim/processSimulation/SimulationBaseClass.java
@@ -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;
@@ -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",
diff --git a/src/main/java/neqsim/processSimulation/measurementDevice/CombustionEmissionsCalculator.java b/src/main/java/neqsim/processSimulation/measurementDevice/CombustionEmissionsCalculator.java
index 8566dd5131..7296d60400 100644
--- a/src/main/java/neqsim/processSimulation/measurementDevice/CombustionEmissionsCalculator.java
+++ b/src/main/java/neqsim/processSimulation/measurementDevice/CombustionEmissionsCalculator.java
@@ -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 MapinletStream
.
*
inletStream
.
*
*/
+ @Override
public void setInletStream(StreamInterface inletStream) {
this.inletStream = inletStream;
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/separator/NeqGasScrubber.java b/src/main/java/neqsim/processSimulation/processEquipment/separator/NeqGasScrubber.java
index 75b8e212f8..5380e79c17 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/separator/NeqGasScrubber.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/separator/NeqGasScrubber.java
@@ -98,6 +98,7 @@ public GasScrubberMechanicalDesign getMechanicalDesign() {
* Setter for the field inletStream
.
*
*/
+ @Override
public void setInletStream(StreamInterface inletStream) {
this.inletStream = inletStream;
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java b/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java
index 7dac7af75b..5ff92fd37d 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java
@@ -314,7 +314,6 @@ public void runTransient(double dt, UUID id) {
run(id);
increaseTime(dt);
setCalculationIdentifier(id);
- return;
} else {
inletStreamMixer.run(id);
thermoSystem.init(3);
@@ -380,7 +379,6 @@ public void runTransient(double dt, UUID id) {
* getInternalDiameter() * getSeparatorLength();
// System.out.println("gas volume " + gasVolume + " liq volime " + liquidVolume);
setCalculationIdentifier(id);
- return;
}
}
@@ -479,6 +477,7 @@ public void setGasCarryunderFraction(double gasCarryunderFraction) {
*
*
**/
+ @Override
public void setLiquidLevel(double liquidlev) {
liquidLevel = liquidlev;
}
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/splitter/Splitter.java b/src/main/java/neqsim/processSimulation/processEquipment/splitter/Splitter.java
index 765833c95c..1e22ac0478 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/splitter/Splitter.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/splitter/Splitter.java
@@ -248,9 +248,7 @@ public void runTransient(double dt, UUID id) {
if (getCalculateSteadyState()) {
run(id);
increaseTime(dt);
- return;
} else {
-
Mixer mixer = new Mixer();
for (int i = 0; i < splitStream.length; i++) {
splitStream[i].setPressure(inletStream.getPressure());
@@ -263,7 +261,6 @@ public void runTransient(double dt, UUID id) {
inletStream.setThermoSystem(mixer.getThermoSystem());
inletStream.run();
setCalculationIdentifier(id);
- return;
}
}
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java b/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java
index d8877c3096..9ac23af967 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java
@@ -190,7 +190,7 @@ public Stream clone() {
ex.printStackTrace();
}
if (stream != null) {
- clonedSystem.setStream((Stream) stream.clone());
+ clonedSystem.setStream(stream.clone());
}
if (thermoSystem != null) {
clonedSystem.thermoSystem = thermoSystem.clone();
@@ -434,6 +434,7 @@ public void displayResult() {
*
* @return an array of {@link java.lang.String} objects
*/
+ @Override
public String[][] getResultTable() {
return getFluid().getResultTable();
}
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/stream/StreamInterface.java b/src/main/java/neqsim/processSimulation/processEquipment/stream/StreamInterface.java
index 86706217aa..534e197481 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/stream/StreamInterface.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/stream/StreamInterface.java
@@ -48,6 +48,7 @@ public interface StreamInterface extends ProcessEquipmentInterface {
* getPressure.
*
*/
+ @Override
public double getPressure(String unit);
/** {@inheritDoc} */
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java b/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java
index c28f10c6b9..c4f1f52c91 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java
@@ -122,7 +122,7 @@ public void setInletStream(StreamInterface inletStream) {
*/
public void addStream(StreamInterface newStream) {
if (numberOfInputStreams == 0) {
- setInletStream((Stream) newStream);
+ setInletStream(newStream);
} else {
inletStreamMixer.addStream(newStream);
}
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java b/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java
index 4ac6f6920e..def931f7a2 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java
@@ -80,6 +80,7 @@ public FlowSetter(String name, StreamInterface stream) {
* Setter for the field inletStream
.
*
*/
+ @Override
public void setInletStream(StreamInterface inletStream) {
this.inStream = inletStream;
try {
@@ -320,7 +321,6 @@ public void run(UUID id) {
}
public ProcessSystem createReferenceProcess(StreamInterface feedStream) {
-
ProcessSystem referenceProcess = new ProcessSystem();
StreamInterface feedStream1 = new Stream("feed stream", feedStream.getFluid());
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/GORfitter.java b/src/main/java/neqsim/processSimulation/processEquipment/util/GORfitter.java
index 7960f74268..53ef05eaf1 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/util/GORfitter.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/util/GORfitter.java
@@ -83,6 +83,7 @@ public double getGFV() {
* Setter for the field inletStream
.
*
*/
+ @Override
public void setInletStream(StreamInterface inletStream) {
this.inStream = inletStream;
try {
@@ -99,6 +100,7 @@ public void setInletStream(StreamInterface inletStream) {
*
* @return a double
*/
+ @Override
public double getPressure() {
return pressure;
}
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/MoleFractionControllerUtil.java b/src/main/java/neqsim/processSimulation/processEquipment/util/MoleFractionControllerUtil.java
index 6d93ba46ce..901c261eeb 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/util/MoleFractionControllerUtil.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/util/MoleFractionControllerUtil.java
@@ -46,6 +46,7 @@ public MoleFractionControllerUtil(StreamInterface inletStream) {
* Setter for the field inletStream
.
*
*/
+ @Override
public void setInletStream(StreamInterface inletStream) {
this.inStream = inletStream;
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java b/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java
index 87af343110..9ee7a3f63e 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java
@@ -54,6 +54,7 @@ public NeqSimUnit(StreamInterface inletStream, String equipment, String flowPatt
* Setter for the field inletStream
.
*
*/
+ @Override
public void setInletStream(StreamInterface inletStream) {
this.inStream = inletStream;
diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java b/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java
index d1a2ade68a..95a5f45ddb 100644
--- a/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java
+++ b/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java
@@ -257,6 +257,7 @@ public double calcMixStreamEnthalpy() {
*
* @return a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface} object
*/
+ @Override
@Deprecated
public StreamInterface getOutStream() {
return mixedStream;
@@ -334,7 +335,7 @@ public void run(UUID id) {
setErrorFlow(massBalanceCheck2());
logger.debug("comp recycle error: " + getError());
logger.debug("flow recycle error: " + getErrorFlow());
- lastIterationStream = (Stream) mixedStream.clone();
+ lastIterationStream = mixedStream.clone();
outletStream.setThermoSystem(mixedStream.getThermoSystem());
outletStream.setCalculationIdentifier(id);
logger.info(
@@ -549,6 +550,7 @@ public ArrayListinletStream
.
*
*/
+ @Override
public void setInletStream(StreamInterface inletStream) {
this.inStream = inletStream;
diff --git a/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java b/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java
index ed528a1d22..1ea56eea15 100644
--- a/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java
+++ b/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java
@@ -152,7 +152,7 @@ public void checkModulesRecycles() {
for (ProcessSystem operation : addedUnitOperations) {
for (ProcessEquipmentInterface unitOperation : operation.getUnitOperations()) {
if (unitOperation instanceof Recycle) {
- recycleModules.add((Recycle) unitOperation);
+ recycleModules.add(unitOperation);
}
}
}
diff --git a/src/main/java/neqsim/processSimulation/processSystem/ProcessModuleBaseClass.java b/src/main/java/neqsim/processSimulation/processSystem/ProcessModuleBaseClass.java
index d88a67e5a4..5b07668b52 100644
--- a/src/main/java/neqsim/processSimulation/processSystem/ProcessModuleBaseClass.java
+++ b/src/main/java/neqsim/processSimulation/processSystem/ProcessModuleBaseClass.java
@@ -227,6 +227,7 @@ public String getConditionAnalysisMessage() {
*
* @return an array of {@link java.lang.String} objects
*/
+ @Override
public String[][] getResultTable() {
return null;
}
@@ -238,6 +239,7 @@ public String[][] getResultTable() {
* getPressure.
*
*/
+ @Override
public double getPressure(String unit) {
return 1.0;
}
diff --git a/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java b/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java
index d0a2a555cd..6f33680ec6 100644
--- a/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java
+++ b/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java
@@ -432,8 +432,8 @@ public void run(UUID id) {
if (!unitOperations.get(i).getClass().getSimpleName().equals("Recycle")) {
try {
if (iter == 1
- || ((ProcessEquipmentInterface) unitOperations.get(i)).needRecalculation()) {
- ((ProcessEquipmentInterface) unitOperations.get(i)).run(id);
+ || unitOperations.get(i).needRecalculation()) {
+ unitOperations.get(i).run(id);
}
} catch (Exception ex) {
// String error = ex.getMessage();
@@ -443,7 +443,7 @@ public void run(UUID id) {
if (unitOperations.get(i).getClass().getSimpleName().equals("Recycle")
&& recycleController.doSolveRecycle((Recycle) unitOperations.get(i))) {
try {
- ((ProcessEquipmentInterface) unitOperations.get(i)).run(id);
+ unitOperations.get(i).run(id);
} catch (Exception ex) {
// String error = ex.getMessage();
logger.error(ex.getMessage(), ex);
@@ -485,7 +485,7 @@ public void run(UUID id) {
} while ((!isConverged || (iter < 2 && hasResycle)) && iter < 100);
for (int i = 0; i < unitOperations.size(); i++) {
- ((ProcessEquipmentInterface) unitOperations.get(i)).setCalculationIdentifier(id);
+ unitOperations.get(i).setCalculationIdentifier(id);
}
setCalculationIdentifier(id);
@@ -541,6 +541,7 @@ public boolean solved() {
*
* @return a double
*/
+ @Override
public double getTime() {
return time;
}
@@ -730,6 +731,7 @@ public void setTimeStep(double timeStep) {
*
* @return the name
*/
+ @Override
public String getName() {
return name;
}
@@ -741,6 +743,7 @@ public String getName() {
* Setter for the field name
.
*
*/
+ @Override
public void setName(String name) {
this.name = name;
}
diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java
index dc0518bfbe..2710bd0ce3 100644
--- a/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java
+++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java
@@ -108,7 +108,7 @@ public void initializeStreams() {
for (int i = 0; i < numberOfAdsorptionBeds; i++) {
adsorber[i] = new SimpleAdsorber("SimpleAdsorber_" + i + 1, gasStreamToAdsorber);
}
- this.gasStreamFromAdsorber = (Stream) this.gasStreamToAdsorber.clone();
+ this.gasStreamFromAdsorber = this.gasStreamToAdsorber.clone();
this.gasStreamFromAdsorber.setName("Stream from Adsorber");
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/CO2RemovalModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/CO2RemovalModule.java
index 9352b7e63c..be73f092d0 100644
--- a/src/main/java/neqsim/processSimulation/processSystem/processModules/CO2RemovalModule.java
+++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/CO2RemovalModule.java
@@ -63,7 +63,7 @@ public void run(UUID id) {
}
getOperations().run(id);
- streamFromAbsorber = (Stream) inletSeparator.getGasOutStream().clone();
+ streamFromAbsorber = inletSeparator.getGasOutStream().clone();
streamFromAbsorber.getThermoSystem().addComponent("CO2", -streamFromAbsorber.getThermoSystem()
.getPhase(0).getComponent("CO2").getNumberOfMolesInPhase() * 0.99);
streamFromAbsorber.getThermoSystem().addComponent("MEG", -streamFromAbsorber.getThermoSystem()
@@ -77,10 +77,10 @@ public void run(UUID id) {
public void initializeStreams() {
isInitializedStreams = true;
try {
- this.streamFromAbsorber = (Stream) this.streamToAbsorber.clone();
+ this.streamFromAbsorber = this.streamToAbsorber.clone();
this.streamFromAbsorber.setName("Stream from ABsorber");
- this.gasFromCO2Stripper = (Stream) this.streamToAbsorber.clone();
+ this.gasFromCO2Stripper = this.streamToAbsorber.clone();
this.gasFromCO2Stripper.setName("Gas stream from Stripper");
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/MEGReclaimerModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/MEGReclaimerModule.java
index 0eb12202bf..6160a1a464 100644
--- a/src/main/java/neqsim/processSimulation/processSystem/processModules/MEGReclaimerModule.java
+++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/MEGReclaimerModule.java
@@ -73,13 +73,13 @@ public StreamInterface getOutputStream(String streamName) {
public void initializeStreams() {
isInitializedStreams = true;
try {
- this.streamToWaterRemoval = (Stream) this.streamToReclaimer.clone();
+ this.streamToWaterRemoval = this.streamToReclaimer.clone();
this.streamToWaterRemoval.setName("Desalted MEG stream");
- this.streamFromBoosterCompressor = (Stream) this.streamToReclaimer.clone();
+ this.streamFromBoosterCompressor = this.streamToReclaimer.clone();
this.streamFromBoosterCompressor.setName("Stream from Booster Compressor");
- this.streamWithWaste = (Stream) this.streamToReclaimer.clone();
+ this.streamWithWaste = this.streamToReclaimer.clone();
this.streamWithWaste.setName("Reclaimer Waste Stream");
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/PropaneCoolingModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/PropaneCoolingModule.java
index c3883e1cfa..1c049eec28 100644
--- a/src/main/java/neqsim/processSimulation/processSystem/processModules/PropaneCoolingModule.java
+++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/PropaneCoolingModule.java
@@ -111,7 +111,7 @@ public void initializeModule() {
Heater condenser = new Heater("propane condenser", compressor1.getOutletStream());
condenser.setPressureDrop(0.07);
condenser.setSpecification("out stream");
- condenser.setOutletStream((Stream) refrigerantStream);
+ condenser.setOutletStream(refrigerantStream);
System.out.println("adding operations....");
getOperations().add(refrigerantStream);
diff --git a/src/main/java/neqsim/standards/gasQuality/Standard_ISO15403.java b/src/main/java/neqsim/standards/gasQuality/Standard_ISO15403.java
index 3c3077c72b..acd10f97fc 100644
--- a/src/main/java/neqsim/standards/gasQuality/Standard_ISO15403.java
+++ b/src/main/java/neqsim/standards/gasQuality/Standard_ISO15403.java
@@ -42,7 +42,6 @@ public void calculate() {
/** {@inheritDoc} */
@Override
public double getValue(String returnParameter) {
-
if (returnParameter.equals("MON")) {
return MON;
} else if (returnParameter.equals("NM")) {
diff --git a/src/main/java/neqsim/thermo/Fluid.java b/src/main/java/neqsim/thermo/Fluid.java
index a490b4a219..555a346d49 100644
--- a/src/main/java/neqsim/thermo/Fluid.java
+++ b/src/main/java/neqsim/thermo/Fluid.java
@@ -39,7 +39,7 @@ public neqsim.thermo.system.SystemInterface getFluid() {
}
/**
- *
+ *
*/
private void setThermoModel() {
if (thermoModel.equals("srk")) {
@@ -83,7 +83,7 @@ public neqsim.thermo.system.SystemInterface create2(String[] componentNames, dou
String unit) {
setThermoModel();
createFluid(componentNames, flowrate, unit);
- if (isHasWater() == true) {
+ if (isHasWater()) {
fluid.addComponent("water", 0.1);
}
fluid.createDatabase(true);
@@ -208,7 +208,7 @@ public neqsim.thermo.system.SystemInterface create(String fluidType) {
return null;
}
- if (isHasWater() == true) {
+ if (isHasWater()) {
fluid.addComponent("water", 0.1);
}
fluid.createDatabase(true);
diff --git a/src/main/java/neqsim/thermo/ThermodynamicModelTest.java b/src/main/java/neqsim/thermo/ThermodynamicModelTest.java
index 44b43a1e83..e9853dc03a 100644
--- a/src/main/java/neqsim/thermo/ThermodynamicModelTest.java
+++ b/src/main/java/neqsim/thermo/ThermodynamicModelTest.java
@@ -423,7 +423,7 @@ public boolean checkNumerically() {
/**
* Setter for property maxError
.
- *
+ *
* @param maxErr before test will report failed Set maximum allowed error in model check
*/
public void setMaxError(double maxErr) {
diff --git a/src/main/java/neqsim/thermo/atomElement/Element.java b/src/main/java/neqsim/thermo/atomElement/Element.java
index 014b3767cc..dd9b308078 100644
--- a/src/main/java/neqsim/thermo/atomElement/Element.java
+++ b/src/main/java/neqsim/thermo/atomElement/Element.java
@@ -43,7 +43,6 @@ public Element(String name) {
try (neqsim.util.database.NeqSimDataBase database = new neqsim.util.database.NeqSimDataBase();
java.sql.ResultSet dataSet =
database.getResultSet(("SELECT * FROM element WHERE componentname='" + name + "'"))) {
-
if (!dataSet.next()) {
return;
}
diff --git a/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java b/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java
index df47c24957..3beaa2da26 100644
--- a/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java
+++ b/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java
@@ -237,6 +237,7 @@ public int hashCode() {
/** {@inheritDoc} */
// @Override
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
diff --git a/src/main/java/neqsim/thermo/component/Component.java b/src/main/java/neqsim/thermo/component/Component.java
index 254ee3ea26..0f445b7f87 100644
--- a/src/main/java/neqsim/thermo/component/Component.java
+++ b/src/main/java/neqsim/thermo/component/Component.java
@@ -2188,6 +2188,7 @@ public double getVolumeCorrectionT() {
*
* @return a double
*/
+ @Override
public double getVolumeCorrection() {
return 0.0;
}
diff --git a/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java b/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java
index a0c16c996d..86d78508fa 100644
--- a/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java
+++ b/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java
@@ -11,7 +11,7 @@
/**
* Abstract class ComponentGEUniquacmodifiedHV
- *
+ *
* @author Even Solbraa
*/
abstract class ComponentGEUniquacmodifiedHV extends ComponentGEUniquac {
diff --git a/src/main/java/neqsim/thermo/component/ComponentPrCPA.java b/src/main/java/neqsim/thermo/component/ComponentPrCPA.java
index 854c8d9156..2f42683da4 100644
--- a/src/main/java/neqsim/thermo/component/ComponentPrCPA.java
+++ b/src/main/java/neqsim/thermo/component/ComponentPrCPA.java
@@ -5,7 +5,7 @@
/**
* Abstract class ComponentPrCPA.
- *
+ *
* @author Even Solbraa
*/
abstract class ComponentPrCPA extends ComponentPR implements ComponentCPAInterface {
diff --git a/src/main/java/neqsim/thermo/phase/Phase.java b/src/main/java/neqsim/thermo/phase/Phase.java
index f25374a0ae..975edf491f 100644
--- a/src/main/java/neqsim/thermo/phase/Phase.java
+++ b/src/main/java/neqsim/thermo/phase/Phase.java
@@ -1315,7 +1315,7 @@ public double getLogInfiniteDiluteFugacity(int k, int p) {
/** {@inheritDoc} */
@Override
public double getLogInfiniteDiluteFugacity(int k) {
- PhaseInterface dilphase = (PhaseInterface) this.clone();
+ PhaseInterface dilphase = this.clone();
dilphase.addMoles(k, -(1.0 - 1e-10) * dilphase.getComponent(k).getNumberOfMolesInPhase());
dilphase.getComponent(k).setx(1e-10);
dilphase.init(dilphase.getNumberOfMolesInPhase(), dilphase.getNumberOfComponents(), 1,
diff --git a/src/main/java/neqsim/thermo/phase/PhaseEos.java b/src/main/java/neqsim/thermo/phase/PhaseEos.java
index 162b88bdff..9bac2f1fb6 100644
--- a/src/main/java/neqsim/thermo/phase/PhaseEos.java
+++ b/src/main/java/neqsim/thermo/phase/PhaseEos.java
@@ -80,7 +80,6 @@ public void displayInteractionCoefficients(String intType) {
@Override
public void init(double totalNumberOfMoles, int numberOfComponents, int initType, PhaseType pt,
double beta) {
-
// Replace with pt != PhaseType.GAS?
if (pt.getValue() > 1) {
pt = PhaseType.LIQUID;
diff --git a/src/main/java/neqsim/thermo/phase/PhaseGE.java b/src/main/java/neqsim/thermo/phase/PhaseGE.java
index df8797e8a0..08f0560018 100644
--- a/src/main/java/neqsim/thermo/phase/PhaseGE.java
+++ b/src/main/java/neqsim/thermo/phase/PhaseGE.java
@@ -182,7 +182,7 @@ public double getActivityCoefficientInfDilWater(int k, int p) {
* @return a double
*/
public double getActivityCoefficientInfDil(int k) {
- PhaseInterface dilphase = (PhaseInterface) this.clone();
+ PhaseInterface dilphase = this.clone();
dilphase.addMoles(k, -(1.0 - 1e-10) * dilphase.getComponent(k).getNumberOfMolesInPhase());
dilphase.getComponent(k).setx(1e-10);
dilphase.init(dilphase.getNumberOfMolesInPhase(), dilphase.getNumberOfComponents(), 1,
diff --git a/src/main/java/neqsim/thermo/phase/PhasePrCPA.java b/src/main/java/neqsim/thermo/phase/PhasePrCPA.java
index a2e528c2ca..8a1bd7e72a 100644
--- a/src/main/java/neqsim/thermo/phase/PhasePrCPA.java
+++ b/src/main/java/neqsim/thermo/phase/PhasePrCPA.java
@@ -75,7 +75,7 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int initType
gcpavv = calc_lngVV();
gcpavvv = calc_lngVVV();
}
- } while (Xsolved != true && totiter < 5);
+ } while (!Xsolved && totiter < 5);
if (initType > 1) {
hcpatotdT = calc_hCPAdT();
diff --git a/src/main/java/neqsim/thermo/phase/PhasePrEosvolcor.java b/src/main/java/neqsim/thermo/phase/PhasePrEosvolcor.java
index e57b580ef2..5b9e4e370f 100644
--- a/src/main/java/neqsim/thermo/phase/PhasePrEosvolcor.java
+++ b/src/main/java/neqsim/thermo/phase/PhasePrEosvolcor.java
@@ -303,6 +303,7 @@ public double gVV() {
*
* @return a double
*/
+ @Override
public double gVVV() {
double val1 = numberOfMolesInPhase * getMolarVolume();
double val2 = val1 + getC() - getB();
@@ -338,6 +339,7 @@ public double fVV() {
*
* @return a double
*/
+ @Override
public double fVVV() {
double val1 = numberOfMolesInPhase * molarVolume + getB() * delta1 + getC();
double val2 = numberOfMolesInPhase * molarVolume + getB() * delta2 + getC();
diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java
index d1039b8360..df38a4f0e9 100644
--- a/src/main/java/neqsim/thermo/system/SystemThermo.java
+++ b/src/main/java/neqsim/thermo/system/SystemThermo.java
@@ -2245,6 +2245,7 @@ public ChemicalReactionOperations getChemicalReactionOperations() {
* @param pt PhaseType to look for.
* @return True if system contains a phase of requested type.
*/
+ @Override
public boolean hasPhaseType(PhaseType pt) {
for (int i = 0; i < numberOfPhases; i++) {
if (getPhase(i) == null) {
@@ -2925,7 +2926,6 @@ public void setAllPhaseType(PhaseType pt) {
@Override
public void invertPhaseTypes() {
// Following code was from public void setPhaseType(int phaseToChange, String phaseTypeName) {
-
/*
* int newPhaseType = 0; if (phaseTypeName.equals("gas")) { newPhaseType = 1; } else if
* (StateOfMatter.isLiquid(PhaseType.byDesc(phaseTypeName))) { newPhaseType = 0; } else {
@@ -3857,9 +3857,8 @@ public void saveObject(int ID, String text) {
* if (!text.isEmpty()) { ps = con.prepareStatement(
* "REPLACE INTO fluidinfo (ID, TEXT) VALUES (?,?)"); ps.setInt(1, ID); ps.setString(2, text);
* }
- *
+ *
* ps.executeUpdate();
- *
*/
} catch (Exception ex) {
logger.error(ex.getMessage(), ex);
@@ -5131,6 +5130,7 @@ public void addOilFractions(String[] charNames, double[] charFlowrate, double[]
}
/** {@inheritDoc} */
+ @Override
public double getIdealLiquidDensity(String unit) {
double normalLiquidDensity = 0.0;
double molarMass = getMolarMass();
diff --git a/src/main/java/neqsim/thermo/util/GERG/DETAIL.java b/src/main/java/neqsim/thermo/util/GERG/DETAIL.java
index 6371beb565..701c7cf55f 100644
--- a/src/main/java/neqsim/thermo/util/GERG/DETAIL.java
+++ b/src/main/java/neqsim/thermo/util/GERG/DETAIL.java
@@ -251,7 +251,6 @@ public void DensityDetail(double T, double P, double[] x, doubleW D, intW ierr,
ierr.val = 1;
herr.val = "Calculation failed to converge in DETAIL method, ideal gas density returned.";
D.val = P / RDetail / T;
- return;
}
/**
@@ -1480,7 +1479,6 @@ public void SetupDetail() {
n0i[i][3] = n0i[i][3] - 1;
n0i[i][1] = n0i[i][1] - Math.log(d0);
}
- return;
// Code to produce nearly exact values for n0[1] and n0[2]
// This is not called in the current code, but included below to show how the
diff --git a/src/main/java/neqsim/thermo/util/GERG/GERG2008.java b/src/main/java/neqsim/thermo/util/GERG/GERG2008.java
index 70659aada2..f73ea75f1c 100644
--- a/src/main/java/neqsim/thermo/util/GERG/GERG2008.java
+++ b/src/main/java/neqsim/thermo/util/GERG/GERG2008.java
@@ -3196,7 +3196,6 @@ public void SetupGERG() {
n0i[i][2] = n0i[i][2] - T0;
n0i[i][1] = n0i[i][1] - Math.log(d0);
}
- return;
// Code to produce nearly exact values for n0(1) and n0(2)
// This is not called in the current code, but included below to show how the values were
diff --git a/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java b/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java
index fb8f4d2223..eac675645f 100644
--- a/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java
+++ b/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java
@@ -302,7 +302,7 @@ public void setPhase(PhaseInterface phase) {
if (molarMass > 121.0 / 1000.0)
notNormalizedGERGComposition[14] += phase.getComponent(i).getx();
break;
- };
+ }
}
normalizeComposition();
}
diff --git a/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java b/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java
index dbd3fffb19..051a75c3ce 100644
--- a/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java
+++ b/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java
@@ -310,7 +310,7 @@ public void setPhase(PhaseInterface phase) {
notNormalizedGERGComposition[14] += phase.getComponent(i).getx();
}
break;
- };
+ }
}
normalizeComposition();
}
diff --git a/src/main/java/neqsim/thermo/util/readwrite/TablePrinter.java b/src/main/java/neqsim/thermo/util/readwrite/TablePrinter.java
index 7934716b32..00bf36b8a0 100644
--- a/src/main/java/neqsim/thermo/util/readwrite/TablePrinter.java
+++ b/src/main/java/neqsim/thermo/util/readwrite/TablePrinter.java
@@ -6,6 +6,7 @@
* A utility class for pretty printing a 2D string table.
*/
public class TablePrinter implements Serializable {
+ private static final long serialVersionUID = 1L;
/**
* Prints a 2D string table in a formatted and visually appealing way.
diff --git a/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java b/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java
index 07007a3d47..91931d4885 100644
--- a/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java
+++ b/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java
@@ -1299,7 +1299,7 @@ public void bubblePointPressureFlash() throws Exception {
*/
public void bubblePointPressureFlash(boolean derivatives) throws Exception {
ConstantDutyFlashInterface operation = null;
- if (derivatives == true) {
+ if (derivatives) {
operation = new bubblePointPressureFlashDer(system);
} else {
operation = new bubblePointPressureFlash(system);
@@ -1977,7 +1977,7 @@ public CalculationResult propertyFlash(List* testSetPressure