Class SystemBnsEos
java.lang.Object
neqsim.thermo.system.SystemThermo
neqsim.thermo.system.SystemEos
neqsim.thermo.system.SystemBnsEos
- All Implemented Interfaces:
Serializable, Cloneable, SystemInterface
Thermodynamic system implementing the Burgoyne–Nielsen–Stanko PR correlation.
- Author:
- esol
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double[]private booleanprivate booleanprivate double[][]private booleanprivate static final doubleprivate static final doubleprivate final double[]private static final intprivate final double[]private final double[]private static final doubleprivate final double[]private doubleprivate static final longprivate static final doubleprivate final double[]private static final doubleprivate final double[]private final double[]private final double[]Fields inherited from class SystemThermo
a, allowPhaseShift, attractiveTermNumber, beta, CapeOpenProperties10, CapeOpenProperties11, characterization, checkStability, chemicalReactionOperations, chemicalSystem, componentNameTag, criticalPressure, criticalTemperature, enhancedMultiPhaseCheck, fluidInfo, fluidName, hydrateCheck, interfaceProp, isInitialized, logger, maxNumberOfPhases, modelName, multiPhaseCheck, numberOfComponents, numberOfPhases, numericDerivatives, oilAssayCharacterisation, phaseArray, phaseIndex, phaseType, resultTable, solidPhaseCheck, standard, waxCharacterisation -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for SystemBnsEos.SystemBnsEos(double T, double P) Constructor for SystemBnsEos.SystemBnsEos(double T, double P, double sg, double yCO2, double yH2S, double yN2, double yH2, boolean associatedGas) Constructs a BNS-PR system with composition. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddBnsComponent(String name, double moles, int compIndex) private voidprivate static doublecalcVshift(double ciField, double omegaB, double tc, double pc) Calculates the volume shift parameter.clone()clone.private static StringcompName(int i) private static doubledegRToK(double degR) private static doublehydrocarbonSg(double sg, double[] zf, double[] mws) private static doublepcFn(double x, double vcSlope, double tc) private static double[]pseudoCritical(double sgHc, boolean ag) private static doublepsiaToBar(double psia) voidsetAssociatedGas(boolean ag) Setter for the fieldassociatedGas.voidsetComposition(double yCO2, double yH2S, double yN2, double yH2) Sets the composition of the system using mole fractions of CO2, H2S, N2, and H2.voidsetComposition(double sg, double yCO2, double yH2S, double yN2, double yH2, boolean associatedGas) Sets the composition using BNS-specific parameters matching the Python interface.voidsetMixingRule(int type) method to set mixing rule used for the fluid.voidsetRelativeDensity(double sg) Setter for the fieldrelativeDensity.private static doubletcAg(double x) private static doubletcGc(double x) private voidprivate voidUpdates heat capacity coefficients for all components.private voidUpdates the hydrocarbon pseudo-component properties based on composition and relative density.Methods inherited from class SystemThermo
addCapeOpenProperty, addCharacterized, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addFluid, addFluid, addGasToLiquid, addHydratePhase, addHydratePhase2, addLiquidToGas, addOilFractions, addOilFractions, addPhase, addPhaseFractionToPhase, addPhaseFractionToPhase, addPlusFraction, addSalt, addSolidComplexPhase, addSolidPhase, addTBPfraction, addTBPfraction, addTBPfraction2, addTBPfraction3, addTBPfraction4, addToComponentNames, allowPhaseShift, allowPhaseShift, autoSelectMixingRule, autoSelectModel, calc_x_y, calc_x_y_nonorm, calcHenrysConstant, calcInterfaceProperties, calcKIJ, calculateDensityFromBoilingPoint, calculateMolarMassFromDensityAndBoilingPoint, changeComponentName, checkStability, checkStability, chemicalReactionInit, clearAll, createDatabase, createTable, deleteFluidPhase, display, doEnhancedMultiPhaseCheck, doMultiPhaseCheck, doSolidPhaseCheck, getAntoineVaporPressure, getBeta, getBeta, getCapeOpenProperties10, getCapeOpenProperties11, getCASNumbers, getCharacterization, getChemicalReactionOperations, getCompFormulaes, getCompIDs, getCompNames, getComponentNameTag, getCorrectedVolume, getCorrectedVolumeFraction, getCp, getCp, getCv, getCv, getDensity, getDensity, getdPdVtn, getdVdPtn, getdVdTpn, getEmptySystemClone, getEnthalpy, getEnthalpy, getEntropy, getEntropy, getExergy, getExergy, getFlowRate, getFluidInfo, getFluidName, getGamma, getGasPhase, getGibbsEnergy, getHeatOfVaporization, getHelmholtzEnergy, getHydrateCheck, getIdealLiquidDensity, getInterfacialTension, getInterfacialTension, getInterfacialTension, getInternalEnergy, getInternalEnergy, getInterphaseProperties, getJouleThomsonCoefficient, getJouleThomsonCoefficient, getKappa, getKinematicViscosity, getKinematicViscosity, getKvector, getLiquidPhase, getLiquidVolume, getLowestGibbsEnergyPhase, getMass, getMaxNumberOfPhases, getMixingRule, getMixingRuleName, getModelName, getMolarComposition, getMolarMass, getMolarMass, getMolarRate, getMolarVolume, getMolarVolume, getMolecularWeights, getMoleFraction, getMoleFractionsSum, getNormalBoilingPointTemperatures, getNumberOfComponents, getNumberOfOilFractionComponents, getNumberOfPhases, getOilAssayCharacterisation, getOilFractionIDs, getOilFractionLiquidDensityAt25C, getOilFractionMolecularMass, getOilFractionNormalBoilingPoints, getPC, getPhase, getPhase, getPhase, getPhaseFraction, getPhaseIndex, getPhaseIndex, getPhaseIndex, getPhaseNumberOfPhase, getPhaseOfType, getPhases, getPressure, getPressure, getPressure, getProperties, getProperty, getProperty, getProperty, getResultTable, getSoundSpeed, getSoundSpeed, getStandard, getStandard, getSumBeta, getTC, getTemperature, getTemperature, getTemperature, getThermalConductivity, getThermalConductivity, getTotalNumberOfMoles, getViscosity, getViscosity, getVolume, getVolume, getVolumeFraction, getWaxCharacterisation, getWaxModel, getWeightBasedComposition, getWtFraction, getZ, getzvector, getZvolcorr, hasPhaseType, hasPlusFraction, hasTBPFraction, init, init, init_x_y, initAnalytic, initAnalytic, initBeta, initNumeric, initNumeric, initNumeric, initPhysicalProperties, initPhysicalProperties, initRefPhases, initTotalNumberOfMoles, invertPhaseTypes, isBetaValid, isChemicalSystem, isChemicalSystem, isForcePhaseTypes, isImplementedCompositionDeriativesofFugacity, isImplementedCompositionDeriativesofFugacity, isImplementedPressureDeriativesofFugacity, isImplementedTemperatureDeriativesofFugacity, isInitialized, isMultiphaseWaxCheck, isNumericDerivatives, isPhase, normalizeBeta, orderByDensity, phaseToSystem, phaseToSystem, phaseToSystem, phaseToSystem, readFluid, readObject, readObjectFromFile, reInitPhaseInformation, reInitPhaseType, removeComponent, removePhase, removePhaseKeepTotalComposition, renameComponent, replacePhase, reset, reset_x_y, resetCharacterisation, resetDatabase, resetPhysicalProperties, save, saveFluid, saveFluid, saveObject, saveObjectToFile, saveToDataBase, setAllComponentsInPhase, setAllPhaseType, setAttractiveTerm, setBeta, setBeta, setBinaryInteractionParameter, setBinaryInteractionParameter, setBmixType, setComponentCriticalParameters, setComponentCriticalParameters, setComponentFlowRates, setComponentNames, setComponentNameTag, setComponentNameTagOnNormalComponents, setComponentVolumeCorrection, setComponentVolumeCorrection, setEmptyFluid, setEnhancedMultiPhaseCheck, setFluidInfo, setFluidName, setForcePhaseTypes, setForceSinglePhase, setForceSinglePhase, setHeavyTBPfractionAsPlusFraction, setHydrateCheck, setImplementedCompositionDeriativesofFugacity, setImplementedPressureDeriativesofFugacity, setImplementedTemperatureDeriativesofFugacity, setLastTBPasPlus, setMaxNumberOfPhases, setMixingRule, setMixingRule, setMixingRuleGEmodel, setMixingRuleParametersForComponent, setModel, setModelName, setMolarComposition, setMolarCompositionOfNamedComponents, setMolarCompositionOfPlusFluid, setMolarCompositionPlus, setMolarFlowRates, setMultiPhaseCheck, setMultiphaseWaxCheck, setNumberOfPhases, setNumericDerivatives, setPC, setPhase, setPhaseIndex, setPhaseType, setPhaseType, setPressure, setPressure, setSolidPhaseCheck, setSolidPhaseCheck, setStandard, setTC, setTemperature, setTemperature, setTemperature, setTotalFlowRate, setTotalNumberOfMoles, setUseTVasIndependentVariables, toCompJson, toJson, tuneModel, useTVasIndependentVariables, useVolumeCorrection, write, writeMethods inherited from class Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SystemInterface
addComponent, addComponents, addComponents, calcResultTable, display, getComponent, getComponent, getComponentNames, getGamma2, getHydrateFraction, getHydratePhase, getNumberOfMoles, getPhaseNumberOfPhase, hasComponent, hasComponent, hashCode, hasHydratePhase, hasPhaseType, hasSolidPhase, initPhysicalProperties, initProperties, initThermoProperties, prettyPrint, setMixingRule, setPhysicalPropertyModel, setPhysicalPropertyModel, validateSetup
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
MW_AIR
private static final double MW_AIR- See Also:
-
MW_CH4
private static final double MW_CH4- See Also:
-
TcCH4
private static final double TcCH4 -
PcCH4
private static final double PcCH4 -
VcZcCH4
private static final double VcZcCH4 -
NUM_BNS_COMPONENTS
private static final int NUM_BNS_COMPONENTS- See Also:
-
tcs
private final double[] tcs -
pcs
private final double[] pcs -
mws
private final double[] mws -
acfs
private final double[] acfs -
omegaA
private final double[] omegaA -
omegaB
private final double[] omegaB -
vshift
private final double[] vshift -
vshiftField
private final double[] vshiftField -
cpCoeffs
private double[][] cpCoeffs -
zfractions
private final double[] zfractions -
relativeDensity
private double relativeDensity -
associatedGas
private boolean associatedGas -
mixingRuleDefined
private boolean mixingRuleDefined -
componentsInitialized
private boolean componentsInitialized
-
-
Constructor Details
-
SystemBnsEos
public SystemBnsEos()Constructor for SystemBnsEos.
-
SystemBnsEos
public SystemBnsEos(double T, double P) Constructor for SystemBnsEos.
- Parameters:
T- a doubleP- a double
-
SystemBnsEos
public SystemBnsEos(double T, double P, double sg, double yCO2, double yH2S, double yN2, double yH2, boolean associatedGas) Constructs a BNS-PR system with composition.- Parameters:
T- a doubleP- a doublesg- a doubleyCO2- a doubleyH2S- a doubleyN2- a doubleyH2- a doubleassociatedGas- a boolean
-
-
Method Details
-
degRToK
private static double degRToK(double degR) -
psiaToBar
private static double psiaToBar(double psia) -
tcAg
private static double tcAg(double x) -
tcGc
private static double tcGc(double x) -
pcFn
private static double pcFn(double x, double vcSlope, double tc) -
calcVshift
private static double calcVshift(double ciField, double omegaB, double tc, double pc) Calculates the volume shift parameter.- Parameters:
ciField- volume shift field coefficientomegaB- PR equation omega B parametertc- critical temperature [K]pc- critical pressure [bar]- Returns:
- volume shift parameter
-
pseudoCritical
private static double[] pseudoCritical(double sgHc, boolean ag) -
hydrocarbonSg
private static double hydrocarbonSg(double sg, double[] zf, double[] mws) -
compName
-
applyBnsBips
private void applyBnsBips() -
setComposition
public void setComposition(double sg, double yCO2, double yH2S, double yN2, double yH2, boolean associatedGas) Sets the composition using BNS-specific parameters matching the Python interface. This method matches the Python call: setComposition(sg, yCO2, yH2S, yN2, yH2, associatedGas)- Parameters:
sg- relative density (specific gravity)yCO2- mole fraction of CO2 (must be >= 0)yH2S- mole fraction of H2S (must be >= 0)yN2- mole fraction of N2 (must be >= 0)yH2- mole fraction of H2 (must be >= 0)associatedGas- true for associated gas, false for gas condensate- Throws:
IllegalArgumentException- if any mole fraction is negative or sum exceeds 1.0
-
setComposition
public void setComposition(double yCO2, double yH2S, double yN2, double yH2) Sets the composition of the system using mole fractions of CO2, H2S, N2, and H2.- Parameters:
yCO2- mole fraction of CO2 (must be >= 0)yH2S- mole fraction of H2S (must be >= 0)yN2- mole fraction of N2 (must be >= 0)yH2- mole fraction of H2 (must be >= 0)- Throws:
IllegalArgumentException- if any mole fraction is negative or sum exceeds 1.0
-
setRelativeDensity
public void setRelativeDensity(double sg) Setter for the field
relativeDensity.- Parameters:
sg- a double (relative density, must be positive)- Throws:
IllegalArgumentException- if relative density is not positive
-
setAssociatedGas
public void setAssociatedGas(boolean ag) Setter for the field
associatedGas.- Parameters:
ag- a boolean
-
updateHydrocarbonProperties
private void updateHydrocarbonProperties()Updates the hydrocarbon pseudo-component properties based on composition and relative density. -
updateHeatCapacityCoefficients
private void updateHeatCapacityCoefficients()Updates heat capacity coefficients for all components. -
updateComposition
private void updateComposition() -
addBnsComponent
-
setMixingRule
public void setMixingRule(int type) method to set mixing rule used for the fluid.- Parameters:
type- The type of mixing rule to be used for the fluid. 1 - classic mixing rule with all kij set to zero 2 -classic mixing rule with kij from NeqSim database 3- classic mixing rule with temperature dependent kij 4- Huron Vidal mixing rule with parameters from NeqSim database 7 -classic mixing rule with kij of CPA from NeqSim Database 9 -classicmixing rule with temperature dependent kij of CPA from NeqSim database 10-classic mixing rule with temperature and composition dependent kij of CPA from NeqSim database
-
clone
clone.
- Specified by:
clonein interfaceSystemInterface- Overrides:
clonein classSystemThermo- Returns:
- a
SystemInterfaceobject
-