Class RecombinationFlashGenerator
java.lang.Object
neqsim.process.util.optimizer.RecombinationFlashGenerator
- All Implemented Interfaces:
Serializable
Generates feed fluids at different GOR by recombining gas and oil phases.
This is a simple, physically-based approach:
- Start with separated gas and oil phases from reference fluid
- Mix at different ratios to achieve target GOR
- Add water based on water cut
This mimics what happens in the reservoir when wells produce at different GOR:
- Low GOR: High drawdown, more liquid production, less gas liberation
- High GOR: Low drawdown or gas cap expansion, more gas
Performance Optimization
The generator includes a fluid cache keyed by (GOR, WC) to avoid regenerating the same fluid composition multiple times during parallel VFP table generation.
Usage Example
FluidMagicInput input = FluidMagicInput.fromE300File("FLUID.E300");
input.setGORRange(250, 10000);
input.setWaterCutRange(0.05, 0.60);
input.separateToStandardConditions();
RecombinationFlashGenerator generator = new RecombinationFlashGenerator(input);
// Generate fluid at GOR=1000, WC=20%
SystemInterface fluid = generator.generateFluid(1000.0, 0.20, 10000.0, 353.15, 50.0);
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate intprivate booleanprivate Map<String, SystemInterface> private SystemInterfaceprivate doubleprivate static final org.apache.logging.log4j.LoggerLogger object for class.private static final doubleMolecular weight of water in kg/kmol.private SystemInterfaceprivate doubleprivate static final longSerialization version UID.private static final doubleStandard pressure in bara (1 atm).private static final doubleStandard temperature in Kelvin (15°C).private SystemInterfaceprivate double -
Constructor Summary
ConstructorsConstructorDescriptionCreate generator from FluidMagicInput. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddScaledPhase(SystemInterface target, SystemInterface source, double factor) Add scaled phase components to target fluid.private voidCalculate standard molar volumes for each phase.voidClear the fluid cache.private SystemInterfaceCreate base fluid system for recombination.generateFluid(double targetGOR, double waterCut, double temperature, double pressure) Generate fluid at specified GOR and water cut with default rates.generateFluid(double targetGOR, double waterCut, double totalLiquidRate, double temperature, double pressure) Generate feed fluid at specified GOR and water cut.private StringgetCacheKey(double gor, double wc) Get cache key for GOR/WC combination.Get cache statistics.Get the gas phase used for recombination.Get the oil phase used for recombination.private doublegetStandardVolume(SystemInterface phase) Get standard volume of a phase.Get the water phase used for recombination.booleanCheck if caching is enabled.private voidscaleFluidToRate(SystemInterface fluid, double totalLiquidRate, double waterCut) Scale fluid to desired total liquid rate.voidsetEnableCaching(boolean enable) Enable or disable fluid caching.booleanvalidateGOR(double targetGOR, double waterCut, double tolerance) Validate that recombination produces expected GOR.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger object for class. -
MW_WATER
private static final double MW_WATERMolecular weight of water in kg/kmol.- See Also:
-
STD_TEMPERATURE_K
private static final double STD_TEMPERATURE_KStandard temperature in Kelvin (15°C).- See Also:
-
STD_PRESSURE_BARA
private static final double STD_PRESSURE_BARAStandard pressure in bara (1 atm).- See Also:
-
gasPhase
-
oilPhase
-
waterPhase
-
gasStdVolumePerMole
private double gasStdVolumePerMole -
oilStdVolumePerMole
private double oilStdVolumePerMole -
waterStdVolumePerMole
private double waterStdVolumePerMole -
fluidCache
-
enableCaching
private boolean enableCaching -
cacheHits
private int cacheHits -
cacheMisses
private int cacheMisses
-
-
Constructor Details
-
RecombinationFlashGenerator
Create generator from FluidMagicInput.- Parameters:
input- FluidMagicInput with separated phases
-
-
Method Details
-
calculateMolarVolumes
private void calculateMolarVolumes()Calculate standard molar volumes for each phase. -
generateFluid
public SystemInterface generateFluid(double targetGOR, double waterCut, double totalLiquidRate, double temperature, double pressure) Generate feed fluid at specified GOR and water cut.Uses recombination flash: mix gas and oil at ratio to achieve target GOR, then add water based on water cut.
- Parameters:
targetGOR- target GOR in Sm3/Sm3waterCut- water cut as fraction (0-1)totalLiquidRate- total liquid rate (oil + water) in Sm3/hrtemperature- temperature in Kpressure- pressure in bara- Returns:
- recombined fluid at specified conditions
-
generateFluid
public SystemInterface generateFluid(double targetGOR, double waterCut, double temperature, double pressure) Generate fluid at specified GOR and water cut with default rates.- Parameters:
targetGOR- target GOR in Sm3/Sm3waterCut- water cut as fraction (0-1)temperature- temperature in Kpressure- pressure in bara- Returns:
- recombined fluid
-
createBaseFluid
Create base fluid system for recombination.- Returns:
- empty fluid system
-
getStandardVolume
Get standard volume of a phase.- Parameters:
phase- the phase- Returns:
- volume at standard conditions in m3
-
addScaledPhase
Add scaled phase components to target fluid.- Parameters:
target- target fluid to add components tosource- source phase with componentsfactor- scaling factor for moles
-
scaleFluidToRate
Scale fluid to desired total liquid rate.- Parameters:
fluid- the fluid to scaletotalLiquidRate- desired total liquid rate in Sm3/hrwaterCut- water cut fraction
-
getCacheKey
Get cache key for GOR/WC combination.- Parameters:
gor- GOR valuewc- water cut value- Returns:
- cache key string
-
clearCache
public void clearCache()Clear the fluid cache. -
getCacheStatistics
Get cache statistics.- Returns:
- string with cache hit/miss statistics
-
setEnableCaching
public void setEnableCaching(boolean enable) Enable or disable fluid caching.- Parameters:
enable- true to enable caching
-
isEnableCaching
public boolean isEnableCaching()Check if caching is enabled.- Returns:
- true if caching is enabled
-
validateGOR
public boolean validateGOR(double targetGOR, double waterCut, double tolerance) Validate that recombination produces expected GOR.This method is useful for testing and verification.
- Parameters:
targetGOR- target GOR in Sm3/Sm3waterCut- water cut fractiontolerance- acceptable relative error (e.g., 0.05 for 5%)- Returns:
- true if actual GOR is within tolerance of target
-
getGasPhase
-
getOilPhase
-
getWaterPhase
Get the water phase used for recombination.- Returns:
- water phase
-