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
* 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
.
+ *
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);