diff --git a/pom.xml b/pom.xml index 2c001391cf..ce92dad321 100644 --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.1.0 + 1.2.2 true diff --git a/src/main/java/neqsim/PVTsimulation/modelTuning/TuneToSaturation.java b/src/main/java/neqsim/PVTsimulation/modelTuning/TuneToSaturation.java index bf12bbcbbd..9074af430b 100644 --- a/src/main/java/neqsim/PVTsimulation/modelTuning/TuneToSaturation.java +++ b/src/main/java/neqsim/PVTsimulation/modelTuning/TuneToSaturation.java @@ -25,7 +25,7 @@ public TuneToSaturation(SimulationInterface simulation) { /** {@inheritDoc} */ @Override public void run() { - double error = 1.0; + // double error = 1.0; double maxError = 0.01; int plusNumber = 0; double plusMolarMass = 0; diff --git a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java index de9d955908..87ef38f524 100644 --- a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java +++ b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java @@ -244,15 +244,16 @@ public void chemSolve() { */ public void updateMoles() { upMoles++; - double changeMoles = 0.0; + // double changeMoles = 0.0; for (int i = 0; i < components.length; i++) { system.addComponent(components[i].getComponentNumber(), (n_mol[i] - system.getPhase(phasenumb).getComponents()[components[i].getComponentNumber()] .getNumberOfMolesInPhase()), phasenumb); - changeMoles += n_mol[i] - - system.getPhase(phasenumb).getComponents()[components[i].getComponentNumber()] - .getNumberOfMolesInPhase(); + + // changeMoles += n_mol[i] - + // system.getPhase(phasenumb).getComponents()[components[i].getComponentNumber()] + // .getNumberOfMolesInPhase(); } system.initBeta(); // this was added for mass trans calc system.init_x_y(); @@ -268,10 +269,10 @@ public void updateMoles() { public boolean solve() { double error = 1e10, errOld = 1e10, thisError = 0; double p = 1.0; - boolean negN = false; + // boolean negN = false; double maxError = 1e-8; upMoles = 0; - double old = 0; + // double old = 0; try { do { p++; @@ -308,9 +309,7 @@ public boolean solve() { } // Print statement added by Neeraj // System.out.println("Error " + error); - } // Number of iterations changed to 1000 by Neeraj (initially only 350 - // interations were performed) - while (((errOld > maxError && Math.abs(error) > maxError) && p < 350) || p < 2); + } while (((errOld > maxError && Math.abs(error) > maxError) && p < 350) || p < 2); } catch (Exception e) { e.printStackTrace(); return false; diff --git a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java index 7df7801f52..17f64a1b31 100644 --- a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java +++ b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java @@ -51,7 +51,6 @@ public class LinearProgrammingChemicalEquilibrium */ public LinearProgrammingChemicalEquilibrium() {} - @SuppressWarnings("unchecked") /** *

* Constructor for LinearProgrammingChemicalEquilibrium. diff --git a/src/main/java/neqsim/dataPresentation/iTextPDF/PdfCreator.java b/src/main/java/neqsim/dataPresentation/iTextPDF/PdfCreator.java index 9bd4fc0073..996c2e9545 100644 --- a/src/main/java/neqsim/dataPresentation/iTextPDF/PdfCreator.java +++ b/src/main/java/neqsim/dataPresentation/iTextPDF/PdfCreator.java @@ -64,7 +64,7 @@ public void closeDocument() { */ public void generatePDF(neqsim.thermo.system.SystemInterface thermoSystem) { document.addTitle("NeqSim Simulation Report"); - String temp = "Temperature " + Double.toString(thermoSystem.getTemperature()); + // String temp = "Temperature " + Double.toString(thermoSystem.getTemperature()); } /** diff --git a/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/FluidBoundary.java b/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/FluidBoundary.java index 73f1d1ff25..639ecf4685 100644 --- a/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/FluidBoundary.java +++ b/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/FluidBoundary.java @@ -448,7 +448,7 @@ public String[][] createTable(String name) { nf.applyPattern("#.#####E0"); String[][] table = new String[bulkSystem.getPhases()[0].getNumberOfComponents() * 10][5]; - String[] names = {"", "Phase 1", "Phase 2", "Phase 3", "Unit"}; + // String[] names = {"", "Phase 1", "Phase 2", "Phase 3", "Unit"}; table[0][0] = ""; table[0][1] = ""; table[0][2] = ""; diff --git a/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/finiteVolumeBoundary/fluidBoundarySolver/FluidBoundarySolver.java b/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/finiteVolumeBoundary/fluidBoundarySolver/FluidBoundarySolver.java index 74f46fa170..09971aff31 100644 --- a/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/finiteVolumeBoundary/fluidBoundarySolver/FluidBoundarySolver.java +++ b/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/finiteVolumeBoundary/fluidBoundarySolver/FluidBoundarySolver.java @@ -237,9 +237,10 @@ public double getMolarFlux(int componentNumber) { /** {@inheritDoc} */ @Override public void solve() { - double d[]; + // double d[]; int iter = 0, iterTop = 0; - double maxDiff = 0, maxDiffOld = 0; + double maxDiff = 0; + // double maxDiffOld = 0; double diff = 0; xNew = new double[boundary.getNode(0).getBulkSystem().getPhases()[0] .getNumberOfComponents()][boundary.getNumberOfNodes()]; @@ -251,7 +252,7 @@ public void solve() { " vol " + boundary.getNode(2).getBulkSystem().getPhases()[0].getMolarVolume()); do { - maxDiffOld = maxDiff; + // maxDiffOld = maxDiff; maxDiff = 0; iterTop++; iter = 0; @@ -277,6 +278,7 @@ public void solve() { } while (diff > 1e-15 && iter < 100); System.out.println("maxDiff " + maxDiff); - } while (Math.abs(maxDiff) > 1e-10 && iterTop < 10);// diffMatrix.norm2()/sol2Matrix.norm2())>0.1); + } while (Math.abs(maxDiff) > 1e-10 && iterTop < 10); + // diffMatrix.norm2()/sol2Matrix.norm2())>0.1); } } diff --git a/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/nonEquilibriumFluidBoundary/NonEquilibriumFluidBoundary.java b/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/nonEquilibriumFluidBoundary/NonEquilibriumFluidBoundary.java index 32003e4a82..61b988cdcd 100644 --- a/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/nonEquilibriumFluidBoundary/NonEquilibriumFluidBoundary.java +++ b/src/main/java/neqsim/fluidMechanics/flowNode/fluidBoundary/heatMassTransferCalc/nonEquilibriumFluidBoundary/NonEquilibriumFluidBoundary.java @@ -562,12 +562,13 @@ public void heatTransSolve() { @Override public void massTransSolve() { int iter = 1; - double err = 1.0e10, oldErr = 0.0; + double err = 1.0e10; + // double oldErr = 0.0; double factor = 10.0; // if(bulkSystem.isChemicalSystem()) factor=100.0; setuMassTrans(); do { - oldErr = err; + // oldErr = err; iter++; init(); setfvecMassTrans2(); diff --git a/src/main/java/neqsim/fluidMechanics/flowNode/multiPhaseNode/MultiPhaseFlowNode.java b/src/main/java/neqsim/fluidMechanics/flowNode/multiPhaseNode/MultiPhaseFlowNode.java index 378664aa53..99b4c297b0 100644 --- a/src/main/java/neqsim/fluidMechanics/flowNode/multiPhaseNode/MultiPhaseFlowNode.java +++ b/src/main/java/neqsim/fluidMechanics/flowNode/multiPhaseNode/MultiPhaseFlowNode.java @@ -130,10 +130,10 @@ public void initFlowCalc() { phaseFraction[0] -= phaseFraction[0] / step; } phaseFraction[1] = 1.0 - phaseFraction[0]; - } // while(Math.abs((f-fOld)/f)>1e-8 && iterations<10000); - while (Math.abs(f) > 1e-2 && iterations < 100); + } while (Math.abs(f) > 1e-2 && iterations < 100); + // while(Math.abs((f-fOld)/f)>1e-8 && iterations<10000); - if (iterations == 10000) { + if (iterations == 100) { System.out.println("error in void init calc"); } this.init(); diff --git a/src/main/java/neqsim/processSimulation/mechanicalDesign/absorber/AbsorberMechanicalDesign.java b/src/main/java/neqsim/processSimulation/mechanicalDesign/absorber/AbsorberMechanicalDesign.java index 39e7da7d8a..b049bec0d9 100644 --- a/src/main/java/neqsim/processSimulation/mechanicalDesign/absorber/AbsorberMechanicalDesign.java +++ b/src/main/java/neqsim/processSimulation/mechanicalDesign/absorber/AbsorberMechanicalDesign.java @@ -88,7 +88,7 @@ public void calcDesign() { double moduleWidth = 0.0, moduleHeight = 0.0, moduleLength = 0.0; double materialsCost = 0.0; - double sepLength = 0.0; + // double sepLength = 0.0; double gasDensity = ((Separator) getProcessEquipment()).getGasOutStream().getThermoSystem() .getPhase(0).getPhysicalProperties().getDensity(); diff --git a/src/main/java/neqsim/processSimulation/mechanicalDesign/adsorber/AdsorberMechanicalDesign.java b/src/main/java/neqsim/processSimulation/mechanicalDesign/adsorber/AdsorberMechanicalDesign.java index 0d4cf9912b..1f41c38dd7 100644 --- a/src/main/java/neqsim/processSimulation/mechanicalDesign/adsorber/AdsorberMechanicalDesign.java +++ b/src/main/java/neqsim/processSimulation/mechanicalDesign/adsorber/AdsorberMechanicalDesign.java @@ -63,7 +63,7 @@ public void readDesignSpecifications() { public void calcDesign() { super.calcDesign(); SimpleAdsorber separator = (SimpleAdsorber) getProcessEquipment(); - double Fg = 1.0; + // double Fg = 1.0; double emptyVesselWeight = 0.0, internalsWeight = 0.0, externalNozzelsWeight = 0.0; double pipingWeight = 0.0, structualWeight = 0.0, electricalWeight = 0.0; @@ -72,12 +72,12 @@ public void calcDesign() { double moduleWidth = 0.0, moduleHeight = 0.0, moduleLength = 0.0; double materialsCost = 0.0; - double sepLength = 0.0; + // double sepLength = 0.0; - double gasDensity = ((SeparatorInterface) getProcessEquipment()).getThermoSystem() - .getPhase(0).getPhysicalProperties().getDensity(); - double liqDensity = ((SeparatorInterface) getProcessEquipment()).getThermoSystem() - .getPhase(1).getPhysicalProperties().getDensity(); + // double gasDensity = ((SeparatorInterface) + // getProcessEquipment()).getThermoSystem().getPhase(0).getPhysicalProperties().getDensity(); + // double liqDensity = ((SeparatorInterface) + // getProcessEquipment()).getThermoSystem().getPhase(1).getPhysicalProperties().getDensity(); // maxDesignVolumeFlow = volumeSafetyFactor * ((Separator) // getProcessEquipment()).getThermoSystem().getPhase(0).getVolume() / 1e5; diff --git a/src/main/java/neqsim/processSimulation/mechanicalDesign/designStandards/PipelineDesignStandard.java b/src/main/java/neqsim/processSimulation/mechanicalDesign/designStandards/PipelineDesignStandard.java index 4cd17a6d5c..fefcf1a03a 100644 --- a/src/main/java/neqsim/processSimulation/mechanicalDesign/designStandards/PipelineDesignStandard.java +++ b/src/main/java/neqsim/processSimulation/mechanicalDesign/designStandards/PipelineDesignStandard.java @@ -27,8 +27,8 @@ public class PipelineDesignStandard extends DesignStandard { public PipelineDesignStandard(String name, MechanicalDesign equipmentInn) { super(name, equipmentInn); - double wallT = 0; - double maxAllowableStress = equipment.getMaterialDesignStandard().getDivisionClass(); + // double wallT = 0; + // double maxAllowableStress = equipment.getMaterialDesignStandard().getDivisionClass(); // double jointEfficiency = // equipment.getJointEfficiencyStandard().getJEFactor(); diff --git a/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDeisgn.java b/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDeisgn.java index 060b52ccea..5d3500a89d 100644 --- a/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDeisgn.java +++ b/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDeisgn.java @@ -5,7 +5,6 @@ import neqsim.processSimulation.mechanicalDesign.designStandards.PipelineDesignStandard; import neqsim.processSimulation.processEquipment.ProcessEquipmentInterface; import neqsim.processSimulation.processEquipment.pipeline.AdiabaticPipe; -import neqsim.processSimulation.processEquipment.pipeline.Pipeline; import neqsim.processSimulation.processEquipment.stream.Stream; /** @@ -58,17 +57,13 @@ public void readDesignSpecifications() { @Override public void calcDesign() { super.calcDesign(); - - Pipeline pipeline = (Pipeline) getProcessEquipment(); - - double flow = - ((AdiabaticPipe) getProcessEquipment()).getOutStream().getThermoSystem().getVolume() - / 1e5; - - double innerArea = Math.PI * innerDiameter * innerDiameter / 4.0; - - double gasVelocity = flow / innerArea; - double wallThickness = 0.0; + /* + * Pipeline pipeline = (Pipeline) getProcessEquipment(); double flow = ((AdiabaticPipe) + * getProcessEquipment()).getOutStream().getThermoSystem().getVolume() / 1e5; + * + * double innerArea = Math.PI * innerDiameter * innerDiameter / 4.0; double gasVelocity = + * flow / innerArea; double wallThickness = 0.0; + */ // ASME/ANSI Code B31.8 if (designStandardCode.equals("ANSI/ASME Standard B31.8")) { diff --git a/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java b/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java index 864ea03a2a..7494f5f930 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/absorber/SimpleTEGAbsorber.java @@ -327,8 +327,8 @@ public double calcNTU(double y0, double y1, double yb, double ymix) { @Override public void run() { try { - double y0 = 0.0, y1 = 0.0, - yN = gasInStream.getThermoSystem().getPhase(0).getComponent("water").getx(); + double y0 = 0.0, y1 = 0.0; + // double yN = gasInStream.getThermoSystem().getPhase(0).getComponent("water").getx(); double absorptionEffiency = 0.0; mixedStream.setThermoSystem((streams.get(0).getThermoSystem().clone())); mixedStream.getThermoSystem().setNumberOfPhases(2); @@ -398,20 +398,20 @@ public void run() { gasInStream.getThermoSystem().getPhase(0).getComponent("water").getx(), yMean)); // System.out.println("NTU " + getNTU()); - double Ks = 0.055; + // double Ks = 0.055; getSolventOutStream().getThermoSystem().initPhysicalProperties(); getGasOutStream().getThermoSystem().initPhysicalProperties(); - double vtemp = Ks * Math.sqrt((getSolventOutStream().getThermoSystem().getPhase(0) - .getPhysicalProperties().getDensity() - - getGasOutStream().getThermoSystem().getPhase(0).getPhysicalProperties() - .getDensity()) - / getSolventOutStream().getThermoSystem().getPhase(0).getPhysicalProperties() - .getDensity()); - double d = Math.sqrt(4.0 * getGasOutStream().getMolarRate() - * getGasOutStream().getThermoSystem().getPhase(0).getMolarMass() - / getGasOutStream().getThermoSystem().getPhase(0).getPhysicalProperties() - .getDensity() - / 3.14 / vtemp); + + // double vtemp = Ks * Math.sqrt((getSolventOutStream().getThermoSystem().getPhase(0) + // .getPhysicalProperties().getDensity() - + // getGasOutStream().getThermoSystem().getPhase(0).getPhysicalProperties() + // .getDensity()) / + // getSolventOutStream().getThermoSystem().getPhase(0).getPhysicalProperties().getDensity()); + + // double d = Math.sqrt(4.0 * getGasOutStream().getMolarRate() * + // getGasOutStream().getThermoSystem().getPhase(0).getMolarMass() / + // getGasOutStream().getThermoSystem().getPhase(0).getPhysicalProperties() + // .getDensity()/ 3.14 / vtemp); // System.out.println("diameter " + d); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java b/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java index 7b09064281..70b45b2efe 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/compressor/Compressor.java @@ -421,9 +421,10 @@ public void run() { // thermoSystem.getFlowRate("m3/hr"))); } if (surgeCheck && getAntiSurge().isActive()) { - double surgeFLow = - getCompressorChart().getSurgeCurve().getSurgeFlow(polytropicHead); - double correction = surgeFLow / thermoSystem.getFlowRate("m3/hr"); + // double surgeFLow = + // getCompressorChart().getSurgeCurve().getSurgeFlow(polytropicHead); + + // double correction = surgeFLow / thermoSystem.getFlowRate("m3/hr"); thermoSystem.setTotalNumberOfMoles(getAntiSurge().getSurgeControlFactor() * thermoSystem.getTotalNumberOfMoles()); thermoSystem.init(3); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java b/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java index 37fe9d0157..6b9f3d8282 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/distillation/Condenser.java @@ -11,7 +11,7 @@ * @author ESOL * @version $Id: $Id */ -public class Condenser extends neqsim.processSimulation.processEquipment.distillation.SimpleTray { +public class Condenser extends SimpleTray { private static final long serialVersionUID = 1000; private double refluxRatio = 0.1; diff --git a/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationInterface.java b/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationInterface.java index e75df5fc11..70fd43e93e 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationInterface.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/distillation/DistillationInterface.java @@ -1,5 +1,7 @@ package neqsim.processSimulation.processEquipment.distillation; +import neqsim.processSimulation.processEquipment.ProcessEquipmentInterface; + /** *

* DistillationInterface interface. @@ -8,25 +10,7 @@ * @author esol * @version $Id: $Id */ -public interface DistillationInterface { - /** - *

- * setName. - *

- * - * @param name a {@link java.lang.String} object - */ - public void setName(String name); - - /** - *

- * getName. - *

- * - * @return a {@link java.lang.String} object - */ - public String getName(); - +public interface DistillationInterface extends ProcessEquipmentInterface { /** *

* setNumberOfTrays. diff --git a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java index ca8b8ee7e9..e2f3cfe021 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java @@ -57,9 +57,9 @@ public void run() { ThermodynamicOperations thermoOps = new ThermodynamicOperations(getThermoSystem()); thermoOps = new ThermodynamicOperations(thermoSystem); thermoSystem.init(3); - double presinn = getThermoSystem().getPressure(); + // double presinn = getThermoSystem().getPressure(); double hinn = getThermoSystem().getEnthalpy(); - double densInn = getThermoSystem().getDensity(); + // double densInn = getThermoSystem().getDensity(); double entropy = getThermoSystem().getEntropy(); inletEnthalpy = hinn; @@ -99,7 +99,7 @@ public void run() { // System.out.println("entropy inn.." + entropy); thermoOps.PSflash(entropy); - double densOutIdeal = getThermoSystem().getDensity(); + // double densOutIdeal = getThermoSystem().getDensity(); if (!powerSet) { dH = (getThermoSystem().getEnthalpy() - hinn) * isentropicEfficiency; } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java index 143eeb5d56..c1fbd0295e 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java @@ -218,7 +218,8 @@ public void run() { testOps = new ThermodynamicOperations(system); testOps.TPflash(); } - boolean test = false; + + // boolean test = false; do { iter++; oldPressure = system.getPressure(); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java b/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java index e16885c4ce..29a4510c22 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/powerGeneration/GasTurbine.java @@ -131,8 +131,8 @@ public void run() { // outStreamAir.getFluid().setTemperature(800.0); // outStreamAir.getFluid().createDatabase(true); double moleMethane = outStreamAir.getFluid().getComponent("methane").getNumberOfmoles(); - double moleEthane = outStreamAir.getFluid().getComponent("ethane").getNumberOfmoles(); - double molePropane = outStreamAir.getFluid().getComponent("propane").getNumberOfmoles(); + // double moleEthane = outStreamAir.getFluid().getComponent("ethane").getNumberOfmoles(); + // double molePropane = outStreamAir.getFluid().getComponent("propane").getNumberOfmoles(); outStreamAir.run(); Heater locHeater = new Heater(outStreamAir); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java index 11d357364d..fb408cfe4b 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java @@ -278,16 +278,17 @@ public void setReservoirFluid(SystemInterface thermoSystem, double gasVolume, do // thermoSystem.init(1); // thermoSystem.display(); // System.out.println("number of phases " + thermoSystem.getNumberOfPhases()); - double totalliquidVolume = 0.0; + // double totalliquidVolume = 0.0; for (int j = 0; j < thermoSystem.getNumberOfPhases(); j++) { double relFact = gasVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5); if (j >= 1) { if (j == 1) { relFact = oilVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5); - totalliquidVolume += oilVolume / thermoSystem2.getPhase(j).getMolarVolume(); + // totalliquidVolume += oilVolume / thermoSystem2.getPhase(j).getMolarVolume(); } else if (j == 2) { relFact = waterVolume / (thermoSystem2.getPhase(j).getVolume() * 1.0e-5); - totalliquidVolume += waterVolume / thermoSystem2.getPhase(j).getMolarVolume(); + // totalliquidVolume += waterVolume / + // thermoSystem2.getPhase(j).getMolarVolume(); } } for (int i = 0; i < thermoSystem.getPhase(j).getNumberOfComponents(); i++) { @@ -486,12 +487,12 @@ public void runTransient(double dt) { for (int k = 0; k < gasInjector.size(); k++) { gasInjector.get(k).getStream().run(); } + /* + * double totalVolume = 0; for (int i = 0; i < getReservoirFluid().getNumberOfPhases(); i++) + * { totalVolume += getReservoirFluid().getPhase(i).getVolume("m3"); } + * System.out.println("tot volume " + totalVolume/1.0e6 + " gas volume "+ + */ - double totalVolume = 0; - for (int i = 0; i < getReservoirFluid().getNumberOfPhases(); i++) { - totalVolume += getReservoirFluid().getPhase(i).getVolume("m3"); - } - // System.out.println("tot volume " + totalVolume/1.0e6 + " gas volume "+ // getReservoirFluid().getPhase("gas").getVolume("m3")/1.0e6 + " oil volume "+ // getReservoirFluid().getPhase("oil").getVolume("m3")/1.0e6 + " water volume "+ // getReservoirFluid().getPhase("aqueous").getVolume("m3")/1.0e6); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/separator/Hydrocyclone.java b/src/main/java/neqsim/processSimulation/processEquipment/separator/Hydrocyclone.java index 44b11225ff..53e5c13489 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/separator/Hydrocyclone.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/separator/Hydrocyclone.java @@ -98,13 +98,14 @@ public void run() { inletStreamMixer.run(); thermoSystem = inletStreamMixer.getOutStream().getThermoSystem().clone(); - double oilInWaterIn = 0.0001;// thermoSystem.getPhase("aqueous").getOilMolarConcentration(); - double oilInWaterOut = 0.0; + // double oilInWaterIn = 0.0001; // + // thermoSystem.getPhase("aqueous").getOilMolarConcentration(); + // double oilInWaterOut = 0.0; double inPressure = thermoSystem.getPressure("bara"); underflowPressure = inPressure / 2.0; overflowPressure = inPressure + (inPressure - underflowPressure) / 1.0 / PDR; separationEfficiency = 0.9; - oilInWaterOut = oilInWaterIn * separationEfficiency; + // oilInWaterOut = oilInWaterIn * separationEfficiency; thermoSystem.setMultiPhaseCheck(true); thermoSystem.setPressure(underflowPressure); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java b/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java index f7f9cfe9e7..1826565d4f 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java @@ -258,9 +258,10 @@ public void runTransient(double dt) { inletStreamMixer.run(); System.out.println("moles out" + liquidOutStream.getThermoSystem().getTotalNumberOfMoles()); - double inMoles = inletStreamMixer.getOutStream().getThermoSystem().getTotalNumberOfMoles(); - double gasoutMoles = gasOutStream.getThermoSystem().getNumberOfMoles(); - double liqoutMoles = liquidOutStream.getThermoSystem().getNumberOfMoles(); + // double inMoles = + // inletStreamMixer.getOutStream().getThermoSystem().getTotalNumberOfMoles(); + // double gasoutMoles = gasOutStream.getThermoSystem().getNumberOfMoles(); + // double liqoutMoles = liquidOutStream.getThermoSystem().getNumberOfMoles(); thermoSystem.init(3); gasOutStream.getThermoSystem().init(3); liquidOutStream.getThermoSystem().init(3); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java b/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java index ed070e6316..071626f9f0 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/stream/Stream.java @@ -401,7 +401,7 @@ public void phaseEnvelope() { ThermodynamicOperations ops = new ThermodynamicOperations(localSyst); ops.setRunAsThread(true); ops.calcPTphaseEnvelope(true); - boolean isFinished = ops.waitAndCheckForFinishedCalculation(10000); + ops.waitAndCheckForFinishedCalculation(10000); ops.displayResult(); // ops.getJfreeChart(); } @@ -413,7 +413,7 @@ public double CCB(String unit) { ThermodynamicOperations ops = new ThermodynamicOperations(localSyst); ops.setRunAsThread(true); ops.calcPTphaseEnvelope(true); - boolean isFinished = ops.waitAndCheckForFinishedCalculation(10000); + ops.waitAndCheckForFinishedCalculation(10000); if (unit.equals("bara") || unit.equals("bar")) { return ops.get("cricondenbar")[1]; } else { @@ -433,7 +433,7 @@ public double CCT(String unit) { ThermodynamicOperations ops = new ThermodynamicOperations(localSyst); ops.setRunAsThread(true); ops.calcPTphaseEnvelope(true); - boolean isFinished = ops.waitAndCheckForFinishedCalculation(10000); + ops.waitAndCheckForFinishedCalculation(10000); if (unit.equals("bara") || unit.equals("bar")) { return ops.get("cricondentherm")[1]; } else { @@ -455,7 +455,6 @@ public double TVP(double temperature, String unit) { try { ops.bubblePointPressureFlash(false); } catch (Exception e) { - String error = e.getMessage(); } return localSyst.getPressure(unit); } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java b/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java index 4ab8e87e8e..6e7375fe3d 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/tank/Tank.java @@ -218,9 +218,10 @@ public void runTransient(double dt) { inletStreamMixer.run(); System.out.println("moles out" + liquidOutStream.getThermoSystem().getTotalNumberOfMoles()); - double inMoles = inletStreamMixer.getOutStream().getThermoSystem().getTotalNumberOfMoles(); - double gasoutMoles = gasOutStream.getThermoSystem().getNumberOfMoles(); - double liqoutMoles = liquidOutStream.getThermoSystem().getNumberOfMoles(); + // double inMoles = + // inletStreamMixer.getOutStream().getThermoSystem().getTotalNumberOfMoles(); + // double gasoutMoles = gasOutStream.getThermoSystem().getNumberOfMoles(); + // double liqoutMoles = liquidOutStream.getThermoSystem().getNumberOfMoles(); thermoSystem.init(3); gasOutStream.getThermoSystem().init(3); liquidOutStream.getThermoSystem().init(3); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java b/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java index 42469ea16d..67d42a9964 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java @@ -109,7 +109,7 @@ public StreamInterface getStream(int i) { */ public void mixStream() { int index = 0; - String compName = new String(); + // String compName = new String(); for (int k = 1; k < streams.size(); k++) { for (int i = 0; i < streams.get(k).getThermoSystem().getPhase(0) @@ -118,7 +118,7 @@ public void mixStream() { String componentName = streams.get(k).getThermoSystem().getPhase(0).getComponent(i).getName(); // System.out.println("adding: " + componentName); - int numberOfPhases = streams.get(k).getThermoSystem().getNumberOfPhases(); + // int numberOfPhases = streams.get(k).getThermoSystem().getNumberOfPhases(); double moles = streams.get(k).getThermoSystem().getPhase(0).getComponent(i) .getNumberOfmoles(); @@ -131,8 +131,8 @@ public void mixStream() { gotComponent = true; index = streams.get(0).getThermoSystem().getPhase(0).getComponent(p) .getComponentNumber(); - compName = streams.get(0).getThermoSystem().getPhase(0).getComponent(p) - .getComponentName(); + // compName = streams.get(0).getThermoSystem().getPhase(0).getComponent(p) + // .getComponentName(); } } @@ -254,7 +254,7 @@ public void run() { try { enthalpy = calcMixStreamEnthalpy(); } catch (Exception e) { - String error = e.getMessage(); + // String error = e.getMessage(); return; } // System.out.println("temp guess " + guessTemperature()); diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java index 82d053fff7..4ac02e9305 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/AdsorptionDehydrationlModule.java @@ -170,7 +170,7 @@ public void calcDesign() { adsorbentFillingHeight = 400.0 * waterLoadingCycle / (Math.PI * usefulDesiccantCapacity * bulkDensityDesiccant * adsorberInternalDiameter * adsorberInternalDiameter); - double lenghtDiameterRatio = adsorbentFillingHeight / adsorberInternalDiameter; + // double lenghtDiameterRatio = adsorbentFillingHeight / adsorberInternalDiameter; // design is done here } diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java index d72f82ac46..bb128aaa28 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java @@ -79,7 +79,7 @@ public StreamInterface getOutputStream(String streamName) { @Override public void initializeModule() { isInitializedModule = true; - double inletPressure = feedStream.getPressure(); + // double inletPressure = feedStream.getPressure(); ValveInterface inletValve = new ThrottlingValve("inlet valve", feedStream); inletValve.setOutletPressure(pressureAfterRedValve); diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/MixerGasProcessingModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/MixerGasProcessingModule.java index 3559a16280..5d48359466 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/MixerGasProcessingModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/MixerGasProcessingModule.java @@ -12,7 +12,9 @@ import neqsim.processSimulation.processSystem.ProcessModuleBaseClass; /** - *

MixerGasProcessingModule class.

+ *

+ * MixerGasProcessingModule class. + *

* * @author ESOL * @version $Id: $Id @@ -66,7 +68,7 @@ public StreamInterface getOutputStream(String streamName) { @Override public void initializeModule() { isInitializedModule = true; - double inletPressure = feedStream.getPressure(); + // double inletPressure = feedStream.getPressure(); Cooler inletCooler = new Cooler("inlet well stream cooler", feedStream); inletCooler.setOutTemperature(inletSepTemperature + 273.15); @@ -185,7 +187,9 @@ public void setSpecification(String specificationName, double value) { } /** - *

main.

+ *

+ * main. + *

* * @param args an array of {@link java.lang.String} objects */ diff --git a/src/main/java/neqsim/standards/Standard.java b/src/main/java/neqsim/standards/Standard.java index 1017e61a2e..77e3746785 100644 --- a/src/main/java/neqsim/standards/Standard.java +++ b/src/main/java/neqsim/standards/Standard.java @@ -129,7 +129,7 @@ public String[][] createTable(String name) { nf.setMaximumFractionDigits(5); nf.applyPattern("#.#####E0"); String[][] table = new String[thermoSystem.getPhases()[0].getNumberOfComponents() + 30][6]; - String[] names = {"", "Phase 1", "Phase 2", "Phase 3", "Unit"}; + // String[] names = {"", "Phase 1", "Phase 2", "Phase 3", "Unit"}; table[0][0] = "";// getPhases()[0].getPhaseTypeName();//""; for (int i = 0; i < thermoSystem.getPhases()[0].getNumberOfComponents() + 30; i++) { diff --git a/src/main/java/neqsim/standards/gasQuality/Draft_GERG2004.java b/src/main/java/neqsim/standards/gasQuality/Draft_GERG2004.java index b225b80c1d..3c1b1822fa 100644 --- a/src/main/java/neqsim/standards/gasQuality/Draft_GERG2004.java +++ b/src/main/java/neqsim/standards/gasQuality/Draft_GERG2004.java @@ -113,7 +113,7 @@ public String[][] createTable(String name) { nf.setMaximumFractionDigits(5); nf.applyPattern("#.#####E0"); String[][] table = new String[thermoSystem.getPhases()[0].getNumberOfComponents() + 30][6]; - String[] names = {"", "Phase 1", "Phase 2", "Phase 3", "Unit"}; + // String[] names = {"", "Phase 1", "Phase 2", "Phase 3", "Unit"}; table[0][0] = "";// getPhases()[0].getPhaseTypeName();//""; for (int i = 0; i < thermoSystem.getPhases()[0].getNumberOfComponents() + 30; i++) { diff --git a/src/main/java/neqsim/standards/gasQuality/Standard_ISO6578.java b/src/main/java/neqsim/standards/gasQuality/Standard_ISO6578.java index 77c0a43d53..7a6e0e6c53 100644 --- a/src/main/java/neqsim/standards/gasQuality/Standard_ISO6578.java +++ b/src/main/java/neqsim/standards/gasQuality/Standard_ISO6578.java @@ -155,52 +155,52 @@ public void calculate() { Vi = new double[thermoSystem.getPhase(0).getNumberOfComponents()]; PolynomialSplineFunction function = null; for (int i = 0; i < thermoSystem.getPhase(0).getNumberOfComponents(); i++) { - double a = 0, b = 0, c = 0; + // double a, b, c; if (thermoSystem.getPhase(0).getComponent(i).getName().equals("methane")) { - a = 8.452e-7; - b = -5.744e-5; - c = 3.383e-2; + // a = 8.452e-7; + // b = -5.744e-5; + // c = 3.383e-2; function = liearInterpol.interpolate(Vitemperatures, Vimethane); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("ethane")) { - a = 1.905e-7; - b = 4.133e-5; - c = 4.083e-2; + // a = 1.905e-7; + // b = 4.133e-5; + // c = 4.083e-2; function = liearInterpol.interpolate(Vitemperatures, Viethane); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("propane")) { - a = 1.310e-7; - b = 6.102e-5; - c = 5.391e-2; + // a = 1.310e-7; + // b = 6.102e-5; + // c = 5.391e-2; function = liearInterpol.interpolate(Vitemperatures, Vipropane); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("i-butane")) { - a = 1.25e-7; - b = 7.257e-5; - c = 6.854e-2; + // a = 1.25e-7; + // b = 7.257e-5; + // c = 6.854e-2; function = liearInterpol.interpolate(Vitemperatures, ViiC4); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("n-butane")) { - a = 1.101e-7; - b = 7.114e-5; - c = 6.742e-2; + // a = 1.101e-7; + // b = 7.114e-5; + // c = 6.742e-2; function = liearInterpol.interpolate(Vitemperatures, VinC4); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("i-pentane") || thermoSystem.getPhase(0).getComponent(i).getName().equals("iC5")) { - a = 9.524e-8; - b = 8.727e-5; - c = 8.063e-2; + // a = 9.524e-8; + // b = 8.727e-5; + // c = 8.063e-2; function = liearInterpol.interpolate(Vitemperatures, ViiC5); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("n-pentane")) { - a = 5.060e-8; - b = 9.386e-5; - c = 8.031e-2; + // a = 5.060e-8; + // b = 9.386e-5; + // c = 8.031e-2; function = liearInterpol.interpolate(Vitemperatures, VinC5); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("n-hexane")) { - a = 5.060e-8; - b = 9.386e-5; - c = 8.031e-2; + // a = 5.060e-8; + // b = 9.386e-5; + // c = 8.031e-2; function = liearInterpol.interpolate(Vitemperatures, VinC6); } else if (thermoSystem.getPhase(0).getComponent(i).getName().equals("nitrogen")) { - a = 1.968e-5; - b = -3.753e-3; - c = 2.198e-1; + // a = 1.968e-5; + // b = -3.753e-3; + // c = 2.198e-1; function = liearInterpol.interpolate(Vitemperatures, Vinitrogen); } else { Vi[i] = 0.036315; diff --git a/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976.java b/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976.java index 1385d3912a..bd5a635aea 100644 --- a/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976.java +++ b/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976.java @@ -98,31 +98,20 @@ public Standard_ISO6976(SystemInterface thermoSystem) { M[i] = Double.parseDouble(dataSet.getString("MolarMass")); } catch (Exception e) { try { - dataSet.close(); - if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("inert")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants WHERE ComponentName='nitrogen'")); - } else if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("HC")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants WHERE ComponentName='n-heptane'")); - } else if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("alcohol") - || this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("glycol")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants WHERE ComponentName='methanol'")); - } else if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("TPB") - || this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("plus")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants WHERE ComponentName='n-heptane'")); - } else { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants WHERE ComponentName='nitrogen'")); + String compName = "inert"; + String compType = + this.thermoSystem.getPhase(0).getComponent(i).getComponentType(); + if (compType.equals("HC") || compType.equals("TPB") + || compType.equals("plus")) { + compName = "n-heptane"; + } else if (compType.equals("alcohol") || compType.equals("glycol")) { + compName = "methanol"; } + + dataSet.close(); + dataSet = database.getResultSet( + ("SELECT * FROM iso6976constants WHERE ComponentName='" + compName + + "'")); M[i] = this.thermoSystem.getPhase(0).getComponent(i).getMolarMass(); dataSet.next(); } catch (Exception er) { @@ -132,6 +121,8 @@ public Standard_ISO6976(SystemInterface thermoSystem) { "this.thermoSystem.getPhase(0).getComponent(i).getComponentName()"); // logger.info("added component not specified by ISO6976 " + // this.thermoSystem.getPhase(0).getComponent(i).getComponentName()); + } finally { + dataSet.close(); } carbonNumber[i] = Integer.parseInt(dataSet.getString("numberOfCarbon")); diff --git a/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976_2016.java b/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976_2016.java index 72f7791bd3..98f84e2902 100644 --- a/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976_2016.java +++ b/src/main/java/neqsim/standards/gasQuality/Standard_ISO6976_2016.java @@ -83,31 +83,21 @@ public Standard_ISO6976_2016(SystemInterface thermoSystem) { M[i] = Double.parseDouble(dataSet.getString("MolarMass")); } catch (Exception e) { try { - dataSet.close(); - if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("inert")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants2016 WHERE ComponentName='nitrogen'")); - } else if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("HC")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants2016 WHERE ComponentName='n-heptane'")); - } else if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("alcohol") - || this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("glycol")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants2016 WHERE ComponentName='methanol'")); - } else if (this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("TPB") - || this.thermoSystem.getPhase(0).getComponent(i).getComponentType() - .equals("plus")) { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants2016 WHERE ComponentName='n-heptane'")); - } else { - dataSet = database.getResultSet( - ("SELECT * FROM iso6976constants2016 WHERE ComponentName='nitrogen'")); + String compName = "inert"; + String compType = + this.thermoSystem.getPhase(0).getComponent(i).getComponentType(); + + if (compType.equals("HC") || compType.equals("TPB") + || compType.equals("plus")) { + compName = "n-heptane"; + } else if (compType.equals("alcohol") || compType.equals("glycol")) { + compName = "methanol"; } + + dataSet.close(); + dataSet = database.getResultSet( + ("SELECT * FROM iso6976constants2016 WHERE ComponentName='" + + compName + "'")); M[i] = this.thermoSystem.getPhase(0).getComponent(i).getMolarMass(); dataSet.next(); } catch (Exception er) { @@ -117,6 +107,8 @@ public Standard_ISO6976_2016(SystemInterface thermoSystem) { "this.thermoSystem.getPhase(0).getComponent(i).getComponentName()"); logger.info("added component not specified by ISO6976constants2016 " + this.thermoSystem.getPhase(0).getComponent(i).getComponentName()); + } finally { + dataSet.close(); } carbonNumber[i] = Integer.parseInt(dataSet.getString("numberOfCarbon")); diff --git a/src/main/java/neqsim/standards/oilQuality/Standard_ASTM_D6377.java b/src/main/java/neqsim/standards/oilQuality/Standard_ASTM_D6377.java index 6f269edf29..386c8267db 100644 --- a/src/main/java/neqsim/standards/oilQuality/Standard_ASTM_D6377.java +++ b/src/main/java/neqsim/standards/oilQuality/Standard_ASTM_D6377.java @@ -38,7 +38,8 @@ public void calculate() { } catch (Exception e) { e.printStackTrace(); } - double TVP = this.thermoSystem.getPressure(); + + // double TVP = this.thermoSystem.getPressure(); double liquidVolume = thermoSystem.getVolume(); this.thermoSystem.setPressure(0.9); diff --git a/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/DataReader.java b/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/DataReader.java index 72b088125f..9719bcc342 100644 --- a/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/DataReader.java +++ b/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/DataReader.java @@ -63,9 +63,7 @@ public void readData() { filepointer = file.getFilePointer(); tokenizer.nextToken(); - } - - while (filepointer < length); + } while (filepointer < length); } catch (Exception e) { String err = e.toString(); System.out.println(err); diff --git a/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/wettedWallColumnReader/WettedWallDataReader.java b/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/wettedWallColumnReader/WettedWallDataReader.java index b5bba8833c..09fc2c46fb 100644 --- a/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/wettedWallColumnReader/WettedWallDataReader.java +++ b/src/main/java/neqsim/statistics/experimentalSampleCreation/readDataFromFile/wettedWallColumnReader/WettedWallDataReader.java @@ -7,7 +7,6 @@ import java.io.RandomAccessFile; import java.util.StringTokenizer; - import neqsim.statistics.experimentalSampleCreation.readDataFromFile.DataReader; /** @@ -41,7 +40,7 @@ public WettedWallDataReader(String fileName) { @Override public void readData() { StringTokenizer tokenizer; - String token; + // String token; int k = 0; String path = "c:/logdata/" + this.fileName + ".log"; System.out.println(path); @@ -80,9 +79,7 @@ public void readData() { filepointer = file.getFilePointer(); tokenizer.nextToken(); sampleObjectList.add(dataObject); - } - - while (filepointer < length); + } while (filepointer < length); } catch (Exception e) { String err = e.toString(); System.out.println(err); diff --git a/src/main/java/neqsim/thermo/ThermodynamicModelTest.java b/src/main/java/neqsim/thermo/ThermodynamicModelTest.java index 3fa1b79083..d79bfe1c29 100644 --- a/src/main/java/neqsim/thermo/ThermodynamicModelTest.java +++ b/src/main/java/neqsim/thermo/ThermodynamicModelTest.java @@ -147,7 +147,7 @@ public boolean checkFugasityCoeffisientsDn() { * @return a boolean */ public boolean checkFugasityCoeffisientsDn2() { - boolean test1 = false, test2 = false; + // boolean test1 = false, test2 = false; double temp1 = 0, temp2 = 0; double sum = 0; @@ -185,7 +185,7 @@ public boolean checkFugasityCoeffisientsDn2() { * @return a boolean */ public boolean checkFugasityCoeffisientsDP() { - boolean test1 = false, test2 = false; + // boolean test1 = false, test2 = false; double temp1 = 0, temp2 = 0; double sum = 0; @@ -221,7 +221,7 @@ public boolean checkFugasityCoeffisientsDP() { * @return a boolean */ public boolean checkFugasityCoeffisientsDT() { - boolean test1 = false, test2 = false; + // boolean test1 = false, test2 = false; double temp1 = 0, temp2 = 0; double sum = 0; diff --git a/src/main/java/neqsim/thermo/characterization/LumpingModel.java b/src/main/java/neqsim/thermo/characterization/LumpingModel.java index 00300c7a63..22b6d4b1da 100644 --- a/src/main/java/neqsim/thermo/characterization/LumpingModel.java +++ b/src/main/java/neqsim/thermo/characterization/LumpingModel.java @@ -86,7 +86,7 @@ public void generateLumpedComposition(Characterise charac) { lumpedComponentNames = new String[numberOfLumpedComponents]; fractionOfHeavyEnd = new double[numberOfPseudocomponents]; double[] zPlus = new double[numberOfPseudocomponents]; - double[] MPlus = new double[numberOfPseudocomponents]; + // double[] MPlus = new double[numberOfPseudocomponents]; double weightFrac = 0.0; double weightTot = 0.0; @@ -103,7 +103,7 @@ public void generateLumpedComposition(Characterise charac) { double meanWeightFrac = weightTot / (numberOfPseudocomponents + 1e-10); int k = 0; - int firstPS = charac.getPlusFractionModel().getFirstTBPFractionNumber(); + // int firstPS = charac.getPlusFractionModel().getFirstTBPFractionNumber(); double Maverage = 0.0, denstemp1 = 0.0, denstemp2 = 0.0; double totalNumberOfMoles = system.getNumberOfMoles(); int numbComp = system.getPhase(0).getNumberOfComponents(); @@ -150,7 +150,7 @@ public void generateLumpedComposition(Characterise charac) { weightFrac = 0.0; Maverage = 0.0; k++; - firstPS = i + 1; + // firstPS = i + 1; added++; } @@ -188,7 +188,7 @@ public void generateLumpedComposition(Characterise charac) { weightFrac = 0.0; Maverage = 0.0; k++; - firstPS = i + 1; + // firstPS = i + 1; } } if (charac.getPlusFractionModel().hasPlusFraction()) { diff --git a/src/main/java/neqsim/thermo/component/ComponentEos.java b/src/main/java/neqsim/thermo/component/ComponentEos.java index 44d3898e27..5ab89b6cf6 100644 --- a/src/main/java/neqsim/thermo/component/ComponentEos.java +++ b/src/main/java/neqsim/thermo/component/ComponentEos.java @@ -594,15 +594,16 @@ public void setb(double b) { /** {@inheritDoc} */ @Override public double getSurfaceTenisionInfluenceParameter(double temperature) { - double a_inf = -3.471 + 4.927 * getCriticalCompressibilityFactor() - + 13.085 * Math.pow(getCriticalCompressibilityFactor(), 2.0) - - 2.067 * getAcentricFactor() + 1.891 * Math.pow(getAcentricFactor(), 2.0); - double b_inf = -1.690 + 2.311 * getCriticalCompressibilityFactor() - + 5.644 * Math.pow(getCriticalCompressibilityFactor(), 2.0) - - 1.027 * getAcentricFactor() + 1.424 * Math.pow(getAcentricFactor(), 2.0); - double c_inf = -0.318 + 0.299 * getCriticalCompressibilityFactor() - + 1.710 * Math.pow(getCriticalCompressibilityFactor(), 2.0) - - 0.174 * getAcentricFactor() + 0.157 * Math.pow(getAcentricFactor(), 2.0); + /* + * double a_inf = -3.471 + 4.927 * getCriticalCompressibilityFactor() + 13.085 * + * Math.pow(getCriticalCompressibilityFactor(), 2.0) - 2.067 * getAcentricFactor() + 1.891 * + * Math.pow(getAcentricFactor(), 2.0); double b_inf = -1.690 + 2.311 * + * getCriticalCompressibilityFactor() + 5.644 * Math.pow(getCriticalCompressibilityFactor(), + * 2.0) - 1.027 * getAcentricFactor() + 1.424 * Math.pow(getAcentricFactor(), 2.0); double + * c_inf = -0.318 + 0.299 * getCriticalCompressibilityFactor() + 1.710 * + * Math.pow(getCriticalCompressibilityFactor(), 2.0) - 0.174 * getAcentricFactor() + 0.157 * + * Math.pow(getAcentricFactor(), 2.0); + */ double TR = 1.0 - temperature / getTC(); if (TR < 1) { TR = 0.5; @@ -646,11 +647,11 @@ public double getAresnTV(PhaseInterface phase) { public double getChemicalPotential(PhaseInterface phase) { double entalp = getHID(phase.getTemperature()) * numberOfMolesInPhase; double entrop = numberOfMolesInPhase * getIdEntropy(phase.getTemperature()); - double chempot = ((entalp - phase.getTemperature() * entrop) - + numberOfMolesInPhase * R * phase.getTemperature() - * Math.log(numberOfMolesInPhase * R * phase.getTemperature() - / phase.getVolume() / referencePressure) - + getAresnTV(phase) * numberOfMolesInPhase) / numberOfMolesInPhase; + // double chempot = ((entalp - phase.getTemperature() * entrop) + numberOfMolesInPhase * R * + // phase.getTemperature() * Math.log(numberOfMolesInPhase * R * phase.getTemperature() / + // phase.getVolume() / referencePressure) + getAresnTV(phase) * numberOfMolesInPhase) / + // numberOfMolesInPhase; + // double chempot2 = super.getChemicalPotential(phase); // System.out.println("d " + chempot + " " + chempot2); return ((entalp - phase.getTemperature() * entrop) diff --git a/src/main/java/neqsim/thermo/component/ComponentGE.java b/src/main/java/neqsim/thermo/component/ComponentGE.java index 51fb119717..2a56a1e1e4 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGE.java +++ b/src/main/java/neqsim/thermo/component/ComponentGE.java @@ -82,8 +82,8 @@ public double fugcoef(PhaseInterface phase) { * @return a double */ public double fugcoefDiffPres(PhaseInterface phase) { - double temperature = phase.getTemperature(), pressure = phase.getPressure(); - int numberOfComponents = phase.getNumberOfComponents(); + // double temperature = phase.getTemperature(), pressure = phase.getPressure(); + // int numberOfComponents = phase.getNumberOfComponents(); if (referenceStateType.equals("solvent")) { dfugdp = 0.0; // forelopig uten pointing } else { @@ -101,8 +101,9 @@ public double fugcoefDiffPres(PhaseInterface phase) { * @return a double */ public double fugcoefDiffTemp(PhaseInterface phase) { - double temperature = phase.getTemperature(), pressure = phase.getPressure(); - int numberOfComponents = phase.getNumberOfComponents(); + double temperature = phase.getTemperature(); + // double pressure = phase.getPressure(); + // int numberOfComponents = phase.getNumberOfComponents(); if (referenceStateType.equals("solvent")) { dfugdt = dlngammadt + 1.0 / getAntoineVaporPressure(temperature) diff --git a/src/main/java/neqsim/thermo/component/ComponentGEUnifacUMRPRU.java b/src/main/java/neqsim/thermo/component/ComponentGEUnifacUMRPRU.java index 7b6d2b8483..448b3f5124 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGEUnifacUMRPRU.java +++ b/src/main/java/neqsim/thermo/component/ComponentGEUnifacUMRPRU.java @@ -363,7 +363,7 @@ public void commonInit(PhaseInterface phase, int numberOfComponents, double temp FCommontemp += (compArray[j].getQ() * compArray[j].getx()); } - int initType = phase.getInitType(); + // int initType = phase.getInitType(); } // TODO impement dlngammadn diff --git a/src/main/java/neqsim/thermo/component/ComponentGEWilson.java b/src/main/java/neqsim/thermo/component/ComponentGEWilson.java index 75a4918752..bfecb461d0 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGEWilson.java +++ b/src/main/java/neqsim/thermo/component/ComponentGEWilson.java @@ -185,8 +185,9 @@ public double getWilsonInteractionEnergy(PhaseInterface phase1) { // calculating transition enthalpy double deltaHtot = (3.7791 * carbonnumber - 12.654) * 1000; - double Ttrans = - 420.42 - 134.784 * Math.exp(-4.344 * Math.pow(carbonnumber + 6.592, 0.14627)); + // double Ttrans = 420.42 - 134.784 * Math.exp(-4.344 * Math.pow(carbonnumber + 6.592, + // 0.14627)); + double Tf = 374.5 + 0.2617 * getMolarMass() - 20.172 / getMolarMass(); double deltaHf = (0.1426 * getMolarMass() * Tf) * 4.1868; double deltaHtrans = (deltaHtot - deltaHf); diff --git a/src/main/java/neqsim/thermo/component/ComponentWax.java b/src/main/java/neqsim/thermo/component/ComponentWax.java index d9df13fa83..89fb92ea31 100644 --- a/src/main/java/neqsim/thermo/component/ComponentWax.java +++ b/src/main/java/neqsim/thermo/component/ComponentWax.java @@ -81,11 +81,10 @@ public double fugcoef2(PhaseInterface phase1) { * Math.exp(-getHeatOfFusion() / (R * phase1.getTemperature()) * (1.0 - phase1.getTemperature() / getTriplePointTemperature()) + presTerm); - double SolidFug2 = - getx() * liquidPhaseFugacity - * Math.exp(-getHeatOfFusion() / (R * phase1.getTemperature()) - * (1.0 - phase1.getTemperature() / getTriplePointTemperature()) - + presTerm); + + // double SolidFug2 = getx() * liquidPhaseFugacity * Math.exp(-getHeatOfFusion() / (R * + // phase1.getTemperature()) * (1.0 - phase1.getTemperature() / getTriplePointTemperature()) + // + presTerm); fugasityCoeffisient = SolidFug / (phase1.getPressure() * getx()); logFugasityCoeffisient = Math.log(fugasityCoeffisient); diff --git a/src/main/java/neqsim/thermo/component/ComponentWaxWilson.java b/src/main/java/neqsim/thermo/component/ComponentWaxWilson.java index 76d01b46cb..aa0965bee0 100644 --- a/src/main/java/neqsim/thermo/component/ComponentWaxWilson.java +++ b/src/main/java/neqsim/thermo/component/ComponentWaxWilson.java @@ -199,12 +199,12 @@ public double getWilsonInteractionEnergy(PhaseInterface phase1) { * ((deltaHvap0 + omega * deltaHvap1 + omega * omega * deltaHvap2) * 4.1868); // calculating transition enthalpy - double deltaHtot = (3.7791 * carbonnumber - 12.654) * 1000; /// should not be a cooma - cirrected Tosin 08.05.2013 - double Ttrans = - 420.42 - 134784.0 * Math.exp(-4.344 * Math.pow(carbonnumber + 6.592, 0.14627)); + + // double Ttrans = 420.42 - 134784.0 * Math.exp(-4.344 * Math.pow(carbonnumber + 6.592, + /// 0.14627)); double Tf = 374.5 + 0.2617 * getMolarMass() - 20.172 / getMolarMass(); double deltaHf = (0.1426 * getMolarMass() * Tf) * 4.1868; double deltaHtrans = (deltaHtot - deltaHf); diff --git a/src/main/java/neqsim/thermo/component/atractiveEosTerm/AtractiveTermTwuCoon.java b/src/main/java/neqsim/thermo/component/atractiveEosTerm/AtractiveTermTwuCoon.java index e5807f1360..8959a5b3f3 100644 --- a/src/main/java/neqsim/thermo/component/atractiveEosTerm/AtractiveTermTwuCoon.java +++ b/src/main/java/neqsim/thermo/component/atractiveEosTerm/AtractiveTermTwuCoon.java @@ -96,9 +96,8 @@ private double diffalphaCritT(double temperature) { * @return double */ private double diffdiffalphaCritT(double temperature) { - double t = temperature; double TC = getComponent().getTC(); - // double Tr = (t / TC); + // double Tr = (temperature / TC); return 4.0 * Math.pow(Math.exp(c * (1.0 - Math.pow(temperature / TC, 1.0 * d))), 2.0) * c * c * Math.pow(Math.pow(temperature / TC, 1.0 * d), 2.0) * d * d / (temperature * temperature) diff --git a/src/main/java/neqsim/thermo/mixingRule/EosMixingRules.java b/src/main/java/neqsim/thermo/mixingRule/EosMixingRules.java index 8d83f0e983..b55f2a7d86 100644 --- a/src/main/java/neqsim/thermo/mixingRule/EosMixingRules.java +++ b/src/main/java/neqsim/thermo/mixingRule/EosMixingRules.java @@ -1444,7 +1444,8 @@ public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double public double calcAT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0.0; - ComponentEosInterface[] compArray = (ComponentEosInterface[]) phase.getcomponentArray(); + // ComponentEosInterface[] compArray = (ComponentEosInterface[]) + // phase.getcomponentArray(); A = phase.getNumberOfMolesInPhase() * getB() * R * temperature * dadt + phase.getNumberOfMolesInPhase() * getB() * R * alpha_mix; @@ -1595,7 +1596,7 @@ public void init(PhaseInterface phase, double temperature, double pressure, int } } - double rhs = 0.0; + // double rhs = 0.0; for (int i = 0; i < numbcomp; i++) { oneSubAlf[i] = 1.0 - qPure[i]; abf[i] = compArray[i].getb() * oneSubAlf[i]; @@ -1707,7 +1708,8 @@ public double calcAi(int compNumb, PhaseInterface phase, double temperature, public double calcAT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0; - ComponentEosInterface[] compArray = (ComponentEosInterface[]) phase.getcomponentArray(); + // ComponentEosInterface[] compArray = (ComponentEosInterface[]) + // phase.getcomponentArray(); A = Math.pow(phase.getNumberOfMolesInPhase(), 1.0) * getB() * R * temperature * dadt + Math.pow(phase.getNumberOfMolesInPhase(), 1.0) * getB() * R * alpha_mix diff --git a/src/main/java/neqsim/thermo/phase/Phase.java b/src/main/java/neqsim/thermo/phase/Phase.java index 7ec3fcedb8..563c50958a 100644 --- a/src/main/java/neqsim/thermo/phase/Phase.java +++ b/src/main/java/neqsim/thermo/phase/Phase.java @@ -1502,7 +1502,7 @@ public double getMolalMeanIonicActivity(int comp1, int comp2) { double act1 = 0.0; double act2 = 0.0; int watNumb = 0; - double vminus = 0.0, vplus = 0.0; + // double vminus = 0.0, vplus = 0.0; double ions = 0.0; for (int j = 0; j < this.numberOfComponents; j++) { if (getComponent(j).getIonicCharge() != 0) { @@ -1572,13 +1572,14 @@ public double getOsmoticCoefficient(int watNumb) { // } // else return getOsmoticCoefficient(watNumb); // } + /** {@inheritDoc} */ @Override public double getMeanIonicActivity(int comp1, int comp2) { double act1 = 0.0; double act2 = 0.0; int watNumb = 0; - double vminus = 0.0, vplus = 0.0; + // double vminus = 0.0, vplus = 0.0; for (int j = 0; j < this.numberOfComponents; j++) { if (getComponent(j).getComponentName().equals("water")) { diff --git a/src/main/java/neqsim/thermo/phase/PhaseBWRSEos.java b/src/main/java/neqsim/thermo/phase/PhaseBWRSEos.java index 2bde7dff86..3abbe48343 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseBWRSEos.java +++ b/src/main/java/neqsim/thermo/phase/PhaseBWRSEos.java @@ -186,14 +186,14 @@ public double getFpoldVdV() { */ public double getFpoldVdVdV() { double temp = 0.0, temp2 = 0.0; - double temp3 = 0.0, temp4 = 0.0; + // double temp3 = 0.0, temp4 = 0.0; for (int i = 1; i < OP; i++) { temp += (i - 2) * (i - 1) * (i) * ((ComponentBWRS) componentArray[0]).getBP(i) / (i - 0.0) * Math.pow(getMolarDensity(), i - 3); temp2 += (i - 1) * (i) * ((ComponentBWRS) componentArray[0]).getBP(i) / (i - 0.0) * Math.pow(getMolarDensity(), i - 2); - temp3 += (i) * ((ComponentBWRS) componentArray[0]).getBP(i) / (i - 0.0) - * Math.pow(getMolarDensity(), i - 1); + // temp3 += (i) * ((ComponentBWRS) componentArray[0]).getBP(i) / (i - 0.0) * + // Math.pow(getMolarDensity(), i - 1); } return numberOfMolesInPhase / (R * temperature) * temp * Math.pow(getdRhodV(), 3) + 2 * numberOfMolesInPhase / (R * temperature) * temp2 * Math.pow(getdRhodV(), 1) diff --git a/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java b/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java index b9f0c0be44..f93f359f73 100644 --- a/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java +++ b/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java @@ -1451,9 +1451,9 @@ public double molarVolume(double pressure, double temperature, double A, double // setMolarVolume(1.0 / BonV * Btemp / numberOfMolesInPhase); Z = pressure * getMolarVolume() / (R * temperature); // System.out.println("BonV " + BonV); - } // while(Math.abs((BonV-BonVold)/BonV)>1.0e-10 && iterations<500); - while (Math.abs((oldMolarVolume - getMolarVolume()) / oldMolarVolume) > 1.0e-10 + } while (Math.abs((oldMolarVolume - getMolarVolume()) / oldMolarVolume) > 1.0e-10 && iterations < 100); + // while(Math.abs((BonV-BonVold)/BonV)>1.0e-10 && iterations<500); // while(Math.abs((h-hOld)/h)>1.0e-10 && iterations<6000); // System.out.println("error BonV " + Math.abs((BonV-BonVold)/BonV)); diff --git a/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java b/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java index 51284802c0..e59639a0e0 100644 --- a/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java +++ b/src/main/java/neqsim/thermo/util/GERG/NeqSimAGA8Detail.java @@ -89,7 +89,6 @@ public double getDensity() { * @return a double */ public double getPressure() { - int d = 0; double moldens = getMolarDensity(); doubleW P = new doubleW(0.0); doubleW Z = new doubleW(0.0); @@ -118,12 +117,9 @@ public double getMolarMass() { * @return a double */ public double getMolarDensity() { - int d = 0; - int flag = 0; intW ierr = new intW(0); StringW herr = new StringW(""); doubleW D = new doubleW(0.0); - StringW strW = new StringW(""); double pressure = phase.getPressure() * 100.0; neqsim.thermo.util.GERG.DETAIL.DensityDetail(phase.getTemperature(), pressure, normalizedGERGComposition, D, ierr, herr); @@ -153,7 +149,7 @@ public double[] propertiesDetail(PhaseInterface phase) { * @return an array of {@link double} objects */ public double[] getProperties(PhaseInterface phase, String[] properties) { - double molarDens = getMolarDensity(phase); + // double molarDens = getMolarDensity(phase); double[] allProperties = propertiesDetail(); double[] returnProperties = new double[properties.length]; diff --git a/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java b/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java index 09db9ea464..d0c0adab48 100644 --- a/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java +++ b/src/main/java/neqsim/thermo/util/GERG/NeqSimGERG2008.java @@ -89,7 +89,6 @@ public double getDensity() { * @return a double */ public double getPressure() { - int d = 0; double moldens = getMolarDensity(); doubleW P = new doubleW(0.0); doubleW Z = new doubleW(0.0); @@ -118,12 +117,10 @@ public double getMolarMass() { * @return a double */ public double getMolarDensity() { - int d = 0; int flag = 0; intW ierr = new intW(0); StringW herr = new StringW(""); doubleW D = new doubleW(0.0); - StringW strW = new StringW(""); double pressure = phase.getPressure() * 100.0; neqsim.thermo.util.GERG.GERG2008.DensityGERG(flag, phase.getTemperature(), pressure, normalizedGERGComposition, D, ierr, herr); @@ -153,7 +150,6 @@ public double[] propertiesGERG(PhaseInterface phase) { * @return an array of {@link double} objects */ public double[] getProperties(PhaseInterface phase, String[] properties) { - double molarDens = getMolarDensity(phase); double[] allProperties = propertiesGERG(); double[] returnProperties = new double[properties.length]; @@ -184,7 +180,7 @@ public double[] getProperties(PhaseInterface phase, String[] properties) { * @return an array of {@link double} objects */ public double[] propertiesGERG() { - int _x_offset = 0; + // int _x_offset = 0; doubleW p = new doubleW(0.0); doubleW z = new doubleW(0.0); doubleW dpdd = new doubleW(0.0); diff --git a/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/HuronVidalParameterFitting/UMRPRUFunction.java b/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/HuronVidalParameterFitting/UMRPRUFunction.java index 76bf0f5ebb..61eebf966e 100644 --- a/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/HuronVidalParameterFitting/UMRPRUFunction.java +++ b/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/HuronVidalParameterFitting/UMRPRUFunction.java @@ -60,7 +60,7 @@ public void setFittingParams(int i, double value) { if (i == 2) { PhaseGEUnifac unifacp = (PhaseGEUnifac) ((PhaseEosInterface) system.getPhases()[0]) .getMixingRule().getGEPhase(); - double aa = unifacp.getAij(0, 2); + // double aa = unifacp.getAij(0, 2); unifacp.setAij(2, 0, value); unifacp.setAij(2, 1, value); diff --git a/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_CO2.java b/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_CO2.java index 68d5b54fbb..50f335744f 100644 --- a/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_CO2.java +++ b/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_CO2.java @@ -310,7 +310,8 @@ public void setFittingParams5(int i, double value) { */ public void setFittingParams3(int i, double value) { params[i] = value; - int MDEAplusNumb = 0, MDEANumb = 0, CO2Numb = 0, HCO3numb = 0, Waternumb = 0; + int MDEAplusNumb = 0, CO2Numb = 0; + // double MDEANumb = 0, HCO3numb = 0, Waternumb = 0; int j = 0; do { MDEAplusNumb = j; @@ -320,7 +321,7 @@ public void setFittingParams3(int i, double value) { j = 0; do { - MDEANumb = j; + // MDEANumb = j; j++; } while (!system.getPhases()[0].getComponents()[j - 1].getComponentName().equals("MDEA")); j = 0; @@ -331,15 +332,15 @@ public void setFittingParams3(int i, double value) { j = 0; do { - HCO3numb = j; + // HCO3numb = j; j++; } while (!system.getPhases()[0].getComponents()[j - 1].getComponentName() .equals("HCO3minus")); - j = 0; - do { - Waternumb = j; - j++; - } while (!system.getPhases()[0].getComponents()[j - 1].getComponentName().equals("water")); + + /* + * j = 0; do { Waternumb = j; j++; } while (!system.getPhases()[0].getComponents()[j - + * 1].getComponentName().equals("water")); + */ if (i == 0) { ((PhaseModifiedFurstElectrolyteEos) system.getPhases()[0]).getElectrolyteMixingRule() diff --git a/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_Sleipner.java b/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_Sleipner.java index 8793ade0c7..cb804b1ac5 100644 --- a/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_Sleipner.java +++ b/src/main/java/neqsim/thermo/util/parameterFitting/binaryInteractionParameterFitting/ionicInteractionCoefficientFitting/IonicInteractionParameterFittingFunction_Sleipner.java @@ -55,8 +55,8 @@ public double calcTrueValue(double val) { @Override public void setFittingParams(int i, double value) { params[i] = value; - int MDEAplusNumb = 0, MDEANumb = 0, CO2Numb = 0, HCO3Numb = 0, WaterNumb = 0, AcidNumb = 0, - AcidnegNumb = 0; + int MDEAplusNumb = 0, MDEANumb = 0, AcidNumb = 0, AcidnegNumb = 0; + // int CO2Numb = 0, HCO3Numb = 0, WaterNumb = 0; int j = 0; do { MDEAplusNumb = j; @@ -68,23 +68,21 @@ public void setFittingParams(int i, double value) { MDEANumb = j; j++; } while (!system.getPhases()[1].getComponents()[j - 1].getComponentName().equals("MDEA")); - j = 0; - do { - CO2Numb = j; - j++; - } while (!system.getPhases()[1].getComponents()[j - 1].getComponentName().equals("CO2")); - j = 0; - do { - HCO3Numb = j; - j++; - } while (!system.getPhases()[1].getComponents()[j - 1].getComponentName().equals("HCO3-")); + /* + * j = 0; do { CO2Numb = j; j++; } while (!system.getPhases()[1].getComponents()[j - + * 1].getComponentName().equals("CO2")); + */ - j = 0; - do { - WaterNumb = j; - j++; - } while (!system.getPhases()[1].getComponents()[j - 1].getComponentName().equals("water")); + /* + * j = 0; do { HCO3Numb = j; j++; } while (!system.getPhases()[1].getComponents()[j - + * 1].getComponentName().equals("HCO3-")); + */ + + /* + * j = 0; do { WaterNumb = j; j++; } while (!system.getPhases()[1].getComponents()[j - + * 1].getComponentName().equals("water")); + */ j = 0; do { diff --git a/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java b/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java index 3420b34e75..b6c8695882 100644 --- a/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java +++ b/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java @@ -4,8 +4,6 @@ import java.io.File; import java.io.FileReader; import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import neqsim.thermo.phase.PhaseEosInterface; @@ -36,9 +34,7 @@ public static SystemInterface read(String inputFile) { new neqsim.thermo.system.SystemSrkEos(288.15, 1.01325); double[][] kij = null; - try { - File file = new File(inputFile); - BufferedReader br = new BufferedReader(new FileReader(file)); + try (BufferedReader br = new BufferedReader(new FileReader(new File(inputFile)))) { String st; ArrayList names = new ArrayList(); @@ -161,7 +157,8 @@ public static SystemInterface read(String inputFile) { if (arr.length == 1) { break; } - List list = Arrays.asList(arr); + + // List list = Arrays.asList(arr); for (int i = 0; i < arr.length - 1; i++) { BIC.add(Double.parseDouble(arr[i + 1])); kij[numb][i] = Double.parseDouble(arr[i + 1]); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/CriticalPointFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/CriticalPointFlash.java index 25dfe54756..6a63ff9c81 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/CriticalPointFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/CriticalPointFlash.java @@ -183,13 +183,14 @@ public void run() { double detM, olddetM, ddetdT; double dT = 0.1; calcMmatrix(); - int i = Mmatrix.eig().getNumberOfEigenvalues(); + // int i = Mmatrix.eig().getNumberOfEigenvalues(); SimpleMatrix eigenVector = Mmatrix.eig().getEigenVector(0); SimpleMatrix evalMatrix = eigenVector.transpose().mult(Mmatrix).mult(eigenVector); detM = Mmatrix.determinant();// evalMatrix.get(0, 0); int iter = 0; system.setTemperature(system.getTemperature() + dT); - double dTOld = 111110; + + // double dTOld = 111110; do { system.init(3); @@ -201,7 +202,7 @@ public void run() { evalMatrix = eigenVector.transpose().mult(Mmatrix).mult(eigenVector); detM = Mmatrix.determinant();// evalMatrix.get(0, 0); ddetdT = (detM - olddetM) / dT; - dTOld = dT; + // dTOld = dT; dT = -detM / ddetdT; if (Math.abs(dT) > 5.0) { // dT = Math.signum(dT) * 5.0; diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java index 9bc5937d80..2ff08a39ec 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java @@ -65,9 +65,10 @@ public void run() { / system.getPhase(0).getNumberOfMolesInPhase() * system.getTotalNumberOfMoles(); double liqEnthalpy = system.getPhase(1).getEnthalpy() / system.getPhase(1).getNumberOfMolesInPhase() * system.getTotalNumberOfMoles(); - double solidEnthalpy = 0.0; /* + * double solidEnthalpy = 0.0; + * * if (system.doSolidPhaseCheck()) { system.init(3, 3); solidEnthalpy = * system.getPhases()[3].getEnthalpy() / system.getPhases()[3].getNumberOfMolesInPhase() * system.getTotalNumberOfMoles(); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/PHsolidFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/PHsolidFlash.java index 7e855449f8..02734ac3f9 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/PHsolidFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/PHsolidFlash.java @@ -8,7 +8,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import neqsim.thermo.system.SystemInterface; -import neqsim.thermodynamicOperations.ThermodynamicOperations; /** *

@@ -54,7 +53,7 @@ public void run() { double err = 0; int iter = 0; double f_func = 0.0, f_func_old = 0.0, df_func_dt = 0, t_old = 0, t_oldold = 0.0; - ThermodynamicOperations ops = new ThermodynamicOperations(system); + // ThermodynamicOperations ops = new ThermodynamicOperations(system); tpFlash.run(); double dt = 10; do { diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlash.java index 3d15109edb..843a553462 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/PSFlash.java @@ -43,7 +43,7 @@ public PSFlash(SystemInterface system, double Sspec, int type) { /** {@inheritDoc} */ @Override public double calcdQdTT() { - double cP1 = 0.0, cP2 = 0.0; + // double cP1 = 0.0, cP2 = 0.0; if (system.getNumberOfPhases() == 1) { return -system.getPhase(0).getCp() / system.getTemperature(); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/PVrefluxflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/PVrefluxflash.java index 66ea25ae9c..6eb1387996 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/PVrefluxflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/PVrefluxflash.java @@ -44,7 +44,7 @@ public PVrefluxflash(SystemInterface system, double refluxSpec, int refluxPhase) @Override public void run() { // System.out.println("enthalpy: " + system.getEnthalpy()); - double err = 0; + // double err = 0; int iter = 0; double f_func = 0.0, f_func_old = 0.0, df_func_dt = 0, t_old = 0, t_oldold = 0.0; tpFlash.run(); @@ -60,7 +60,7 @@ public void run() { // / system.getVolume(); df_func_dt = (f_func - f_func_old) / (t_old - t_oldold); - err = Math.abs(f_func); + // err = Math.abs(f_func); if (iter < 4) { if (f_func > 0) { diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash.java index e1066c6e27..546db65f6c 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash.java @@ -211,7 +211,7 @@ public double calcQ() { */ public void solveBeta(boolean ideal) { double oldBeta[] = new double[system.getNumberOfPhases() - 1]; - double newBeta[] = new double[system.getNumberOfPhases() - 1]; + // double newBeta[] = new double[system.getNumberOfPhases() - 1]; int iter = 0; Matrix ans = new Matrix(system.getNumberOfPhases() - 1, 1); do { @@ -222,7 +222,7 @@ public void solveBeta(boolean ideal) { calcQ(); oldBeta = new double[system.getNumberOfPhases() - 1]; - newBeta = new double[system.getNumberOfPhases() - 1]; + // newBeta = new double[system.getNumberOfPhases() - 1]; iter++; for (int k = 0; k < system.getNumberOfPhases() - 1; k++) { oldBeta[k] = system.getBeta(k); @@ -319,12 +319,12 @@ public void checkGibbs() { */ public void calcSolidBeta() { double tempVar = system.getPhase(0).getComponents()[solidComponent].getz(); - double beta = 1.0; + // double beta = 1.0; for (int i = 0; i < system.getNumberOfPhases() - 1; i++) { tempVar -= system.getBeta(i) * system.getPhase(3).getComponent(solidComponent).getFugasityCoeffisient() / system.getPhase(i).getComponent(solidComponent).getFugasityCoeffisient(); - beta -= system.getBeta(i); + // beta -= system.getBeta(i); } if (tempVar > 0 && tempVar < 1.0) { system.setBeta(system.getNumberOfPhases() - 1, tempVar); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash1.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash1.java index a8cff58061..78c83fc47a 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash1.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash1.java @@ -237,7 +237,7 @@ public void calcGradientAndHesian() { */ public void solveBeta() { double oldBeta[] = new double[system.getNumberOfPhases() - solidsNumber]; - double newBeta[] = new double[system.getNumberOfPhases() - solidsNumber]; + // double newBeta[] = new double[system.getNumberOfPhases() - solidsNumber]; int iter = 0; Matrix ans = new Matrix(system.getNumberOfPhases() - solidsNumber, 1); double Qold = 0; @@ -249,7 +249,7 @@ public void solveBeta() { Qold = calcQ(); calcGradientAndHesian(); oldBeta = new double[system.getNumberOfPhases() - solidsNumber]; - newBeta = new double[system.getNumberOfPhases() - solidsNumber]; + // newBeta = new double[system.getNumberOfPhases() - solidsNumber]; iter++; for (int k = 0; k < system.getNumberOfPhases() - solidsNumber; k++) { oldBeta[k] = system.getBeta(k); @@ -370,13 +370,13 @@ public void checkGibbs() { */ public double calcSolidBeta() { double tempVar = system.getPhase(0).getComponents()[solidIndex].getz(); - double beta = 1.0; + // double beta = 1.0; for (int i = 0; i < system.getNumberOfPhases() - solidsNumber; i++) { if (FluidPhaseActiveDescriptors[i] == 1) { tempVar -= system.getBeta(i) * system.getPhases()[3].getComponent(solidIndex).getFugasityCoeffisient() / system.getPhase(i).getComponent(solidIndex).getFugasityCoeffisient(); - beta -= system.getBeta(i); + // beta -= system.getBeta(i); } } if (tempVar > 0 && tempVar < 1.0) { @@ -462,8 +462,8 @@ public int checkAndAddSolidPhase() { solidCandidate[k] = system.getPhase(0).getComponents()[k].getz(); system.getPhases()[3].getComponent(k).setx(1.0); for (int i = 0; i < system.getNumberOfPhases(); i++) { - double e = system.getBeta(i) - * system.getPhases()[3].getComponent(k).fugcoef(system.getPhases()[3]); + // double e = system.getBeta(i)* + // system.getPhases()[3].getComponent(k).fugcoef(system.getPhases()[3]); solidCandidate[k] -= system.getBeta(i) * system.getPhases()[3].getComponent(k).fugcoef(system.getPhases()[3]) / system.getPhase(i).getComponent(k).getFugasityCoeffisient(); @@ -502,7 +502,8 @@ public int checkAndAddSolidPhase() { * @return a double */ public double solvebeta1() { - double numberOfMolesFreeze = system.getPhase(0).getComponent(solidIndex).getNumberOfmoles(); + // double numberOfMolesFreeze = + // system.getPhase(0).getComponent(solidIndex).getNumberOfmoles(); double solidCandidate = 0; int iter = 0; double dn = -0.01; diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash12.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash12.java index 26baaa3b23..2ee56b90bf 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash12.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/SolidFlash12.java @@ -194,7 +194,7 @@ public double calcQ() { */ public void solveBeta() { double oldBeta[] = new double[system.getNumberOfPhases() - solidsNumber]; - double newBeta[] = new double[system.getNumberOfPhases() - solidsNumber]; + // double newBeta[] = new double[system.getNumberOfPhases() - solidsNumber]; int iter = 0; Matrix ans = new Matrix(system.getNumberOfPhases() - solidsNumber, 1); do { @@ -204,7 +204,7 @@ public void solveBeta() { calcQ(); oldBeta = new double[system.getNumberOfPhases() - solidsNumber]; - newBeta = new double[system.getNumberOfPhases() - solidsNumber]; + // newBeta = new double[system.getNumberOfPhases() - solidsNumber]; iter++; for (int k = 0; k < system.getNumberOfPhases() - solidsNumber; k++) { oldBeta[k] = system.getBeta(k); @@ -223,7 +223,7 @@ public void solveBeta() { dQM.print(10, 10); dQdBM.print(10, 10); ans.print(30, 30); - double betaReductionFactor = 1.0; + // double betaReductionFactor = 1.0; // betaMatrixTemp = betaMatrix.minus(ans.times(betaReductionFactor)); // betaMatrixTemp.print(10, 2); @@ -293,12 +293,12 @@ public void checkGibbs() { */ public void calcSolidBeta() { double tempVar = system.getPhase(0).getComponents()[solidIndex].getz(); - double beta = 1.0; + // double beta = 1.0; for (int i = 0; i < system.getNumberOfPhases() - 1; i++) { tempVar -= system.getBeta(i) * system.getPhase(3).getComponent(solidIndex).getFugasityCoeffisient() / system.getPhase(i).getComponent(solidIndex).getFugasityCoeffisient(); - beta -= system.getBeta(i); + // beta -= system.getBeta(i); } if (tempVar > 0 && tempVar < 1.0) { system.setBeta(system.getNumberOfPhases() - 1, tempVar); @@ -382,7 +382,8 @@ public int checkAndAddSolidPhase() { * @return a double */ public double solvebeta1() { - double numberOfMolesFreeze = system.getPhase(0).getComponent(solidIndex).getNumberOfmoles(); + // double numberOfMolesFreeze = + // system.getPhase(0).getComponent(solidIndex).getNumberOfmoles(); double solidCandidate = 0; int iter = 0; double dn = -0.01; diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java index b23ddc822f..6a4958dcc9 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java @@ -922,7 +922,7 @@ public void run() { int iterations = 0; if (multiPhaseTest) {// && !system.isChemicalSystem()) { - double oldBeta = 1.0; + // double oldBeta = 1.0; double diff = 1.0e10, oldDiff = 1.0e10; double chemdev = 0; @@ -962,7 +962,7 @@ public void run() { iterations = 0; do { iterations++; - oldBeta = system.getBeta(system.getNumberOfPhases() - 1); + // oldBeta = system.getBeta(system.getNumberOfPhases() - 1); // system.init(1); oldDiff = diff; diff = this.solveBeta(); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflashWAX.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflashWAX.java index 8ff9ffd131..90f1330290 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflashWAX.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflashWAX.java @@ -167,7 +167,7 @@ public double calcQ() { */ public void solveBeta(boolean updateFugacities) { double oldBeta[] = new double[system.getNumberOfPhases()]; - double newBeta[] = new double[system.getNumberOfPhases()]; + // double newBeta[] = new double[system.getNumberOfPhases()]; Matrix ans = new Matrix(system.getNumberOfPhases() - 1, 1); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash_1.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash_1.java index a35226e4aa..74d74bd6c6 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash_1.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash_1.java @@ -151,7 +151,7 @@ public double calcQ() { */ public void solveBeta() { double oldBeta[] = new double[system.getNumberOfPhases()]; - double newBeta[] = new double[system.getNumberOfPhases()]; + // double newBeta[] = new double[system.getNumberOfPhases()]; Matrix ans; int iter = 1; @@ -195,7 +195,8 @@ public void stabilityAnalysis() { double[][] Wi = new double[system.getPhases()[1] .getNumberOfComponents()][system.getPhases()[0].getNumberOfComponents()]; double[] sumw = new double[system.getPhases()[1].getNumberOfComponents()]; - double sumz = 0, err = 0; + // double sumz = 0; + double err = 0; double[] oldlogw = new double[system.getPhases()[1].getNumberOfComponents()]; double[] d = new double[system.getPhases()[1].getNumberOfComponents()]; double[][] x = new double[system.getPhases()[1] @@ -222,7 +223,7 @@ public void stabilityAnalysis() { // logger.info("low gibbs phase " + lowestGibbsEnergyPhase); for (int k = 0; k < minimumGibbsEnergySystem.getPhases()[1].getNumberOfComponents(); k++) { - sumz += minimumGibbsEnergySystem.getPhases()[1].getComponents()[k].getz(); + // sumz += minimumGibbsEnergySystem.getPhases()[1].getComponents()[k].getz(); for (int i = 0; i < minimumGibbsEnergySystem.getPhases()[1] .getNumberOfComponents(); i++) { sumw[k] += (clonedSystem.get(k)).getPhases()[1].getComponents()[i].getx(); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/TSFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/TSFlash.java index 45659a1ef3..021708ba1b 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/TSFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/TSFlash.java @@ -47,7 +47,7 @@ public TSFlash(SystemInterface system, double Sspec) { /** {@inheritDoc} */ @Override public double calcdQdTT() { - double cP1 = 0.0, cP2 = 0.0; + // double cP1 = 0.0, cP2 = 0.0; if (system.getNumberOfPhases() == 1) { return -system.getPhase(0).getCp() / system.getTemperature(); @@ -74,10 +74,10 @@ public double solveQ() { double oldTemp = system.getPressure(), nyTemp = system.getPressure(); int iterations = 1; double error = 1.0, erorOld = 10.0e10; - double factor = 0.8; + // double factor = 0.8; - boolean correctFactor = true; - double newCorr = 1.0; + // boolean correctFactor = true; + // double newCorr = 1.0; do { iterations++; oldTemp = system.getPressure(); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/VHflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/VHflash.java index e045e8b229..071a640e17 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/VHflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/VHflash.java @@ -38,19 +38,20 @@ public VHflash(SystemInterface system, double Hspec, double Vspec) { this.pHFlash = new PHflash(system, Hspec, 0); this.Hspec = Hspec; this.Vspec = Vspec; - // System.out.println("entalpy " + Hspec); + // System.out.println("enthalpy " + Hspec); // System.out.println("volume " + Vspec); } /** {@inheritDoc} */ @Override public void run() { - double oldVol = system.getVolume(), newVol = system.getVolume(); - double pNew = system.getPressure(), pOld = system.getPressure(), pOldOld = 0.0; + // double oldVol = system.getVolume(); + double newVol = system.getVolume(); + // double pNew = system.getPressure(), pOld = system.getPressure(), pOldOld = 0.0; double err = 0.0; int iterations = 0; - // System.out.println("entalpy start " + system.getEnthalpy()); - double dPdV = 0.0; + // System.out.println("enthalpy start " + system.getEnthalpy()); + // double dPdV = 0.0; double wallHeat = 0.0; for (int i = 0; i < 1; i++) { wallHeat = 0 * i / 20.0 * 400.0 * 1295.0 * 1000.0 * (293.15 - system.getTemperature()); @@ -62,9 +63,9 @@ public void run() { this.pHFlash = new PHflash(system, Hspec + wallHeat, 0); // System.out.println("Hspec " + Hspec); this.pHFlash.run(); - pOldOld = pOld; - pOld = system.getPressure(); - oldVol = newVol; + // pOldOld = pOld; + // pOld = system.getPressure(); + // oldVol = newVol; newVol = system.getVolume(); err = (newVol - Vspec) / Vspec; @@ -78,12 +79,12 @@ public void run() { system.setPressure(system.getPressure() - 0.6 * 1.0 / system.getdVdPtn() * (newVol - Vspec));// system.getdVdPtn()*(newVol-Vspec));//dPdV*(newVol-Vspec)); } - pNew = system.getPressure(); - dPdV = (pOld - pOldOld) / (newVol - oldVol); + // pNew = system.getPressure(); + // dPdV = (pOld - pOldOld) / (newVol - oldVol); // System.out.println("pressure " + system.getPressure()); } while ((Math.abs(err) > 1e-10 && iterations < 1000) || iterations < 7); } - // System.out.println("entalpy end " + system.getEnthalpy()); + // System.out.println("enthalpy end " + system.getEnthalpy()); // System.out.println("iterations " + iterations); } diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/VSflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/VSflash.java index 9822a84e7e..6152df7763 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/VSflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/VSflash.java @@ -40,7 +40,7 @@ public VSflash(SystemInterface system, double Vspec, double Sspec) { this.tpFlash = new TPflash(system); this.Sspec = Sspec; this.Vspec = Vspec; - // System.out.println("entalpy " + Hspec); + // System.out.println("enthalpy " + Hspec); // System.out.println("volume " + Vspec); } diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/VUflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/VUflash.java index 6bb1cc8199..02839abab9 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/VUflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/VUflash.java @@ -43,19 +43,22 @@ public VUflash(SystemInterface system, double Vspec, double Uspec) { this.pHFlash = new PHflash(system, Uspec, 0); this.Uspec = Uspec; this.Vspec = Vspec; - // System.out.println("entalpy " + Hspec); + // System.out.println("enthalpy " + Hspec); // System.out.println("volume " + Vspec); } /** {@inheritDoc} */ @Override public void run() { - double oldVol = system.getVolume(), newVol = system.getVolume(); - double pNew = system.getPressure(), pOld = system.getPressure(), pOldOld = 0.0; + // double oldVol = system.getVolume(); + double newVol = system.getVolume(); + // double pNew = system.getPressure(); + // double pOld = system.getPressure(); + // double pOldOld = 0.0; double err = 0.0; int iterations = 0; - // \\ System.out.println("entalpy start " + system.getEnthalpy()); - double dPdV = 0.0; + // System.out.println("enthalpy start " + system.getEnthalpy()); + // double dPdV = 0.0; double wallHeat = 0.0; for (int i = 0; i < 21; i++) { wallHeat = 0 * i / 20.0 * 400.0 * 1295.0 * 1000.0 * (293.15 - system.getTemperature()); @@ -68,9 +71,9 @@ public void run() { Uspec + wallHeat + system.getPressure() * system.getVolume(), 0); // System.out.println("Hspec " + Hspec); this.pHFlash.run(); - pOldOld = pOld; - pOld = system.getPressure(); - oldVol = newVol; + // pOldOld = pOld; + // pOld = system.getPressure(); + // oldVol = newVol; newVol = system.getVolume(); err = (newVol - Vspec) / Vspec; @@ -84,12 +87,12 @@ public void run() { system.setPressure(system.getPressure() - 0.6 * 1.0 / system.getdVdPtn() * (newVol - Vspec));// system.getdVdPtn()*(newVol-Vspec));//dPdV*(newVol-Vspec)); } - pNew = system.getPressure(); - dPdV = (pOld - pOldOld) / (newVol - oldVol); + // pNew = system.getPressure(); + // dPdV = (pOld - pOldOld) / (newVol - oldVol); // System.out.println("pressure " + system.getPressure()); } while ((Math.abs(err) > 1e-10 && iterations < 1000) || iterations < 7); } - // System.out.println("entalpy end " + system.getEnthalpy()); + // System.out.println("enthalpy end " + system.getEnthalpy()); // System.out.println("iterations " + iterations); } diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/dTPflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/dTPflash.java index 8ee0969945..1e1bc72b39 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/dTPflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/dTPflash.java @@ -47,16 +47,16 @@ public dTPflash(SystemInterface system, String[] comps) { public void run() { iterations = 0; double diff = 0.0; - double fracdiff = 0.0; + // double fracdiff = 0.0; // system.setBeta(0.5); do { diff = 0.0; - fracdiff = 0.0; + // fracdiff = 0.0; iterations++; system.init(1); for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) { - boolean hasgot = false; + // boolean hasgot = false; for (int j = 0; j < flashComp.length; j++) { if (flashComp[j].equals(system.getPhase(0).getComponent(i).getName())) { diff += Math.abs((system.getPhase(1).getComponent(i).getx() @@ -76,9 +76,11 @@ public void run() { * system.getPhase(1).getComponent(i) .getFugasityCoefficient() * system.getPhase(1).getPressure())); - fracdiff += system.getPhase(1).getComponent(i).getz() - - system.getPhase(1).getComponent(i).getx(); - hasgot = true; + + // fracdiff += system.getPhase(1).getComponent(i).getz() - + // system.getPhase(1).getComponent(i).getx(); + + // hasgot = true; // logger.info("x " + system.getPhase(1).getComponent(i).getx()); } } diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointPressureFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointPressureFlash.java index 5d144e302c..652090ec6d 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointPressureFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointPressureFlash.java @@ -43,7 +43,8 @@ public void run() { } int iterations = 0, maxNumberOfIterations = 500; - double yold = 0, ytotal = 1, deriv = 0, funk = 0; + double yold = 0, ytotal = 1; + // double deriv = 0, funk = 0; boolean chemSolved = true; // logger.info("starting"); // system.setPressure(1.0); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java index b4ba696b54..1db9af7c11 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/bubblePointTemperatureNoDer.java @@ -44,7 +44,7 @@ public void run() { int iterations = 0, maxNumberOfIterations = 1000; double yold = 0, ytotal = 1; - double deriv = 0, funk = 0; + // double deriv = 0, funk = 0; // logger.info("starting"); system.init(0); @@ -69,7 +69,7 @@ public void run() { } } - double oldPres = 0; + // double oldPres = 0; if (system.isChemicalSystem()) { system.getChemicalReactionOperations().solveChemEq(0); system.getChemicalReactionOperations().solveChemEq(1); diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/dewPointTemperatureFlashDer.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/dewPointTemperatureFlashDer.java index 6ff6e5668e..cd46b2bf37 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/dewPointTemperatureFlashDer.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/dewPointTemperatureFlashDer.java @@ -41,7 +41,7 @@ public void run() { int iterations = 0, maxNumberOfIterations = 1000; double xold = 0, xtotal = 1; - double deriv = 0, funk = 0; + // double deriv = 0, funk = 0; // System.out.println("starting"); system.init(0); system.setBeta(0, 1.0 - 1e-15); @@ -82,7 +82,8 @@ public void run() { .setx(system.getPhases()[1].getComponents()[i].getx() / xtotal); } - double ktot = 0.0, oldTemperature = 0.0, fold = 0; + double ktot = 0.0; + // double = 0.0, fold = 0; do { oldTemp = system.getTemperature(); iterations++; @@ -99,10 +100,10 @@ public void run() { - system.getPhases()[0].getComponents()[i].getdfugdt()); } double f = xtotal - 1.0; - fold = f; + // fold = f; // System.out.println("x" + xtotal); - oldTemperature = system.getTemperature(); + // oldTemperature = system.getTemperature(); if (iterations < 5) { system.setTemperature(system.getTemperature() + iterations / (iterations + 100.0) diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java index 029959cbc7..bfcc900120 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java @@ -37,9 +37,9 @@ public waterDewPointTemperatureFlash(SystemInterface system) { /** {@inheritDoc} */ @Override public void run() { - int iterations = 0, maxNumberOfIterations = 15000; - double yold = 0, ytotal = 1; - double deriv = 0, funk = 0; + int iterations = 0, maxNumberOfIterations = 10000; + // double yold = 0, ytotal = 1, deriv = 0; + double funk = 0; double maxTemperature = 0, minTemperature = 1e6; system.init(0); @@ -62,7 +62,7 @@ public void run() { iterations = 0; do { funk = 0; - deriv = 0.0; + // deriv = 0.0; iterations++; system.init(3); funk = system.getPhases()[0].getComponents()[k].getz(); @@ -70,26 +70,25 @@ public void run() { funk -= system.getPhases()[0].getBeta() * system.getPhases()[1].getComponents()[k].getFugasityCoeffisient() / system.getPhases()[0].getComponents()[k].getFugasityCoeffisient(); - deriv -= system.getPhases()[0].getBeta() - * (system.getPhases()[1].getComponents()[k].getFugasityCoeffisient() - * system.getPhases()[0].getComponents()[k].getdfugdt() * -1.0 - / Math.pow(system.getPhases()[0].getComponents()[k] - .getFugasityCoeffisient(), 2.0) - + system.getPhases()[1].getComponents()[k].getdfugdt() - / system.getPhases()[i].getComponents()[k] - .getFugasityCoeffisient()); // logger.info("funk " + funk); - - // double newTemp = system.getTemperature() - funk/deriv; - // system.setTemperature(newTemp); + /* + * deriv -= system.getPhases()[0].getBeta() + * (system.getPhases()[1].getComponents()[k].getFugasityCoeffisient() + * system.getPhases()[0].getComponents()[k].getdfugdt() * -1.0 / + * Math.pow(system.getPhases()[0].getComponents()[k] .getFugasityCoeffisient(), + * 2.0) + system.getPhases()[1].getComponents()[k].getdfugdt() / + * system.getPhases()[i].getComponents()[k] .getFugasityCoeffisient()); + * + * system.setTemperature(system.getTemperature() - funk/deriv); + */ system.setTemperature(system.getTemperature() + 100.0 * funk); // logger.info("temp " + system.getTemperature()); // if(system.getPhase(0).getComponent(k).getComponentName().equals("MEG")) // logger.info("funk " + funk + " temp " + system.getTemperature()); - } while (Math.abs(funk) >= 0.0000001 && iterations < 10000); + } while (Math.abs(funk) >= 0.0000001 && iterations < maxNumberOfIterations); // logger.info("funk " + funk + k + " " + system.getTemperature()); if (system.getTemperature() < minTemperature) { diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonPHflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonPHflash.java index 2f5dedd17f..4e5bc14b24 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonPHflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonPHflash.java @@ -142,7 +142,7 @@ public void setJac() { double dij = 0.0; double tempJ = 0.0, sumdyidbeta = 0, sumdxidbeta = 0; - int nofc = numberOfComponents; + // int nofc = numberOfComponents; for (int i = 0; i < numberOfComponents; i++) { for (int j = 0; j < numberOfComponents; j++) { @@ -247,7 +247,7 @@ public void init() { * @return a int */ public int solve(int np) { - Matrix dx; + // Matrix dx; iter = 1; do { iter++; diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonTPflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonTPflash.java index 867e04b226..a888348b9d 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonTPflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/sysNewtonRhapsonTPflash.java @@ -84,8 +84,9 @@ public void setJac() { Jac.timesEquals(0.0); double dij = 0.0; - double tempJ = 0.0, sumdyidbeta = 0, sumdxidbeta = 0; - int nofc = numberOfComponents; + double tempJ = 0.0; + // double sumdyidbeta = 0, sumdxidbeta = 0; + // int nofc = numberOfComponents; for (int i = 0; i < numberOfComponents; i++) { for (int j = 0; j < numberOfComponents; j++) { diff --git a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java index f945c9badd..4ca06c8c89 100644 --- a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java +++ b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java @@ -288,7 +288,6 @@ public void calcRSWTOB() { /** {@inheritDoc} */ @Override - @SuppressWarnings("empty-statement") public void run() { calcRSWTOB(); logger.info("RSWTOB " + RSWTOB); diff --git a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java index 5258d1caa7..a08263dcd7 100644 --- a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java +++ b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java @@ -284,7 +284,6 @@ public void calcRSWTOB() { /** {@inheritDoc} */ @Override - @SuppressWarnings("empty-statement") public void run() { calcRSWTOB(); logger.info("RSWTOB " + RSWTOB); diff --git a/src/main/java/neqsim/util/database/AspenIP21Database.java b/src/main/java/neqsim/util/database/AspenIP21Database.java index 4f40348576..cd0e4755cc 100644 --- a/src/main/java/neqsim/util/database/AspenIP21Database.java +++ b/src/main/java/neqsim/util/database/AspenIP21Database.java @@ -58,7 +58,7 @@ public AspenIP21Database() { */ public Connection openConnection(String database) throws SQLException, ClassNotFoundException { javax.naming.InitialContext ctx = null; - javax.sql.DataSource ds = null; + // javax.sql.DataSource ds = null; try { return DriverManager.getConnection("....."); diff --git a/src/main/java/neqsim/util/database/NeqSimDataBase.java b/src/main/java/neqsim/util/database/NeqSimDataBase.java index 7de4e2d81f..3d531ca482 100644 --- a/src/main/java/neqsim/util/database/NeqSimDataBase.java +++ b/src/main/java/neqsim/util/database/NeqSimDataBase.java @@ -374,7 +374,7 @@ public static String[] getComponentNames() { public static boolean hasComponent(String compName) { neqsim.util.database.NeqSimDataBase database = new neqsim.util.database.NeqSimDataBase(); java.sql.ResultSet dataSet = null; - String[] names = null; + // String[] names = null; try { dataSet = database .getResultSet("select count(*) from comp WHERE NAME='" + compName + "'");