diff --git a/src/main/java/neqsim/process/equipment/stream/Stream.java b/src/main/java/neqsim/process/equipment/stream/Stream.java index 59571daf9..ed8edb8d7 100644 --- a/src/main/java/neqsim/process/equipment/stream/Stream.java +++ b/src/main/java/neqsim/process/equipment/stream/Stream.java @@ -14,6 +14,7 @@ import org.apache.logging.log4j.Logger; import com.google.gson.GsonBuilder; import neqsim.process.equipment.ProcessEquipmentBaseClass; +import neqsim.process.measurementdevice.HydrocarbonDewPointAnalyser; import neqsim.process.util.monitor.StreamResponse; import neqsim.standards.gasquality.Standard_ISO6976; import neqsim.standards.oilquality.Standard_ASTM_D6377; @@ -558,6 +559,18 @@ public double getRVP(double referenceTemperature, String unit, String returnUnit return standard.getValue("RVP", returnUnit); } + /** {@inheritDoc} */ + @Override + public double getRVP(double referenceTemperature, String unit, String returnUnit, + String rvpMethod) { + SystemInterface localSyst = getFluid().clone(); + Standard_ASTM_D6377 standard = new Standard_ASTM_D6377(localSyst); + standard.setReferenceTemperature(referenceTemperature, unit); + standard.setMethodRVP(rvpMethod); + standard.calculate(); + return standard.getValue("RVP", returnUnit); + } + /** {@inheritDoc} */ @Override public String[][] reportResults() { @@ -595,6 +608,16 @@ public double GCV() { return standard.getValue("GCV") * 1.0e3; } + /** {@inheritDoc} */ + @Override + public double getHydrocarbonDewPoint(String temperatureUnit, double refpressure, + String refPressureUnit) { + HydrocarbonDewPointAnalyser dewPointAnalyser = + new HydrocarbonDewPointAnalyser("dew point analyser", this); + dewPointAnalyser.setReferencePressure(refpressure); + return dewPointAnalyser.getMeasuredValue(temperatureUnit); + } + /** {@inheritDoc} */ @Override public double getGCV(String unit, double refTVolume, double refTCombustion) { diff --git a/src/main/java/neqsim/process/equipment/stream/StreamInterface.java b/src/main/java/neqsim/process/equipment/stream/StreamInterface.java index a647b4edf..65c1a79f4 100644 --- a/src/main/java/neqsim/process/equipment/stream/StreamInterface.java +++ b/src/main/java/neqsim/process/equipment/stream/StreamInterface.java @@ -154,6 +154,19 @@ public default double getFlowRate(String unit) { */ public double getRVP(double referenceTemperature, String unit, String returnUnit); + + /** + * Calculates the Reid Vapor Pressure (RVP) of the stream. + * + * @param referenceTemperature the reference temperature at which RVP is calculated + * @param unit the unit of the reference temperature + * @param returnUnit the unit in which the RVP should be returned + * @param rvpMethod the method used to calculate RVP + * @return the calculated RVP in the specified return unit + */ + public double getRVP(double referenceTemperature, String unit, String returnUnit, + String rvpMethod); + /** *
* setFluid. @@ -307,4 +320,17 @@ public default double getFlowRate(String unit) { /** {@inheritDoc} */ @Override public int hashCode(); + + + /** + * Calculates the hydrocarbon dew point of the stream. + * + * @param temperatureUnit the unit of the temperature to be used (e.g., "C" for Celsius, "K" for + * Kelvin) + * @param refpressure the reference pressure at which the dew point is to be calculated + * @param refPressureUnit the unit of the reference pressure (e.g., "bar", "Pa") + * @return the hydrocarbon dew point temperature in the specified temperature unit + */ + public double getHydrocarbonDewPoint(String temperatureUnit, double refpressure, + String refPressureUnit); } diff --git a/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java b/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java index 9c75cf8d9..05c069d8c 100644 --- a/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java +++ b/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java @@ -32,6 +32,8 @@ void testHCdewPoint() { hc_analyser.getMeasuredValue("C"); Assertions.assertEquals(-14.0173918, hc_analyser.getMeasuredValue("C"), 1e-5); + Assertions.assertEquals(-14.0173918, stream1.getHydrocarbonDewPoint("C", 40.0, "bara"), 1e-5); + } }