Interface SystemInterface

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
SystemAmmoniaEos, SystemBnsEos, SystemBWRSEos, SystemCSPsrkEos, SystemDesmukhMather, SystemDuanSun, SystemElectrolyteCPA, SystemElectrolyteCPAMM, SystemElectrolyteCPAstatoil, SystemEos, SystemEOSCGEos, SystemFurstElectrolyteEos, SystemFurstElectrolyteEosMod2004, SystemGERG2004Eos, SystemGERG2008Eos, SystemGERGwaterEos, SystemGEWilson, SystemIdealGas, SystemKentEisenberg, SystemLeachmanEos, SystemNRTL, SystemPCSAFT, SystemPCSAFTa, SystemPitzer, SystemPrCPA, SystemPrDanesh, SystemPrEos, SystemPrEos1978, SystemPrEosDelft1998, SystemPrEosvolcor, SystemPrGassemEos, SystemPrMathiasCopeman, SystemPsrkEos, SystemRKEos, SystemSoreideWhitson, SystemSpanWagnerEos, SystemSrkCPA, SystemSrkCPAs, SystemSrkCPAstatoil, SystemSrkEos, SystemSrkEosvolcor, SystemSrkMathiasCopeman, SystemSrkPenelouxEos, SystemSrkSchwartzentruberEos, SystemSrkTwuCoonEos, SystemSrkTwuCoonParamEos, SystemSrkTwuCoonStatoilEos, SystemThermo, SystemTSTEos, SystemUMRCPAEoS, SystemUMRPRUEos, SystemUMRPRUMCEos, SystemUMRPRUMCEosNew, SystemUNIFAC, SystemUNIFACpsrk, SystemVegaEos, SystemWaterIF97

public interface SystemInterface extends Cloneable, Serializable

SystemInterface interface.

