diff --git a/src/main/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyser.java b/src/main/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyser.java new file mode 100644 index 000000000..ce9cbf096 --- /dev/null +++ b/src/main/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyser.java @@ -0,0 +1,126 @@ +package neqsim.process.measurementdevice; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import neqsim.process.equipment.stream.StreamInterface; +import neqsim.thermo.system.SystemInterface; +import neqsim.thermodynamicoperations.ThermodynamicOperations; +import neqsim.util.ExcludeFromJacocoGeneratedReport; + +/** + *
+ * WaterDewPointAnalyser class. + *
+ * + * @author ESOL + * @version $Id: $Id + */ +public class HydrocarbonDewPointAnalyser extends StreamMeasurementDeviceBaseClass { + /** Serialization version UID. */ + private static final long serialVersionUID = 1000; + /** Logger object for class. */ + static Logger logger = LogManager.getLogger(WaterDewPointAnalyser.class); + + private double referencePressure = 50.0; + private String method = "EOS"; + + /** + *+ * Constructor for WaterDewPointAnalyser. + *
+ * + * @param stream a {@link neqsim.process.equipment.stream.StreamInterface} object + */ + public HydrocarbonDewPointAnalyser(StreamInterface stream) { + this("HydrocarbonDewPointAnalyser", stream); + } + + /** + *+ * Constructor for WaterDewPointAnalyser. + *
+ * + * @param name Name of WaterDewPointAnalyser + * @param stream a {@link neqsim.process.equipment.stream.StreamInterface} object + */ + public HydrocarbonDewPointAnalyser(String name, StreamInterface stream) { + super(name, "K", stream); + setConditionAnalysisMaxDeviation(1.0); + } + + /** {@inheritDoc} */ + @Override + @ExcludeFromJacocoGeneratedReport + public void displayResult() { + try { + // System.out.println("total water production [kg/dag]" + + // stream.getThermoSystem().getPhase(0).getComponent("water").getNumberOfmoles() * + // stream.getThermoSystem().getPhase(0).getComponent("water").getMolarMass()*3600*24); + // System.out.println("water in phase 1 (ppm) " + + // stream.getThermoSystem().getPhase(0).getComponent("water").getx()*1e6); + } finally { + } + } + + /** {@inheritDoc} */ + @Override + public double getMeasuredValue(String unit) { + SystemInterface tempFluid = stream.getThermoSystem().clone(); + if (tempFluid.hasComponent("water")) { + tempFluid.removeComponent("water"); + } + tempFluid.setPressure(referencePressure); + tempFluid.setTemperature(-10.0, "C"); + ThermodynamicOperations thermoOps = new ThermodynamicOperations(tempFluid); + try { + thermoOps.dewPointTemperatureFlash(false); + } catch (Exception ex) { + logger.error(ex.getMessage(), ex); + } + return tempFluid.getTemperature(unit); + } + + /** + *
+ * Getter for the field referencePressure
.
+ *
+ * Setter for the field referencePressure
.
+ *
+ * Getter for the field method
.
+ *
+ * Setter for the field method
.
+ *