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 Map NATURAL_GAS_COMPOSITION = new HashMap<>(); diff --git a/src/main/java/neqsim/processSimulation/mechanicalDesign/separator/SeparatorMechanicalDesign.java b/src/main/java/neqsim/processSimulation/mechanicalDesign/separator/SeparatorMechanicalDesign.java index 4491391a01..e718eca581 100644 --- a/src/main/java/neqsim/processSimulation/mechanicalDesign/separator/SeparatorMechanicalDesign.java +++ b/src/main/java/neqsim/processSimulation/mechanicalDesign/separator/SeparatorMechanicalDesign.java @@ -78,7 +78,6 @@ public void readDesignSpecifications() { // design")).getLiquidRetentionTime("API12J", this); } else { System.out.println("no separator process design specified......"); - return; } } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentBaseClass.java b/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentBaseClass.java index 8ceaacab5f..f09d13cc00 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentBaseClass.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentBaseClass.java @@ -248,6 +248,7 @@ public String getConditionAnalysisMessage() { * * @return an array of {@link java.lang.String} objects */ + @Override public String[][] getResultTable() { return null; } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java b/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java index d9fc256ef3..18a6020846 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java @@ -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); @@ -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); } @@ -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; } @@ -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); } @@ -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; diff --git a/src/main/java/neqsim/processSimulation/processEquipment/absorber/WaterStripperColumn.java b/src/main/java/neqsim/processSimulation/processEquipment/absorber/WaterStripperColumn.java index 654e3c246b..ff502e6495 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/absorber/WaterStripperColumn.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/absorber/WaterStripperColumn.java @@ -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); @@ -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); } @@ -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; } @@ -117,7 +117,7 @@ public void addSolventInStream(StreamInterface newStream) { * object */ public void replaceSolventInStream(StreamInterface newStream) { - solventInStream = (Stream) newStream; + solventInStream = newStream; streams.set(solventStreamNumber, solventInStream); } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorber.java b/src/main/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorber.java index fd9b62dd37..233e4ac14f 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorber.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorber.java @@ -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); @@ -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(); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java b/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java index 9ad463572f..244264afb1 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java @@ -152,6 +152,7 @@ public CompressorMechanicalDesign getMechanicalDesign() { * * @return a {@link neqsim.processSimulation.processSystem.ProcessSystem} object */ + @Override public Compressor copy() { return (Compressor) super.copy(); } @@ -204,6 +205,7 @@ public void setOutletPressure(double pressure, String unit) { * * @return a double */ + @Override public double getOutletPressure() { return pressure; } @@ -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())) @@ -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; } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartGenerator.java b/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartGenerator.java index 7645dff291..bc9c2f91cf 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartGenerator.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartGenerator.java @@ -4,7 +4,6 @@ * Compressor chart generator. */ public class CompressorChartGenerator { - Compressor compressor = null; public CompressorChartGenerator(Compressor inpcompressor) { @@ -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"); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java b/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java index 30a647b621..14975f1081 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java @@ -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)); @@ -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)); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumn.java b/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumn.java index 820cc016fb..c10e58b94c 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumn.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumn.java @@ -316,11 +316,11 @@ public void run(UUID id) { for (int i = 0; i < numberOfTrays; i++) { trays.get(i).setPressure(bottomTrayPressure - i * dp); } - SystemInterface inpS = (SystemInterface) feedStream.getThermoSystem().clone(); + SystemInterface inpS = feedStream.getThermoSystem().clone(); getTray(feedTrayNumber).getStream(0).setThermoSystem(inpS); if (numberOfTrays == 1) { - ((SimpleTray) trays.get(0)).run(id); + trays.get(0).run(id); gasOutStream.setThermoSystem(trays.get(0).getGasOutStream().getThermoSystem().clone()); liquidOutStream.setThermoSystem(trays.get(0).getLiquidOutStream().getThermoSystem().clone()); } else { @@ -331,7 +331,7 @@ public void run(UUID id) { double errOld; int iter = 0; double[] oldtemps = new double[numberOfTrays]; - ((SimpleTray) trays.get(feedTrayNumber)).run(id); + trays.get(feedTrayNumber).run(id); do { iter++; @@ -346,12 +346,12 @@ public void run(UUID id) { ((Mixer) trays.get(i - 1)).replaceStream(replaceStream1, trays.get(i).getLiquidOutStream()); trays.get(i - 1).setPressure(bottomTrayPressure - (i - 1) * dp); - ((SimpleTray) trays.get(i - 1)).run(id); + trays.get(i - 1).run(id); } int streamNumb = trays.get(0).getNumberOfInputStreams() - 1; trays.get(0).setPressure(bottomTrayPressure); ((Mixer) trays.get(0)).replaceStream(streamNumb, trays.get(1).getLiquidOutStream()); - ((SimpleTray) trays.get(0)).run(id); + trays.get(0).run(id); for (int i = 1; i <= numberOfTrays - 1; i++) { int replaceStream = trays.get(i).getNumberOfInputStreams() - 2; @@ -359,14 +359,14 @@ public void run(UUID id) { replaceStream = trays.get(i).getNumberOfInputStreams() - 1; } ((Mixer) trays.get(i)).replaceStream(replaceStream, trays.get(i - 1).getGasOutStream()); - ((SimpleTray) trays.get(i)).run(id); + trays.get(i).run(id); } for (int i = numberOfTrays - 2; i >= feedTrayNumber; i--) { int replaceStream = trays.get(i).getNumberOfInputStreams() - 1; ((Mixer) trays.get(i)).replaceStream(replaceStream, trays.get(i + 1).getLiquidOutStream()); - ((SimpleTray) trays.get(i)).run(id); + trays.get(i).run(id); } for (int i = 0; i < numberOfTrays; i++) { err += Math.abs( @@ -387,7 +387,7 @@ public void run(UUID id) { for (int i = 0; i < numberOfTrays; i++) { // TODO: set calculation ids of child elements of trays - ((SimpleTray) trays.get(i)).setCalculationIdentifier(id); + trays.get(i).setCalculationIdentifier(id); } } setCalculationIdentifier(id); @@ -727,6 +727,7 @@ public double getInternalDiameter() { * * @return a boolean */ + @Override public boolean solved() { return (err < 1e-4); } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/distillation/SimpleTray.java b/src/main/java/neqsim/processSimulation/processEquipment/distillation/SimpleTray.java index 721e369c67..91c30f713f 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/distillation/SimpleTray.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/distillation/SimpleTray.java @@ -3,7 +3,6 @@ import java.util.UUID; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import neqsim.processSimulation.processEquipment.mixer.Mixer; import neqsim.processSimulation.processEquipment.stream.Stream; import neqsim.processSimulation.processEquipment.stream.StreamInterface; import neqsim.thermo.system.SystemInterface; diff --git a/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/Heater.java b/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/Heater.java index 29313d64b0..6a3f761164 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/Heater.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/Heater.java @@ -225,13 +225,11 @@ public void runTransient(double dt, UUID id) { if (getCalculateSteadyState()) { run(id); increaseTime(dt); - return; } else { inStream.setPressure(outStream.getPressure()); inStream.run(); run(id); increaseTime(dt); - return; } } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/mixer/Mixer.java b/src/main/java/neqsim/processSimulation/processEquipment/mixer/Mixer.java index 06b4273db9..36206a9bd2 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/mixer/Mixer.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/mixer/Mixer.java @@ -85,7 +85,7 @@ public void addStream(StreamInterface newStream) { try { if (getNumberOfInputStreams() == 0) { - mixedStream = (Stream) streams.get(0).clone(); // cloning the first stream + mixedStream = streams.get(0).clone(); // cloning the first stream // mixedStream.getThermoSystem().setNumberOfPhases(2); // mixedStream.getThermoSystem().init(0); // mixedStream.getThermoSystem().init(3); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticPipe.java b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticPipe.java index a11ce27278..270fb01dd2 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticPipe.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticPipe.java @@ -77,7 +77,7 @@ public AdiabaticPipe(String name) { public AdiabaticPipe(String name, StreamInterface inStream) { this(name); this.inStream = inStream; - outStream = (Stream) inStream.clone(); + outStream = inStream.clone(); } /** diff --git a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/OnePhasePipeLine.java b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/OnePhasePipeLine.java index de6e2fada4..ab5a14d6af 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/OnePhasePipeLine.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/OnePhasePipeLine.java @@ -78,7 +78,7 @@ public void run(UUID id) { setCalculationIdentifier(oldid); pipe.solveSteadyState(10, id); // pipe.print(); - outStream.setThermoSystem((SystemInterface)pipe.getNode(pipe.getTotalNumberOfNodes() - 1).getBulkSystem().clone()); + outStream.setThermoSystem(pipe.getNode(pipe.getTotalNumberOfNodes() - 1).getBulkSystem().clone()); outStream.setCalculationIdentifier(id); setCalculationIdentifier(id); } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java index a4b82cb141..3765b013da 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java @@ -480,7 +480,6 @@ public double calcHydrostaticPressureDifference() { } if (regime != "Single Phase") { - double SG; if (system.getNumberOfPhases() == 3) { mixtureOilMassFraction = system.getPhase(1).getFlowRate("kg/hr") @@ -649,7 +648,6 @@ public double calcPressureDrop() { /** {@inheritDoc} */ @Override public void run(UUID id) { - iteration = 0; pressureProfile = new ArrayList<>(); @@ -738,7 +736,6 @@ public void run(UUID id) { public void runTransient(double dt, UUID id) { run(id); increaseTime(dt); - return; } /** {@inheritDoc} */ diff --git a/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java b/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java index bd5dae337e..9a87d44617 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java @@ -133,6 +133,7 @@ public double getPower() { * Setter for the field inletStream. *

*/ + @Override public void setInletStream(StreamInterface inletStream) { this.inStream = inletStream; try { diff --git a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java index 621dc21c1a..150d712f46 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java @@ -829,6 +829,7 @@ public double getOGIP(String unit) { * * @return a double */ + @Override public double getTime() { return time; } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/separator/GasScrubberSimple.java b/src/main/java/neqsim/processSimulation/processEquipment/separator/GasScrubberSimple.java index efd0ff4b2e..a22e965d8a 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/separator/GasScrubberSimple.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/separator/GasScrubberSimple.java @@ -97,6 +97,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/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 ArrayList getDownstreamProperty() { * * @return a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface} object */ + @Override public StreamInterface getOutletStream() { return outletStream; } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/StreamSaturatorUtil.java b/src/main/java/neqsim/processSimulation/processEquipment/util/StreamSaturatorUtil.java index 117c11b2c7..2ef35764ff 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/util/StreamSaturatorUtil.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/util/StreamSaturatorUtil.java @@ -55,6 +55,7 @@ public StreamSaturatorUtil(String name, StreamInterface inStream) { * Setter for the field inletStream. *

*/ + @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 Spec1, List Spec2, i Double[] sum = new Double[Spec1.size()]; // Verify that sum of fractions equals 1/100, i.e., assume percentages - Boolean hasOnlineFractions = onlineFractions != null; + boolean hasOnlineFractions = onlineFractions != null; if (hasOnlineFractions) { double range = 5; for (int t = 0; t < sum.length; t++) { diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008.java index 648184a5a7..99752dedef 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008.java @@ -105,6 +105,5 @@ public void run() { } solveQ(); system.init(3); - return; } } diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java index be0bd63172..abcd7d84c4 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java @@ -151,7 +151,6 @@ public void run() { && Math.abs(system.getPhases()[1].getComponents()[0].getFugacityCoefficient() / system.getPhases()[0].getComponents()[0].getFugacityCoefficient() - 1.0) < 1e-20) { setSuperCritical(true); - return; } } diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java index 7d2c2a23df..8d24a775a6 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java @@ -156,11 +156,11 @@ public void run() { continue; } if (system.getPhase(0).getComponent(i).getIonicCharge() == 0) { - if (bubblePointFirst == true && system.getPhase(0).getComponents()[speceq] + if (bubblePointFirst && system.getPhase(0).getComponents()[speceq] .getTC() > system.getPhase(0).getComponents()[i].getTC()) { speceq = system.getPhase(0).getComponent(i).getComponentNumber(); } - if (bubblePointFirst == false && system.getPhase(0).getComponents()[speceq] + if (!bubblePointFirst && system.getPhase(0).getComponents()[speceq] .getTC() < system.getPhase(0).getComponents()[i].getTC()) { speceq = system.getPhase(0).getComponent(i).getComponentNumber(); } @@ -230,7 +230,6 @@ public void run() { // double TT = system.getPhase(0).getTemperature(); // double PP = system.getPhase(0).getPressure(); } catch (Exception e0) { - // the envelope crushed. // this part keeps the old values // restarts the envelope from the other side @@ -293,7 +292,7 @@ public void run() { // System.out.println(np + " " + system.getTemperature() + " " + // system.getPressure() + " " + densV + " " + densL ); - if ((nonLinSolver.etterCP == false)) { + if (!nonLinSolver.etterCP) { if (Kvallc < 1.05 && Kvalhc > 0.95) { // close to the critical point // invert phase types and find the CP Temp and Press diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java index 1876e16029..cf3b526e2a 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java @@ -129,11 +129,11 @@ public void run() { // based on the desired first point, dew/bubble for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) { if (system.getPhase(0).getComponent(i).getIonicCharge() == 0) { - if (bubblePointFirst == true && system.getPhase(0).getComponents()[speceq] + if (bubblePointFirst && system.getPhase(0).getComponents()[speceq] .getTC() > system.getPhase(0).getComponents()[i].getTC()) { speceq = system.getPhase(0).getComponent(i).getComponentNumber(); } - if (bubblePointFirst == false && system.getPhase(0).getComponents()[speceq] + if (!bubblePointFirst && system.getPhase(0).getComponents()[speceq] .getTC() < system.getPhase(0).getComponents()[i].getTC()) { speceq = system.getPhase(0).getComponent(i).getComponentNumber(); } @@ -252,7 +252,7 @@ public void run() { // System.out.println(np + " " + system.getTemperature() + " " + // system.getPressure() + " " + densV + " " + densL ); - if ((nonLinSolver.etterCP == false)) { + if (!nonLinSolver.etterCP) { if (Kvallc < 1.05 && Kvalhc > 0.95) { // close to the critical point // invert phase types and find the CP Temp and Press diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/sysNewtonRhapsonPhaseEnvelope.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/sysNewtonRhapsonPhaseEnvelope.java index 62b6bf06ea..ba7060e99f 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/sysNewtonRhapsonPhaseEnvelope.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/sysNewtonRhapsonPhaseEnvelope.java @@ -424,7 +424,7 @@ public void calcInc(int np) { double Kvalhc = system.getPhase(0).getComponent(hc).getx() / system.getPhase(1).getComponent(hc).getx(); - if ((etterCP == false)) { + if (!etterCP) { if (Kvallc < 1.05 && Kvalhc > 0.95) { calcCP = true; etterCP = true; diff --git a/src/test/java/neqsim/PVTsimulation/simulation/ConstantMassExpansionTest.java b/src/test/java/neqsim/PVTsimulation/simulation/ConstantMassExpansionTest.java index 52fae0ed47..0ab90ab829 100644 --- a/src/test/java/neqsim/PVTsimulation/simulation/ConstantMassExpansionTest.java +++ b/src/test/java/neqsim/PVTsimulation/simulation/ConstantMassExpansionTest.java @@ -6,7 +6,6 @@ import neqsim.thermo.system.SystemSrkEos; public class ConstantMassExpansionTest { - @Test void testRunCalc() { SystemInterface tempSystem = new SystemSrkEos(273.15 + 73.0, 10.0); diff --git a/src/test/java/neqsim/PVTsimulation/simulation/DifferentialLiberationTest.java b/src/test/java/neqsim/PVTsimulation/simulation/DifferentialLiberationTest.java index 755f6a43f8..28da6cc6f7 100644 --- a/src/test/java/neqsim/PVTsimulation/simulation/DifferentialLiberationTest.java +++ b/src/test/java/neqsim/PVTsimulation/simulation/DifferentialLiberationTest.java @@ -5,7 +5,6 @@ import neqsim.thermo.system.SystemInterface; public class DifferentialLiberationTest { - @Test void testRunCalc() { SystemInterface tempSystem = FluidCreator.create("black oil"); diff --git a/src/test/java/neqsim/chemicalReactions/ChemicalReactionOperationsTest.java b/src/test/java/neqsim/chemicalReactions/ChemicalReactionOperationsTest.java index 7766160dd5..607c49bfb8 100644 --- a/src/test/java/neqsim/chemicalReactions/ChemicalReactionOperationsTest.java +++ b/src/test/java/neqsim/chemicalReactions/ChemicalReactionOperationsTest.java @@ -4,7 +4,6 @@ import neqsim.thermo.system.SystemSrkEos; public class ChemicalReactionOperationsTest { - static SystemSrkEos testSystem; @BeforeAll diff --git a/src/test/java/neqsim/fluidMechanics/flowSystem/twoPhaseFlowSystem/shipSystem/LNGshipTest.java b/src/test/java/neqsim/fluidMechanics/flowSystem/twoPhaseFlowSystem/shipSystem/LNGshipTest.java index a1061431c9..1287735344 100644 --- a/src/test/java/neqsim/fluidMechanics/flowSystem/twoPhaseFlowSystem/shipSystem/LNGshipTest.java +++ b/src/test/java/neqsim/fluidMechanics/flowSystem/twoPhaseFlowSystem/shipSystem/LNGshipTest.java @@ -7,7 +7,6 @@ import neqsim.thermo.system.SystemInterface; class LNGshipTest { - LNGship testShip; SystemInterface testSystem; diff --git a/src/test/java/neqsim/processSimulation/controllerDevice/ControllerDeviceBaseClassTest.java b/src/test/java/neqsim/processSimulation/controllerDevice/ControllerDeviceBaseClassTest.java index 010ede2656..5325a1ccf6 100644 --- a/src/test/java/neqsim/processSimulation/controllerDevice/ControllerDeviceBaseClassTest.java +++ b/src/test/java/neqsim/processSimulation/controllerDevice/ControllerDeviceBaseClassTest.java @@ -5,7 +5,6 @@ import org.junit.jupiter.api.Test; public class ControllerDeviceBaseClassTest { - static ControllerDeviceBaseClass c; @BeforeAll diff --git a/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java b/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java index 43f5c7870a..0e6d35337d 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java @@ -6,13 +6,11 @@ import neqsim.processSimulation.processEquipment.stream.StreamInterface; public class DistillationColumnTest { - /** * @throws java.lang.Exception */ @Test public void DistillationColumnTest() throws Exception { - neqsim.thermo.system.SystemInterface richTEG = new neqsim.thermo.system.SystemSrkCPAstatoil(273.15 + 42.0, 10.00); richTEG.addComponent("nitrogen", 0.0003884521907420086); diff --git a/src/test/java/neqsim/processSimulation/processEquipment/pipeline/PipelineTest.java b/src/test/java/neqsim/processSimulation/processEquipment/pipeline/PipelineTest.java index 00a4dfae0b..d50b406fd6 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/pipeline/PipelineTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/pipeline/PipelineTest.java @@ -5,7 +5,6 @@ import neqsim.processSimulation.processEquipment.stream.Stream; public class PipelineTest { - @Test public void testMain() { double flow = 60.0; diff --git a/src/test/java/neqsim/processSimulation/processEquipment/util/PressureDropTest.java b/src/test/java/neqsim/processSimulation/processEquipment/util/PressureDropTest.java index 9f6c248e31..6f19ee62a1 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/util/PressureDropTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/util/PressureDropTest.java @@ -6,7 +6,6 @@ import neqsim.thermo.system.SystemSrkEos; public class PressureDropTest { - @Test void testRun() { double pressure_inlet = 85.0; diff --git a/src/test/java/neqsim/processSimulation/processSystem/OilGasProcessTest.java b/src/test/java/neqsim/processSimulation/processSystem/OilGasProcessTest.java index d8cf896156..23119c3241 100644 --- a/src/test/java/neqsim/processSimulation/processSystem/OilGasProcessTest.java +++ b/src/test/java/neqsim/processSimulation/processSystem/OilGasProcessTest.java @@ -13,7 +13,6 @@ import neqsim.thermo.system.SystemSrkEos; public class OilGasProcessTest extends neqsim.NeqSimTest { - @Test public void runProcess() throws InterruptedException { SystemInterface thermoSystem = new SystemSrkEos(298.0, 10.0); diff --git a/src/test/java/neqsim/standards/gasQuality/Standard_ISO15403Test.java b/src/test/java/neqsim/standards/gasQuality/Standard_ISO15403Test.java index b465faaf06..900771490f 100644 --- a/src/test/java/neqsim/standards/gasQuality/Standard_ISO15403Test.java +++ b/src/test/java/neqsim/standards/gasQuality/Standard_ISO15403Test.java @@ -9,7 +9,6 @@ import neqsim.thermodynamicOperations.ThermodynamicOperations; public class Standard_ISO15403Test { - private static SystemInterface testSystem = null; private static Standard_ISO15403 ISO15403 = null; diff --git a/src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java b/src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java index 681f6da47c..c8dcae9156 100644 --- a/src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java +++ b/src/test/java/neqsim/statistics/dataanalysis/datasmoothing/DataSmootherTest.java @@ -4,7 +4,6 @@ import org.junit.jupiter.api.Test; public class DataSmootherTest { - @Test void testgetSmoothedNumbers() { double[] numbers = {10, 11, 12, 13, 14, 15, 15.5, 15, 19, 14, 14, 13, 12, 12, 11, 10, 9, 8}; diff --git a/src/test/java/neqsim/thermo/atomElement/ElementTest.java b/src/test/java/neqsim/thermo/atomElement/ElementTest.java index 206fd1440d..6bc2782ea9 100644 --- a/src/test/java/neqsim/thermo/atomElement/ElementTest.java +++ b/src/test/java/neqsim/thermo/atomElement/ElementTest.java @@ -5,7 +5,6 @@ import org.junit.jupiter.api.Test; public class ElementTest { - @Test public void testExistingElement() { ArrayList names = Element.getAllElementComponentNames(); diff --git a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java index aa8247ef35..eac997b6bd 100644 --- a/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java +++ b/src/test/java/neqsim/thermo/phase/PhasePCSAFTRahmatTest.java @@ -218,204 +218,124 @@ void testCalcmmin1SAFT() { } @Test - void testDF_DISP1_SAFTdT() { - - } + void testDF_DISP1_SAFTdT() {} @Test - void testDF_DISP1_SAFTdV() { - - } + void testDF_DISP1_SAFTdV() {} @Test - void testDF_DISP1_SAFTdVdV() { - - } + void testDF_DISP1_SAFTdVdV() {} @Test - void testDF_DISP1_SAFTdVdVdV() { - - } + void testDF_DISP1_SAFTdVdVdV() {} @Test - void testDF_DISP2_SAFTdT() { - - } + void testDF_DISP2_SAFTdT() {} @Test - void testDF_DISP2_SAFTdV() { - - } + void testDF_DISP2_SAFTdV() {} @Test - void testDF_DISP2_SAFTdVdV() { - - } + void testDF_DISP2_SAFTdVdV() {} @Test - void testDF_DISP2_SAFTdVdVdV() { - - } + void testDF_DISP2_SAFTdVdVdV() {} @Test - void testDF_HC_SAFTdT() { - - } + void testDF_HC_SAFTdT() {} @Test - void testDF_HC_SAFTdV() { - - } + void testDF_HC_SAFTdV() {} @Test - void testDF_HC_SAFTdVdV() { - - } + void testDF_HC_SAFTdVdV() {} @Test - void testDF_HC_SAFTdVdVdV() { - - } + void testDF_HC_SAFTdVdVdV() {} @Test - void testDFdT() { - - } + void testDFdT() {} @Test - void testDFdV() { - - } + void testDFdV() {} @Test - void testDFdVdV() { - - } + void testDFdVdV() {} @Test - void testDFdVdVdV() { - - } + void testDFdVdVdV() {} @Test - void testGetAHSSAFT() { - - } + void testGetAHSSAFT() {} @Test - void testGetDSAFT() { - - } + void testGetDSAFT() {} @Test - void testGetDgHSSAFTdN() { - - } + void testGetDgHSSAFTdN() {} @Test - void testGetDmeanSAFT() { - - } + void testGetDmeanSAFT() {} @Test - void testGetDnSAFTdV() { - - } + void testGetDnSAFTdV() {} @Test - void testGetF() { - - } + void testGetF() {} @Test - void testGetF1dispI1() { - - } + void testGetF1dispI1() {} @Test - void testGetF1dispSumTerm() { - - } + void testGetF1dispSumTerm() {} @Test - void testGetF1dispVolTerm() { - - } + void testGetF1dispVolTerm() {} @Test - void testGetF2dispI2() { - - } + void testGetF2dispI2() {} @Test - void testGetF2dispSumTerm() { - - } + void testGetF2dispSumTerm() {} @Test - void testGetF2dispZHC() { - - } + void testGetF2dispZHC() {} @Test - void testGetF2dispZHCdN() { - - } + void testGetF2dispZHCdN() {} @Test - void testGetF2dispZHCdm() { - - } + void testGetF2dispZHCdm() {} @Test - void testGetGhsSAFT() { - - } + void testGetGhsSAFT() {} @Test - void testGetMmin1SAFT() { - - } + void testGetMmin1SAFT() {} @Test - void testGetNSAFT() { - - } + void testGetNSAFT() {} @Test - void testGetNmSAFT() { - - } + void testGetNmSAFT() {} @Test - void testGetVolumeSAFT() { - - } + void testGetVolumeSAFT() {} @Test - void testGetaSAFT() { - - } + void testGetaSAFT() {} @Test - void testGetaSAFTdm() { - - } + void testGetaSAFTdm() {} @Test - void testGetdDSAFTdT() { - - } + void testGetdDSAFTdT() {} @Test - void testGetmSAFT() { - - } + void testGetmSAFT() {} @Test - void testGetmdSAFT() { - - } + void testGetmdSAFT() {} @Test void testInit() { @@ -423,92 +343,56 @@ void testInit() { } @Test - void testMolarVolume() { - - } + void testMolarVolume() {} @Test - void testSetAHSSAFT() { - - } + void testSetAHSSAFT() {} @Test - void testSetDSAFT() { - - } + void testSetDSAFT() {} @Test - void testSetDgHSSAFTdN() { - - } + void testSetDgHSSAFTdN() {} @Test - void testSetDmeanSAFT() { - - } + void testSetDmeanSAFT() {} @Test - void testSetDnSAFTdV() { - - } + void testSetDnSAFTdV() {} @Test - void testSetF1dispVolTerm() { - - } + void testSetF1dispVolTerm() {} @Test - void testSetF2dispI2() { - - } + void testSetF2dispI2() {} @Test - void testSetF2dispSumTerm() { - - } + void testSetF2dispSumTerm() {} @Test - void testSetF2dispZHC() { - - } + void testSetF2dispZHC() {} @Test - void testSetF2dispZHCdm() { - - } + void testSetF2dispZHCdm() {} @Test - void testSetGhsSAFT() { - - } + void testSetGhsSAFT() {} @Test - void testSetMmin1SAFT() { - - } + void testSetMmin1SAFT() {} @Test - void testSetNSAFT() { - - } + void testSetNSAFT() {} @Test - void testSetNmSAFT() { - - } + void testSetNmSAFT() {} @Test - void testSetVolumeSAFT() { - - } + void testSetVolumeSAFT() {} @Test - void testSetmSAFT() { - - } + void testSetmSAFT() {} @Test - void testSetmdSAFT() { - - } + void testSetmdSAFT() {} } diff --git a/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java b/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java index 0febde2fdc..fe157a2a30 100644 --- a/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java +++ b/src/test/java/neqsim/thermo/system/SystemPCSAFTTest.java @@ -5,7 +5,6 @@ import neqsim.thermodynamicOperations.ThermodynamicOperations; public class SystemPCSAFTTest { - @Test public void testInit() { SystemInterface testSystem = new SystemPCSAFT(250.0, 10.0); diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java index 566a6d4e83..db81185f3c 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java @@ -59,9 +59,7 @@ void testRun() { testOps.TPflash(); - double[] intParameter = { - - -0.24, // "CO2" + double[] intParameter = {-0.24, // "CO2" -0.721, // "methane" @@ -161,7 +159,6 @@ void testRun() { private int findComponentIndex(String[] componentNames, String componentName) { for (int i = 0; i < componentNames.length; i++) { - if (componentNames[i].equals(componentName)) { return i; } diff --git a/src/test/java/neqsim/util/unit/PressureUnitTest.java b/src/test/java/neqsim/util/unit/PressureUnitTest.java index 5d706ebf1e..f96f869256 100644 --- a/src/test/java/neqsim/util/unit/PressureUnitTest.java +++ b/src/test/java/neqsim/util/unit/PressureUnitTest.java @@ -6,7 +6,6 @@ import neqsim.thermodynamicOperations.ThermodynamicOperations; class PressureUnitTest extends neqsim.NeqSimTest { - /** *

* testSetPressure