Version:
$Id: $Id
Author:
asmund
  • Method Details

    • addFluids

      static SystemInterface addFluids(SystemInterface addFluid1, SystemInterface addFluid2)
      return two fluid added as a new fluid.
      Parameters:
      addFluid1 - first fluid to add
      addFluid2 - second fluid o add
      Returns:
      new fluid
    • combineReservoirFluids

      static SystemInterface combineReservoirFluids(int numberOfPseudoComponents, SystemInterface... fluids)
      Combine fluids and redistribute pseudo components to a requested number.
      Parameters:
      numberOfPseudoComponents - target number of pseudo components
      fluids - fluids to combine
      Returns:
      combined fluid
    • characterizeToReference

      static SystemInterface characterizeToReference(SystemInterface source, SystemInterface reference)
      Characterize a fluid to match the pseudo component definition of a reference fluid.
      Parameters:
      source - fluid to characterize
      reference - fluid providing the pseudo component definition
      Returns:
      characterized fluid with pseudo components aligned to the reference
    • addCapeOpenProperty

      void addCapeOpenProperty(String propertyName)

      addCapeOpenProperty.

      Parameters:
      propertyName - a String object
    • addCharacterized

      void addCharacterized(String[] charNames, double[] charFlowrate, double[] molarMass, double[] relativedensity)

      addCharacterized.

      Parameters:
      charNames - an array of String objects
      charFlowrate - an array of type double
      molarMass - an array of type double
      relativedensity - an array of type double
    • addComponent

      void addComponent(ComponentInterface inComponent)
      add a component to a fluid. If component already exists, the moles will be added to the existing component.
      Parameters:
      inComponent - Component object to add.
    • addComponent

      void addComponent(int index, double moles)

      addComponent.

      Parameters:
      index - Component number to add
      moles - number of moles (per second) of the component to be added to the fluid
    • addComponent

      void addComponent(int index, double moles, int phaseNumber)

      addComponent.

      Parameters:
      index - Component number to add
      moles - number of moles (per second) of the component to be added to the fluid
      phaseNumber - Number of the phase to add the component to
    • addComponent

      default void addComponent(String name)
      add a component to a fluid with no moles.
      Parameters:
      name - Name of the component to add. See NeqSim database for component in the database.
    • addComponent

      void addComponent(String name, double moles)
      add a component to a fluid. If component already exists, the moles will be added to the existing component.
      Parameters:
      name - Name of the component to add. See NeqSim database for component in the database.
      moles - number of moles (per second) of the component to be added to the fluid
    • addComponent

      void addComponent(String name, double moles, double TC, double PC, double acs)

      addComponent.

      Parameters:
      name - Name of the component to add. See NeqSim database for component in the database.
      moles - number of moles (per second) of the component to be added to the fluid
      TC - Critical temperature [K]
      PC - Critical pressure [bara]
      acs - a double
    • addComponent

      void addComponent(String name, double moles, int phaseNumber)
      add a component to a fluid. If component already exists, the moles will be added to the existing component.
      Parameters:
      name - Name of the component to add. See NeqSim database for component in the database.
      moles - number of moles (per second) of the component to be added to the fluid
      phaseNumber - Number of the phase to add the component to
    • addComponent

      void addComponent(String name, double value, String unitName)
      add a component to a fluid. If component already exists, the amount will be added to the existing component.
      Parameters:
      name - Name of the component to add. See NeqSim database for component in the database.
      value - The amount.
      unitName - the unit of rate (sported units are kg/sec, mol/sec, Nlitre/min, kg/hr, Sm^3/hr, Sm^3/day, MSm^3/day ..
    • addComponent

      void addComponent(String name, double value, String unitName, int phaseNumber)
      add a component to a fluid. I component already exists, it will be added to the component
      Parameters:
      name - Name of the component to add. See NeqSim database for component in the database.
      value - rate of the component to add to the fluid
      unitName - the unit of the flow rate (eg. mol/sec, kg/sec, etc.)
      phaseNumber - Number of the phase to add the component to
    • addComponents

      default void addComponents(String[] names)
      Add named components to a System. Does nothing if components already exist in System.
      Parameters:
      names - Names of the components to be added. See NeqSim database for available components in the database.
    • addComponents

      default void addComponents(String[] names, double[] moles)
      Add named components to a System with a number of moles. If component already exists, the moles will be added to the component.
      Parameters:
      names - Names of the components to be added. See NeqSim database for available components in the database.
      moles - Number of moles to add per component.
    • addFluid

      SystemInterface addFluid(SystemInterface addSystem)

      addFluid.

      Parameters:
      addSystem - a SystemInterface object
      Returns:
      SystemInterface
    • addFluid

      SystemInterface addFluid(SystemInterface addSystem, int phaseNum)

      addFluid.

      Parameters:
      addSystem - a SystemInterface object
      phaseNum - phase number of phase to add fluid to
      Returns:
      SystemInterface
    • addGasToLiquid

      void addGasToLiquid(double fraction)

      addGasToLiquid.

      Parameters:
      fraction - a double
    • addLiquidToGas

      void addLiquidToGas(double fraction)

      addLiquidToGas.

      Parameters:
      fraction - a double
    • addOilFractions

      void addOilFractions(String[] charNames, double[] charFlowrate, double[] molarMass, double[] relativedensity, boolean lastIsPlusFraction)

      addCharacterized.

      Parameters:
      charNames - an array of String objects
      charFlowrate - an array of type double
      molarMass - an array of type double
      relativedensity - an array of type double
      lastIsPlusFraction - True if last fraction is a Plus fraction
    • addOilFractions

      void addOilFractions(String[] charNames, double[] charFlowrate, double[] molarMass, double[] relativedensity, boolean lastIsPlusFraction, boolean lumpComponents, int numberOfPseudoComponents)

      addCharacterized.

      Parameters:
      charNames - an array of String objects
      charFlowrate - an array of type double
      molarMass - an array of type double
      relativedensity - an array of type double
      lastIsPlusFraction - True if last fraction is a Plus fraction
      lumpComponents - True if component should be lumped
      numberOfPseudoComponents - number of pseudo components
    • addPhase

      void addPhase()
      Add phase to SystemInterface object.
    • addPhaseFractionToPhase

      void addPhaseFractionToPhase(double fraction, String specification, String fromPhaseName, String toPhaseName)

      addPhaseFractionToPhase.

      Parameters:
      fraction - a double
      specification - a String object
      fromPhaseName - a String object
      toPhaseName - a String object
    • addPhaseFractionToPhase

      void addPhaseFractionToPhase(double fraction, String specification, String specifiedStream, String fromPhaseName, String toPhaseName)

      addPhaseFractionToPhase.

      Parameters:
      fraction - a double
      specification - a String object
      specifiedStream - a String object
      fromPhaseName - a String object
      toPhaseName - a String object
    • addPlusFraction

      void addPlusFraction(String componentName, double numberOfMoles, double molarMass, double density)

      addPlusFraction.

      Parameters:
      componentName - a String object
      numberOfMoles - a double
      molarMass - a double
      density - a double
    • addSalt

      void addSalt(String componentName, double value)

      addSalt.

      Parameters:
      componentName - a String object
      value - a double
    • addSolidComplexPhase

      void addSolidComplexPhase(String type)

      addSolidComplexPhase.

      Parameters:
      type - a String object
    • addTBPfraction

      void addTBPfraction(String componentName, double numberOfMoles, double molarMass, double density)
      method to add true boiling point fraction.
      Parameters:
      componentName - selected name of the component to be added
      numberOfMoles - number of moles to be added
      molarMass - molar mass of the component in kg/mol
      density - density of the component in g/cm3
    • addTBPfraction

      void addTBPfraction(String componentName, double numberOfMoles, double molarMass, double density, double criticalTemperature, double criticalPressure, double acentricFactor)

      addTBPfraction.

      Parameters:
      componentName - a String object
      numberOfMoles - a double
      molarMass - a double
      density - a double
      criticalTemperature - a double
      criticalPressure - a double
      acentricFactor - a double
    • addTBPfraction2

      void addTBPfraction2(String componentName, double numberOfMoles, double molarMass, double boilingPoint)

      addTBPfraction2.

      Parameters:
      componentName - a String object
      numberOfMoles - a double
      molarMass - a double
      boilingPoint - a double
    • calculateDensityFromBoilingPoint

      double calculateDensityFromBoilingPoint(double molarMass, double boilingPoint)
      Calculate density from boiling point and molar mass using TBP correlation.
      Parameters:
      molarMass - molar mass in kg/mol
      boilingPoint - boiling point in K
      Returns:
      density in g/cm3
    • addToComponentNames

      void addToComponentNames(String name)
      Add to component names.
      Parameters:
      name - Component name to add
    • allowPhaseShift

      boolean allowPhaseShift()

      Getter for property allowPhaseShift.

      Returns:
      a boolean
    • allowPhaseShift

      void allowPhaseShift(boolean allowPhaseShift)

      Setter for property allowPhaseShift.

      Parameters:
      allowPhaseShift - a boolean
    • autoSelectMixingRule

      void autoSelectMixingRule()

      autoSelectMixingRule.

    • autoSelectModel

      SystemInterface autoSelectModel()

      autoSelectModel.

      Returns:
      a SystemInterface object
    • calc_x_y

      void calc_x_y()

      calc_x_y.

    • calc_x_y_nonorm

      void calc_x_y_nonorm()

      calc_x_y_nonorm.

    • calcHenrysConstant

      double calcHenrysConstant(String component)

      calcHenrysConstant.

      Parameters:
      component - a String object
      Returns:
      a double
    • calcInterfaceProperties

      void calcInterfaceProperties()

      calcInterfaceProperties.

    • calcKIJ

      void calcKIJ(boolean ok)

      calcKIJ.

      Parameters:
      ok - a boolean
    • calcResultTable

      default String[][] calcResultTable()

      calcResultTable.

      Returns:
      an array of String objects
    • changeComponentName

      void changeComponentName(String name, String newName)

      changeComponentName.

      Parameters:
      name - a String object
      newName - a String object
    • checkStability

      boolean checkStability()

      checkStability.

      Returns:
      a boolean
    • checkStability

      void checkStability(boolean val)

      checkStability.

      Parameters:
      val - a boolean
    • chemicalReactionInit

      void chemicalReactionInit()

      chemicalReactionInit.

    • clearAll

      void clearAll()

      clearAll.

    • clone

      clone.

      Returns:
      a SystemInterface object
    • createDatabase

      void createDatabase(boolean reset)
      method to read pure component and interaction parameters from the NeqSim database and create temporary tables with parameters for active fluid.

      NB! Resets the mixing rule of each phase.

      Parameters:
      reset - If reset is set to true, new temporary tables with parameters for the added components will be created. When parameters are needed (eg. when adding components or when setting a mixing rule) it will try to find them in the temporary tables first eg. COMPTEMP (for pure component parameters) and INTERTEMP (for interaction parameters). If reset is set to false it will not create new temporary tables. If a fluid is created with the same components many times, performance improvements will be obtained, if temporary tables are created the first time (reset=true), and then the same tables is used when creating new fluids with the same temporary tables (reset=false)
    • createTable

      String[][] createTable(String name)

      createTable.

      Parameters:
      name - a String object
      Returns:
      an array of String objects
    • deleteFluidPhase

      void deleteFluidPhase(int phaseNum)

      deleteFluidPhase.

      Parameters:
      phaseNum - a int
    • display

      default void display()

      display.

    • display

      void display(String name)

      display.

      Parameters:
      name - a String object
    • doMultiPhaseCheck

      boolean doMultiPhaseCheck()

      Getter for property multiPhaseCheck.

      Returns:
      a boolean
    • doEnhancedMultiPhaseCheck

      boolean doEnhancedMultiPhaseCheck()
      Check if enhanced stability analysis is enabled. When enabled, the flash calculation uses Wilson K-value initial guesses and tests both vapor-like and liquid-like trial phases for more robust detection of multiple liquid phases (e.g., liquid-liquid-vapor equilibria in sour gas or CO2 systems).
      Returns:
      true if enhanced stability analysis is enabled
    • doSolidPhaseCheck

      boolean doSolidPhaseCheck()

      doSolidPhaseCheck.

      Returns:
      a boolean
    • equals

      boolean equals(Object o)
      Overrides:
      equals in class Object
    • getBeta

      double getBeta()

      Getter for property beta. Gets value for heaviest phase.

      Returns:
      Beta value
    • getBeta

      double getBeta(int phaseNum)

      Getter for property beta for a specific phase.

      Parameters:
      phaseNum - Number of phase to get beta for.
      Returns:
      Beta value for
    • getCapeOpenProperties10

      String[] getCapeOpenProperties10()

      getCapeOpenProperties10.

      Returns:
      an array of String objects
    • getCapeOpenProperties11

      String[] getCapeOpenProperties11()

      getCapeOpenProperties11.

      Returns:
      an array of String objects
    • getCASNumbers

      String[] getCASNumbers()

      getCASNumbers.

      Returns:
      an array of String objects
    • getCharacterization

      Characterise getCharacterization()

      Getter for property characterization.

      Returns:
      a Characterise object
    • getChemicalReactionOperations

      ChemicalReactionOperations getChemicalReactionOperations()

      getChemicalReactionOperations.

      Returns:
      a ChemicalReactionOperations object
    • getCompFormulaes

      String[] getCompFormulaes()

      getCompFormulaes.

      Returns:
      an array of String objects
    • getCompIDs

      String[] getCompIDs()

      getCompIDs.

      Returns:
      an array of String objects
    • getCompNames

      String[] getCompNames()
      Get normalized names of all components in System.
      Returns:
      Array of names of components in System.
    • getComponent

      default ComponentInterface getComponent(int i)

      Get component by index.

      Parameters:
      i - Component index
      Returns:
      a ComponentInterface object
    • getComponent

      default ComponentInterface getComponent(String name)

      Get component by name.

      Parameters:
      name - Name of component
      Returns:
      a ComponentInterface object
    • getComponentNames

      default String[] getComponentNames()
      Get normalized names of components in System.
      Returns:
      Array of names of components in system.
    • getComponentNameTag

      String getComponentNameTag()

      getComponentNameTag.

      Returns:
      a String object
    • getCorrectedVolume

      double getCorrectedVolume()
      method to return fluid volume with Peneloux volume correction.
      Returns:
      volume in unit m3
    • getCorrectedVolumeFraction

      double getCorrectedVolumeFraction(int phaseNumber)
      method to return the volume fraction of a phase note: with Peneloux volume correction.
      Parameters:
      phaseNumber - number of the phase to get volume fraction for
      Returns:
      volume fraction
    • getCp

      double getCp()
      method to return specific heat capacity (Cp).
      Returns:
      Cp in unit J/K
    • getCp

      double getCp(String unit)
      method to return specific heat capacity (Cp) in a specified unit.
      Parameters:
      unit - Supported units are J/K, J/molK, J/kgK and kJ/kgK
      Returns:
      Cp in specified unit
    • getCv

      double getCv()
      method to return specific heat capacity (Cv).
      Returns:
      Cv in unit J/K
    • getCv

      double getCv(String unit)
      method to return specific heat capacity (Cp) in a specified unit.
      Parameters:
      unit - Supported units are J/K, J/molK, J/kgK and kJ/kgK
      Returns:
      Cp in specified unit
    • getDensity

      double getDensity()
      Get density of a fluid note: without Peneloux volume correction.
      Returns:
      density with unit kg/m3
    • getDensity

      double getDensity(String unit)
      Get density of a fluid note: with Peneloux volume correction.
      Parameters:
      unit - Supported units are kg/m3, mol/m3
      Returns:
      density in specified unit
    • getdVdPtn

      double getdVdPtn()

      getdVdPtn.

      Returns:
      a double
    • getdVdTpn

      double getdVdTpn()

      getdVdTpn.

      Returns:
      a double
    • getEmptySystemClone

      SystemInterface getEmptySystemClone()

      getEmptySystemClone.

      Returns:
      a SystemInterface object
    • getEnthalpy

      double getEnthalpy()
      Get the total enthalpy of a fluid.
      Returns:
      molar mass in unit J (Joule)
    • getEnthalpy

      double getEnthalpy(String unit)
      method to return total enthalpy in a specified unit.
      Parameters:
      unit - Supported units are 'J', 'J/mol', 'kJ/kmol', 'J/kg' and 'kJ/kg'
      Returns:
      enthalpy in specified unit
    • getEntropy

      double getEntropy()
      method to return total entropy of the fluid.
      Returns:
      entropy in unit J/K (Joule/Kelvin)
    • getEntropy

      double getEntropy(String unit)
      method to return total entropy of the fluid.
      Parameters:
      unit - unit supported units are J/K, J/molK, J/kgK and kJ/kgK
      Returns:
      entropy in specified unit
    • getExergy

      double getExergy(double temperatureOfSurroundings)
      method to return exergy defined as (h1-T0*s1) in a unit Joule.
      Parameters:
      temperatureOfSurroundings - in Kelvin
      Returns:
      a double
    • getExergy

      double getExergy(double temperatureOfSurroundings, String exergyUnit)
      method to return exergy in a specified unit.
      Parameters:
      temperatureOfSurroundings - in Kelvin
      exergyUnit - a String object
      Returns:
      exergy in specified unit
    • getFlowRate

      double getFlowRate(String flowunit)
      method to return flow rate of fluid.
      Parameters:
      flowunit - Supported units are kg/sec, kg/min, kg/hr, kg/day, m3/sec, m3/min, m3/hr, idSm3/hr, Sm3/sec, Sm3/hr, Sm3/day, MSm3/day, mole/sec, mole/min, mole/hr
      Returns:
      flow rate in specified unit
    • getFluidInfo

      String getFluidInfo()

      Getter for property info.

      Returns:
      a String object
    • getFluidName

      String getFluidName()

      getFluidName.

      Returns:
      a String object
    • getGamma

      double getGamma()
      method to return heat capacity ratio/adiabatic index/Poisson constant.
      Returns:
      kappa
    • getGamma2

      default double getGamma2()
      method to return heat capacity ratio calculated as Cp/(Cp-R*nMoles).
      Returns:
      kappa
    • getGasPhase

      PhaseInterface getGasPhase()

      getGasPhase.

      Returns:
      a PhaseInterface object
    • getGibbsEnergy

      double getGibbsEnergy()

      getGibbsEnergy.

      Returns:
      a double
    • getHeatOfVaporization

      double getHeatOfVaporization()

      getHeatOfVaporization.

      Returns:
      a double
    • getHelmholtzEnergy

      double getHelmholtzEnergy()

      getHelmholtzEnergy.

      Returns:
      a double
    • getHydrateCheck

      boolean getHydrateCheck()

      Getter for property hydrateCheck.

      Returns:
      a boolean
    • getIdealLiquidDensity

      double getIdealLiquidDensity(String unit)
      Get ideal liquid density of fluid in given unit.
      Parameters:
      unit - String Supported units are kg/m3 and gr/cm3
      Returns:
      a double
    • getInterfacialTension

      double getInterfacialTension(int phase1, int phase2)
      method to return interfacial tension between two phases.
      Parameters:
      phase1 - phase number of phase1
      phase2 - phase number of phase2
      Returns:
      interfacial tension with unit N/m
    • getInterfacialTension

      double getInterfacialTension(int phase1, int phase2, String unit)

      getInterfacialTension.

      Parameters:
      phase1 - phase number of phase1
      phase2 - phase number of phase2
      unit - a String object
      Returns:
      interfacial tension with specified unit
    • getInterfacialTension

      double getInterfacialTension(String phase1, String phase2)
      method to return interfacial tension between two phases.
      Parameters:
      phase1 - phase type of phase1 as string (valid phases are gas, oil, aqueous)
      phase2 - phase type of phase2 as string (valid phases are gas, oil, aqueous)
      Returns:
      interfacial tension with unit N/m. If one or both phases does not exist - the method will return NaN
    • getInternalEnergy

      double getInternalEnergy()
      method to return internal energy (U) in unit J.
      Returns:
      internal energy in unit Joule (J)
    • getInternalEnergy

      double getInternalEnergy(String unit)
      method to return internal energy (U) in a specified unit.
      Parameters:
      unit - Supported units are 'J', 'J/mol', 'J/kg' and 'kJ/kg'
      Returns:
      enthalpy in specified unit
    • getInterphaseProperties

      InterphasePropertiesInterface getInterphaseProperties()

      getInterphaseProperties.

      Returns:
      a InterphasePropertiesInterface object
    • getJouleThomsonCoefficient

      double getJouleThomsonCoefficient()
      Get the Joule Thomson Coefficient of a system. Based on a phase mole fraction basis average
      Returns:
      Joule Thomson coefficient in K/bar
    • getJouleThomsonCoefficient

      double getJouleThomsonCoefficient(String unit)
      Get the Joule Thomson Coefficient of a system. Based on a phase mole fraction basis average.
      Parameters:
      unit - Supported units are K/bar, C/bar
      Returns:
      Joule Thomson coefficient in specified unit
    • getKappa

      double getKappa()
      method to return heat capacity ratio/adiabatic index/Poisson constant.
      Returns:
      kappa
    • getKinematicViscosity

      double getKinematicViscosity()

      getKinematicViscosity.

      Returns:
      a double
    • getKinematicViscosity

      double getKinematicViscosity(String unit)
      method to return kinematic viscosity in a specified unit.
      Parameters:
      unit - Supported units are m2/sec
      Returns:
      kinematic viscosity in specified unit
    • getLiquidPhase

      PhaseInterface getLiquidPhase()

      getLiquidPhase.

      Returns:
      a PhaseInterface object
    • getLiquidVolume

      double getLiquidVolume()

      getLiquidVolume.

      Returns:
      a double
    • getLowestGibbsEnergyPhase

      PhaseInterface getLowestGibbsEnergyPhase()

      getLowestGibbsEnergyPhase.

      Returns:
      a PhaseInterface object
    • getMass

      double getMass(String unit)
      method to return mass of fluid.
      Parameters:
      unit - Supported units are kg, gr, tons
      Returns:
      mass in specified unit
    • getMaxNumberOfPhases

      int getMaxNumberOfPhases()

      Getter for property maxNumberOfPhases.

      Returns:
      Gets the maximum allowed number of phases to use.
    • getMixingRule

      MixingRuleTypeInterface getMixingRule()

      getMixingRule.

      Returns:
      A MixingRuleTypeInterface
    • getMixingRuleName

      String getMixingRuleName()

      getMixingRuleName.

      Returns:
      a String object
    • getModelName

      String getModelName()

      Getter for property modelName.

      Returns:
      a String object
    • getMolarComposition

      double[] getMolarComposition()

      Returns the overall mole composition vector in unit mole fraction.

      Returns:
      an array of type double
    • getWeightBasedComposition

      double[] getWeightBasedComposition()

      Returns the overall composition vector in unit mass fraction.

      Returns:
      an array of type double
    • getMolarMass

      double getMolarMass()
      Get molar mass of system.
      Returns:
      molar mass in unit kg/mol
    • getMolarMass

      double getMolarMass(String unit)
      Get molar mass of a fluid phase.
      Parameters:
      unit - Supported units are kg/mol, gr/mol
      Returns:
      molar mass in specified unit
    • getMolarRate

      double[] getMolarRate()
      Get the total molar flow rate of individual components in a fluid.
      Returns:
      molar flow of individual components in unit mol/sec
    • getMolarVolume

      double getMolarVolume()
      method to return molar volume of the fluid note: without Peneloux volume correction.
      Returns:
      molar volume volume in unit m3/mol*1e5
    • getMolarVolume

      double getMolarVolume(String unit)
      method to return molar volume of the fluid: eventual volume correction included.
      Parameters:
      unit - Supported units are m3/mol, litre/mol
      Returns:
      molar volume volume in unit
    • getMolecularWeights

      double[] getMolecularWeights()

      getMolecularWeights.

      Returns:
      an array of type double
    • getMoleFraction

      double getMoleFraction(int phaseNumber)

      getMoleFraction.

      Parameters:
      phaseNumber - a int
      Returns:
      a double
    • getMoleFractionsSum

      double getMoleFractionsSum()

      Get sum of mole fractions for all components. NB! init(0) must be called first.

      Returns:
      a double
    • getNormalBoilingPointTemperatures

      double[] getNormalBoilingPointTemperatures()

      getNormalBoilingPointTemperatures.

      Returns:
      an array of type double
    • getNumberOfComponents

      int getNumberOfComponents()

      Get number of components added to System.

      Returns:
      the number of components in System.
    • getNumberOfMoles

      @Deprecated default double getNumberOfMoles()
      Deprecated.

      Getter for property numberOfMoles.

      Returns:
      a double
    • getNumberOfOilFractionComponents

      int getNumberOfOilFractionComponents()

      getNumberOfOilFractionComponents.

      Returns:
      a int
    • getNumberOfPhases

      int getNumberOfPhases()

      Getter for property numberOfPhases.

      Returns:
      Number of phases used
    • getOilFractionIDs

      int[] getOilFractionIDs()

      getOilFractionIDs.

      Returns:
      an array of
      invalid reference
      int
      objects
    • getOilFractionLiquidDensityAt25C

      double[] getOilFractionLiquidDensityAt25C()

      getOilFractionLiquidDensityAt25C.

      Returns:
      an array of type double
    • getOilFractionMolecularMass

      double[] getOilFractionMolecularMass()

      getOilFractionMolecularMass.

      Returns:
      an array of type double
    • getOilFractionNormalBoilingPoints

      double[] getOilFractionNormalBoilingPoints()

      getOilFractionNormalBoilingPoints.

      Returns:
      an array of type double
    • getPC

      double getPC()

      Getter for property PC.

      Returns:
      Critical pressure in unit bara.
    • getPhase

      PhaseInterface getPhase(int i)
      Get phase number i from SystemInterface object.
      Parameters:
      i - Phase number
      Returns:
      a PhaseInterface object
    • getPhase

      PhaseInterface getPhase(PhaseType pt)

      getPhase.

      Parameters:
      pt - a PhaseType object
      Returns:
      a PhaseInterface object
    • getPhase

      PhaseInterface getPhase(String phaseTypeName)

      getPhase.

      Parameters:
      phaseTypeName - a String object
      Returns:
      a PhaseInterface object
    • getPhaseFraction

      double getPhaseFraction(String phaseTypeName, String unit)
      method to return phase fraction of selected phase.
      Parameters:
      phaseTypeName - gas/oil/aqueous
      unit - mole/volume/weight
      Returns:
      phase: fraction in specified unit
    • getPhaseIndex

      int getPhaseIndex(int i)

      Indexed getter for property phaseIndex.

      Parameters:
      i - Phase number
      Returns:
      PhaseIndex to index into phaseArray.
    • getPhaseIndex

      int getPhaseIndex(PhaseInterface phase)
      Get property phaseIndex corresponding to a phase.
      Parameters:
      phase - Phase object to search for.
      Returns:
      PhaseIndex to index into phaseArray.
    • getPhaseIndex

      int getPhaseIndex(String phaseTypeName)

      Get property phaseIndex corresponding to a phase.

      Parameters:
      phaseTypeName - a String object
      Returns:
      PhaseIndex to index into phaseArray.
    • getPhaseNumberOfPhase

      int getPhaseNumberOfPhase(PhaseType pt)

      Get phase number of phase of specific type.

      Parameters:
      pt - Phase type to look for.
      Returns:
      Phase number
    • getPhaseNumberOfPhase

      default int getPhaseNumberOfPhase(String phaseTypeName)

      Get phase number of phase of specific type.

      Parameters:
      phaseTypeName - Name of phase type to look for
      Returns:
      Phase number
    • getPhaseOfType

      PhaseInterface getPhaseOfType(String phaseTypeName)
      return the phase of to specified type if the phase does not exist, the method will return null.
      Parameters:
      phaseTypeName - the phase type to be returned (gas, oil, aqueous, wax, hydrate are supported)
      Returns:
      a PhaseInterface object
    • getPhases

      PhaseInterface[] getPhases()

      getPhases.

      Returns:
      an array of PhaseInterface objects
    • getPressure

      double getPressure()
      method to return pressure.
      Returns:
      pressure in unit bara
    • getPressure

      double getPressure(int phaseNumber)

      method to return pressure of phase.

      Parameters:
      phaseNumber - Number of the phase to get pressure for
      Returns:
      pressure in unit bara
    • getPressure

      double getPressure(String unit)
      method to return pressure in a specified unit.
      Parameters:
      unit - Supported units are bara, barg, Pa, MPa, psi, psia, psig
      Returns:
      pressure in specified unit
    • getProperties

      SystemProperties getProperties()
      Get physical properties of System.
      Returns:
      System properties
    • getProperty

      double getProperty(String prop)

      getProperty.

      Parameters:
      prop - a String object
      Returns:
      a double
    • getProperty

      double getProperty(String prop, int phaseNum)

      getProperty.

      Parameters:
      prop - a String object
      phaseNum - a int
      Returns:
      a double
    • getProperty

      double getProperty(String prop, String compName, int phaseNum)

      getProperty.

      Parameters:
      prop - a String object
      compName - a String object
      phaseNum - a int
      Returns:
      a double
    • getResultTable

      String[][] getResultTable()

      getResultTable.

      Returns:
      an array of String objects
    • getSoundSpeed

      double getSoundSpeed()
      Get the speed of sound of a system. The sound speed is implemented based on a molar average over the phases
      Returns:
      speed of sound in m/s
    • getSoundSpeed

      double getSoundSpeed(String unit)
      Get the speed of sound of a system. The sound speed is implemented based on a molar average over the phases
      Parameters:
      unit - Supported units are m/s, km/h
      Returns:
      speed of sound in m/s
    • getStandard

      StandardInterface getStandard()

      Getter for property standard.

      Returns:
      a StandardInterface object
    • getStandard

      StandardInterface getStandard(String standardName)

      Getter for property standard.

      Parameters:
      standardName - a String object
      Returns:
      a StandardInterface object
    • getTC

      double getTC()

      Get critical temperature.

      Returns:
      Critical temperature in unit Kelvin
    • getTemperature

      double getTemperature()
      Get temperature.
      Returns:
      temperature in unit Kelvin
    • getTemperature

      double getTemperature(int phaseNumber)

      method to return temperature from a specific phase.

      Parameters:
      phaseNumber - phase to get temperature of
      Returns:
      temperature in unit Kelvin
    • getTemperature

      double getTemperature(String unit)
      method to return temperature in a specified unit.
      Parameters:
      unit - Supported units are K, C, R
      Returns:
      temperature in specified unit
    • getThermalConductivity

      double getThermalConductivity()
      method to return conductivity of a fluid.
      Returns:
      conductivity in unit W/mK
    • getThermalConductivity

      double getThermalConductivity(String unit)
      method to return thermal conductivity in a specified unit.
      Parameters:
      unit - Supported units are W/mK, W/cmK
      Returns:
      conductivity in specified unit
    • getTotalNumberOfMoles

      double getTotalNumberOfMoles()
      Getter for property totalNumberOfMoles.
      Returns:
      Total molar flow rate of fluid in unit mol/sec
    • getViscosity

      double getViscosity()
      method to return viscosity of a fluid.
      Returns:
      viscosity in unit kg/msec
    • getViscosity

      double getViscosity(String unit)
      method to return viscosity in a specified unit.
      Parameters:
      unit - Supported units are kg/msec, cP (centipoise), Pas (Pascal*second)
      Returns:
      viscosity in specified unit
    • getVolume

      double getVolume()
      method to return fluid volume.
      Returns:
      volume in unit m3*1e5
    • getVolume

      double getVolume(String unit)
      method to return fluid volume.
      Parameters:
      unit - Supported units are m3, litre, m3/kg, m3/mol
      Returns:
      volume in specified unit
    • getVolumeFraction

      double getVolumeFraction(int phaseNumber)
      method to return the volume fraction of a phase note: without Peneloux volume correction.
      Parameters:
      phaseNumber - number of the phase to get volume fraction for
      Returns:
      volume fraction
    • getOilAssayCharacterisation

      OilAssayCharacterisation getOilAssayCharacterisation()

      getOilAssayCharacterisation.

      Returns:
      a OilAssayCharacterisation object
    • getWaxCharacterisation

      WaxCharacterise getWaxCharacterisation()

      getWaxCharacterisation.

      Returns:
      a WaxCharacterise object
    • getWaxModel

      WaxModelInterface getWaxModel()

      getWaxModel.

      Returns:
      a WaxModelInterface object
    • getWtFraction

      double getWtFraction(int phaseNumber)

      getWtFraction.

      Parameters:
      phaseNumber - a int
      Returns:
      a double
    • getZ

      double getZ()
      method to return compressibility factor of a fluid compressibility factor is defined in EoS from PV=ZnRT where V is total volume of fluid.
      Returns:
      compressibility factor Z
    • getZvolcorr

      double getZvolcorr()
      method to return Z volume corrected gas compressibility.
      Returns:
      double Z volume corrected
    • hasComponent

      default boolean hasComponent(String name)
      Verify if system has a component.
      Parameters:
      name - Name of component to look for. NB! Converts name to normalized name.
      Returns:
      True if component is found.
    • hasComponent

      default boolean hasComponent(String name, boolean normalized)
      Verify if system has a component.
      Parameters:
      name - Name of component to look for.
      normalized - Set true to convert input name to normalized component name.
      Returns:
      True if component is found.
    • hashCode

      int hashCode()
      Overrides:
      hashCode in class Object
    • hasPhaseType

      boolean hasPhaseType(PhaseType pt)
      Verify if system has a phase of a specific type.
      Parameters:
      pt - PhaseType to look for
      Returns:
      True if system contains a phase of requested type
    • hasPhaseType

      default boolean hasPhaseType(String phaseTypeName)
      Verify if system has a phase of a specific type.
      Parameters:
      phaseTypeName - PhaseType to look for
      Returns:
      True if system contains a phase of requested type
    • hasPlusFraction

      boolean hasPlusFraction()

      Getter for property hasPlusFraction.

      Returns:
      a boolean
    • hasSolidPhase

      default boolean hasSolidPhase()

      hasSolidPhase.

      Returns:
      True if system contains a solid phase
    • hasHydratePhase

      default boolean hasHydratePhase()
      Check if the system contains a hydrate phase.
      Returns:
      True if system contains a hydrate phase
    • getHydrateFraction

      default double getHydrateFraction()
      Get the mole fraction of the hydrate phase.

      Returns the beta value (phase fraction) for the hydrate phase if it exists, otherwise returns 0.0.

      Returns:
      the hydrate phase mole fraction, or 0.0 if no hydrate phase exists
    • getHydratePhase

      default PhaseInterface getHydratePhase()
      Get the hydrate phase if it exists.
      Returns:
      the hydrate phase, or null if no hydrate phase exists
    • init

      void init(int initType)
      method to calculate thermodynamic properties of the fluid. The temperature, pressure, number of phases and composition of the phases will be used as basis for calculation.
      Parameters:
      initType - - The number can be 0, 1, 2 or 3. 0: Set feed composition for all phases. 1: Calculation of density, fugacities and Z-factor 2: 1 + calculation of enthalpy, entropy, Cp, Cv, and most other thermodynamic properties 3: 1+2 + Calculation of composition derivatives of fugacity coefficients.
    • init

      void init(int initType, int phaseNum)
      method to calculate thermodynamic properties of the selected phase. The temperature, pressure, number of phases and composition of the phase will be used as basis for calculation.
      Parameters:
      initType - - The number can be 0, 1, 2 or 3. 0: Set feed composition. 1: Calculation of density, fugacities and Z-factor 2: 1 + calculation of enthalpy, entropy, Cp, Cv, and most other thermodynamic properties 3: 1+2 + Calculation of composition derivatives of fugacity coefficients.
      phaseNum - a int
    • init_x_y

      void init_x_y()

      init_x_y.

    • initBeta

      void initBeta()

      Calculate system beta values using Phase.getNumberOfMolesInPhase and getTotalNumberOfMoles.

    • initNumeric

      void initNumeric()
      initNumeric.
    • initPhysicalProperties

      void initPhysicalProperties()
      Initialize / calculate all physical properties for all phases and interfaces.
    • initPhysicalProperties

      void initPhysicalProperties(PhysicalPropertyType ppt)
      Initialize / calculate a specified physical properties for all phases and interfaces.
      Parameters:
      ppt - PhysicalPropertyType enum object.
    • initPhysicalProperties

      default void initPhysicalProperties(String name)
      Initialize / calculate a specified physical properties for all phases and interfaces.
      Parameters:
      name - Name of physical property.
    • initProperties

      default void initProperties()
      Calculates thermodynamic and physical properties of a fluid using initThermoProperties() and initPhysicalProperties().
    • initRefPhases

      void initRefPhases()

      initRefPhases.

    • initThermoProperties

      default void initThermoProperties()
      Calculates thermodynamic properties of a fluid using the init(2) method.
    • initTotalNumberOfMoles

      void initTotalNumberOfMoles(double change)

      initTotalNumberOfMoles.

      Parameters:
      change - a double
    • invertPhaseTypes

      void invertPhaseTypes()

      invertPhaseTypes.

    • isChemicalSystem

      boolean isChemicalSystem()

      isChemicalSystem.

      Returns:
      a boolean
    • isChemicalSystem

      void isChemicalSystem(boolean temp)

      isChemicalSystem.

      Parameters:
      temp - a boolean
    • isForcePhaseTypes

      boolean isForcePhaseTypes()

      isForcePhaseTypes.

      Returns:
      a boolean
    • isImplementedCompositionDeriativesofFugacity

      boolean isImplementedCompositionDeriativesofFugacity()

      isImplementedCompositionDeriativesofFugacity.

      Returns:
      a boolean
    • isImplementedCompositionDeriativesofFugacity

      void isImplementedCompositionDeriativesofFugacity(boolean isImpl)

      isImplementedCompositionDeriativesofFugacity.

      Parameters:
      isImpl - a boolean
    • isImplementedPressureDeriativesofFugacity

      boolean isImplementedPressureDeriativesofFugacity()

      isImplementedPressureDeriativesofFugacity.

      Returns:
      a boolean
    • isImplementedTemperatureDeriativesofFugacity

      boolean isImplementedTemperatureDeriativesofFugacity()

      isImplementedTemperatureDeriativesofFugacity.

      Returns:
      a boolean
    • isMultiphaseWaxCheck

      boolean isMultiphaseWaxCheck()

      isMultiphaseWaxCheck.

      Returns:
      a boolean
    • isNumericDerivatives

      boolean isNumericDerivatives()

      Getter for property numericDerivatives.

      Returns:
      a boolean
    • isPhase

      boolean isPhase(int i)
      Returns true if phase exists and is not null.
      Parameters:
      i - Phase number
      Returns:
      True if phase exists, false if not.
    • normalizeBeta

      void normalizeBeta()

      normalizeBeta.

    • orderByDensity

      void orderByDensity()
      Order phases 0-3, as many as there are, by density such that getPhase(0) is lightest.

      Typically GAS, LIQUID for two-phase or GAS, OIL, AQUEOUS for multiphase .

    • phaseToSystem

      SystemInterface phaseToSystem(int phaseNumber)

      phaseToSystem.

      Parameters:
      phaseNumber - a int
      Returns:
      a SystemInterface object
    • phaseToSystem

      SystemInterface phaseToSystem(int phaseNumber1, int phaseNumber2)

      phaseToSystem.

      Parameters:
      phaseNumber1 - a int
      phaseNumber2 - a int
      Returns:
      a SystemInterface object
    • phaseToSystem

      SystemInterface phaseToSystem(PhaseInterface newPhase)

      phaseToSystem.

      Parameters:
      newPhase - a PhaseInterface object
      Returns:
      a SystemInterface object
    • phaseToSystem

      SystemInterface phaseToSystem(String phaseName)

      phaseToSystem.

      Parameters:
      phaseName - a String object
      Returns:
      a SystemInterface object
    • prettyPrint

      default void prettyPrint()
      Prints the fluid in a visually appealing way.
    • readFluid

      void readFluid(String fluidName)

      readFluid.

      Parameters:
      fluidName - a String object
    • readObject

      SystemInterface readObject(int ID)

      readObject.

      Parameters:
      ID - a int
      Returns:
      a SystemInterface object
    • readObjectFromFile

      SystemInterface readObjectFromFile(String filePath, String fluidName)

      readObjectFromFile.

      Parameters:
      filePath - a String object
      fluidName - a String object
      Returns:
      a SystemInterface object
    • reInitPhaseType

      void reInitPhaseType()

      reInitPhaseType.

    • removeComponent

      void removeComponent(String name)

      removeComponent.

      Parameters:
      name - Name of the component to remove. See NeqSim database for component in the database.
    • removePhase

      void removePhase(int specPhase)

      removePhase.

      Parameters:
      specPhase - a int
    • removePhaseKeepTotalComposition

      void removePhaseKeepTotalComposition(int specPhase)

      removePhaseKeepTotalComposition.

      Parameters:
      specPhase - a int
    • renameComponent

      void renameComponent(String oldName, String newName)

      renameComponent.

      Parameters:
      oldName - a String object
      newName - a String object
    • replacePhase

      void replacePhase(int repPhase, PhaseInterface newPhase)

      replacePhase.

      Parameters:
      repPhase - a int
      newPhase - a PhaseInterface object
    • reset

      void reset()
      Set mole fractions of all components to 0.
    • reset_x_y

      void reset_x_y()

      reset_x_y.

    • resetCharacterisation

      void resetCharacterisation()

      resetCharacterisation.

    • resetDatabase

      void resetDatabase()

      resetDatabase.

    • resetPhysicalProperties

      void resetPhysicalProperties()

      resetPhysicalProperties.

    • save

      void save(String name)

      Save System object to file.

      Parameters:
      name - File path to save to.
    • saveFluid

      void saveFluid(int id)

      saveFluid.

      Parameters:
      id - a int
    • saveFluid

      void saveFluid(int id, String text)

      saveFluid.

      Parameters:
      id - a int
      text - a String object
    • saveObject

      void saveObject(int ID, String text)

      saveObject.

      Parameters:
      ID - a int
      text - a String object
    • saveObjectToFile

      void saveObjectToFile(String filePath, String fluidName)

      saveObjectToFile.

      Parameters:
      filePath - a String object
      fluidName - a String object
    • saveToDataBase

      void saveToDataBase()

      saveToDataBase.

    • setAllComponentsInPhase

      void setAllComponentsInPhase(int phaseNum)

      setAllComponentsInPhase.

      Parameters:
      phaseNum - a int
    • setAllPhaseType

      void setAllPhaseType(PhaseType pt)
      Set phase type of all phases.
      Parameters:
      pt - PhaseType to set phases as.
    • setAttractiveTerm

      void setAttractiveTerm(int i)

      setAttractiveTerm.

      Parameters:
      i - a int
    • setBeta

      void setBeta(double b)
      Setter for property beta.

      NB! Sets beta = b for first (heaviest) phase and 1-b for second (lightest) phase, not for multiphase systems.

      Parameters:
      b - Beta value to set.
    • setBeta

      void setBeta(int phaseNum, double b)

      Setter for property beta for a given phase.

      Parameters:
      phaseNum - Phase number to set beta for.
      b - Beta value to set.
    • setBmixType

      void setBmixType(int bmixType)

      setBmixType.

      Parameters:
      bmixType - a int
    • setComponentNames

      void setComponentNames(String[] componentNames)

      setComponentNames.

      Parameters:
      componentNames - an array of String objects
    • setComponentNameTag

      void setComponentNameTag(String nameTag)

      setComponentNameTag.

      Parameters:
      nameTag - a String object
    • setComponentNameTagOnNormalComponents

      void setComponentNameTagOnNormalComponents(String nameTag)

      setComponentNameTagOnNormalComponents.

      Parameters:
      nameTag - a String object
    • setEmptyFluid

      void setEmptyFluid()
      Set the flow rate (moles) of all components to zero.
    • setFluidInfo

      void setFluidInfo(String info)

      Setter for property info. .

      Parameters:
      info - a String object
    • setFluidName

      void setFluidName(String fluidName)

      setFluidName.

      Parameters:
      fluidName - a String object
    • setForcePhaseTypes

      void setForcePhaseTypes(boolean forcePhaseTypes)

      setForcePhaseTypes.

      Parameters:
      forcePhaseTypes - a boolean
    • setHeavyTBPfractionAsPlusFraction

      boolean setHeavyTBPfractionAsPlusFraction()

      setHeavyTBPfractionAsPlusFraction.

      Returns:
      a boolean
    • setHydrateCheck

      void setHydrateCheck(boolean hydrateCheck)

      setHydrateCheck.

      Parameters:
      hydrateCheck - a boolean
    • setImplementedCompositionDeriativesofFugacity

      void setImplementedCompositionDeriativesofFugacity(boolean implementedCompositionDeriativesofFugacity)

      setImplementedCompositionDeriativesofFugacity.

      Parameters:
      implementedCompositionDeriativesofFugacity - a boolean
    • setImplementedPressureDeriativesofFugacity

      void setImplementedPressureDeriativesofFugacity(boolean implementedPressureDeriativesofFugacity)

      setImplementedPressureDeriativesofFugacity.

      Parameters:
      implementedPressureDeriativesofFugacity - a boolean
    • setImplementedTemperatureDeriativesofFugacity

      void setImplementedTemperatureDeriativesofFugacity(boolean implementedTemperatureDeriativesofFugacity)

      setImplementedTemperatureDeriativesofFugacity.

      Parameters:
      implementedTemperatureDeriativesofFugacity - a boolean
    • setMaxNumberOfPhases

      void setMaxNumberOfPhases(int maxNumberOfPhases)

      Setter for property maxNumberOfPhases.

      Parameters:
      maxNumberOfPhases - The maximum allowed number of phases to use.
    • setMixingRule

      void setMixingRule(MixingRuleTypeInterface emrt)
      method to set mixing rule used for the fluid.
      Parameters:
      emrt - MixingRuleTypeInterface enum
    • setMixingRule

      default 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
    • setMixingRule

      default void setMixingRule(String typename)
      method to set the mixing rule for the fluid.
      Parameters:
      typename - a String object
    • setMixingRule

      void setMixingRule(String typename, String GEmodel)

      setMixingRule.

      Parameters:
      typename - a String object
      GEmodel - a String object
    • setModel

      SystemInterface setModel(String model)

      setModel.

      Parameters:
      model - a String object
      Returns:
      a SystemInterface object
    • setMolarComposition

      void setMolarComposition(double[] moles)

      This method is used to set the total molar composition of a fluid. The total flow rate will be kept constant. The input mole fractions will be normalized.

      Parameters:
      moles - an array of type double
    • setMolarCompositionOfPlusFluid

      void setMolarCompositionOfPlusFluid(double[] molefractions)
      This method is used to set the total molar composition of a characterized fluid. The total flow rate will be kept constant. The input mole fractions will be normalized.
      Parameters:
      molefractions - is a double array taking the molar fraction of the components in the fluid. THe last fraction in the array is the total molefraction of the characterized components.
    • setMolarCompositionPlus

      void setMolarCompositionPlus(double[] molefractions)
      This method is used to set the total molar composition of a plus fluid. The total flow rate will be kept constant. The input mole fractions will be normalized.
      Parameters:
      molefractions - is a double array taking the molar fraction of the components in the fluid. THe last molfraction is the mole fraction of the plus component
    • setMolarFlowRates

      void setMolarFlowRates(double[] moles)

      setMolarFlowRates.

      Parameters:
      moles - an array of type double
    • setComponentFlowRates

      void setComponentFlowRates(double[] componentFlowRates, String unit)

      setComponentFlowRates.

      Parameters:
      componentFlowRates - an array of type double
      unit - a String object. Allowed units are: "mol/sec", "kmol/sec", "kmol/hr", "mol/hr", "kg/hr", "kg/sec", "kmol/day"
    • setMultiPhaseCheck

      void setMultiPhaseCheck(boolean doMultiPhaseCheck)
      method to specify if calculations should check for more than two fluid phases.
      Parameters:
      doMultiPhaseCheck - Specify if the calculations should check for more than two fluid phases. Default is two fluid phases (gas and liquid). If set to true the program will check for gas and multiple liquid phases (eg. gas-oil-aqueous).
    • setEnhancedMultiPhaseCheck

      void setEnhancedMultiPhaseCheck(boolean enhancedMultiPhaseCheck)
      Enable or disable enhanced stability analysis for flash calculations. When enabled, uses Wilson K-value initial guesses and tests both vapor-like and liquid-like trial phases. This is more robust for detecting liquid-liquid equilibria in complex mixtures (e.g., sour gas, CO2 systems) but adds computational overhead. Default is false (disabled).
      Parameters:
      enhancedMultiPhaseCheck - true to enable enhanced multi-phase detection
    • setMultiphaseWaxCheck

      void setMultiphaseWaxCheck(boolean multiphaseWaxCheck)

      setMultiphaseWaxCheck.

      Parameters:
      multiphaseWaxCheck - a boolean
    • setNumberOfPhases

      void setNumberOfPhases(int number)

      Setter for property numberOfPhases.

      Parameters:
      number - Number of phases to use.
    • setNumericDerivatives

      void setNumericDerivatives(boolean numericDerivatives)

      Setter for property numericDerivatives.

      Parameters:
      numericDerivatives - a boolean
    • setPC

      void setPC(double PC)

      Getter for property PC.

      Parameters:
      PC - Critical pressure to set in unit bara.
    • setComponentCriticalParameters

      void setComponentCriticalParameters(int componentIndex, double tc, double pc, double acentricFactor)
      Set critical properties and acentric factor for a component in all phases.
      Parameters:
      componentIndex - index of component to update
      tc - critical temperature in K
      pc - critical pressure in bara
      acentricFactor - component acentric factor
    • setComponentCriticalParameters

      void setComponentCriticalParameters(String componentName, double tc, double pc, double acentricFactor)
      Set critical properties and acentric factor for a component in all phases.
      Parameters:
      componentName - name of component to update
      tc - critical temperature in K
      pc - critical pressure in bara
      acentricFactor - component acentric factor
    • setComponentVolumeCorrection

      void setComponentVolumeCorrection(int componentIndex, double volumeCorrection)
      Set Peneloux volume correction for a component in all phases.
      Parameters:
      componentIndex - index of component to update
      volumeCorrection - Peneloux volume correction
    • setComponentVolumeCorrection

      void setComponentVolumeCorrection(String componentName, double volumeCorrection)
      Set Peneloux volume correction for a component in all phases.
      Parameters:
      componentName - name of component to update
      volumeCorrection - Peneloux volume correction
    • setBinaryInteractionParameter

      void setBinaryInteractionParameter(int component1, int component2, double value)
      Set binary interaction parameter for all phase mixing rules.
      Parameters:
      component1 - index of first component
      component2 - index of second component
      value - kij value
    • setBinaryInteractionParameter

      void setBinaryInteractionParameter(String component1, String component2, double value)
      Set binary interaction parameter for all phase mixing rules.
      Parameters:
      component1 - name of first component
      component2 - name of second component
      value - kij value
    • setPhase

      void setPhase(PhaseInterface phase, int index)

      Set phaseArray[phaseIndex] = phase. NB! Transfers the pressure and temperature from the currently existing phase object at index numb

      Parameters:
      phase - a PhaseInterface object
      index - Phase index to insert object at
    • setPhaseIndex

      void setPhaseIndex(int index, int phaseIndex)

      Indexed setter for property phaseIndex. this.phaseIndex[index] = phaseIndex;

      Parameters:
      index - a int
      phaseIndex - a int
    • setPhaseType

      void setPhaseType(int phaseToChange, PhaseType pt)
      Change the phase type of a given phase.
      Parameters:
      phaseToChange - the phase number of the phase to set phase type
      pt - PhaseType to set
    • setPhaseType

      void setPhaseType(int phaseToChange, String phaseName)
      Change the phase type of a given phase.
      Parameters:
      phaseToChange - the phase number of the phase to set phase type
      phaseName - String to set
    • setPhysicalPropertyModel

      default void setPhysicalPropertyModel(PhysicalPropertyModel ppm)
      Set the physical property model type for each phase of the System.
      Parameters:
      ppm - PhysicalPropertyModel enum object
    • setPhysicalPropertyModel

      default void setPhysicalPropertyModel(int type)
      Set the physical property model type for each phase of the System.
      Parameters:
      type - 0 Default, 1 Water, 2 Glycol, 3 Amine, 4 CO2Water, 6 Basic
    • setPressure

      void setPressure(double pres)
      method to set the pressure of a fluid (same pressure for all phases).
      Parameters:
      pres - pressure in unit bara (absolute pressure in bar)
    • setPressure

      void setPressure(double newPressure, String unit)
      method to set the pressure of a fluid (same pressure for all phases).
      Parameters:
      newPressure - in specified unit
      unit - unit can be bar, bara, barg or atm
    • setSolidPhaseCheck

      void setSolidPhaseCheck(boolean test)

      Setter for property solidPhaseCheck.

      Parameters:
      test - a boolean
    • setSolidPhaseCheck

      void setSolidPhaseCheck(String solidComponent)

      setSolidPhaseCheck.

      Parameters:
      solidComponent - a String object
    • setStandard

      void setStandard(String standardName)

      Setter for property standard.

      Parameters:
      standardName - a String object
    • setTC

      void setTC(double TC)

      Getter for property TC.

      Parameters:
      TC - Critical temperature to set
    • setTemperature

      void setTemperature(double temp)

      Set the temperature of a fluid (same temperature for all phases).

      Parameters:
      temp - Temperature in unit Kelvin
    • setTemperature

      void setTemperature(double temp, int phaseNumber)

      Set the temperature of a single phase in the fluid.

      Parameters:
      temp - Temperature in unit Kelvin
      phaseNumber - a int
    • setTemperature

      void setTemperature(double temp, String unit)
      method to set the temperature of a fluid (same temperature for all phases).
      Parameters:
      temp - Temperature in specified unit
      unit - unit can be C or K (Celsius or Kelvin)
    • setTotalFlowRate

      void setTotalFlowRate(double flowRate, String flowunit)

      setTotalFlowRate.

      Parameters:
      flowRate - a double
      flowunit - a String object. flow units are: kg/sec, kg/min, kg/hr m3/sec, m3/min, m3/hr, mole/sec, mole/min, mole/hr, Sm3/hr, Sm3/day, idSm3/hr, idSm3/day
    • setTotalNumberOfMoles

      void setTotalNumberOfMoles(double totalNumberOfMoles)

      Setter for property totalNumberOfMoles.

      Parameters:
      totalNumberOfMoles - Total molar flow rate of fluid in unit mol/sec
    • setUseTVasIndependentVariables

      void setUseTVasIndependentVariables(boolean useTVasIndependentVariables)

      setUseTVasIndependentVariables.

      Parameters:
      useTVasIndependentVariables - a boolean
    • tuneModel

      void tuneModel(String model, double val, int phaseNum)

      tuneModel.

      Parameters:
      model - a String object
      val - a double
      phaseNum - a int
    • useVolumeCorrection

      void useVolumeCorrection(boolean volcor)

      useVolumeCorrection.

      Parameters:
      volcor - a boolean
    • write

      void write(String name, String filename, boolean newfile)

      write.

      Parameters:
      name - a String object
      filename - a String object
      newfile - a boolean
    • getKvector

      double[] getKvector()

      getKvector - return vector of equilibrium constants.

      Returns:
      an array of type double
    • getzvector

      double[] getzvector()

      getzvector - return vector of total molar composition.

      Returns:
      an array of type double
    • toJson

      String toJson()

      toJson - return String with json inormation of fluid.

      Returns:
      a String object
    • toCompJson

      String toCompJson()

      toCompJson - return String with json inormation of pure component properties of fluid.

      Returns:
      a String object
    • setForceSinglePhase

      void setForceSinglePhase(PhaseType phasetype)

      setForceSinglePhase - force the fluid to be single phase of type as spesified by phasetype input.

      Parameters:
      phasetype - a PhaseType object
    • setForceSinglePhase

      void setForceSinglePhase(String phasetypename)

      setForceSinglePhase - force the fluid to be single phase of type as spesified by phasetype input. phasetypename can be GAS, OIL and AQUEOUS

      Parameters:
      phasetypename - a String object
    • isInitialized

      boolean isInitialized()

      isInitialized.

      Returns:
      a boolean
    • setMolarCompositionOfNamedComponents

      void setMolarCompositionOfNamedComponents(String nameDef, double[] molarComposition)
      Sets the molar composition of components whose names contain the specified definition.
      Parameters:
      nameDef - the definition to match component names against
      molarComposition - an array of molar compositions to set for the matching components
    • addTBPfraction3

      void addTBPfraction3(String componentName, double numberOfMoles, double density, double boilingPoint)
      Adds a TBP fraction to the system.
      Parameters:
      componentName - the name of the component
      numberOfMoles - number of moles
      density - density of the component
      boilingPoint - boiling point
    • addTBPfraction4

      void addTBPfraction4(String componentName, double numberOfMoles, double molarMass, double density, double boilingPoint)
      Adds a TBP fraction to the system.
      Parameters:
      componentName - the name of the component
      numberOfMoles - number of moles
      molarMass - molar mass
      density - density of the component
      boilingPoint - boiling point
    • calculateMolarMassFromDensityAndBoilingPoint

      double calculateMolarMassFromDensityAndBoilingPoint(double density, double boilingPoint)

      calculateMolarMassFromDensityAndBoilingPoint.

      Parameters:
      density - a double
      boilingPoint - a double
      Returns:
      a double
    • validateSetup

      default ValidationResult validateSetup()
      Validate the thermodynamic system setup before use.

      Checks for common setup errors:

      • Components defined
      • Mixing rule set
      • Temperature and pressure in valid ranges
      • Composition normalized
      Returns:
      validation result with errors and warnings