Class PseudoComponentCombiner
java.lang.Object
neqsim.thermo.characterization.PseudoComponentCombiner
Utility class for combining and re-characterizing fluids containing pseudo components.
This class provides methods for:
- Combining multiple reservoir fluids with a common pseudo-component structure
- Characterizing one fluid to match another's pseudo-component definition
- Transferring binary interaction parameters between fluids
Reference: Pedersen et al., "Phase Behavior of Petroleum Reservoir Fluids", Chapters 5.5-5.6.
- Author:
- ESOL
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final classprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Loggerprivate static final double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SystemInterfacecharacterizeToReference(SystemInterface source, SystemInterface reference) Characterize a fluid to another fluid's pseudo component definition (Pedersen et al., Chapter 5.6).static SystemInterfacecharacterizeToReference(SystemInterface source, SystemInterface reference, CharacterizationOptions options) Characterize a fluid to another fluid's pseudo component definition with options.private static List<PseudoComponentCombiner.PseudoComponentProfile> combineProfiles(List<List<PseudoComponentCombiner.PseudoComponentProfile>> perFluidProfiles, double[] fluidMassTotals, double[] fluidMoleTotals) static SystemInterfacecombineReservoirFluids(int targetPseudoComponents, Collection<SystemInterface> fluids) Combine one or more reservoir fluids and redistribute their pseudo components into a specified number of new pseudo components.static SystemInterfacecombineReservoirFluids(int targetPseudoComponents, SystemInterface... fluids) Combine one or more reservoir fluids and redistribute their pseudo components into a specified number of new pseudo components.determineQuantileBoundaries(List<PseudoComponentCombiner.PseudoComponentContribution> contributions, int targetPseudoComponents) determineReferenceBoundaries(List<PseudoComponentCombiner.PseudoComponentContribution> referenceContributions) private static List<PseudoComponentCombiner.PseudoComponentProfile> distributeToProfiles(List<PseudoComponentCombiner.PseudoComponentContribution> contributions, List<Double> boundaries, int targetPseudoComponents) private static PseudoComponentCombiner.FluidExtractionextractComponents(SystemInterface fluid) private static voidfinalizeFluid(SystemInterface system) generateValidationReport(SystemInterface source, SystemInterface reference, SystemInterface characterized) Generate a validation report comparing source and characterized fluids.private static doublegetBinaryInteractionParameter(SystemInterface fluid, String comp1, String comp2) Get a BIP value between two components in a fluid.private static List<ComponentInterface> Get ordered list of pseudo-components from a fluid.static voidNormalize composition so mole fractions sum to 1.0.private static voidremoveAllComponents(SystemInterface system) private static StringstripPcSuffix(String componentName) static voidtransferBinaryInteractionParameters(SystemInterface reference, SystemInterface target) Transfer binary interaction parameters from a reference fluid to a target fluid.
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
MASS_TOLERANCE
private static final double MASS_TOLERANCE- See Also:
-
-
Constructor Details
-
PseudoComponentCombiner
private PseudoComponentCombiner()
-
-
Method Details
-
combineReservoirFluids
public static SystemInterface combineReservoirFluids(int targetPseudoComponents, SystemInterface... fluids) Combine one or more reservoir fluids and redistribute their pseudo components into a specified number of new pseudo components. The new pseudo components are calculated using the weighting scheme described in Chapter 5.5 of Pedersen et al. (mixing of multiple fluids), i.e. the properties of each resulting pseudo component are weighted by the fluid fraction and the mole fraction of the contributing pseudo components.- Parameters:
targetPseudoComponents- number of pseudo components in the combined fluidfluids- input fluids- Returns:
- combined fluid with the requested number of pseudo components
-
combineReservoirFluids
public static SystemInterface combineReservoirFluids(int targetPseudoComponents, Collection<SystemInterface> fluids) Combine one or more reservoir fluids and redistribute their pseudo components into a specified number of new pseudo components. The new pseudo components are calculated using the weighting scheme described in Chapter 5.5 of Pedersen et al. (mixing of multiple fluids), i.e. the properties of each resulting pseudo component are weighted by the fluid fraction and the mole fraction of the contributing pseudo components.- Parameters:
targetPseudoComponents- number of pseudo components in the combined fluidfluids- input fluids- Returns:
- combined fluid with the requested number of pseudo components
-
characterizeToReference
public static SystemInterface characterizeToReference(SystemInterface source, SystemInterface reference) Characterize a fluid to another fluid's pseudo component definition (Pedersen et al., Chapter 5.6). The pseudo component cut points are derived from the reference fluid's pseudo component ordering and applied to the source fluid.- Parameters:
source- fluid to characterizereference- fluid defining the pseudo component characterization- Returns:
- characterized fluid containing pseudo components compatible with the reference fluid
-
characterizeToReference
public static SystemInterface characterizeToReference(SystemInterface source, SystemInterface reference, CharacterizationOptions options) Characterize a fluid to another fluid's pseudo component definition with options.This overload allows specifying options for BIP transfer, normalization, and validation.
- Parameters:
source- fluid to characterizereference- fluid defining the pseudo component characterizationoptions- characterization options- Returns:
- characterized fluid containing pseudo components compatible with the reference fluid
-
transferBinaryInteractionParameters
public static void transferBinaryInteractionParameters(SystemInterface reference, SystemInterface target) Transfer binary interaction parameters from a reference fluid to a target fluid.This method copies BIPs between components that exist in both fluids. For pseudo-components, it matches by position (first PC to first PC, etc.) since names may differ.
- Parameters:
reference- the fluid containing BIPs to copytarget- the fluid to receive the BIPs
-
getBinaryInteractionParameter
private static double getBinaryInteractionParameter(SystemInterface fluid, String comp1, String comp2) Get a BIP value between two components in a fluid.- Parameters:
fluid- the fluidcomp1- first component namecomp2- second component name- Returns:
- the BIP value, or 0.0 if not found
-
getPseudoComponentList
Get ordered list of pseudo-components from a fluid.- Parameters:
fluid- the fluid- Returns:
- list of pseudo-components in order
-
normalizeComposition
Normalize composition so mole fractions sum to 1.0.- Parameters:
fluid- the fluid to normalize
-
generateValidationReport
public static CharacterizationValidationReport generateValidationReport(SystemInterface source, SystemInterface reference, SystemInterface characterized) Generate a validation report comparing source and characterized fluids.- Parameters:
source- the original source fluidreference- the reference fluid used for characterizationcharacterized- the resulting characterized fluid- Returns:
- validation report
-
stripPcSuffix
-
finalizeFluid
-
removeAllComponents
-
extractComponents
-
mergeBaseComponents
-
determineQuantileBoundaries
private static List<Double> determineQuantileBoundaries(List<PseudoComponentCombiner.PseudoComponentContribution> contributions, int targetPseudoComponents) -
determineReferenceBoundaries
private static List<Double> determineReferenceBoundaries(List<PseudoComponentCombiner.PseudoComponentContribution> referenceContributions) -
distributeToProfiles
private static List<PseudoComponentCombiner.PseudoComponentProfile> distributeToProfiles(List<PseudoComponentCombiner.PseudoComponentContribution> contributions, List<Double> boundaries, int targetPseudoComponents) -
combineProfiles
private static List<PseudoComponentCombiner.PseudoComponentProfile> combineProfiles(List<List<PseudoComponentCombiner.PseudoComponentProfile>> perFluidProfiles, double[] fluidMassTotals, double[] fluidMoleTotals)
-