Skip to content

Commit

Permalink
update (#1246)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored Jan 9, 2025
1 parent e483963 commit b9019a3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/neqsim/process/equipment/stream/Stream.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/neqsim/process/equipment/stream/StreamInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/**
* <p>
* setFluid.
Expand Down Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);


}
}

0 comments on commit b9019a3

Please sign in to comment.