diff --git a/src/main/java/neqsim/physicalproperties/physicalpropertymethods/commonphasephysicalproperties/viscosity/PFCTViscosityMethodMod86.java b/src/main/java/neqsim/physicalproperties/physicalpropertymethods/commonphasephysicalproperties/viscosity/PFCTViscosityMethodMod86.java index 3e3dcb5b57..f70fe1e696 100644 --- a/src/main/java/neqsim/physicalproperties/physicalpropertymethods/commonphasephysicalproperties/viscosity/PFCTViscosityMethodMod86.java +++ b/src/main/java/neqsim/physicalproperties/physicalpropertymethods/commonphasephysicalproperties/viscosity/PFCTViscosityMethodMod86.java @@ -56,14 +56,10 @@ public PFCTViscosityMethodMod86( /** {@inheritDoc} */ @Override public double calcViscosity() { - double Pc0 = referenceSystem.getPhase(0).getComponent(0).getPC(); - double Tc0 = referenceSystem.getPhase(0).getComponent(0).getTC(); - double M0 = referenceSystem.getPhase(0).getComponent(0).getMolarMass() * 1e3; + final double Pc0 = referenceSystem.getPhase(0).getComponent(0).getPC(); + final double Tc0 = referenceSystem.getPhase(0).getComponent(0).getTC(); + final double M0 = referenceSystem.getPhase(0).getComponent(0).getMolarMass() * 1e3; double PCmix = 0.0; - double TCmix = 0.0; - double Mmix = 0.0; - double alfa0 = 1.0; - double alfaMix = 1.0; double tempTC1 = 0.0; double tempTC2 = 0.0; double tempPC1 = 0.0; @@ -97,8 +93,9 @@ public double calcViscosity() { return 0.0; } PCmix = 8.0 * tempPC1 / (tempPC2 * tempPC2); - TCmix = tempTC1 / tempTC2; - Mmix = (Mmtemp + 1.304e-4 * (Math.pow(Mwtemp / Mmtemp, 2.303) - Math.pow(Mmtemp, 2.303))) * 1e3; // phase.getPhase().getMolarMass(); + double TCmix = tempTC1 / tempTC2; + double Mmix = + (Mmtemp + 1.304e-4 * (Math.pow(Mwtemp / Mmtemp, 2.303) - Math.pow(Mmtemp, 2.303))) * 1e3; // phase.getPhase().getMolarMass(); referenceSystem.setTemperature(phase.getPhase().getTemperature() * referenceSystem.getPhase(0).getComponent(0).getTC() / TCmix); @@ -112,8 +109,8 @@ public double calcViscosity() { double critMolDens = 10.15; // 1.0/referenceSystem.getPhase(0).getComponent(0).getCriticalVolume(); double redDens = molDens / critMolDens; - alfaMix = 1.0 + 7.378e-3 * Math.pow(redDens, 1.847) * Math.pow(Mmix, 0.5173); - alfa0 = 1.0 + 7.378e-3 * Math.pow(redDens, 1.847) + double alfaMix = 1.0 + 7.378e-3 * Math.pow(redDens, 1.847) * Math.pow(Mmix, 0.5173); + double alfa0 = 1.0 + 7.378e-3 * Math.pow(redDens, 1.847) * Math.pow(referenceSystem.getMolarMass() * 1.0e3, 0.5173); // alfa0 = 1.0 + 8.374e-4 * Math.pow(redDens, 4.265); // System.out.println("func " + 7.475e-5*Math.pow(16.043, 0.8579)); diff --git a/src/main/java/neqsim/processsimulation/measurementdevice/HydrateEquilibriumTemperatureAnalyser.java b/src/main/java/neqsim/processsimulation/measurementdevice/HydrateEquilibriumTemperatureAnalyser.java index 4dba3085fb..a280292a02 100644 --- a/src/main/java/neqsim/processsimulation/measurementdevice/HydrateEquilibriumTemperatureAnalyser.java +++ b/src/main/java/neqsim/processsimulation/measurementdevice/HydrateEquilibriumTemperatureAnalyser.java @@ -20,17 +20,6 @@ public class HydrateEquilibriumTemperatureAnalyser extends StreamMeasurementDevi private double referencePressure = 0; - /** - *
- * Constructor for HydrateEquilibriumTemperatureAnalyser. - *
- * - * @param stream a {@link neqsim.processsimulation.processequipment.stream.StreamInterface} object - */ - public HydrateEquilibriumTemperatureAnalyser(StreamInterface stream) { - this("HydrateEquilibriumTemperatureAnalyser", stream); - } - /** *
* Constructor for HydrateEquilibriumTemperatureAnalyser.
@@ -40,7 +29,7 @@ public HydrateEquilibriumTemperatureAnalyser(StreamInterface stream) {
* @param stream a {@link neqsim.processsimulation.processequipment.stream.StreamInterface} object
*/
public HydrateEquilibriumTemperatureAnalyser(String name, StreamInterface stream) {
- super("HydrateEquilibriumTemperatureAnalyser", "K", stream);
+ super(name, "K", stream);
setConditionAnalysisMaxDeviation(1.0);
}
diff --git a/src/main/java/neqsim/processsimulation/measurementdevice/simpleflowregime/Pipe.java b/src/main/java/neqsim/processsimulation/measurementdevice/simpleflowregime/Pipe.java
index 5d98257f6d..98a26febea 100644
--- a/src/main/java/neqsim/processsimulation/measurementdevice/simpleflowregime/Pipe.java
+++ b/src/main/java/neqsim/processsimulation/measurementdevice/simpleflowregime/Pipe.java
@@ -1,4 +1,3 @@
-// Create a Pipe Object
package neqsim.processsimulation.measurementdevice.simpleflowregime;
/**
@@ -10,22 +9,13 @@
* @version $Id: $Id
*/
public class Pipe {
- private String name = "Default severe slug pipe";
+ private String name;
private double internalDiameter = 0.05;
private double leftLength = 167.0;
private double rightLength = 7.7;
private double angle = 2.0;
final double pi = 3.1415926;
- // Default Constructor:
- Pipe() {
- this.setName(name);
- this.setInternalDiameter(internalDiameter);
- this.setLeftLength(leftLength);
- this.setRightLength(rightLength);
- this.setAngle(angle);
- }
-
// User Defined pipe parameters including pipe name (constructor):
Pipe(String name, double internalDiameter, double leftLength, double rightLength, double angle) {
this.setName(name);
@@ -35,14 +25,6 @@ public class Pipe {
this.setAngle(angle);
}
- // User Defined pipe parameters excluding pipe name (constructor):
- Pipe(double internalDiameter, double leftLength, double rightLength, double angle) {
- this.setInternalDiameter(internalDiameter);
- this.setLeftLength(leftLength);
- this.setRightLength(rightLength);
- this.setAngle(angle);
- }
-
// Encapsulation: Get and Set Methods. This keyword referes to the current object
// 1. Pipe name encapsulation
/**
@@ -153,15 +135,17 @@ public void setAngle(double angle) {
* Getter for the field angle
.
*
* setSuperficialLiquidVelocity.
@@ -312,7 +330,7 @@ public double getSlugValue() {
* Setter for the field outletPressure
.
*
outletPressure
.
*
*
- * @return a double
+ * @return Get pressure in Pa
*/
public double getOutletPressure() {
return outletPressure;
@@ -684,8 +702,8 @@ public double getMeasuredValue(String unit) {
}
fluidSevereS = new FluidSevereSlug(fluid);
usg = fluid.getPhase(0).getFlowRate("m3/sec") / pipe.getArea();
- severeSlug = new SevereSlugAnalyser(usl, usg, outletPressure, temperature, simulationTime,
- numberOfTimeSteps);
+ severeSlug = new SevereSlugAnalyser("tmp", usl, usg, outletPressure, temperature,
+ simulationTime, numberOfTimeSteps);
checkFlowRegime(fluidSevereS, pipe, severeSlug);
return slugValue;
}
@@ -717,7 +735,6 @@ public double getMeasuredValue(FluidSevereSlug fluid, Pipe pipe, SevereSlugAnaly
* @return a {@link java.lang.String} object
*/
public String getPredictedFlowRegime() {
- logger.debug(angle);
SystemInterface fluid = streamS.getThermoSystem();
ThermodynamicOperations ops = new ThermodynamicOperations(fluid);
ops.TPflash();
@@ -735,8 +752,8 @@ public String getPredictedFlowRegime() {
}
fluidSevereS = new FluidSevereSlug(fluid);
usg = fluid.getPhase(0).getFlowRate("m3/sec") / pipe.getArea();
- severeSlug = new SevereSlugAnalyser(usl, usg, outletPressure, temperature, simulationTime,
- numberOfTimeSteps);
+ severeSlug = new SevereSlugAnalyser("tmp", usl, usg, outletPressure, temperature,
+ simulationTime, numberOfTimeSteps);
checkFlowRegime(fluidSevereS, pipe, severeSlug);
}
return flowPattern;
@@ -778,7 +795,7 @@ public static void main(String[] args) {
testSystem.init(0);
Stream inputStream = new Stream("inputStream", testSystem);
SevereSlugAnalyser mySevereSlug4 =
- new SevereSlugAnalyser(inputStream, 0.05, 167, 7.7, 2, 100000.0, 20.0, 200.0, 20000);
+ new SevereSlugAnalyser("tmp", inputStream, 0.05, 167, 7.7, 2, 100000.0, 20.0, 200.0, 20000);
logger.debug(inputStream.getFlowRate("kg/sec"));
mySevereSlug4.getPredictedFlowRegime();
// inputStream.setFlowRate(0.00001, "MSm^3/day");
diff --git a/src/main/java/neqsim/processsimulation/processequipment/manifold/Manifold.java b/src/main/java/neqsim/processsimulation/processequipment/manifold/Manifold.java
index d58b4134ba..2d1ad5de05 100644
--- a/src/main/java/neqsim/processsimulation/processequipment/manifold/Manifold.java
+++ b/src/main/java/neqsim/processsimulation/processequipment/manifold/Manifold.java
@@ -22,29 +22,21 @@ public class Manifold extends ProcessEquipmentBaseClass {
private static final long serialVersionUID = 1000;
static Logger logger = LogManager.getLogger(Manifold.class);
- protected Mixer localmixer = new Mixer("local mixer");
- protected Splitter localsplitter = new Splitter("local splitter");
+ protected Mixer localmixer = new Mixer("tmpName");
+ protected Splitter localsplitter = new Splitter("tmpName");
double[] splitFactors = new double[1];
/**
* - * Constructor for Splitter. - *
- */ - public Manifold() { - super("Manifold"); - } - - /** - *- * Constructor for Splitter with name as input. + * Constructor for Manifold with name as input. *
* * @param name name of manifold */ public Manifold(String name) { super(name); + setName(name); } /** @@ -73,7 +65,9 @@ public void setSplitFactors(double[] splitFact) { } /** - *getSplitStream.
+ *+ * getSplitStream. + *
* * @param i a int * @return a {@link neqsim.processsimulation.processequipment.stream.StreamInterface} object @@ -100,4 +94,12 @@ public void run(UUID id) { localsplitter.setInletStream(localmixer.getOutletStream()); localsplitter.run(); } + + /** {@inheritDoc} */ + @Override + public void setName(String name) { + super.setName(name); + localmixer.setName(name + "local mixer"); + localsplitter.setName(name + "local splitter"); + } } diff --git a/src/main/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitter.java b/src/main/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitter.java index 07119b7642..ffe6f50f8c 100644 --- a/src/main/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitter.java +++ b/src/main/java/neqsim/processsimulation/processequipment/splitter/ComponentSplitter.java @@ -27,15 +27,6 @@ public class ComponentSplitter extends ProcessEquipmentBaseClass { protected int splitNumber = 1; double[] splitFactor = new double[1]; - /** - *- * Constructor for Splitter. - *
- */ - public ComponentSplitter() { - super("Component Splitter"); - } - /** * Constructor for Splitter. * diff --git a/src/main/java/neqsim/processsimulation/processequipment/util/StreamTransition.java b/src/main/java/neqsim/processsimulation/processequipment/util/StreamTransition.java index f1a60243fd..091ab31780 100644 --- a/src/main/java/neqsim/processsimulation/processequipment/util/StreamTransition.java +++ b/src/main/java/neqsim/processsimulation/processequipment/util/StreamTransition.java @@ -17,31 +17,6 @@ public class StreamTransition extends TwoPortEquipment { private static final long serialVersionUID = 1L; - /** - *- * Constructor for StreamTransition. - *
- */ - @Deprecated - public StreamTransition() { - super("StreamTransition"); - } - - /** - *- * Constructor for StreamTransition. - *
- * - * @param inletStream a {@link neqsim.processsimulation.processequipment.stream.StreamInterface} - * object - * @param outletStream a {@link neqsim.processsimulation.processequipment.stream.StreamInterface} - * object - */ - @Deprecated - public StreamTransition(StreamInterface inletStream, StreamInterface outletStream) { - this("StreamTransition", inletStream, outletStream); - } - /** ** Constructor for StreamTransition. @@ -104,7 +79,7 @@ public static void main(String[] args) { ProcessSystem offshoreProcessoperations = ProcessSystem.open("c:/temp/offshorePro.neqsim"); ProcessSystem TEGprocess = ProcessSystem.open("c:/temp//TEGprocessHX.neqsim"); StreamTransition trans = - new StreamTransition((StreamInterface) offshoreProcessoperations.getUnit("rich gas"), + new StreamTransition("tmp", (StreamInterface) offshoreProcessoperations.getUnit("rich gas"), (StreamInterface) TEGprocess.getUnit("dry feed gas")); UUID id = UUID.randomUUID(); diff --git a/src/test/java/neqsim/processsimulation/measurementdevice/simpleflowregime/SevereSlugTest.java b/src/test/java/neqsim/processsimulation/measurementdevice/simpleflowregime/SevereSlugTest.java index 8d47db4019..a591813e51 100644 --- a/src/test/java/neqsim/processsimulation/measurementdevice/simpleflowregime/SevereSlugTest.java +++ b/src/test/java/neqsim/processsimulation/measurementdevice/simpleflowregime/SevereSlugTest.java @@ -18,7 +18,8 @@ void testCheckFlowRegime1() { testSystem2.init(0); Stream inputStream3 = new Stream("test stream", testSystem2); - SevereSlugAnalyser mySevereSlug6 = new SevereSlugAnalyser(inputStream3, 0.05, 167, 7.7, 0.1); + SevereSlugAnalyser mySevereSlug6 = + new SevereSlugAnalyser("tmp", inputStream3, 0.05, 167, 7.7, 0.1); assertEquals(mySevereSlug6.getPredictedFlowRegime(), "Severe Slug", ""); assertEquals(0.19085996383839476, mySevereSlug6.getMeasuredValue(), 1e-1, ""); } diff --git a/src/test/java/neqsim/thermo/system/SystemThermoTest.java b/src/test/java/neqsim/thermo/system/SystemThermoTest.java index b70e78b437..905fdd96e3 100644 --- a/src/test/java/neqsim/thermo/system/SystemThermoTest.java +++ b/src/test/java/neqsim/thermo/system/SystemThermoTest.java @@ -131,7 +131,6 @@ void TESTsetForceSinglePhase() { testOps.TPflash(); testSystem.initProperties(); - double density = testSystem.getDensity("kg/m3"); testSystem.setForceSinglePhase(PhaseType.GAS); @@ -144,7 +143,5 @@ void TESTsetForceSinglePhase() { testSystem.initProperties(); assertEquals(density, testSystem.getDensity("kg/m3"), 1e-4); - - } }