Class VirtualFlowMeter
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.measurementdevice.MeasurementDeviceBaseClass
neqsim.process.measurementdevice.StreamMeasurementDeviceBaseClass
neqsim.process.measurementdevice.vfm.VirtualFlowMeter
- All Implemented Interfaces:
Serializable, MeasurementDeviceInterface, NamedInterface
Virtual Flow Meter for calculating multiphase flow rates from pressure and temperature
measurements.
This class implements a physics-based virtual flow meter using NeqSim's thermodynamic models to estimate oil, gas, and water flow rates. It is designed for integration with AI-powered production optimization platforms that require accurate flow estimates with uncertainty quantification.
Key features:
- Thermodynamic flash calculations for phase split
- Uncertainty propagation from input measurements
- Online calibration with well test data
- Quality indicators for result confidence
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWell test data for VFM calibration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate List<VirtualFlowMeter.WellTestData> private doubleprivate doubleprivate doubleprivate Instantprivate VFMResultprivate doubleprivate static final longprivate doubleprivate doubleprivate doubleFields inherited from class StreamMeasurementDeviceBaseClass
streamFields inherited from class MeasurementDeviceBaseClass
unitFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionVirtualFlowMeter(String name, StreamInterface stream) Creates a new Virtual Flow Meter. -
Method Summary
Modifier and TypeMethodDescriptionCalculates flow rates from current measurements.calculateFlowRates(double pressure, double differentialPressure, double temperature) Calculates flow rates from specified P, T, dP conditions.private doublecalculateUncertainty(double rate, double pressureUncert, double tempUncert) Calculates uncertainty using simplified error propagation.voidcalibrate(List<VirtualFlowMeter.WellTestData> wellTests) Calibrates the VFM using well test data.private VFMResult.QualitydetermineQuality(double pressure, double temperature) Determines result quality based on operating conditions and calibration.doubleGets the calibration factor.Gets the last calibration timestamp.Gets the last calculated result.doublegetMeasuredValue(String unit) Get Measured value in specified unit.Gets uncertainty bounds for the current measurement.voidsetChokeOpening(double opening) Sets the choke opening.voidsetDownstreamPressure(double pressure) Sets the downstream pressure measurement.voidsetFlowCoefficient(double coefficient) Sets the flow coefficient (Cv-like parameter).voidsetMeasurementUncertainties(double pressureRelative, double temperatureAbsolute) Sets the measurement uncertainties.voidsetTemperature(double temperature) Sets the temperature measurement.voidsetUpstreamPressure(double pressure) Sets the upstream pressure measurement.Methods inherited from class StreamMeasurementDeviceBaseClass
getStream, setStreamMethods inherited from class MeasurementDeviceBaseClass
acknowledgeAlarm, applySignalModifiers, displayResult, doConditionAnalysis, evaluateAlarm, getAlarmConfig, getAlarmState, getConditionAnalysisMaxDeviation, getConditionAnalysisMessage, getDelaySteps, getMaximumValue, getMeasuredPercentValue, getMinimumValue, getNoiseStdDev, getOnlineMeasurementValue, getOnlineSignal, getUnit, isLogging, isOnlineSignal, runConditionAnalysis, setAlarmConfig, setConditionAnalysis, setConditionAnalysisMaxDeviation, setDelaySteps, setIsOnlineSignal, setLogging, setMaximumValue, setMinimumValue, setNoiseStdDev, setOnlineMeasurementValue, setOnlineSignal, setQualityCheckMessage, setRandomSeed, setUnitMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MeasurementDeviceInterface
equals, getMeasuredValue, getOnlineValue, hashCodeMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagName
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
upstreamPressure
private double upstreamPressure -
downstreamPressure
private double downstreamPressure -
temperature
private double temperature -
chokeOpening
private double chokeOpening -
pressureUncertainty
private double pressureUncertainty -
temperatureUncertainty
private double temperatureUncertainty -
flowCoefficient
private double flowCoefficient -
calibrationFactor
private double calibrationFactor -
calibrationHistory
-
lastCalibration
-
lastResult
-
-
Constructor Details
-
VirtualFlowMeter
Creates a new Virtual Flow Meter.- Parameters:
name- the meter name/tagstream- the stream to measure
-
-
Method Details
-
setUpstreamPressure
public void setUpstreamPressure(double pressure) Sets the upstream pressure measurement.- Parameters:
pressure- pressure in bara
-
setDownstreamPressure
public void setDownstreamPressure(double pressure) Sets the downstream pressure measurement.- Parameters:
pressure- pressure in bara
-
setTemperature
public void setTemperature(double temperature) Sets the temperature measurement.- Parameters:
temperature- temperature in K
-
setChokeOpening
public void setChokeOpening(double opening) Sets the choke opening.- Parameters:
opening- choke opening in percent (0-100)
-
setMeasurementUncertainties
public void setMeasurementUncertainties(double pressureRelative, double temperatureAbsolute) Sets the measurement uncertainties.- Parameters:
pressureRelative- relative pressure uncertainty (e.g., 0.01 for 1%)temperatureAbsolute- absolute temperature uncertainty in K
-
calculateFlowRates
Calculates flow rates from current measurements.- Returns:
- VFM result with flow rates and uncertainties
-
calculateFlowRates
public VFMResult calculateFlowRates(double pressure, double differentialPressure, double temperature) Calculates flow rates from specified P, T, dP conditions.- Parameters:
pressure- upstream pressure in baradifferentialPressure- pressure drop in bartemperature- temperature in K- Returns:
- VFM result with flow rates and uncertainties
-
calculateUncertainty
private double calculateUncertainty(double rate, double pressureUncert, double tempUncert) Calculates uncertainty using simplified error propagation.- Parameters:
rate- phase flow rate in Sm3/dpressureUncert- relative pressure uncertainty (fraction)tempUncert- absolute temperature uncertainty (K)- Returns:
- one standard deviation of the flow-rate estimate
-
determineQuality
Determines result quality based on operating conditions and calibration.- Parameters:
pressure- current operating pressure in baratemperature- current operating temperature in Kelvin- Returns:
- quality indicator based on calibration range and age
-
calibrate
Calibrates the VFM using well test data.- Parameters:
wellTests- list of well test measurements
-
getLastResult
-
getUncertaintyBounds
Gets uncertainty bounds for the current measurement.- Returns:
- uncertainty bounds for total flow rate
-
getMeasuredValue
Description copied from class:MeasurementDeviceBaseClassGet Measured value in specified unit.
- Specified by:
getMeasuredValuein interfaceMeasurementDeviceInterface- Overrides:
getMeasuredValuein classMeasurementDeviceBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
setFlowCoefficient
public void setFlowCoefficient(double coefficient) Sets the flow coefficient (Cv-like parameter).- Parameters:
coefficient- the flow coefficient
-
getCalibrationFactor
public double getCalibrationFactor()Gets the calibration factor.- Returns:
- the calibration factor
-
getLastCalibrationTime
Gets the last calibration timestamp.- Returns:
- the last calibration time or null
-