Class EclipseFluidReadWrite
EclipseFluidReadWrite class.
- Version:
- $Id: $Id
- Author:
- asmund
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static org.apache.logging.log4j.LoggerLogger object for class.static StringConstantpseudoName="" -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddWaterToFluid(SystemInterface fluid, double waterKij) Add a water component to an existing fluid with specified binary interaction parameters.private static voidapplyLBCViscosityModel(SystemInterface fluid, double[] lbcParams) Apply LBC viscosity model with custom parameters to fluid.private static voidApply PFCT (Pedersen) viscosity model to all phases.private static double[][]Gets binary interaction parameters from fluid.private static StringgetEOSType(SystemInterface fluid) Determines the EOS type string for the fluid.private static double[]Get LBC parameters from fluid if LBC viscosity model is active.private static booleanCheck if PFCT (Pedersen) viscosity model is active on any phase.static SystemInterfaceread.static SystemInterfaceRead an Eclipse E300 fluid file and optionally add a water component.static SystemInterfaceRead an Eclipse E300 fluid file and optionally add a water component with a custom kij value.static SystemInterfaceread.static SystemInterfaceread.static SystemInterfaceRead an Eclipse E300 fluid file with a pseudo-name suffix and optionally add a water component.static SystemInterfaceRead an Eclipse E300 fluid file with a pseudo-name suffix and optionally add a water component with a custom kij value.static SystemInterfacereadE300File(String inputFile) readE300File.static voidsetComposition(SystemInterface fluid, String inputFile) setComposition.static voidsetComposition(SystemInterface fluid, String inputFile, String pseudoNameIn) setComposition.private static StringshortenComponentName(String name) Shortens component names to E300 compatible format.static StringtoE300String(SystemInterface fluid) Convert a NeqSim fluid to Eclipse E300 format string.static StringtoE300String(SystemInterface fluid, double reservoirTempC) Convert a NeqSim fluid to Eclipse E300 format string.static voidwrite(SystemInterface fluid, String outputFile) Write a NeqSim fluid to Eclipse E300 compositional EOS file format.static voidwrite(SystemInterface fluid, String outputFile, double reservoirTempC) Write a NeqSim fluid to Eclipse E300 compositional EOS file format.static voidwrite(SystemInterface fluid, Path outputPath, double reservoirTempC) Write a NeqSim fluid to Eclipse E300 compositional EOS file format.private static voidwriteToWriter(SystemInterface fluid, Writer writer, double reservoirTempC) Internal method to write E300 content to a Writer.
-
Field Details
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
pseudoName
ConstantpseudoName=""
-
-
Constructor Details
-
EclipseFluidReadWrite
public EclipseFluidReadWrite()
-
-
Method Details
-
setComposition
setComposition.
- Parameters:
fluid- aSystemInterfaceobjectinputFile- aStringobjectpseudoNameIn- aStringobject
-
setComposition
setComposition.
- Parameters:
fluid- aSystemInterfaceobjectinputFile- aStringobject
-
read
read.
- Parameters:
inputFile- aStringobjectpseudoNameIn- aStringobject- Returns:
- a
SystemInterfaceobject
-
read
read.
- Parameters:
inputFile- aStringobject- Returns:
- a
SystemInterfaceobject - Throws:
IllegalArgumentException- if the input file does not exist or cannot be read
-
read
Read an Eclipse E300 fluid file and optionally add a water component.When
addWateris true and the fluid does not already contain water, a water component is added with zero mole fraction and binary interaction parameters (kij) of 0.5 against all other components. This matches the water parameterization used in PVTsim-generated E300 files (e.g., osebergfluid_water.e300). Multi-phase check is also enabled so that an aqueous phase can form.- Parameters:
inputFile- path to the Eclipse E300 fluid fileaddWater- if true, add a water component with default kij = 0.5- Returns:
- a
SystemInterfaceobject - Throws:
IllegalArgumentException- if the input file does not exist or cannot be read
-
read
Read an Eclipse E300 fluid file and optionally add a water component with a custom kij value.When
addWateris true and the fluid does not already contain water, a water component is added with zero mole fraction and the specified binary interaction parameter (kij) against all other components. Multi-phase check is enabled so that an aqueous phase can form.- Parameters:
inputFile- path to the Eclipse E300 fluid fileaddWater- if true, add a water componentwaterKij- binary interaction parameter between water and all other components (typical value: 0.5)- Returns:
- a
SystemInterfaceobject - Throws:
IllegalArgumentException- if the input file does not exist or cannot be read
-
read
Read an Eclipse E300 fluid file with a pseudo-name suffix and optionally add a water component.- Parameters:
inputFile- path to the Eclipse E300 fluid filepseudoNameIn- pseudo-name suffix appended to pseudo-component namesaddWater- if true, add a water component with default kij = 0.5- Returns:
- a
SystemInterfaceobject - Throws:
IllegalArgumentException- if the input file does not exist or cannot be read
-
read
public static SystemInterface read(String inputFile, String pseudoNameIn, boolean addWater, double waterKij) Read an Eclipse E300 fluid file with a pseudo-name suffix and optionally add a water component with a custom kij value.- Parameters:
inputFile- path to the Eclipse E300 fluid filepseudoNameIn- pseudo-name suffix appended to pseudo-component namesaddWater- if true, add a water componentwaterKij- binary interaction parameter between water and all other components- Returns:
- a
SystemInterfaceobject - Throws:
IllegalArgumentException- if the input file does not exist or cannot be read
-
addWaterToFluid
Add a water component to an existing fluid with specified binary interaction parameters.This method adds water as a component with zero mole fraction to a fluid that was typically read from an E300 file without water. The water component is added with standard NeqSim water properties from the component database, a specified kij value against all other components (default: 0.5), a volume correction constant of 0.084004, and a parachor parameter of 10.0 (matching PVTsim water calibration). Multi-phase check is enabled so that an aqueous phase can be identified.
If the fluid already contains a water component, this method does nothing.
- Parameters:
fluid- the fluid to add water towaterKij- binary interaction parameter between water and all other components (typical value: 0.5)
-
read
read.
- Parameters:
inputFile- aStringobject representing the path to the input filefluidNames- an array ofStringobjects representing the names of the fluids- Returns:
- a
SystemInterfaceobject representing the thermodynamic system - Throws:
IllegalArgumentException- if the input file does not exist or cannot be read
-
readE300File
readE300File.
- Parameters:
inputFile- aStringobject- Returns:
- a
SystemInterfaceobject - Throws:
IllegalArgumentException- if the input file does not exist or cannot be read
-
write
Write a NeqSim fluid to Eclipse E300 compositional EOS file format.The exported file contains all EOS parameters needed to recreate the fluid in Eclipse 300 or read it back into NeqSim, including: component names, critical properties, acentric factors, molecular weights, volume shifts, parachors, mole fractions, and binary interaction coefficients.
- Parameters:
fluid- the fluid to exportoutputFile- path to output file (e.g., "myfluid.e300")- Throws:
IOException- if writing fails
-
write
public static void write(SystemInterface fluid, String outputFile, double reservoirTempC) throws IOException Write a NeqSim fluid to Eclipse E300 compositional EOS file format.- Parameters:
fluid- the fluid to exportoutputFile- path to output filereservoirTempC- reservoir temperature in Celsius for RTEMP keyword- Throws:
IOException- if writing fails
-
write
public static void write(SystemInterface fluid, Path outputPath, double reservoirTempC) throws IOException Write a NeqSim fluid to Eclipse E300 compositional EOS file format.- Parameters:
fluid- the fluid to exportoutputPath- output file pathreservoirTempC- reservoir temperature in Celsius- Throws:
IOException- if writing fails
-
toE300String
Convert a NeqSim fluid to Eclipse E300 format string.- Parameters:
fluid- the fluid to export- Returns:
- E300 format content as string
-
toE300String
Convert a NeqSim fluid to Eclipse E300 format string.- Parameters:
fluid- the fluid to exportreservoirTempC- reservoir temperature in Celsius- Returns:
- E300 format content as string
-
writeToWriter
private static void writeToWriter(SystemInterface fluid, Writer writer, double reservoirTempC) throws IOException Internal method to write E300 content to a Writer.- Parameters:
fluid- the fluid to exportwriter- output writerreservoirTempC- reservoir temperature in Celsius- Throws:
IOException- if writing fails
-
isPFCTViscosityModelActive
Check if PFCT (Pedersen) viscosity model is active on any phase.- Parameters:
fluid- the fluid- Returns:
- true if PFCT viscosity model is active
-
getEOSType
Determines the EOS type string for the fluid.- Parameters:
fluid- the fluid- Returns:
- EOS type string (SRK, PR, etc.)
-
shortenComponentName
-
getBinaryInteractionParameters
Gets binary interaction parameters from fluid.- Parameters:
fluid- the fluid- Returns:
- 2D array of kij values
-
applyLBCViscosityModel
Apply LBC viscosity model with custom parameters to fluid.- Parameters:
fluid- the fluid to configurelbcParams- array of 5 LBC dense contribution parameters
-
applyPFCTViscosityModel
Apply PFCT (Pedersen) viscosity model to all phases.- Parameters:
fluid- the fluid to configure
-
getLBCParametersFromFluid
Get LBC parameters from fluid if LBC viscosity model is active.- Parameters:
fluid- the fluid- Returns:
- array of 5 LBC parameters, or null if not using LBC model
-