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 0d14a3f1f..c98b4f8dd 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 @@ -1,12 +1,9 @@ package neqsim.fluidmechanics.flownode.fluidboundary.heatmasstransfercalc.nonequilibriumfluidboundary; +import Jama.Matrix; import neqsim.fluidmechanics.flownode.FlowNodeInterface; import neqsim.thermo.system.SystemInterface; -import Jama.Matrix; - - - /** *

* Abstract NonEquilibriumFluidBoundary class. diff --git a/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/filmmodelboundary/reactivefilmmodel/enhancementfactor/EnhancementFactor.java b/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/filmmodelboundary/reactivefilmmodel/enhancementfactor/EnhancementFactor.java index e1b1e9693..457db958d 100644 --- a/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/filmmodelboundary/reactivefilmmodel/enhancementfactor/EnhancementFactor.java +++ b/src/main/java/neqsim/fluidmechanics/flownode/fluidboundary/heatmasstransfercalc/nonequilibriumfluidboundary/filmmodelboundary/reactivefilmmodel/enhancementfactor/EnhancementFactor.java @@ -116,7 +116,6 @@ public void setOnesVec(int phase) { } } - /** * Getter for property hattaNumber. * diff --git a/src/main/java/neqsim/processsimulation/measurementdevice/MultiPhaseMeter.java b/src/main/java/neqsim/processsimulation/measurementdevice/MultiPhaseMeter.java index 14cf3f1cf..15fb73795 100644 --- a/src/main/java/neqsim/processsimulation/measurementdevice/MultiPhaseMeter.java +++ b/src/main/java/neqsim/processsimulation/measurementdevice/MultiPhaseMeter.java @@ -126,7 +126,7 @@ public double getMeasuredValue(String measurement, String unit) { try { thermoOps.TPflash(); } catch (Exception ex) { - logger.error(ex.getMessage(), ex); + logger.error(ex.getMessage()); return Double.NaN; } // tempFluid.display(); @@ -148,7 +148,7 @@ public double getMeasuredValue(String measurement, String unit) { try { thermoOps.TPflash(); } catch (Exception ex) { - logger.error(ex.getMessage(), ex); + logger.error(ex.getMessage()); return Double.NaN; } // tempFluid.display(); @@ -166,7 +166,7 @@ public double getMeasuredValue(String measurement, String unit) { try { thermoOps.TPflash(); } catch (Exception ex) { - logger.error(ex.getMessage(), ex); + logger.error(ex.getMessage()); return Double.NaN; } // tempFluid.display(); @@ -184,7 +184,7 @@ public double getMeasuredValue(String measurement, String unit) { try { thermoOps.TPflash(); } catch (Exception ex) { - logger.error(ex.getMessage(), ex); + logger.error(ex.getMessage()); return Double.NaN; } // tempFluid.display(); @@ -203,7 +203,7 @@ public double getMeasuredValue(String measurement, String unit) { try { thermoOps.TPflash(); } catch (Exception ex) { - logger.error(ex.getStackTrace()); + logger.error(ex.getMessage()); return Double.NaN; } tempFluid.initPhysicalProperties(); @@ -237,7 +237,7 @@ public double getMeasuredValue(String measurement, String unit) { try { thermoOps.TPflash(); } catch (Exception ex) { - logger.error(ex.getStackTrace()); + logger.error(ex.getMessage()); return Double.NaN; } if (!tempFluid.hasPhaseType("gas")) { diff --git a/src/main/java/neqsim/processsimulation/mechanicaldesign/valve/ValveMechanicalDesign.java b/src/main/java/neqsim/processsimulation/mechanicaldesign/valve/ValveMechanicalDesign.java index 002686856..98fc11cb9 100644 --- a/src/main/java/neqsim/processsimulation/mechanicaldesign/valve/ValveMechanicalDesign.java +++ b/src/main/java/neqsim/processsimulation/mechanicaldesign/valve/ValveMechanicalDesign.java @@ -33,9 +33,8 @@ public class ValveMechanicalDesign extends MechanicalDesign { * Constructor for ValveMechanicalDesign. *

* - * @param equipment a - * {@link neqsim.processsimulation.processequipment.ProcessEquipmentInterface} - * object + * @param equipment a {@link neqsim.processsimulation.processequipment.ProcessEquipmentInterface} + * object */ public ValveMechanicalDesign(ProcessEquipmentInterface equipment) { super(equipment); @@ -50,7 +49,8 @@ public void readDesignSpecifications() { if (getDesignStandard().containsKey("valve design codes")) { System.out.println("valve code standard: " + getDesignStandard().get("valve design codes").getStandardName()); - valveCvMax = ((ValveDesignStandard) getDesignStandard().get("valve design codes")).getValveCvMax(); + valveCvMax = + ((ValveDesignStandard) getDesignStandard().get("valve design codes")).getValveCvMax(); } else { System.out.println("no valve code standard specified......using default"); } @@ -78,7 +78,7 @@ public void displayResults() { Container dialogContentPane = dialog.getContentPane(); dialogContentPane.setLayout(new BorderLayout()); - String[] names = { "Name", "Value", "Unit" }; + String[] names = {"Name", "Value", "Unit"}; String[][] table = new String[16][3]; // createTable(getProcessEquipment().getName()); diff --git a/src/main/java/neqsim/processsimulation/processequipment/compressor/CompressorChartAlternativeMapLookup.java b/src/main/java/neqsim/processsimulation/processequipment/compressor/CompressorChartAlternativeMapLookup.java index 668ed55b3..8fea23435 100644 --- a/src/main/java/neqsim/processsimulation/processequipment/compressor/CompressorChartAlternativeMapLookup.java +++ b/src/main/java/neqsim/processsimulation/processequipment/compressor/CompressorChartAlternativeMapLookup.java @@ -191,10 +191,8 @@ public CompressorCurve getCurveAtRefSpeed(double refSpeed) { } } String msg = "Does not match any speed in the chart."; - neqsim.util.exception.InvalidInputException ex = - new neqsim.util.exception.InvalidInputException(this, "getCurveAtRefSpeed", "refSpeed", - msg); - throw new RuntimeException(ex); + throw new RuntimeException(new neqsim.util.exception.InvalidInputException(this, + "getCurveAtRefSpeed", "refSpeed", msg)); } /** diff --git a/src/main/java/neqsim/processsimulation/processequipment/pipeline/Fittings.java b/src/main/java/neqsim/processsimulation/processequipment/pipeline/Fittings.java index 1095be84d..871773b78 100644 --- a/src/main/java/neqsim/processsimulation/processequipment/pipeline/Fittings.java +++ b/src/main/java/neqsim/processsimulation/processequipment/pipeline/Fittings.java @@ -89,7 +89,7 @@ public Fitting(String name) { LtoD = (Double.parseDouble(dataSet.getString("LtoD"))); System.out.printf("LtoD " + LtoD); } catch (Exception ex) { - logger.error("error in comp", ex); + logger.error("error in fittings"); } } diff --git a/src/main/java/neqsim/processsimulation/processequipment/stream/Stream.java b/src/main/java/neqsim/processsimulation/processequipment/stream/Stream.java index f925f4754..c8d48f285 100644 --- a/src/main/java/neqsim/processsimulation/processequipment/stream/Stream.java +++ b/src/main/java/neqsim/processsimulation/processequipment/stream/Stream.java @@ -567,13 +567,14 @@ public String[][] reportResults() { * @return a {@link java.lang.Object} object */ public Object getProperty(String propertyName, String unit, String phase, String component) { + throw new RuntimeException( + new neqsim.util.exception.NotImplementedException(this, "getProperty")); // getFluid().getProperties.containsKey(propertyName)) { // if(properties.containsKey(propertyName)) { // } // else - // todo: throw not implemented error - return null; + // return null; } /** {@inheritDoc} */ diff --git a/src/main/java/neqsim/processsimulation/processequipment/stream/StreamInterface.java b/src/main/java/neqsim/processsimulation/processequipment/stream/StreamInterface.java index a20c115b7..dbd4c6790 100644 --- a/src/main/java/neqsim/processsimulation/processequipment/stream/StreamInterface.java +++ b/src/main/java/neqsim/processsimulation/processequipment/stream/StreamInterface.java @@ -191,7 +191,6 @@ public default double getFlowRate(String unit) { */ public StreamInterface clone(String name); - /** *

* flashStream. diff --git a/src/main/java/neqsim/processsimulation/processequipment/valve/ThrottlingValve.java b/src/main/java/neqsim/processsimulation/processequipment/valve/ThrottlingValve.java index f67915e85..1fa5e2177 100644 --- a/src/main/java/neqsim/processsimulation/processequipment/valve/ThrottlingValve.java +++ b/src/main/java/neqsim/processsimulation/processequipment/valve/ThrottlingValve.java @@ -508,8 +508,8 @@ public void run(UUID id) { try { inStream.getThermoSystem().setTotalNumberOfMoles(molarFlow); inStream.getThermoSystem().init(3); - } catch (Exception e) { - logger.error(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage()); } // inletStream.run(id); @@ -572,15 +572,15 @@ public void runTransient(double dt, UUID id) { inStream.getThermoSystem().setTotalNumberOfMoles(molarFlow); inStream.getThermoSystem().init(1); inStream.run(id); - } catch (Exception e) { - logger.error(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage()); } try { outStream.getThermoSystem().setTotalNumberOfMoles(molarFlow); outStream.getThermoSystem().init(1); outStream.run(id); - } catch (Exception e) { - logger.error(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage()); } setCalculationIdentifier(id); } diff --git a/src/main/java/neqsim/processsimulation/processsystem/ProcessSystem.java b/src/main/java/neqsim/processsimulation/processsystem/ProcessSystem.java index bdf9f1e51..d5200d8df 100644 --- a/src/main/java/neqsim/processsimulation/processsystem/ProcessSystem.java +++ b/src/main/java/neqsim/processsimulation/processsystem/ProcessSystem.java @@ -664,7 +664,6 @@ public static ProcessSystem open(String filePath) { return (ProcessSystem) objectinputstream.readObject(); // logger.info("process file open ok: " + filePath); } catch (Exception ex) { - // logger.error(ex.toString()); logger.error(ex.getMessage(), ex); } return null; diff --git a/src/main/java/neqsim/processsimulation/util/monitor/StreamResponse.java b/src/main/java/neqsim/processsimulation/util/monitor/StreamResponse.java index d627f7ee6..3081843e6 100644 --- a/src/main/java/neqsim/processsimulation/util/monitor/StreamResponse.java +++ b/src/main/java/neqsim/processsimulation/util/monitor/StreamResponse.java @@ -208,8 +208,8 @@ public StreamResponse(StreamInterface inputStream) { Double.toString( inputStream.getTVP(37.8, "C", neqsim.util.unit.Units.getSymbol("pressure"))), neqsim.util.unit.Units.getSymbol("pressure"))); - } catch (Exception e) { - logger.error(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage()); } try { newdata.put("RVP", @@ -220,8 +220,8 @@ public StreamResponse(StreamInterface inputStream) { newdata.put("relative density", new Value( Double.toString(inputStream.getFluid().getPhase(name).getDensity("kg/m3") / 1000.0), "-")); - } catch (Exception e) { - logger.error(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage()); } } else if (name.equals("gas")) { Standard_ISO6976 standard = inputStream.getISO6976("volume", 15.0, 15.0); diff --git a/src/main/java/neqsim/processsimulation/util/report/Report.java b/src/main/java/neqsim/processsimulation/util/report/Report.java index 7e4afdf27..7a8a43ef1 100644 --- a/src/main/java/neqsim/processsimulation/util/report/Report.java +++ b/src/main/java/neqsim/processsimulation/util/report/Report.java @@ -30,7 +30,9 @@ public class Report { SystemInterface fluid = null; /** - *

Constructor for Report.

+ *

+ * Constructor for Report. + *

* * @param process a {@link neqsim.processsimulation.processsystem.ProcessSystem} object */ @@ -39,7 +41,9 @@ public Report(ProcessSystem process) { } /** - *

Constructor for Report.

+ *

+ * Constructor for Report. + *

* * @param fluid a {@link neqsim.thermo.system.SystemInterface} object */ @@ -48,16 +52,21 @@ public Report(SystemInterface fluid) { } /** - *

Constructor for Report.

+ *

+ * Constructor for Report. + *

* - * @param processEquipmentBaseClass a {@link neqsim.processsimulation.processequipment.ProcessEquipmentBaseClass} object + * @param processEquipmentBaseClass a + * {@link neqsim.processsimulation.processequipment.ProcessEquipmentBaseClass} object */ public Report(ProcessEquipmentBaseClass processEquipmentBaseClass) { processEquipment = processEquipmentBaseClass; } /** - *

Constructor for Report.

+ *

+ * Constructor for Report. + *

* * @param processModule a {@link neqsim.processsimulation.processsystem.ProcessModule} object */ @@ -66,16 +75,21 @@ public Report(ProcessModule processModule) { } /** - *

Constructor for Report.

+ *

+ * Constructor for Report. + *

* - * @param processModuleBaseClass a {@link neqsim.processsimulation.processsystem.ProcessModuleBaseClass} object + * @param processModuleBaseClass a + * {@link neqsim.processsimulation.processsystem.ProcessModuleBaseClass} object */ public Report(ProcessModuleBaseClass processModuleBaseClass) { // TODO Auto-generated constructor stub } /** - *

generateJsonReport.

+ *

+ * generateJsonReport. + *

* * @return a {@link java.lang.String} object */ @@ -101,16 +115,23 @@ public String generateJsonReport() { for (Map.Entry entry : json_reports.entrySet()) { // Parse each value as a separate JSON object using the static parseString method try { - JsonObject nestedJsonObject = JsonParser.parseString(entry.getValue()).getAsJsonObject(); + String s = entry.getValue(); + if (s == null) { + // Not necessary to log that an entry is null + continue; + } + JsonObject nestedJsonObject = JsonParser.parseString(s).getAsJsonObject(); + // Update the final JsonObject with the parsed JSON object finalJsonObject.add(entry.getKey(), nestedJsonObject); - } catch (Exception e) { - logger.error(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage()); } } // Convert the final JsonObject to a JSON string with pretty printing - Gson prettyGson = new GsonBuilder().serializeSpecialFloatingPointValues().setPrettyPrinting().create(); + Gson prettyGson = + new GsonBuilder().serializeSpecialFloatingPointValues().setPrettyPrinting().create(); return prettyGson.toJson(finalJsonObject); } } diff --git a/src/main/java/neqsim/standards/gasquality/Standard_ISO15403.java b/src/main/java/neqsim/standards/gasquality/Standard_ISO15403.java index cf606a981..cf05c1ada 100644 --- a/src/main/java/neqsim/standards/gasquality/Standard_ISO15403.java +++ b/src/main/java/neqsim/standards/gasquality/Standard_ISO15403.java @@ -54,10 +54,8 @@ public double getValue(String returnParameter) { } else if (returnParameter.equals("NM")) { return NM; } else { - neqsim.util.exception.InvalidInputException ex = - new neqsim.util.exception.InvalidInputException(this, "getValue", "returnParameter", - "parameter not supported"); - throw new RuntimeException(ex); + throw new RuntimeException(new neqsim.util.exception.InvalidInputException(this, "getValue", + "returnParameter", "parameter not supported")); } } 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 86beb0e85..62ea3b471 100644 --- a/src/main/java/neqsim/standards/gasquality/Standard_ISO6976_2016.java +++ b/src/main/java/neqsim/standards/gasquality/Standard_ISO6976_2016.java @@ -126,7 +126,7 @@ public Standard_ISO6976_2016(SystemInterface thermoSystem) { M[i] = this.thermoSystem.getPhase(0).getComponent(i).getMolarMass(); dataSet.next(); } catch (Exception er) { - logger.error(er.toString()); + logger.error(er.getMessage()); } componentsNotDefinedByStandard .add("this.thermoSystem.getPhase(0).getComponent(i).getComponentName()"); diff --git a/src/main/java/neqsim/standards/salescontract/BaseContract.java b/src/main/java/neqsim/standards/salescontract/BaseContract.java index 69614eb4a..fc52e6998 100644 --- a/src/main/java/neqsim/standards/salescontract/BaseContract.java +++ b/src/main/java/neqsim/standards/salescontract/BaseContract.java @@ -72,7 +72,7 @@ public BaseContract(SystemInterface system) { * @param country a {@link java.lang.String} object */ public BaseContract(SystemInterface system, String terminal, String country) { - int numb = 0; + // int numb = 0; this.setContractName(contractName); try ( neqsim.util.database.NeqSimContractDataBase database = @@ -81,7 +81,7 @@ public BaseContract(SystemInterface system, String terminal, String country) { database.getResultSet("SELECT * FROM gascontractspecifications WHERE TERMINAL='" + terminal + "'" + " AND COUNTRY='" + country + "'")) { while (dataSet.next()) { - numb++; + // numb++; StandardInterface method = getMethod(system, dataSet.getString("METHOD")); double referencePressure = Double.parseDouble(dataSet.getString("ReferencePbar")); method.setReferencePressure(referencePressure); @@ -90,12 +90,12 @@ public BaseContract(SystemInterface system, String terminal, String country) { dataSet.getString("TERMINAL"), Double.parseDouble(dataSet.getString("MINVALUE")), Double.parseDouble(dataSet.getString("MAXVALUE")), dataSet.getString("UNIT"), Double.parseDouble(dataSet.getString("ReferenceTdegC")), - Double.parseDouble(dataSet.getString("ReferenceTdegC")), referencePressure, ""));// dataSet.getString("Comments")); + Double.parseDouble(dataSet.getString("ReferenceTdegC")), referencePressure, "")); // dataSet.getString("Comments")); // System.out.println(dataSet.getString("Comments")); // System.out.println("specification added..." + numb); } } catch (Exception ex) { - logger.error("error in comp", ex); + logger.error("error in comp"); } finally { specificationsNumber = spesifications.size(); } diff --git a/src/main/java/neqsim/thermo/atomelement/Element.java b/src/main/java/neqsim/thermo/atomelement/Element.java index a4550286b..9dfacdec7 100644 --- a/src/main/java/neqsim/thermo/atomelement/Element.java +++ b/src/main/java/neqsim/thermo/atomelement/Element.java @@ -89,10 +89,8 @@ public String[] getElementNames() { */ public double getNumberOfElements(String elementName) { if (nameArray == null) { - neqsim.util.exception.InvalidInputException ex = - new neqsim.util.exception.InvalidInputException(this, "getNumberOfElements", elementName, - "component not in element database.."); - throw new RuntimeException(ex); + throw new RuntimeException(new neqsim.util.exception.InvalidInputException(this, + "getNumberOfElements", elementName, "component not in element database..")); } for (int i = 0; i < nameArray.length; i++) { if (nameArray[i].equals(elementName)) { diff --git a/src/main/java/neqsim/thermo/characterization/LumpingModel.java b/src/main/java/neqsim/thermo/characterization/LumpingModel.java index 56143069b..4d85337f7 100644 --- a/src/main/java/neqsim/thermo/characterization/LumpingModel.java +++ b/src/main/java/neqsim/thermo/characterization/LumpingModel.java @@ -196,11 +196,9 @@ public void generateLumpedComposition(Characterise charac) { @Override public double getFractionOfHeavyEnd(int i) { if (fractionOfHeavyEnd == null) { - neqsim.util.exception.ThermoException ex = + throw new RuntimeException( new neqsim.util.exception.NotInitializedException(this, "getFractionOfHeavyEnd", - "fractionOfHeavyEnd", "characterisePlusFraction or generateLumpedComposition"); - logger.error(ex.getMessage(), ex); - throw new RuntimeException(ex); + "fractionOfHeavyEnd", "characterisePlusFraction or generateLumpedComposition")); } return fractionOfHeavyEnd[i]; } @@ -312,11 +310,9 @@ public void generateLumpedComposition(Characterise charac) { @Override public double getFractionOfHeavyEnd(int i) { if (fractionOfHeavyEnd == null) { - neqsim.util.exception.ThermoException ex = + throw new RuntimeException( new neqsim.util.exception.NotInitializedException(this, "getFractionOfHeavyEnd", - "fractionOfHeavyEnd", "characterisePlusFraction or generateLumpedComposition"); - logger.error(ex.getMessage(), ex); - throw new RuntimeException(ex); + "fractionOfHeavyEnd", "characterisePlusFraction or generateLumpedComposition")); } return fractionOfHeavyEnd[i]; } @@ -399,7 +395,7 @@ public void generateLumpedComposition(Characterise charac) { pseudoNumber++; String addName = "C" + Integer.toString(starti) + "-" + Integer.toString(i); getLumpedComponentNames()[k] = addName; - //System.out.println("adding " + addName); + // System.out.println("adding " + addName); fractionOfHeavyEnd[k] = zPlus[k] / molFracTot; system.addTBPfraction(addName, totalNumberOfMoles * zPlus[k], Maverage / zPlus[k], denstemp1 / denstemp2); @@ -416,11 +412,9 @@ public void generateLumpedComposition(Characterise charac) { @Override public double getFractionOfHeavyEnd(int i) { if (fractionOfHeavyEnd == null) { - neqsim.util.exception.ThermoException ex = + throw new RuntimeException( new neqsim.util.exception.NotInitializedException(this, "getFractionOfHeavyEnd", - "fractionOfHeavyEnd", "characterisePlusFraction or generateLumpedComposition"); - logger.error(ex.getMessage(), ex); - throw new RuntimeException(ex); + "fractionOfHeavyEnd", "characterisePlusFraction or generateLumpedComposition")); } return fractionOfHeavyEnd[i]; } diff --git a/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java b/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java index 17617ba7f..1d06a7f97 100644 --- a/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java +++ b/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java @@ -106,12 +106,13 @@ public double calcCriticalViscosity(double molarMass, double density) { @Override public double calcRacketZ(SystemInterface thermoSystem, double molarMass, double density) { - throw new RuntimeException("calcm() method not defined"); + throw new RuntimeException( + new neqsim.util.exception.NotImplementedException(this, "calcRacketZ")); } @Override public double calcm(double molarMass, double density) { - throw new RuntimeException("calcm() method not defined"); + throw new RuntimeException(new neqsim.util.exception.NotImplementedException(this, "calcm")); } @Override diff --git a/src/main/java/neqsim/thermo/component/Component.java b/src/main/java/neqsim/thermo/component/Component.java index 3f3b3c699..7829144bd 100644 --- a/src/main/java/neqsim/thermo/component/Component.java +++ b/src/main/java/neqsim/thermo/component/Component.java @@ -451,7 +451,7 @@ public void createComponent(String name, double moles, double molesInPhase, int } componentNumber = compIndex; } catch (Exception ex) { - logger.error("error in comp", ex); + logger.error("error in comp"); } srkacentricFactor = acentricFactor; @@ -513,10 +513,8 @@ public void addMolesChemReac(double dn, double totdn) { String msg = "will lead to negative number of moles of component in phase for component " + getComponentName() + " who has " + numberOfMolesInPhase + " in phase and chage request was " + dn; - neqsim.util.exception.InvalidInputException ex = - new neqsim.util.exception.InvalidInputException(this, "addMolesChemReac", "dn", msg); - throw new RuntimeException(ex); - // logger.error(ex.getMessage()); + throw new RuntimeException( + new neqsim.util.exception.InvalidInputException(this, "addMolesChemReac", "dn", msg)); } } numberOfMoles += totdn; diff --git a/src/main/java/neqsim/thermo/component/ComponentDesmukhMather.java b/src/main/java/neqsim/thermo/component/ComponentDesmukhMather.java index 4b62e6cc2..df0061f0e 100644 --- a/src/main/java/neqsim/thermo/component/ComponentDesmukhMather.java +++ b/src/main/java/neqsim/thermo/component/ComponentDesmukhMather.java @@ -49,7 +49,7 @@ public ComponentDesmukhMather(String name, double moles, double molesInPhase, in deshMathIonicDiameter = Double.parseDouble(dataSet.getString("DeshMatIonicDiameter")); } } catch (Exception ex) { - logger.error("error in comp", ex); + logger.error("error in comp"); } } diff --git a/src/main/java/neqsim/thermo/component/ComponentHydrate.java b/src/main/java/neqsim/thermo/component/ComponentHydrate.java index d93bacf47..c1381a654 100644 --- a/src/main/java/neqsim/thermo/component/ComponentHydrate.java +++ b/src/main/java/neqsim/thermo/component/ComponentHydrate.java @@ -97,7 +97,7 @@ public ComponentHydrate(String name, double moles, double molesInPhase, int comp sphericalCoreRadiusHydrate = Double.parseDouble(dataSet.getString("SphericalCoreRadiusHYDRATE")); } catch (Exception ex) { - logger.error("error in comp", ex); + logger.error("error in comp"); } finally { try { if (dataSet != null) { diff --git a/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java b/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java index 51732ea42..fc81c8e03 100644 --- a/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java +++ b/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java @@ -59,12 +59,12 @@ public ComponentHydrateGF(String name, double moles, double molesInPhase, int co Bk[1][1] = Double.parseDouble(dataSet.getString("B2_LargeGF")); dataSet.close(); } catch (Exception ex) { - logger.error("error in ComponentHydrateGF", ex); + logger.error("error in comp"); } finally { try { dataSet.close(); } catch (Exception ex) { - logger.error("error closing database.....", ex); + logger.error("error closing database....."); } } } diff --git a/src/main/java/neqsim/thermo/component/ComponentHydratePVTsim.java b/src/main/java/neqsim/thermo/component/ComponentHydratePVTsim.java index df26d9e1f..4ec13f5d2 100644 --- a/src/main/java/neqsim/thermo/component/ComponentHydratePVTsim.java +++ b/src/main/java/neqsim/thermo/component/ComponentHydratePVTsim.java @@ -63,7 +63,7 @@ public ComponentHydratePVTsim(String name, double moles, double molesInPhase, in Ak[1][1] = Double.parseDouble(dataSet.getString("HydrateA2Large")); Bk[1][1] = Double.parseDouble(dataSet.getString("HydrateB2Large")); } catch (Exception ex) { - logger.error("error in ComponentHydratePVTsim", ex); + logger.error("error in comp"); } finally { try { dataSet.close(); diff --git a/src/main/java/neqsim/thermo/phase/PhaseGE.java b/src/main/java/neqsim/thermo/phase/PhaseGE.java index 88a25737b..875d89d0c 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseGE.java +++ b/src/main/java/neqsim/thermo/phase/PhaseGE.java @@ -56,8 +56,11 @@ public PhaseGE() { public void init(double temperature, double pressure, double totalNumberOfMoles, double beta, int numberOfComponents, PhaseType pt, int phase) { if (totalNumberOfMoles <= 0) { - new neqsim.util.exception.InvalidInputException(this, "init", "totalNumberOfMoles", - "must be larger than zero."); + // todo: throw this exception? + /* + * new neqsim.util.exception.InvalidInputException(this, "init", "totalNumberOfMoles", + * "must be larger than zero."); + */ } for (int i = 0; i < numberOfComponents; i++) { // todo: Conflating init type and phase type? diff --git a/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java b/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java index 9c67e2c3b..85db2c2d0 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java +++ b/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java @@ -956,7 +956,6 @@ public boolean solveX2(int maxIter) { } } - /** *

* Getter for the field dFdNtemp. diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 1ce200318..3a5103d53 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -161,17 +161,13 @@ public SystemThermo() { public SystemThermo(double T, double P, boolean checkForSolids) { this(); if (T < 0.0) { - neqsim.util.exception.InvalidInputException ex = - new neqsim.util.exception.InvalidInputException(this.getClass().getSimpleName(), - "SystemThermo", "T", "is negative"); - throw new RuntimeException(ex); + throw new RuntimeException(new neqsim.util.exception.InvalidInputException(this, + "SystemThermo", "T", "is negative")); } if (P < 0.0) { - neqsim.util.exception.InvalidInputException ex = - new neqsim.util.exception.InvalidInputException(this.getClass().getSimpleName(), - "SystemThermo", "P", "is negative"); - throw new RuntimeException(ex); + throw new RuntimeException(new neqsim.util.exception.InvalidInputException(this, + "SystemThermo", "P", "is negative")); } this.solidPhaseCheck = checkForSolids; @@ -379,9 +375,8 @@ public void addComponent(String componentName, double moles, int phaseNumber) { // Add new component if (moles < 0.0) { String msg = "Negative input number of moles."; - neqsim.util.exception.InvalidInputException ex = - new neqsim.util.exception.InvalidInputException(this, "addComponent", "moles", msg); - throw new RuntimeException(ex); + throw new RuntimeException( + new neqsim.util.exception.InvalidInputException(this, "addComponent", "moles", msg)); } componentNames.add(componentName); @@ -4917,8 +4912,8 @@ public void setTotalFlowRate(double flowRate, String flowunit) { init(0); try { init(1); - } catch (Exception e) { - logger.error(e.getMessage()); + } catch (Exception ex) { + logger.error(ex.getMessage()); } double density = 0.0; if (flowunit.equals("Am3/hr") || flowunit.equals("Am3/min") || flowunit.equals("gallons/min") diff --git a/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java b/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java index ab4f296a9..b071fc1fe 100644 --- a/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java +++ b/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java @@ -109,7 +109,7 @@ public static void setComposition(SystemInterface fluid, String inputFile) { } } } catch (Exception ex) { - logger.error(ex.getMessage()); + logger.error(ex.getMessage(), ex); } } diff --git a/src/main/java/neqsim/thermodynamicoperations/ThermodynamicOperations.java b/src/main/java/neqsim/thermodynamicoperations/ThermodynamicOperations.java index 0da8b4fcd..28fda5679 100644 --- a/src/main/java/neqsim/thermodynamicoperations/ThermodynamicOperations.java +++ b/src/main/java/neqsim/thermodynamicoperations/ThermodynamicOperations.java @@ -63,6 +63,7 @@ import neqsim.thermodynamicoperations.phaseenvelopeops.reactivecurves.PloadingCurve2; import neqsim.thermodynamicoperations.propertygenerator.OLGApropertyTableGeneratorWaterStudents; import neqsim.thermodynamicoperations.propertygenerator.OLGApropertyTableGeneratorWaterStudentsPH; +import neqsim.util.exception.IsNaNException; /** *

@@ -79,7 +80,9 @@ public class ThermodynamicOperations implements java.io.Serializable, Cloneable private OperationInterface operation = null; /** - *

Getter for the field system.

+ *

+ * Getter for the field system. + *

* * @return a {@link neqsim.thermo.system.SystemInterface} object */ @@ -728,14 +731,13 @@ public void VUflash(double Vspec, double Uspec) { * bubblePointTemperatureFlash. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void bubblePointTemperatureFlash() throws Exception { + public void bubblePointTemperatureFlash() throws IsNaNException { ConstantDutyFlashInterface operation = new BubblePointTemperatureNoDer(system); operation.run(); if (Double.isNaN(system.getTemperature()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "bubblePointTemperatureFlash", + throw new neqsim.util.exception.IsNaNException(this, "bubblePointTemperatureFlash", "Could not find solution - possible no bubble point exists"); } } @@ -745,14 +747,13 @@ public void bubblePointTemperatureFlash() throws Exception { * freezingPointTemperatureFlash. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void freezingPointTemperatureFlash() throws Exception { + public void freezingPointTemperatureFlash() throws IsNaNException { operation = new FreezingPointTemperatureFlash(system); getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "freezingPointTemperatureFlash", + throw new neqsim.util.exception.IsNaNException(this, "freezingPointTemperatureFlash", "Could not find solution - possible no freezing point exists"); } } @@ -763,14 +764,13 @@ public void freezingPointTemperatureFlash() throws Exception { *

* * @param phaseName a {@link java.lang.String} object - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void freezingPointTemperatureFlash(String phaseName) throws Exception { + public void freezingPointTemperatureFlash(String phaseName) throws IsNaNException { operation = new FreezingPointTemperatureFlash(system); getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "freezingPointTemperatureFlash", + throw new neqsim.util.exception.IsNaNException(this, "freezingPointTemperatureFlash", "Could not find solution - possible no freezing point exists"); } } @@ -780,14 +780,13 @@ public void freezingPointTemperatureFlash(String phaseName) throws Exception { * waterDewPointTemperatureFlash. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void waterDewPointTemperatureFlash() throws Exception { + public void waterDewPointTemperatureFlash() throws IsNaNException { operation = new WaterDewPointTemperatureFlash(system); getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "waterDewPointTemperatureFlash", + throw new neqsim.util.exception.IsNaNException(this, "waterDewPointTemperatureFlash", "Could not find solution - possible no dew point exists"); } } @@ -797,9 +796,9 @@ public void waterDewPointTemperatureFlash() throws Exception { * waterDewPointTemperatureMultiphaseFlash. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void waterDewPointTemperatureMultiphaseFlash() throws Exception { + public void waterDewPointTemperatureMultiphaseFlash() throws IsNaNException { operation = new WaterDewPointTemperatureMultiphaseFlash(system); getOperation().run(); } @@ -809,9 +808,9 @@ public void waterDewPointTemperatureMultiphaseFlash() throws Exception { * waterPrecipitationTemperature. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void waterPrecipitationTemperature() throws Exception { + public void waterPrecipitationTemperature() throws IsNaNException { double lowTemperature = 0.0; dewPointTemperatureFlash(); @@ -838,8 +837,7 @@ public void waterPrecipitationTemperature() throws Exception { // TPflash(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "waterPrecipitationTemperature", + throw new neqsim.util.exception.IsNaNException(this, "waterPrecipitationTemperature", "Could not find solution - possible no dew point exists"); } } @@ -850,14 +848,14 @@ public void waterPrecipitationTemperature() throws Exception { *

* * @param saltName a {@link java.lang.String} object - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void calcSaltSaturation(String saltName) throws Exception { + public void calcSaltSaturation(String saltName) throws IsNaNException { operation = new CalcSaltSatauration(system, saltName); getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "calcSaltSaturation", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "calcSaltSaturation", + "Could not find solution - possible no dew point exists"); } } @@ -867,15 +865,15 @@ public void calcSaltSaturation(String saltName) throws Exception { *

* * @param phaseNumber a int - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void checkScalePotential(int phaseNumber) throws Exception { + public void checkScalePotential(int phaseNumber) throws IsNaNException { operation = new CheckScalePotential(system, phaseNumber); getOperation().run(); resultTable = getOperation().getResultTable(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "checkScalePotential", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "checkScalePotential", + "Could not find solution - possible no dew point exists"); } } @@ -887,16 +885,16 @@ public void checkScalePotential(int phaseNumber) throws Exception { * @param phaseNumber a int * @param scaleSaltName a {@link java.lang.String} object * @param nameOfIonToBeAdded a {@link java.lang.String} object - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ public void addIonToScaleSaturation(int phaseNumber, String scaleSaltName, - String nameOfIonToBeAdded) throws Exception { + String nameOfIonToBeAdded) throws IsNaNException { operation = new AddIonToScaleSaturation(system, phaseNumber, scaleSaltName, nameOfIonToBeAdded); getOperation().run(); resultTable = getOperation().getResultTable(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "addIonToScaleSaturation", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "addIonToScaleSaturation", + "Could not find solution - possible no dew point exists"); } } @@ -905,14 +903,14 @@ public void addIonToScaleSaturation(int phaseNumber, String scaleSaltName, * hydrateFormationPressure. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void hydrateFormationPressure() throws Exception { + public void hydrateFormationPressure() throws IsNaNException { operation = new HydrateFormationPressureFlash(system); getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "hydrateFormationPressure", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "hydrateFormationPressure", + "Could not find solution - possible no dew point exists"); } } @@ -921,13 +919,13 @@ public void hydrateFormationPressure() throws Exception { * calcWAT. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void calcWAT() throws Exception { + public void calcWAT() throws IsNaNException { operation = new WATcalc(system); getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), "calcWAT", + throw new neqsim.util.exception.IsNaNException(this, "calcWAT", "Could not find solution - possible no dew point exists"); } } @@ -980,14 +978,13 @@ public void waitToFinishCalculation() { * calcSolidComlexTemperature. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void calcSolidComlexTemperature() throws Exception { + public void calcSolidComlexTemperature() throws IsNaNException { operation = new SolidComplexTemperatureCalc(system); getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "calcSolidComlexTemperature", + throw new neqsim.util.exception.IsNaNException(this, "calcSolidComlexTemperature", "error in WAT() - could not find solution - possible no dew point exists"); } } @@ -999,16 +996,15 @@ public void calcSolidComlexTemperature() throws Exception { * * @param comp1 a {@link java.lang.String} object * @param comp2 a {@link java.lang.String} object - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void calcSolidComlexTemperature(String comp1, String comp2) throws Exception { + public void calcSolidComlexTemperature(String comp1, String comp2) throws IsNaNException { if (operation == null) { operation = new SolidComplexTemperatureCalc(system, comp1, comp2); } getOperation().run(); if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "calcSolidComlexTemperature", + throw new neqsim.util.exception.IsNaNException(this, "calcSolidComlexTemperature", "error in WAT() - could not find solution - possible no dew point exists"); } } @@ -1088,10 +1084,8 @@ public double calcTOLHydrateFormationTemperature() { * * @param inhibitorName a {@link java.lang.String} object * @param hydEqTemperature a double - * @throws java.lang.Exception if any. */ - public void hydrateInhibitorConcentration(String inhibitorName, double hydEqTemperature) - throws Exception { + public void hydrateInhibitorConcentration(String inhibitorName, double hydEqTemperature) { operation = new HydrateInhibitorConcentrationFlash(system, inhibitorName, hydEqTemperature); operation.run(); } @@ -1103,10 +1097,8 @@ public void hydrateInhibitorConcentration(String inhibitorName, double hydEqTemp * * @param inhibitorName a {@link java.lang.String} object * @param wtfrac a double - * @throws java.lang.Exception if any. */ - public void hydrateInhibitorConcentrationSet(String inhibitorName, double wtfrac) - throws Exception { + public void hydrateInhibitorConcentrationSet(String inhibitorName, double wtfrac) { operation = new HydrateInhibitorwtFlash(system, inhibitorName, wtfrac); operation.run(); } @@ -1117,9 +1109,8 @@ public void hydrateInhibitorConcentrationSet(String inhibitorName, double wtfrac *

* * @param initialTemperatureGuess a double - * @throws java.lang.Exception if any. */ - public void hydrateFormationTemperature(double initialTemperatureGuess) throws Exception { + public void hydrateFormationTemperature(double initialTemperatureGuess) { system.setTemperature(initialTemperatureGuess); operation = new HydrateFormationTemperatureFlash(system); for (int i = 0; i < system.getPhase(4).getNumberOfComponents(); i++) { @@ -1137,9 +1128,9 @@ public void hydrateFormationTemperature(double initialTemperatureGuess) throws E * hydrateFormationTemperature. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void hydrateFormationTemperature() throws Exception { + public void hydrateFormationTemperature() throws IsNaNException { // guessing temperature double factor = 1.0; if (system.getPhase(0).hasComponent("methanol")) { @@ -1179,9 +1170,9 @@ public void hydrateFormationTemperature() throws Exception { *

* * @param structure a int - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void hydrateFormationTemperature(int structure) throws Exception { + public void hydrateFormationTemperature(int structure) throws IsNaNException { system.setTemperature(273.0 + 1.0); if (structure == 0) { system.setSolidPhaseCheck("water"); @@ -1201,8 +1192,8 @@ public void hydrateFormationTemperature(int structure) throws Exception { } if (Double.isNaN(system.getTemperature())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "hydrateFormationTemperature", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "hydrateFormationTemperature", + "Could not find solution - possible no dew point exists"); } } @@ -1213,10 +1204,8 @@ public void hydrateFormationTemperature(int structure) throws Exception { * * @param minimumPressure a double * @param maximumPressure a double - * @throws java.lang.Exception if any. */ - public void hydrateEquilibriumLine(double minimumPressure, double maximumPressure) - throws Exception { + public void hydrateEquilibriumLine(double minimumPressure, double maximumPressure) { operation = new HydrateEquilibriumLine(system, minimumPressure, maximumPressure); if (!isRunAsThread()) { getOperation().run(); @@ -1269,9 +1258,8 @@ public void calcCricoT(double[] cricondenTherm, double[] cricondenThermX, * * @param minimumPressure a double * @param maximumPressure a double - * @throws java.lang.Exception if any. */ - public void waterDewPointLine(double minimumPressure, double maximumPressure) throws Exception { + public void waterDewPointLine(double minimumPressure, double maximumPressure) { operation = new WaterDewPointEquilibriumLine(system, minimumPressure, maximumPressure); if (!isRunAsThread()) { getOperation().run(); @@ -1302,17 +1290,17 @@ public double calcCricondenBar() { * bubblePointPressureFlash. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void bubblePointPressureFlash() throws Exception { + public void bubblePointPressureFlash() throws IsNaNException { system.init(0); ConstantDutyFlashInterface operation = new ConstantDutyPressureFlash(system); system.setBeta(1, 1.0 - 1e-10); system.setBeta(0, 1e-10); operation.run(); if (Double.isNaN(system.getPressure()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "bubblePointPressureFlash", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "bubblePointPressureFlash", + "Could not find solution - possible no dew point exists"); } } @@ -1322,9 +1310,9 @@ public void bubblePointPressureFlash() throws Exception { *

* * @param derivatives a boolean - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void bubblePointPressureFlash(boolean derivatives) throws Exception { + public void bubblePointPressureFlash(boolean derivatives) throws IsNaNException { ConstantDutyFlashInterface operation = null; if (derivatives) { operation = new BubblePointPressureFlashDer(system); @@ -1334,12 +1322,11 @@ public void bubblePointPressureFlash(boolean derivatives) throws Exception { try { operation.run(); } catch (Exception e) { - logger.error(e.getMessage()); + logger.error(e.getMessage(), e); } if (Double.isNaN(system.getPressure()) || operation.isSuperCritical()) { - Exception e = new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "bubblePointPressureFlash", "Could not find solution - possible no bubble point exists"); - logger.error(e.getMessage()); + throw new neqsim.util.exception.IsNaNException(this, "bubblePointPressureFlash", + "Could not find solution - possible no bubble point exists"); } } @@ -1349,9 +1336,9 @@ public void bubblePointPressureFlash(boolean derivatives) throws Exception { *

* * @param fraction a double - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void constantPhaseFractionPressureFlash(double fraction) throws Exception { + public void constantPhaseFractionPressureFlash(double fraction) throws IsNaNException { system.init(0); if (fraction < 1e-10) { fraction = 1e-10; @@ -1364,8 +1351,7 @@ public void constantPhaseFractionPressureFlash(double fraction) throws Exception system.setBeta(0, fraction); operation.run(); if (Double.isNaN(system.getPressure()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "constantPhaseFractionPressureFlash", + throw new neqsim.util.exception.IsNaNException(this, "constantPhaseFractionPressureFlash", "Could not find solution - possible no dew point exists"); } } @@ -1376,9 +1362,9 @@ public void constantPhaseFractionPressureFlash(double fraction) throws Exception *

* * @param fraction a double - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void constantPhaseFractionTemperatureFlash(double fraction) throws Exception { + public void constantPhaseFractionTemperatureFlash(double fraction) throws IsNaNException { system.init(0); if (fraction < 1e-10) { fraction = 1e-10; @@ -1391,8 +1377,7 @@ public void constantPhaseFractionTemperatureFlash(double fraction) throws Except system.setBeta(0, fraction); operation.run(); if (Double.isNaN(system.getPressure()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "constantPhaseFractionTemperatureFlash", + throw new neqsim.util.exception.IsNaNException(this, "constantPhaseFractionTemperatureFlash", "Could not find solution - possible no dew point exists"); } } @@ -1405,10 +1390,10 @@ public void constantPhaseFractionTemperatureFlash(double fraction) throws Except * @param componentName a {@link java.lang.String} object * @param specification a {@link java.lang.String} object * @param spec a double - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ public void dewPointMach(String componentName, String specification, double spec) - throws Exception { + throws IsNaNException { // int componentNumber = // system.getPhase(0).getComponent(componentName).getComponentNumber(); @@ -1417,8 +1402,8 @@ public void dewPointMach(String componentName, String specification, double spec dn = system.getNumberOfMoles() / 1.0e6; system.addComponent(componentName, dn); } else { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "dewPointMach", "Specified component is not present in mixture: " + componentName); + throw new neqsim.util.exception.IsNaNException(this, "dewPointMach", + "Specified component is not present in mixture: " + componentName); } double newTemperature = system.getTemperature(); double oldTemperature = newTemperature; @@ -1448,8 +1433,8 @@ public void dewPointMach(String componentName, String specification, double spec } if (Double.isNaN(system.getPressure())) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "dewPointMach", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "dewPointMach", + "Could not find solution - possible no dew point exists"); } } @@ -1458,15 +1443,15 @@ public void dewPointMach(String componentName, String specification, double spec * dewPointTemperatureFlash. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void dewPointTemperatureFlash() throws Exception { + public void dewPointTemperatureFlash() throws IsNaNException { ConstantDutyFlashInterface operation = new neqsim.thermodynamicoperations.flashops.saturationops.DewPointTemperatureFlash(system); operation.run(); if (Double.isNaN(system.getTemperature()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "dewPointTemperatureFlash", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "dewPointTemperatureFlash", + "Could not find solution - possible no dew point exists"); } } @@ -1476,9 +1461,9 @@ public void dewPointTemperatureFlash() throws Exception { *

* * @param derivatives a boolean - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void dewPointTemperatureFlash(boolean derivatives) throws Exception { + public void dewPointTemperatureFlash(boolean derivatives) throws IsNaNException { ConstantDutyFlashInterface operation = new neqsim.thermodynamicoperations.flashops.saturationops.DewPointTemperatureFlash(system); if (derivatives) { @@ -1486,8 +1471,8 @@ public void dewPointTemperatureFlash(boolean derivatives) throws Exception { } operation.run(); if (Double.isNaN(system.getTemperature()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "dewPointTemperatureFlash", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "dewPointTemperatureFlash", + "Could not find solution - possible no dew point exists"); } } @@ -1496,16 +1481,16 @@ public void dewPointTemperatureFlash(boolean derivatives) throws Exception { * dewPointPressureFlashHC. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void dewPointPressureFlashHC() throws Exception { + public void dewPointPressureFlashHC() throws IsNaNException { // try{ system.init(0); ConstantDutyFlashInterface operation = new HCdewPointPressureFlash(system); operation.run(); if (Double.isNaN(system.getPressure()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "dewPointPressureFlashHC", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "dewPointPressureFlashHC", + "Could not find solution - possible no dew point exists"); } // } } @@ -1515,16 +1500,16 @@ public void dewPointPressureFlashHC() throws Exception { * dewPointPressureFlash. *

* - * @throws java.lang.Exception if any. + * @throws neqsim.util.exception.IsNaNException if any. */ - public void dewPointPressureFlash() throws Exception { + public void dewPointPressureFlash() throws IsNaNException { // try{ system.init(0); ConstantDutyFlashInterface operation = new DewPointPressureFlash(system); operation.run(); if (Double.isNaN(system.getPressure()) || operation.isSuperCritical()) { - throw new neqsim.util.exception.IsNaNException(this.getClass().getSimpleName(), - "dewPointPressureFlash", "Could not find solution - possible no dew point exists"); + throw new neqsim.util.exception.IsNaNException(this, "dewPointPressureFlash", + "Could not find solution - possible no dew point exists"); } // } } diff --git a/src/main/java/neqsim/thermodynamicoperations/flashops/RachfordRice.java b/src/main/java/neqsim/thermodynamicoperations/flashops/RachfordRice.java index af0ec5592..1361a6655 100644 --- a/src/main/java/neqsim/thermodynamicoperations/flashops/RachfordRice.java +++ b/src/main/java/neqsim/thermodynamicoperations/flashops/RachfordRice.java @@ -192,11 +192,12 @@ public double calcBetaMichelsen2001(double[] K, double[] z) beta[1] = 1.0 - nybeta; if (iterations >= maxIterations) { - throw new neqsim.util.exception.TooManyIterationsException(new RachfordRice(), "calcBeta", - maxIterations); + throw new neqsim.util.exception.TooManyIterationsException(new RachfordRice(), + "calcBetaMichelsen2001", maxIterations); } if (Double.isNaN(nybeta)) { - throw new neqsim.util.exception.IsNaNException(new RachfordRice(), "calcBeta", "beta"); + throw new neqsim.util.exception.IsNaNException(new RachfordRice(), "calcBetaMichelsen2001", + "beta"); } return nybeta; } @@ -326,11 +327,12 @@ public double calcBetaNielsen2023(double[] K, double[] z) beta[1] = 1.0 - V; if (iter >= maxIterations) { - throw new neqsim.util.exception.TooManyIterationsException(new RachfordRice(), "calcBeta", - maxIterations); + throw new neqsim.util.exception.TooManyIterationsException(new RachfordRice(), + "calcBetaNielsen2023", maxIterations); } if (Double.isNaN(V)) { - throw new neqsim.util.exception.IsNaNException(new RachfordRice(), "calcBeta", "beta"); + throw new neqsim.util.exception.IsNaNException(new RachfordRice(), "calcBetaNielsen2023", + "beta"); } return V; @@ -493,14 +495,14 @@ public final double calcBetaS(SystemInterface system) throws neqsim.util.excepti this.beta[1] = 1.0 - nybeta; if (iterations >= maxIterations) { - throw new neqsim.util.exception.TooManyIterationsException(this, "calcBeta", maxIterations); + throw new neqsim.util.exception.TooManyIterationsException(this, "calcBetaS", maxIterations); } if (Double.isNaN(beta[1])) { /* * for (i = 0; i < numberOfComponents; i++) { System.out.println("K " + compArray[i].getK()); * System.out.println("z " + compArray[i].getz()); } */ - throw new neqsim.util.exception.IsNaNException(this, "calcBeta", "beta"); + throw new neqsim.util.exception.IsNaNException(this, "calcBetaS", "beta"); } return this.beta[0]; } diff --git a/src/main/java/neqsim/thermodynamicoperations/flashops/SysNewtonRhapsonTPflash.java b/src/main/java/neqsim/thermodynamicoperations/flashops/SysNewtonRhapsonTPflash.java index 218070510..f264028d7 100644 --- a/src/main/java/neqsim/thermodynamicoperations/flashops/SysNewtonRhapsonTPflash.java +++ b/src/main/java/neqsim/thermodynamicoperations/flashops/SysNewtonRhapsonTPflash.java @@ -145,9 +145,8 @@ public void init() { *

* * @return a double - * @throws java.lang.Exception if any. */ - public double solve() throws Exception { + public double solve() { try { iter++; init(); diff --git a/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java b/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java index 8126716ed..a720e9582 100644 --- a/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java +++ b/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java @@ -94,7 +94,7 @@ public void sucsSubs() { RachfordRice rachfordRice = new RachfordRice(); try { system.setBeta(rachfordRice.calcBetaS(system)); - //system.setBeta(rachfordRice.calcBeta(system.getKvector(), system.getzvector())); + // system.setBeta(rachfordRice.calcBeta(system.getKvector(), system.getzvector())); } catch (IsNaNException ex) { logger.warn("Not able to calculate beta. Value is NaN"); system.setBeta(oldBeta); @@ -259,7 +259,7 @@ public void run() { RachfordRice rachfordRice = new RachfordRice(); system.setBeta(rachfordRice.calcBeta(system.getKvector(), system.getzvector())); } catch (Exception ex) { - logger.error(ex.getMessage(), ex); + logger.error(ex.getMessage()); } system.calc_x_y(); system.init(1); diff --git a/src/main/java/neqsim/thermodynamicoperations/flashops/TPmultiflash.java b/src/main/java/neqsim/thermodynamicoperations/flashops/TPmultiflash.java index 8b24abfe2..e6adca918 100644 --- a/src/main/java/neqsim/thermodynamicoperations/flashops/TPmultiflash.java +++ b/src/main/java/neqsim/thermodynamicoperations/flashops/TPmultiflash.java @@ -1196,7 +1196,7 @@ public void stabilityAnalysis2() { if (iter > 198) { // System.out.println("too many iterations....." + err + " temperature " // + system.getTemperature("C") + " C " + system.getPressure("bara") + " bara"); - new Exception("to many iterations "); + new neqsim.util.exception.TooManyIterationsException(this, "stabilityAnalysis2", 200); } // logger.info("err: " + err + " ITER " + iter); double xTrivialCheck0 = 0.0; diff --git a/src/main/java/neqsim/thermodynamicoperations/flashops/saturationops/BubblePointTemperatureFlash.java b/src/main/java/neqsim/thermodynamicoperations/flashops/saturationops/BubblePointTemperatureFlash.java index 44ae7a1ca..6d99c9480 100644 --- a/src/main/java/neqsim/thermodynamicoperations/flashops/saturationops/BubblePointTemperatureFlash.java +++ b/src/main/java/neqsim/thermodynamicoperations/flashops/saturationops/BubblePointTemperatureFlash.java @@ -1,10 +1,8 @@ package neqsim.thermodynamicoperations.flashops.saturationops; -import neqsim.thermo.system.SystemInterface; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - +import neqsim.thermo.system.SystemInterface; /** *

diff --git a/src/main/java/neqsim/thermodynamicoperations/phaseenvelopeops/multicomponentenvelopeops/PTphaseEnvelope.java b/src/main/java/neqsim/thermodynamicoperations/phaseenvelopeops/multicomponentenvelopeops/PTphaseEnvelope.java index 2923bd82f..f89923de1 100644 --- a/src/main/java/neqsim/thermodynamicoperations/phaseenvelopeops/multicomponentenvelopeops/PTphaseEnvelope.java +++ b/src/main/java/neqsim/thermodynamicoperations/phaseenvelopeops/multicomponentenvelopeops/PTphaseEnvelope.java @@ -139,387 +139,379 @@ public PTphaseEnvelope(SystemInterface system, String name, double phaseFraction @Override public void run() { speceq = 0; // initialization - try { - points[0] = new double[10000]; // declarations for points - points[1] = new double[10000]; // declarations for points - - pointsH = new double[10000]; // declarations for points - pointsV = new double[10000]; // declarations for points - pointsS = new double[10000]; // declarations for points - system.init(0); // initialization - - // selects the most volatile and least volatile component based on Tc values - // afterwards it uses them to define the speceq of the first point - // based on the desired first point, dew/bubble - for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) { - if (system.getComponent(i).getz() < 1e-10) { - continue; + points[0] = new double[10000]; // declarations for points + points[1] = new double[10000]; // declarations for points + + pointsH = new double[10000]; // declarations for points + pointsV = new double[10000]; // declarations for points + pointsS = new double[10000]; // declarations for points + system.init(0); // initialization + + // selects the most volatile and least volatile component based on Tc values + // afterwards it uses them to define the speceq of the first point + // based on the desired first point, dew/bubble + for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) { + if (system.getComponent(i).getz() < 1e-10) { + continue; + } + if (system.getPhase(0).getComponent(i).getIonicCharge() == 0) { + if (bubblePointFirst && system.getPhase(0).getComponents()[speceq] + .getTC() > system.getPhase(0).getComponents()[i].getTC()) { + speceq = system.getPhase(0).getComponent(i).getComponentNumber(); } - if (system.getPhase(0).getComponent(i).getIonicCharge() == 0) { - if (bubblePointFirst && system.getPhase(0).getComponents()[speceq] - .getTC() > system.getPhase(0).getComponents()[i].getTC()) { - speceq = system.getPhase(0).getComponent(i).getComponentNumber(); - } - if (!bubblePointFirst && system.getPhase(0).getComponents()[speceq] - .getTC() < system.getPhase(0).getComponents()[i].getTC()) { - speceq = system.getPhase(0).getComponent(i).getComponentNumber(); - } + if (!bubblePointFirst && system.getPhase(0).getComponents()[speceq] + .getTC() < system.getPhase(0).getComponents()[i].getTC()) { + speceq = system.getPhase(0).getComponent(i).getComponentNumber(); } } + } - // initialized the first step of the phase envelope - // pressure is already defined - // temperature is the antoine vapor pressure of the selected component - // (least or most volatile. - pres = lowPres; - // temp = - // system.getPhase(0).getComponent(speceq).getAntoineVaporTemperature(pres); - temp = tempKWilson(phaseFraction, pres); - - if (Double.isNaN(temp)) { - temp = system.getPhase(0).getComponent(speceq).getTC() - 20.0; - } - system.setTemperature(temp); - system.setPressure(pres); + // initialized the first step of the phase envelope + // pressure is already defined + // temperature is the antoine vapor pressure of the selected component + // (least or most volatile. + pres = lowPres; + // temp = + // system.getPhase(0).getComponent(speceq).getAntoineVaporTemperature(pres); + temp = tempKWilson(phaseFraction, pres); + + if (Double.isNaN(temp)) { + temp = system.getPhase(0).getComponent(speceq).getTC() - 20.0; + } + system.setTemperature(temp); + system.setPressure(pres); - ThermodynamicOperations testOps = new ThermodynamicOperations(system); + ThermodynamicOperations testOps = new ThermodynamicOperations(system); - // this part converges the first phase envelope point. - // if the plasefraction is more than 0.5 it does a dew point initiallization - // else a bubble point initiallization + // this part converges the first phase envelope point. + // if the plasefraction is more than 0.5 it does a dew point initiallization + // else a bubble point initiallization - for (int i = 0; i < 5; i++) { - try { - if (phaseFraction < 0.5) { - temp += i * 2; - system.setTemperature(temp); - testOps.bubblePointTemperatureFlash(); - } else { - temp += i * 2; - system.setTemperature(temp); - testOps.dewPointTemperatureFlash(); - } - } catch (Exception ex) { - // ex.toString(); + for (int i = 0; i < 5; i++) { + try { + if (phaseFraction < 0.5) { + temp += i * 2; + system.setTemperature(temp); + testOps.bubblePointTemperatureFlash(); + } else { + temp += i * 2; + system.setTemperature(temp); + testOps.dewPointTemperatureFlash(); } - double tempNy = system.getTemperature(); + } catch (Exception ex) { + // ex.toString(); + } + double tempNy = system.getTemperature(); - if (!Double.isNaN(tempNy)) { - temp = tempNy; - break; - } + if (!Double.isNaN(tempNy)) { + temp = tempNy; + break; } + } - // this part sets the first envelope point into the system - system.setBeta(phaseFraction); - system.setPressure(pres); - system.setTemperature(temp); - - SysNewtonRhapsonPhaseEnvelope nonLinSolver = - new SysNewtonRhapsonPhaseEnvelope(system, 2, system.getPhase(0).getNumberOfComponents()); - startPres = system.getPressure(); - nonLinSolver.setu(); - - for (np = 1; np < 9980; np++) { - try { - // solves the np point of the envelope - nonLinSolver.calcInc(np); - nonLinSolver.solve(np); - - // this catches the exceptions - // double TT = system.getPhase(0).getTemperature(); - // double PP = system.getPhase(0).getPressure(); - } catch (Exception e0) { - // the envelope crushed. - // this part keeps the old values - // restarts the envelope from the other side - // and then stops - - if (restart) { - restart = false; - // keep values - Tmin = points[0][np - 2]; - npfirst = np - 1; - ncrfirst = nonLinSolver.getNpCrit(); - if (ncrfirst == 0) { - ncrfirst = npfirst; - } - Tcfirst = system.getTC(); - Pcfirst = system.getPC(); - - cricondenBarfirst = cricondenBar; - cricondenBarXfirst = cricondenBarX; - cricondenBarYfirst = cricondenBarY; - - cricondenThermfirst = cricondenTherm; - cricondenThermXfirst = cricondenThermX; - cricondenThermYfirst = cricondenThermY; - - hascopiedPoints = true; - copiedPoints = new double[5][np - 1]; - for (int i = 0; i < np - 1; i++) { - copiedPoints[0][i] = points[0][i]; - copiedPoints[1][i] = points[1][i]; - copiedPoints[2][i] = pointsH[i]; - copiedPoints[3][i] = pointsS[i]; - copiedPoints[4][i] = pointsV[i]; - } - - // new settings - phaseFraction = 1.0 - phaseFraction; - if (bubblePointFirst) { - bubblePointFirst = false; - } else { - bubblePointFirst = true; - } - run(); - /**/ - break; - } else { - np = np - 1; - break; + // this part sets the first envelope point into the system + system.setBeta(phaseFraction); + system.setPressure(pres); + system.setTemperature(temp); + + SysNewtonRhapsonPhaseEnvelope nonLinSolver = + new SysNewtonRhapsonPhaseEnvelope(system, 2, system.getPhase(0).getNumberOfComponents()); + startPres = system.getPressure(); + nonLinSolver.setu(); + + for (np = 1; np < 9980; np++) { + try { + // solves the np point of the envelope + nonLinSolver.calcInc(np); + nonLinSolver.solve(np); + + // this catches the exceptions + // double TT = system.getPhase(0).getTemperature(); + // double PP = system.getPhase(0).getPressure(); + } catch (Exception e0) { + // the envelope crushed. + // this part keeps the old values + // restarts the envelope from the other side + // and then stops + + if (restart) { + restart = false; + // keep values + Tmin = points[0][np - 2]; + npfirst = np - 1; + ncrfirst = nonLinSolver.getNpCrit(); + if (ncrfirst == 0) { + ncrfirst = npfirst; + } + Tcfirst = system.getTC(); + Pcfirst = system.getPC(); + + cricondenBarfirst = cricondenBar; + cricondenBarXfirst = cricondenBarX; + cricondenBarYfirst = cricondenBarY; + + cricondenThermfirst = cricondenTherm; + cricondenThermXfirst = cricondenThermX; + cricondenThermYfirst = cricondenThermY; + + hascopiedPoints = true; + copiedPoints = new double[5][np - 1]; + for (int i = 0; i < np - 1; i++) { + copiedPoints[0][i] = points[0][i]; + copiedPoints[1][i] = points[1][i]; + copiedPoints[2][i] = pointsH[i]; + copiedPoints[3][i] = pointsS[i]; + copiedPoints[4][i] = pointsV[i]; } - } - // check for critical point - double Kvallc = system.getPhase(0).getComponent(nonLinSolver.lc).getx() - / system.getPhase(1).getComponent(nonLinSolver.lc).getx(); - double Kvalhc = system.getPhase(0).getComponent(nonLinSolver.hc).getx() - / system.getPhase(1).getComponent(nonLinSolver.hc).getx(); - // double densV = system.getPhase(0).getDensity(); - // double densL = system.getPhase(1).getDensity(); - - // System.out.println(np + " " + system.getTemperature() + " " + - // system.getPressure() + " " + densV + " " + densL ); - - if (!nonLinSolver.etterCP) { - if (Kvallc < 1.05 && Kvalhc > 0.95) { - // close to the critical point - // invert phase types and find the CP Temp and Press - - // System.out.println("critical point"); - nonLinSolver.npCrit = np; - system.invertPhaseTypes(); - nonLinSolver.etterCP = true; - // the critical point is found from interpolation polynomials based on K=1 of - // the most or least volatile component - nonLinSolver.calcCrit(); + // new settings + phaseFraction = 1.0 - phaseFraction; + if (bubblePointFirst) { + bubblePointFirst = false; + } else { + bubblePointFirst = true; } + run(); + /**/ + break; + } else { + np = np - 1; + break; } - if (nonLinSolver.calcCP) { - nonLinSolver.calcCP = false; + } + + // check for critical point + double Kvallc = system.getPhase(0).getComponent(nonLinSolver.lc).getx() + / system.getPhase(1).getComponent(nonLinSolver.lc).getx(); + double Kvalhc = system.getPhase(0).getComponent(nonLinSolver.hc).getx() + / system.getPhase(1).getComponent(nonLinSolver.hc).getx(); + // double densV = system.getPhase(0).getDensity(); + // double densL = system.getPhase(1).getDensity(); + + // System.out.println(np + " " + system.getTemperature() + " " + + // system.getPressure() + " " + densV + " " + densL ); + + if (!nonLinSolver.etterCP) { + if (Kvallc < 1.05 && Kvalhc > 0.95) { + // close to the critical point + // invert phase types and find the CP Temp and Press + + // System.out.println("critical point"); nonLinSolver.npCrit = np; + system.invertPhaseTypes(); + nonLinSolver.etterCP = true; + // the critical point is found from interpolation polynomials based on K=1 of + // the most or least volatile component nonLinSolver.calcCrit(); } + } + if (nonLinSolver.calcCP) { + nonLinSolver.calcCP = false; + nonLinSolver.npCrit = np; + nonLinSolver.calcCrit(); + } - // stores critondenbar and cricondentherm - // HERE the new cricoT and crico P values will be called instead - if (system.getTemperature() > cricondenTherm[0]) { - cricondenTherm[1] = system.getPressure(); - cricondenTherm[0] = system.getTemperature(); - for (int ii = 0; ii < nonLinSolver.numberOfComponents; ii++) { - cricondenThermX[ii] = system.getPhase(1).getComponent(ii).getx(); - cricondenThermY[ii] = system.getPhase(0).getComponent(ii).getx(); - } - } else { - nonLinSolver.ettercricoT = true; + // stores critondenbar and cricondentherm + // HERE the new cricoT and crico P values will be called instead + if (system.getTemperature() > cricondenTherm[0]) { + cricondenTherm[1] = system.getPressure(); + cricondenTherm[0] = system.getTemperature(); + for (int ii = 0; ii < nonLinSolver.numberOfComponents; ii++) { + cricondenThermX[ii] = system.getPhase(1).getComponent(ii).getx(); + cricondenThermY[ii] = system.getPhase(0).getComponent(ii).getx(); } - if (system.getPressure() > cricondenBar[1]) { - cricondenBar[0] = system.getTemperature(); - cricondenBar[1] = system.getPressure(); - for (int ii = 0; ii < nonLinSolver.numberOfComponents; ii++) { - cricondenBarX[ii] = system.getPhase(1).getComponent(ii).getx(); - cricondenBarY[ii] = system.getPhase(0).getComponent(ii).getx(); - } + } else { + nonLinSolver.ettercricoT = true; + } + if (system.getPressure() > cricondenBar[1]) { + cricondenBar[0] = system.getTemperature(); + cricondenBar[1] = system.getPressure(); + for (int ii = 0; ii < nonLinSolver.numberOfComponents; ii++) { + cricondenBarX[ii] = system.getPhase(1).getComponent(ii).getx(); + cricondenBarY[ii] = system.getPhase(0).getComponent(ii).getx(); } + } - // Exit criteria - if ((system.getPressure() < minPressure && nonLinSolver.ettercricoT)) { - break; - } - if (system.getPressure() > maxPressure) { - break; - } - if (system.getTemperature() > Tmin && !restart) { - break; - } + // Exit criteria + if ((system.getPressure() < minPressure && nonLinSolver.ettercricoT)) { + break; + } + if (system.getPressure() > maxPressure) { + break; + } + if (system.getTemperature() > Tmin && !restart) { + break; + } - // Keeps the calculated points - points[0][np - 1] = system.getTemperature(); - points[1][np - 1] = system.getPressure(); - pointsH[np - 1] = - system.getPhase(1).getEnthalpy() / system.getPhase(1).getNumberOfMolesInPhase() - / system.getPhase(1).getMolarMass() / 1e3; - pointsV[np - 1] = system.getPhase(1).getDensity(); - pointsS[np - 1] = - system.getPhase(1).getEntropy() / system.getPhase(1).getNumberOfMolesInPhase() - / system.getPhase(1).getMolarMass() / 1e3; + // Keeps the calculated points + points[0][np - 1] = system.getTemperature(); + points[1][np - 1] = system.getPressure(); + pointsH[np - 1] = system.getPhase(1).getEnthalpy() + / system.getPhase(1).getNumberOfMolesInPhase() / system.getPhase(1).getMolarMass() / 1e3; + pointsV[np - 1] = system.getPhase(1).getDensity(); + pointsS[np - 1] = system.getPhase(1).getEntropy() + / system.getPhase(1).getNumberOfMolesInPhase() / system.getPhase(1).getMolarMass() / 1e3; + } + + try { + int ncr = nonLinSolver.getNpCrit(); + if (ncr == 0) { + ncr = np; + } + int ncr2 = np - ncr; + if (hascopiedPoints) { + // if it enters here the envelope crashed and restarted + // reallocate to have all values + points2 = new double[8][]; + pointsH2 = new double[8][]; + pointsS2 = new double[8][]; + pointsV2 = new double[8][]; } - try { - int ncr = nonLinSolver.getNpCrit(); - if (ncr == 0) { - ncr = np; + // points2 are plotted + points2[0] = new double[ncr + 1]; + points2[1] = new double[ncr + 1]; + pointsH2[0] = new double[ncr + 1]; + pointsH2[1] = new double[ncr + 1]; + pointsS2[0] = new double[ncr + 1]; + pointsS2[1] = new double[ncr + 1]; + pointsV2[0] = new double[ncr + 1]; + pointsV2[1] = new double[ncr + 1]; + + if (ncr2 > 2) { + points2[2] = new double[ncr2 - 2]; + points2[3] = new double[ncr2 - 2]; + pointsH2[2] = new double[ncr2 - 2]; + pointsH2[3] = new double[ncr2 - 2]; + pointsS2[2] = new double[ncr2 - 2]; + pointsS2[3] = new double[ncr2 - 2]; + pointsV2[2] = new double[ncr2 - 2]; + pointsV2[3] = new double[ncr2 - 2]; + } else { + points2[2] = new double[0]; + points2[3] = new double[0]; + pointsH2[2] = new double[0]; + pointsH2[3] = new double[0]; + pointsS2[2] = new double[0]; + pointsS2[3] = new double[0]; + pointsV2[2] = new double[0]; + pointsV2[3] = new double[0]; + } + + for (int i = 0; i < ncr; i++) { + // second branch up to critical point + points2[0][i] = points[0][i]; + points2[1][i] = points[1][i]; + pointsH2[1][i] = points[1][i]; + pointsH2[0][i] = pointsH[i]; + pointsS2[1][i] = points[1][i]; + pointsS2[0][i] = pointsS[i]; + pointsV2[1][i] = points[1][i]; + pointsV2[0][i] = pointsV[i]; + } + if (ncr2 > 2) { + for (int i = 1; i < (ncr2 - 2); i++) { + // second branch after the critical point + points2[2][i] = points[0][i + ncr - 1]; + points2[3][i] = points[1][i + ncr - 1]; + pointsH2[3][i] = points[1][i + ncr - 1]; + pointsH2[2][i] = pointsH[i + ncr - 1]; + pointsS2[3][i] = points[1][i + ncr - 1]; + pointsS2[2][i] = pointsS[i + ncr - 1]; + pointsV2[3][i] = points[1][i + ncr - 1]; + pointsV2[2][i] = pointsV[i + ncr - 1]; } - int ncr2 = np - ncr; - if (hascopiedPoints) { - // if it enters here the envelope crashed and restarted - // reallocate to have all values - points2 = new double[8][]; - pointsH2 = new double[8][]; - pointsS2 = new double[8][]; - pointsV2 = new double[8][]; + } + + if (hascopiedPoints) { + if (ncrfirst > npfirst) { + ncr = copiedPoints[0].length - 1; + ncr2 = npfirst - ncr; + npfirst = npfirst - 1; + } else { + ncr = ncrfirst; + ncr2 = npfirst - ncr; } - // points2 are plotted - points2[0] = new double[ncr + 1]; - points2[1] = new double[ncr + 1]; - pointsH2[0] = new double[ncr + 1]; - pointsH2[1] = new double[ncr + 1]; - pointsS2[0] = new double[ncr + 1]; - pointsS2[1] = new double[ncr + 1]; - pointsV2[0] = new double[ncr + 1]; - pointsV2[1] = new double[ncr + 1]; + points2[4] = new double[ncr + 1]; + points2[5] = new double[ncr + 1]; + pointsH2[4] = new double[ncr + 1]; + pointsH2[5] = new double[ncr + 1]; + pointsS2[4] = new double[ncr + 1]; + pointsS2[5] = new double[ncr + 1]; + pointsV2[4] = new double[ncr + 1]; + pointsV2[5] = new double[ncr + 1]; if (ncr2 > 2) { - points2[2] = new double[ncr2 - 2]; - points2[3] = new double[ncr2 - 2]; - pointsH2[2] = new double[ncr2 - 2]; - pointsH2[3] = new double[ncr2 - 2]; - pointsS2[2] = new double[ncr2 - 2]; - pointsS2[3] = new double[ncr2 - 2]; - pointsV2[2] = new double[ncr2 - 2]; - pointsV2[3] = new double[ncr2 - 2]; + points2[6] = new double[ncr2 - 2]; + points2[7] = new double[ncr2 - 2]; + pointsH2[6] = new double[ncr2 - 2]; + pointsH2[7] = new double[ncr2 - 2]; + pointsS2[6] = new double[ncr2 - 2]; + pointsS2[7] = new double[ncr2 - 2]; + pointsV2[6] = new double[ncr2 - 2]; + pointsV2[7] = new double[ncr2 - 2]; } else { - points2[2] = new double[0]; - points2[3] = new double[0]; - pointsH2[2] = new double[0]; - pointsH2[3] = new double[0]; - pointsS2[2] = new double[0]; - pointsS2[3] = new double[0]; - pointsV2[2] = new double[0]; - pointsV2[3] = new double[0]; + points2[6] = new double[0]; + points2[7] = new double[0]; + pointsH2[6] = new double[0]; + pointsH2[7] = new double[0]; + pointsS2[6] = new double[0]; + pointsS2[7] = new double[0]; + pointsV2[6] = new double[0]; + pointsV2[7] = new double[0]; } for (int i = 0; i < ncr; i++) { - // second branch up to critical point - points2[0][i] = points[0][i]; - points2[1][i] = points[1][i]; - pointsH2[1][i] = points[1][i]; - pointsH2[0][i] = pointsH[i]; - pointsS2[1][i] = points[1][i]; - pointsS2[0][i] = pointsS[i]; - pointsV2[1][i] = points[1][i]; - pointsV2[0][i] = pointsV[i]; + // first branch up to the critical point + points2[4][i] = copiedPoints[0][i]; + points2[5][i] = copiedPoints[1][i]; + pointsH2[5][i] = copiedPoints[1][i]; + pointsH2[4][i] = copiedPoints[2][i]; + pointsS2[5][i] = copiedPoints[1][i]; + pointsS2[4][i] = copiedPoints[3][i]; + pointsV2[5][i] = copiedPoints[1][i]; + pointsV2[4][i] = copiedPoints[4][i]; } if (ncr2 > 2) { for (int i = 1; i < (ncr2 - 2); i++) { - // second branch after the critical point - points2[2][i] = points[0][i + ncr - 1]; - points2[3][i] = points[1][i + ncr - 1]; - pointsH2[3][i] = points[1][i + ncr - 1]; - pointsH2[2][i] = pointsH[i + ncr - 1]; - pointsS2[3][i] = points[1][i + ncr - 1]; - pointsS2[2][i] = pointsS[i + ncr - 1]; - pointsV2[3][i] = points[1][i + ncr - 1]; - pointsV2[2][i] = pointsV[i + ncr - 1]; - } - } - - if (hascopiedPoints) { - if (ncrfirst > npfirst) { - ncr = copiedPoints[0].length - 1; - ncr2 = npfirst - ncr; - npfirst = npfirst - 1; - } else { - ncr = ncrfirst; - ncr2 = npfirst - ncr; - } - - points2[4] = new double[ncr + 1]; - points2[5] = new double[ncr + 1]; - pointsH2[4] = new double[ncr + 1]; - pointsH2[5] = new double[ncr + 1]; - pointsS2[4] = new double[ncr + 1]; - pointsS2[5] = new double[ncr + 1]; - pointsV2[4] = new double[ncr + 1]; - pointsV2[5] = new double[ncr + 1]; - - if (ncr2 > 2) { - points2[6] = new double[ncr2 - 2]; - points2[7] = new double[ncr2 - 2]; - pointsH2[6] = new double[ncr2 - 2]; - pointsH2[7] = new double[ncr2 - 2]; - pointsS2[6] = new double[ncr2 - 2]; - pointsS2[7] = new double[ncr2 - 2]; - pointsV2[6] = new double[ncr2 - 2]; - pointsV2[7] = new double[ncr2 - 2]; - } else { - points2[6] = new double[0]; - points2[7] = new double[0]; - pointsH2[6] = new double[0]; - pointsH2[7] = new double[0]; - pointsS2[6] = new double[0]; - pointsS2[7] = new double[0]; - pointsV2[6] = new double[0]; - pointsV2[7] = new double[0]; - } - - for (int i = 0; i < ncr; i++) { - // first branch up to the critical point - points2[4][i] = copiedPoints[0][i]; - points2[5][i] = copiedPoints[1][i]; - pointsH2[5][i] = copiedPoints[1][i]; - pointsH2[4][i] = copiedPoints[2][i]; - pointsS2[5][i] = copiedPoints[1][i]; - pointsS2[4][i] = copiedPoints[3][i]; - pointsV2[5][i] = copiedPoints[1][i]; - pointsV2[4][i] = copiedPoints[4][i]; - } - if (ncr2 > 2) { - for (int i = 1; i < (ncr2 - 2); i++) { - // first branch after the critical point - points2[6][i] = copiedPoints[0][i + ncr - 1]; - points2[7][i] = copiedPoints[1][i + ncr - 1]; - pointsH2[7][i] = copiedPoints[1][i + ncr - 1]; - pointsH2[6][i] = copiedPoints[2][i + ncr - 1]; - pointsS2[7][i] = copiedPoints[1][i + ncr - 1]; - pointsS2[6][i] = copiedPoints[3][i + ncr - 1]; - pointsV2[7][i] = copiedPoints[1][i + ncr - 1]; - pointsV2[6][i] = copiedPoints[4][i + ncr - 1]; - } + // first branch after the critical point + points2[6][i] = copiedPoints[0][i + ncr - 1]; + points2[7][i] = copiedPoints[1][i + ncr - 1]; + pointsH2[7][i] = copiedPoints[1][i + ncr - 1]; + pointsH2[6][i] = copiedPoints[2][i + ncr - 1]; + pointsS2[7][i] = copiedPoints[1][i + ncr - 1]; + pointsS2[6][i] = copiedPoints[3][i + ncr - 1]; + pointsV2[7][i] = copiedPoints[1][i + ncr - 1]; + pointsV2[6][i] = copiedPoints[4][i + ncr - 1]; } } + } - // critical point - system.setTemperature(system.getTC()); - system.setPressure(system.getPC()); + // critical point + system.setTemperature(system.getTC()); + system.setPressure(system.getPC()); - points2[0][ncr] = system.getTC(); - points2[1][ncr] = system.getPC(); - if (ncr2 > 2) { - points2[2][0] = system.getTC(); - points2[3][0] = system.getPC(); - } - } catch (Exception e2) { + points2[0][ncr] = system.getTC(); + points2[1][ncr] = system.getPC(); + if (ncr2 > 2) { + points2[2][0] = system.getTC(); + points2[3][0] = system.getPC(); } - /* - * try { if (outputToFile) { // update this String name1 = new String(); name1 = fileName + - * "Dew.nc"; file1 = new - * neqsim.dataPresentation.filehandling.createNetCDF.netCDF2D.NetCdf2D(); - * file1.setOutputFileName(name1); file1.setXvalues(points2[2], "temp", "sec"); - * file1.setYvalues(points2[3], "pres", "meter"); file1.createFile(); - * - * String name2 = new String(); name2 = fileName + "Bub.nc"; file2 = new - * neqsim.dataPresentation.filehandling.createNetCDF.netCDF2D.NetCdf2D(); - * file2.setOutputFileName(name2); file2.setXvalues(points2[0], "temp", "sec"); - * file2.setYvalues(points2[1], "pres", "meter"); file2.createFile(); } } catch (Exception e3) - * { logger.error(ex.getMessage(), e3); } - */ - } catch (Exception ex) { - logger.error(ex.getMessage(), ex); - throw ex; + } catch (Exception e2) { } + /* + * try { if (outputToFile) { // update this String name1 = new String(); name1 = fileName + + * "Dew.nc"; file1 = new neqsim.dataPresentation.filehandling.createNetCDF.netCDF2D.NetCdf2D(); + * file1.setOutputFileName(name1); file1.setXvalues(points2[2], "temp", "sec"); + * file1.setYvalues(points2[3], "pres", "meter"); file1.createFile(); + * + * String name2 = new String(); name2 = fileName + "Bub.nc"; file2 = new + * neqsim.dataPresentation.filehandling.createNetCDF.netCDF2D.NetCdf2D(); + * file2.setOutputFileName(name2); file2.setXvalues(points2[0], "temp", "sec"); + * file2.setYvalues(points2[1], "pres", "meter"); file2.createFile(); } } catch (Exception e3) { + * logger.error(ex.getMessage(), e3); } + */ } /** diff --git a/src/main/java/neqsim/util/database/NeqSimDataBase.java b/src/main/java/neqsim/util/database/NeqSimDataBase.java index 635797436..f10345f73 100644 --- a/src/main/java/neqsim/util/database/NeqSimDataBase.java +++ b/src/main/java/neqsim/util/database/NeqSimDataBase.java @@ -228,7 +228,7 @@ public ResultSet getResultSet(String sqlString) { /** {@inheritDoc} */ @Override - public void close() throws Exception { + public void close() throws SQLException { if (databaseConnection != null) { databaseConnection.close(); } diff --git a/src/test/java/neqsim/processsimulation/measurementdevice/FLowInducedVibrationTest.java b/src/test/java/neqsim/processsimulation/measurementdevice/FLowInducedVibrationTest.java index 6403e6d1e..8591c2867 100644 --- a/src/test/java/neqsim/processsimulation/measurementdevice/FLowInducedVibrationTest.java +++ b/src/test/java/neqsim/processsimulation/measurementdevice/FLowInducedVibrationTest.java @@ -1,7 +1,6 @@ package neqsim.processsimulation.measurementdevice; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import neqsim.processsimulation.processequipment.pipeline.PipeBeggsAndBrills; import neqsim.processsimulation.processequipment.stream.Stream; @@ -15,12 +14,6 @@ public class FLowInducedVibrationTest extends neqsim.NeqSimTest { static FlowInducedVibrationAnalyser flowInducedVibrationAnalyser; static FlowInducedVibrationAnalyser flowInducedVibrationAnalyserFRMS; - /** - * @throws java.lang.Exception - */ - @BeforeAll - static void setUpBeforeClass() throws Exception {} - @Test public void testSetUnit() { double pressure = 58.3 + 1.01325; // bara of the separator diff --git a/src/test/java/neqsim/processsimulation/measurementdevice/WellAllocatorTest.java b/src/test/java/neqsim/processsimulation/measurementdevice/WellAllocatorTest.java index 131f119ae..a0316002b 100644 --- a/src/test/java/neqsim/processsimulation/measurementdevice/WellAllocatorTest.java +++ b/src/test/java/neqsim/processsimulation/measurementdevice/WellAllocatorTest.java @@ -2,7 +2,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import neqsim.processsimulation.processequipment.separator.Separator; import neqsim.processsimulation.processequipment.stream.Stream; @@ -16,12 +15,6 @@ class WellAllocatorTest extends neqsim.NeqSimTest { static Logger logger = LogManager.getLogger(WellAllocatorTest.class); - /** - * @throws java.lang.Exception - */ - @BeforeAll - static void setUpBeforeClass() throws Exception {} - /** * Test method for * {@link neqsim.processsimulation.measurementdevice.WellAllocator#getMeasuredValue(java.lang.String)}. diff --git a/src/test/java/neqsim/processsimulation/measurementdevice/nmVOCTest.java b/src/test/java/neqsim/processsimulation/measurementdevice/nmVOCTest.java index c059535fd..d59c4006a 100644 --- a/src/test/java/neqsim/processsimulation/measurementdevice/nmVOCTest.java +++ b/src/test/java/neqsim/processsimulation/measurementdevice/nmVOCTest.java @@ -16,7 +16,7 @@ public class nmVOCTest extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeAll - static void setUpBeforeClass() throws Exception { + static void setUpBeforeClass() { SystemInterface thermoSystem = new SystemSrkEos(298.0, 100.0); thermoSystem.addComponent("water", 1.0); thermoSystem.addComponent("methane", 1.0); diff --git a/src/test/java/neqsim/processsimulation/mechanicaldesign/SystemMechanicalDesignTest.java b/src/test/java/neqsim/processsimulation/mechanicaldesign/SystemMechanicalDesignTest.java index 1f1601fc8..6d97c4486 100644 --- a/src/test/java/neqsim/processsimulation/mechanicaldesign/SystemMechanicalDesignTest.java +++ b/src/test/java/neqsim/processsimulation/mechanicaldesign/SystemMechanicalDesignTest.java @@ -132,13 +132,15 @@ void testRunDesignCalculationforProcess() { SystemMechanicalDesign mecDesign = new SystemMechanicalDesign(operations); mecDesign.runDesignCalculation(); - System.out.println("total process weight " + mecDesign.getTotalWeight() + " kg"); - System.out.println("total process volume " + mecDesign.getTotalVolume() + " m3"); - System.out.println("total plot space " + mecDesign.getTotalPlotSpace() + " m2"); - System.out.println("separator inner diameter " - + ((Separator) operations.getUnit("sepregenGas")).getMechanicalDesign().innerDiameter); - System.out.println("valve weight " - + ((ThrottlingValve) operations.getUnit("valve1")).getMechanicalDesign().getWeightTotal()); + /* + * System.out.println("total process weight " + mecDesign.getTotalWeight() + " kg"); + * System.out.println("total process volume " + mecDesign.getTotalVolume() + " m3"); + * System.out.println("total plot space " + mecDesign.getTotalPlotSpace() + " m2"); + * System.out.println("separator inner diameter " + ((Separator) + * operations.getUnit("sepregenGas")).getMechanicalDesign().innerDiameter); + * System.out.println("valve weight " + ((ThrottlingValve) + * operations.getUnit("valve1")).getMechanicalDesign().getWeightTotal()); + */ } @Test @@ -148,9 +150,11 @@ void testRunDesignCalculationforSeparator() { SeparatorMechanicalDesign sepMechDesign = new SeparatorMechanicalDesign((Separator) operations.getUnit("sepregenGas")); sepMechDesign.calcDesign(); - System.out.println("separator inner diameter " + sepMechDesign.innerDiameter); - System.out.println("separator weight vessel shell " + sepMechDesign.weigthVesselShell); - System.out.println("separator weight structual steel " + sepMechDesign.weightStructualSteel); + /* + * System.out.println("separator inner diameter " + sepMechDesign.innerDiameter); + * System.out.println("separator weight vessel shell " + sepMechDesign.weigthVesselShell); + * System.out.println("separator weight structual steel " + sepMechDesign.weightStructualSteel); + */ } @Test @@ -172,9 +176,11 @@ void testRunDesignCalculationforGasScrubber() { GasScrubberMechanicalDesign sepMechDesign = new GasScrubberMechanicalDesign(sep1); sepMechDesign.setMaxOperationPressure(180); sepMechDesign.calcDesign(); - System.out.println("separator inner diameter " + sepMechDesign.innerDiameter); - System.out.println("separator weight vessel shell " + sepMechDesign.weigthVesselShell); - System.out.println("separator weight structual steel " + sepMechDesign.weightStructualSteel); + /* + * System.out.println("separator inner diameter " + sepMechDesign.innerDiameter); + * System.out.println("separator weight vessel shell " + sepMechDesign.weigthVesselShell); + * System.out.println("separator weight structual steel " + sepMechDesign.weightStructualSteel); + */ sep1.addSeparatorSection("first mesh", "meshpad"); sepMechDesign.calcDesign(); } @@ -184,7 +190,7 @@ void testRunDesignCalculationforValve() { ValveMechanicalDesign valve1MechDesign = new ValveMechanicalDesign((ThrottlingValve) operations.getUnit("valve1")); valve1MechDesign.calcDesign(); - System.out.println("valve total weight " + valve1MechDesign.getWeightTotal()); + // System.out.println("valve total weight " + valve1MechDesign.getWeightTotal()); } @Test @@ -200,7 +206,7 @@ void testRunDesignForPipeline() { pipe.run(); - System.out.println("out pressure " + pipe.getOutletStream().getPressure("bara")); + // System.out.println("out pressure " + pipe.getOutletStream().getPressure("bara")); PipelineMechanicalDesign pipeMechDesign = new PipelineMechanicalDesign(pipe); pipeMechDesign.setMaxOperationPressure(100.0); @@ -210,7 +216,7 @@ void testRunDesignForPipeline() { pipeMechDesign.setCompanySpecificDesignStandards("Statoil"); pipeMechDesign.calcDesign(); - System.out.println("wall thickness " + pipeMechDesign.getWallThickness()); + // System.out.println("wall thickness " + pipeMechDesign.getWallThickness()); } @Test @@ -221,6 +227,6 @@ void testCostEstimateProcess() { CostEstimateBaseClass costEst = new CostEstimateBaseClass(mecDesign); costEst.getWeightBasedCAPEXEstimate(); - System.out.println("weight based cost estmate " + costEst.getWeightBasedCAPEXEstimate()); + // System.out.println("weight based cost estmate " + costEst.getWeightBasedCAPEXEstimate()); } } diff --git a/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorPropertyProfileTest.java b/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorPropertyProfileTest.java index 4f5d21920..25b79d425 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorPropertyProfileTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorPropertyProfileTest.java @@ -25,7 +25,7 @@ class CompressorPropertyProfileTest extends neqsim.NeqSimTest { * @throws java.lang.Exception if any. */ @BeforeEach - public void setUp() throws Exception { + public void setUp() { testSystem = new SystemSrkEos(298.0, 10.0); testSystem.addComponent("methane", 100.0); processOps = new ProcessSystem(); diff --git a/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorTest.java b/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorTest.java index 505cf349a..0f8f0a905 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/compressor/CompressorTest.java @@ -39,7 +39,7 @@ class CompressorTest extends neqsim.NeqSimTest { * @throws java.lang.Exception if any. */ @BeforeEach - public void setUp() throws Exception { + public void setUp() { testSystem = new SystemSrkEos(298.0, 10.0); testSystem.addComponent("methane", 100.0); processOps = new ProcessSystem(); @@ -232,7 +232,7 @@ public void testCompressorWithGERG2008_2() { *

*/ @Test - public void testMultiPhaseCompression() throws Exception { + public void testMultiPhaseCompression() { SystemSrkEos testSystem = new SystemSrkEos(315.0, 10.0); testSystem.addComponent("nitrogen", 2.0); testSystem.addComponent("methane", 50.0); diff --git a/src/test/java/neqsim/processsimulation/processequipment/distillation/DistillationColumnTest.java b/src/test/java/neqsim/processsimulation/processequipment/distillation/DistillationColumnTest.java index a29912d86..4c2414e63 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/distillation/DistillationColumnTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/distillation/DistillationColumnTest.java @@ -10,7 +10,7 @@ public class DistillationColumnTest { * @throws java.lang.Exception */ @Test - public void testRun() throws Exception { + public void testRun() { neqsim.thermo.system.SystemInterface richTEG = new neqsim.thermo.system.SystemSrkCPAstatoil(273.15 + 42.0, 10.00); richTEG.addComponent("nitrogen", 0.0003884521907420086); @@ -120,7 +120,7 @@ public void testRun() throws Exception { * @throws java.lang.Exception */ @Test - public void deethanizerTest() throws Exception { + public void deethanizerTest() { neqsim.thermo.system.SystemInterface gasToDeethanizer = new neqsim.thermo.system.SystemSrkEos(216, 30.00); gasToDeethanizer.addComponent("nitrogen", 1.67366E-3); @@ -165,7 +165,7 @@ public void deethanizerTest() throws Exception { * @throws java.lang.Exception */ @Test - public void debutanizerTest() throws Exception { + public void debutanizerTest() { neqsim.thermo.system.SystemInterface gasToDbutanizer = new neqsim.thermo.system.SystemSrkEos(289.0, 11.00); gasToDbutanizer.addComponent("nitrogen", 3.09189E-7); diff --git a/src/test/java/neqsim/processsimulation/processequipment/heatexchanger/HeaterTest.java b/src/test/java/neqsim/processsimulation/processequipment/heatexchanger/HeaterTest.java index f0cee87c3..a628fdb72 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/heatexchanger/HeaterTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/heatexchanger/HeaterTest.java @@ -19,7 +19,7 @@ public class HeaterTest { * @throws java.lang.Exception */ @BeforeEach - public void setUpBeforeClass() throws Exception { + public void setUpBeforeClass() { testSystem = new SystemSrkEos(298.0, 10.0); testSystem.addComponent("methane", 100.0); processOps = new ProcessSystem(); diff --git a/src/test/java/neqsim/processsimulation/processequipment/mixer/MixerTest.java b/src/test/java/neqsim/processsimulation/processequipment/mixer/MixerTest.java index 7a956fc1f..d0c53214f 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/mixer/MixerTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/mixer/MixerTest.java @@ -22,7 +22,7 @@ class MixerTest { * @throws java.lang.Exception */ @BeforeAll - static void setUpBeforeClass() throws Exception { + static void setUpBeforeClass() { testSystem = new SystemSrkEos(298.15, 1.0); testSystem.addComponent("water", 0.0); testSystem.addComponent("methane", 1.0); diff --git a/src/test/java/neqsim/processsimulation/processequipment/separator/SeparatorTest.java b/src/test/java/neqsim/processsimulation/processequipment/separator/SeparatorTest.java index 01d030886..b465c5cee 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/separator/SeparatorTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/separator/SeparatorTest.java @@ -24,7 +24,7 @@ class SeparatorTest extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeEach - public void setUpBeforeClass() throws Exception { + public void setUpBeforeClass() { testSystem = new SystemSrkCPAstatoil(298.0, 10.0); testSystem.addComponent("methane", 100.0); testSystem.addComponent("ethane", 10.0); diff --git a/src/test/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitterTest.java b/src/test/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitterTest.java index 41f2863ab..e12586a09 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitterTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitterTest.java @@ -24,7 +24,7 @@ class ComponentSplitterTest { ProcessSystem processOps = null; @BeforeEach - public void setUpBeforeClass() throws Exception { + public void setUpBeforeClass() { testSystem = new SystemSrkEos(298.0, 10.0); testSystem.addComponent("methane", 100.0); testSystem.addComponent("ethane", 10.0); diff --git a/src/test/java/neqsim/processsimulation/processequipment/stream/StreamTest.java b/src/test/java/neqsim/processsimulation/processequipment/stream/StreamTest.java index 8fe0f0fd6..9205f2668 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/stream/StreamTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/stream/StreamTest.java @@ -23,7 +23,7 @@ class StreamTest extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeEach - public void setUpBeforeClass() throws Exception { + public void setUpBeforeClass() { testSystem = new SystemSrkEos(298.0, 10.0); testSystem.addComponent("methane", 100.0); processOps = new ProcessSystem(); diff --git a/src/test/java/neqsim/processsimulation/processequipment/stream/VirtualStreamTest.java b/src/test/java/neqsim/processsimulation/processequipment/stream/VirtualStreamTest.java index 8cc3ebca6..8cf0b72f0 100644 --- a/src/test/java/neqsim/processsimulation/processequipment/stream/VirtualStreamTest.java +++ b/src/test/java/neqsim/processsimulation/processequipment/stream/VirtualStreamTest.java @@ -19,7 +19,7 @@ public class VirtualStreamTest { * @throws java.lang.Exception */ @BeforeEach - public void setUpBeforeClass() throws Exception { + public void setUpBeforeClass() { testSystem = new SystemSrkEos(298.0, 10.0); testSystem.addComponent("methane", 100.0); testSystem.addComponent("ethane", 100.0); diff --git a/src/test/java/neqsim/processsimulation/util/example/process1Test.java b/src/test/java/neqsim/processsimulation/util/example/process1Test.java index de7c93c41..29b54c02d 100644 --- a/src/test/java/neqsim/processsimulation/util/example/process1Test.java +++ b/src/test/java/neqsim/processsimulation/util/example/process1Test.java @@ -1,52 +1,44 @@ package neqsim.processsimulation.util.example; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import neqsim.processsimulation.processequipment.stream.Stream; class process1Test extends neqsim.NeqSimTest { - static neqsim.thermo.system.SystemInterface testSystem; - static neqsim.processsimulation.processsystem.ProcessSystem operations; - - /** - *

- * setUp. - *

- */ - @BeforeAll - public static void setUp() { - testSystem = new neqsim.thermo.system.SystemSrkCPA((273.15 + 25.0), 50.00); - testSystem.addComponent("methane", 180.00); - testSystem.addComponent("ethane", 10.00); - testSystem.addComponent("propane", 1.00); - testSystem.createDatabase(true); - testSystem.setMultiPhaseCheck(true); - testSystem.setMixingRule(2); - - Stream stream_1 = new Stream("Stream1", testSystem); - - neqsim.processsimulation.processequipment.compressor.Compressor compr = - new neqsim.processsimulation.processequipment.compressor.Compressor("compr", - stream_1); - compr.setOutletPressure(80.0); - compr.setPolytropicEfficiency(0.9); - compr.setIsentropicEfficiency(0.9); - compr.setUsePolytropicCalc(true); - - operations = new neqsim.processsimulation.processsystem.ProcessSystem(); - operations.add(stream_1); - operations.add(compr); - } - - /** - * @throws Exception - */ - @AfterEach - void tearDown() throws Exception {} - - @Test - void runTest() { - operations.run(); - } + static neqsim.thermo.system.SystemInterface testSystem; + static neqsim.processsimulation.processsystem.ProcessSystem operations; + + /** + *

+ * setUp. + *

+ */ + @BeforeAll + public static void setUp() { + testSystem = new neqsim.thermo.system.SystemSrkCPA((273.15 + 25.0), 50.00); + testSystem.addComponent("methane", 180.00); + testSystem.addComponent("ethane", 10.00); + testSystem.addComponent("propane", 1.00); + testSystem.createDatabase(true); + testSystem.setMultiPhaseCheck(true); + testSystem.setMixingRule(2); + + Stream stream_1 = new Stream("Stream1", testSystem); + + neqsim.processsimulation.processequipment.compressor.Compressor compr = + new neqsim.processsimulation.processequipment.compressor.Compressor("compr", stream_1); + compr.setOutletPressure(80.0); + compr.setPolytropicEfficiency(0.9); + compr.setIsentropicEfficiency(0.9); + compr.setUsePolytropicCalc(true); + + operations = new neqsim.processsimulation.processsystem.ProcessSystem(); + operations.add(stream_1); + operations.add(compr); + } + + @Test + void runTest() { + operations.run(); + } } diff --git a/src/test/java/neqsim/pvtsimulation/simulation/SaturationPressureTest.java b/src/test/java/neqsim/pvtsimulation/simulation/SaturationPressureTest.java index c3aac46b0..123f3217b 100644 --- a/src/test/java/neqsim/pvtsimulation/simulation/SaturationPressureTest.java +++ b/src/test/java/neqsim/pvtsimulation/simulation/SaturationPressureTest.java @@ -8,7 +8,7 @@ class SaturationPressureTest extends neqsim.NeqSimTest { @BeforeAll - static void setUpBeforeClass() throws Exception {} + static void setUpBeforeClass() {} @Test void testCalcSaturationPressure() { diff --git a/src/test/java/neqsim/pvtsimulation/simulation/SaturationTemperatureTest.java b/src/test/java/neqsim/pvtsimulation/simulation/SaturationTemperatureTest.java index a2ca5424d..8671fdc19 100644 --- a/src/test/java/neqsim/pvtsimulation/simulation/SaturationTemperatureTest.java +++ b/src/test/java/neqsim/pvtsimulation/simulation/SaturationTemperatureTest.java @@ -2,7 +2,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import neqsim.thermo.system.SystemInterface; @@ -14,12 +13,6 @@ * @author ESOL */ class SaturationTemperatureTest extends neqsim.NeqSimTest { - /** - * @throws java.lang.Exception - */ - @BeforeAll - static void setUpBeforeClass() throws Exception {} - /** * Test method for * {@link neqsim.pvtsimulation.simulation.SaturationTemperature#calcSaturationTemperature()}. diff --git a/src/test/java/neqsim/standards/gasquality/Standard_ISO15403Test.java b/src/test/java/neqsim/standards/gasquality/Standard_ISO15403Test.java index 78c205667..cafce6227 100644 --- a/src/test/java/neqsim/standards/gasquality/Standard_ISO15403Test.java +++ b/src/test/java/neqsim/standards/gasquality/Standard_ISO15403Test.java @@ -16,7 +16,7 @@ public class Standard_ISO15403Test { * @throws java.lang.Exception */ @BeforeAll - static void setUpBeforeClass() throws Exception { + static void setUpBeforeClass() { testSystem = new SystemSrkEos(273.15 + 20.0, 1.0); testSystem.addComponent("methane", 0.82); testSystem.addComponent("ethane", 0.1); diff --git a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java index ee20348dd..1812a018e 100644 --- a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java +++ b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976Test.java @@ -19,7 +19,7 @@ class Standard_ISO6976Test extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeAll - static void setUpBeforeClass() throws Exception { + static void setUpBeforeClass() { testSystem = new SystemSrkEos(273.15 + 20.0, 1.0); testSystem.addComponent("methane", 0.931819); testSystem.addComponent("ethane", 0.025618); diff --git a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java index 36f19c84b..06f7ba338 100644 --- a/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java +++ b/src/test/java/neqsim/standards/gasquality/Standard_ISO6976_2016_Test.java @@ -19,7 +19,7 @@ class Standard_ISO6976_2016_Test extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeAll - static void setUpBeforeClass() throws Exception { + static void setUpBeforeClass() { testSystem = new SystemSrkEos(273.15 + 20.0, 1.0); testSystem.addComponent("methane", 0.931819); testSystem.addComponent("ethane", 0.025618); diff --git a/src/test/java/neqsim/standards/salescontract/BaseContractTest.java b/src/test/java/neqsim/standards/salescontract/BaseContractTest.java index c4a641f6f..41b76a81c 100644 --- a/src/test/java/neqsim/standards/salescontract/BaseContractTest.java +++ b/src/test/java/neqsim/standards/salescontract/BaseContractTest.java @@ -18,7 +18,7 @@ class BaseContractTest extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeAll - static void testRunCheck() throws Exception { + static void testRunCheck() { testSystem = new SystemGERGwaterEos(273.15 - 5.0, 20.0); testSystem.addComponent("methane", 0.9); testSystem.addComponent("ethane", 0.04); diff --git a/src/test/java/neqsim/thermo/component/AmmoniaTest.java b/src/test/java/neqsim/thermo/component/AmmoniaTest.java index adaf085eb..39e6e767b 100644 --- a/src/test/java/neqsim/thermo/component/AmmoniaTest.java +++ b/src/test/java/neqsim/thermo/component/AmmoniaTest.java @@ -15,7 +15,7 @@ public class AmmoniaTest extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeAll - static void setUpBeforeClass() throws Exception { + static void setUpBeforeClass() { thermoSystem = new SystemSrkEos(298.0, ThermodynamicConstantsInterface.referencePressure); thermoSystem.addComponent("ammonia", 1.0); thermoSystem.init(0); diff --git a/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java b/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java index 2be981574..8aff402d4 100644 --- a/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java +++ b/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java @@ -22,7 +22,7 @@ class ComponentHydrateGFTest extends neqsim.NeqSimTest { * @throws java.lang.Exception */ @BeforeAll - static void setUpBeforeClass() throws Exception { + static void setUpBeforeClass() { thermoSystem = new SystemSrkCPAstatoil(298.0, 100.0); thermoSystem.addComponent("methane", 11.0); thermoSystem.addComponent("CO2", 1.0); diff --git a/src/test/java/neqsim/thermo/component/NewComponentTest.java b/src/test/java/neqsim/thermo/component/NewComponentTest.java index 4fbad4dfa..be89520e8 100644 --- a/src/test/java/neqsim/thermo/component/NewComponentTest.java +++ b/src/test/java/neqsim/thermo/component/NewComponentTest.java @@ -2,7 +2,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import neqsim.thermo.ThermodynamicConstantsInterface; import neqsim.thermo.phase.PhaseSrkEos; @@ -13,12 +12,6 @@ public class NewComponentTest extends neqsim.NeqSimTest { static SystemInterface thermoSystem = null; - /** - * @throws java.lang.Exception - */ - @BeforeAll - static void setUpBeforeClass() throws Exception {} - @Test public void createComponentTest() { PhaseSrkEos p = new PhaseSrkEos(); diff --git a/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java b/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java index bcccb7a3f..b14f71754 100644 --- a/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java +++ b/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java @@ -2,7 +2,6 @@ import java.io.File; import java.io.IOException; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import neqsim.thermodynamicoperations.ThermodynamicOperations; @@ -19,12 +18,6 @@ class EclipseFluidReadWriteTest extends neqsim.NeqSimTest { String fileA17 = file.getAbsolutePath() + "/A-17.E300"; String fileA19 = file.getAbsolutePath() + "/A-19.E300"; - /** - * @throws java.lang.Exception - */ - @BeforeAll - static void setUpBeforeClass() throws Exception {} - /** * Test method for * {@link neqsim.thermo.util.readwrite.EclipseFluidReadWrite#read(java.lang.String)}. diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/Degasser.java b/src/test/java/neqsim/thermodynamicoperations/flashops/Degasser.java index d3ef05e85..442d0ee5c 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/Degasser.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/Degasser.java @@ -18,7 +18,7 @@ class Degasser { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { testSystem = new neqsim.thermo.system.SystemPrEos(243.15, 300.0); testSystem.addComponent("methane", 90.0); testSystem.addComponent("ethane", 0.0); diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashGERG2008Test.java b/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashGERG2008Test.java index c92f95721..1b28ae682 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashGERG2008Test.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashGERG2008Test.java @@ -16,7 +16,7 @@ class PHFlashGERG2008Test { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { testSystem = new neqsim.thermo.system.SystemPrEos(298.0, 50.0); testSystem.addComponent("nitrogen", 0.01); testSystem.addComponent("CO2", 0.01); diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashTest.java b/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashTest.java index aad34d66f..59cd53f89 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashTest.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/PHFlashTest.java @@ -16,7 +16,7 @@ class PHFlashTest { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { testSystem = new neqsim.thermo.system.SystemPrEos(243.15, 300.0); testSystem.addComponent("methane", 90.0); testSystem.addComponent("ethane", 0.0); diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/PSFlashGERG2008Test.java b/src/test/java/neqsim/thermodynamicoperations/flashops/PSFlashGERG2008Test.java index 4d32ddb7b..04a248868 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/PSFlashGERG2008Test.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/PSFlashGERG2008Test.java @@ -16,7 +16,7 @@ class PSFlashGERG2008Test { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { testSystem = new neqsim.thermo.system.SystemPrEos(298.0, 10.0); testSystem.addComponent("nitrogen", 0.01); testSystem.addComponent("CO2", 0.01); diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTest.java b/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTest.java index 1ce8297c5..26c5d8cd3 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTest.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTest.java @@ -16,7 +16,7 @@ class TPFlashTest { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { testSystem = new neqsim.thermo.system.SystemPrEos(243.15, 300.0); testSystem.addComponent("nitrogen", 1.0); testSystem.addComponent("methane", 90.0); @@ -135,8 +135,7 @@ void testRun6() { testOps = new ThermodynamicOperations(testSystem5); testOps.TPflash(); testSystem5.initProperties(); - assertEquals(0.2838675588923609 - , testSystem5.getBeta(), 1e-6); + assertEquals(0.2838675588923609, testSystem5.getBeta(), 1e-6); assertEquals(3, testSystem5.getNumberOfPhases()); } diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTestWellFluid.java b/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTestWellFluid.java index 82165c16a..4004f6b9d 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTestWellFluid.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/TPFlashTestWellFluid.java @@ -16,7 +16,7 @@ class TPFlashTestWellFluid { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { wellFluid = new neqsim.thermo.system.SystemSrkCPAstatoil(273.15 + 30.0, 65.00); wellFluid.addComponent("oxygen", 0.0); wellFluid.addComponent("H2S", 0.00008); @@ -69,7 +69,6 @@ void testTPflashComp2() { 8.96e-3, 1.539e-3, 5.9921e-1}); testOps = new ThermodynamicOperations(wellFluid); testOps.TPflash(); - assertEquals(1.432253736300898 - , wellFluid.getPhase(0).getDensity(), 1e-5); + assertEquals(1.432253736300898, wellFluid.getPhase(0).getDensity(), 1e-5); } } diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/TVFlashTest.java b/src/test/java/neqsim/thermodynamicoperations/flashops/TVFlashTest.java index d8bb5d87f..8584361ac 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/TVFlashTest.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/TVFlashTest.java @@ -23,7 +23,7 @@ class TVFlashTest { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { testSystem = new neqsim.thermo.system.SystemUMRPRUMCEos(293.15, 0.1); testSystem.addComponent("methane", 0.0); testSystem.addComponent("ethane", 0.0); diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/VUFlashTest.java b/src/test/java/neqsim/thermodynamicoperations/flashops/VUFlashTest.java index 15ade68ec..de9cb3f31 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/VUFlashTest.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/VUFlashTest.java @@ -3,7 +3,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import neqsim.thermodynamicoperations.ThermodynamicOperations; @@ -17,14 +16,6 @@ class VUFlashTest { static neqsim.thermo.system.SystemInterface testSystem2 = null; static ThermodynamicOperations testOps = null; - /** - * Sets up test system. - * - * @throws java.lang.Exception - */ - @BeforeEach - void setUp() throws Exception {} - @Test void testVUflash() { testSystem = new neqsim.thermo.system.SystemUMRPRUMCEos(293.15, 23.5); diff --git a/src/test/java/neqsim/thermodynamicoperations/flashops/WaxFlashTest.java b/src/test/java/neqsim/thermodynamicoperations/flashops/WaxFlashTest.java index 1e92fb121..4fe2b79e8 100644 --- a/src/test/java/neqsim/thermodynamicoperations/flashops/WaxFlashTest.java +++ b/src/test/java/neqsim/thermodynamicoperations/flashops/WaxFlashTest.java @@ -22,7 +22,7 @@ class WaxFlashTest { * @throws java.lang.Exception */ @BeforeEach - void setUp() throws Exception { + void setUp() { NeqSimDataBase.setCreateTemporaryTables(true); testSystem = new SystemSrkEos(273.0 + 30, 50.0); testSystem.addComponent("CO2", 0.018);