Class SystemThermo

java.lang.Object
neqsim.thermo.system.SystemThermo
All Implemented Interfaces:
Serializable, Cloneable, SystemInterface
Direct Known Subclasses:
SystemEos, SystemIdealGas

public abstract class SystemThermo extends Object implements SystemInterface
This is the base class of the System classes.
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • logger

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • MAX_PHASES

      private static final int MAX_PHASES
      See Also:
    • a

      protected int a
    • allowPhaseShift

      protected boolean allowPhaseShift
    • attractiveTermNumber

      protected int attractiveTermNumber
    • beta

      protected double[] beta
      Fraction of moles_in_phase / moles_in_system. Cached.
    • CapeOpenProperties10

      protected String[] CapeOpenProperties10
    • CapeOpenProperties11

      protected String[] CapeOpenProperties11
    • characterization

      public Characterise characterization
    • checkStability

      protected boolean checkStability
    • chemicalReactionOperations

      protected ChemicalReactionOperations chemicalReactionOperations
    • chemicalSystem

      protected boolean chemicalSystem
    • componentNames

      private ArrayList<String> componentNames
    • componentNameTag

      public String componentNameTag
    • criticalPressure

      protected double criticalPressure
      Critical pressure in bara.
    • criticalTemperature

      protected double criticalTemperature
      Critical temperature in Kelvin.
    • fluidInfo

      protected String fluidInfo
    • fluidName

      protected String fluidName
    • forcePhaseTypes

      private boolean forcePhaseTypes
    • hydrateCheck

      protected boolean hydrateCheck
    • implementedCompositionDeriativesofFugacity

      private boolean implementedCompositionDeriativesofFugacity
    • implementedPressureDeriativesofFugacity

      private boolean implementedPressureDeriativesofFugacity
    • implementedTemperatureDeriativesofFugacity

      private boolean implementedTemperatureDeriativesofFugacity
    • interfaceProp

      protected InterphasePropertiesInterface interfaceProp
    • isInitialized

      boolean isInitialized
    • maxNumberOfPhases

      public int maxNumberOfPhases
      Maximum allowed number of phases.
    • mixingRuleType

      private MixingRuleTypeInterface mixingRuleType
    • modelName

      protected String modelName
    • multiPhaseCheck

      protected boolean multiPhaseCheck
    • enhancedMultiPhaseCheck

      protected boolean enhancedMultiPhaseCheck
    • multiphaseWaxCheck

      private boolean multiphaseWaxCheck
    • numberOfComponents

      protected int numberOfComponents
    • numberOfPhases

      protected int numberOfPhases
      Number of phases in use/existing.
    • numericDerivatives

      protected boolean numericDerivatives
    • phaseArray

      protected PhaseInterface[] phaseArray
      Array containing all phases of System. NB! Phases are reorered according to density, use phaseIndex to keep track of the creation order.
    • phaseIndex

      protected int[] phaseIndex
      Array of indexes to phaseArray keeping track of the creation order of the phases where 0 is the first created phase and the lowest number is the phase created last.
    • phaseType

      protected PhaseType[] phaseType
    • resultTable

      protected String[][] resultTable
    • solidPhaseCheck

      protected boolean solidPhaseCheck
    • standard

      protected StandardInterface standard
    • totalNumberOfMoles

      private double totalNumberOfMoles
    • useTVasIndependentVariables

      private boolean useTVasIndependentVariables
    • waxCharacterisation

      protected WaxCharacterise waxCharacterisation
    • oilAssayCharacterisation

      protected transient OilAssayCharacterisation oilAssayCharacterisation
  • Constructor Details

    • SystemThermo

      public SystemThermo()

      Constructor for SystemThermo.

    • SystemThermo

      public SystemThermo(double T, double P, boolean checkForSolids)

      Constructor for SystemThermo.

      Parameters:
      T - The temperature in unit Kelvin
      P - The pressure in unit bara (absolute pressure)
      checkForSolids - Set true to do solid phase check and calculations
  • Method Details

    • addCapeOpenProperty

      public void addCapeOpenProperty(String propertyName)

      addCapeOpenProperty.

      Specified by:
      addCapeOpenProperty in interface SystemInterface
      Parameters:
      propertyName - a String object
    • addCharacterized

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

      addCharacterized.

      Specified by:
      addCharacterized in interface SystemInterface
      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

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

      public void addComponent(int index, double moles)

      addComponent.

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

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

      addComponent.

      Specified by:
      addComponent in interface SystemInterface
      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

      public void addComponent(String componentName, double moles)
      add a component to a fluid. If component already exists, the moles will be added to the existing component.
      Specified by:
      addComponent in interface SystemInterface
      Parameters:
      componentName - 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

      public void addComponent(String componentName, double moles, double TC, double PC, double acs)

      addComponent.

      Specified by:
      addComponent in interface SystemInterface
      Parameters:
      componentName - 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

      public void addComponent(String componentName, double moles, int phaseNumber)
      add a component to a fluid. If component already exists, the moles will be added to the existing component.
      Specified by:
      addComponent in interface SystemInterface
      Parameters:
      componentName - 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

      public void addComponent(String componentName, double value, String unitName)
      add a component to a fluid. If component already exists, the amount will be added to the existing component.
      Specified by:
      addComponent in interface SystemInterface
      Parameters:
      componentName - 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

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

      public SystemInterface addFluid(SystemInterface addSystem)

      addFluid.

      Specified by:
      addFluid in interface SystemInterface
      Parameters:
      addSystem - a SystemInterface object
      Returns:
      SystemInterface
    • addFluid

      public SystemInterface addFluid(SystemInterface addSystem, int phaseNum)

      addFluid.

      Specified by:
      addFluid in interface SystemInterface
      Parameters:
      addSystem - a SystemInterface object
      phaseNum - phase number of phase to add fluid to
      Returns:
      SystemInterface
    • addGasToLiquid

      public void addGasToLiquid(double fraction)

      addGasToLiquid.

      Specified by:
      addGasToLiquid in interface SystemInterface
      Parameters:
      fraction - a double
    • addHydratePhase

      public void addHydratePhase()

      addHydratePhase.

    • addHydratePhase2

      public void addHydratePhase2()

      addHydratePhase2.

    • addLiquidToGas

      public void addLiquidToGas(double fraction)

      addLiquidToGas.

      Specified by:
      addLiquidToGas in interface SystemInterface
      Parameters:
      fraction - a double
    • addOilFractions

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

      addCharacterized.

      Specified by:
      addOilFractions in interface SystemInterface
      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

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

      addCharacterized.

      Specified by:
      addOilFractions in interface SystemInterface
      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

      public void addPhase()
      Add phase to SystemInterface object.
      Specified by:
      addPhase in interface SystemInterface
    • addPhaseFractionToPhase

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

      addPhaseFractionToPhase.

      Specified by:
      addPhaseFractionToPhase in interface SystemInterface
      Parameters:
      fraction - a double
      specification - a String object
      fromPhaseName - a String object
      toPhaseName - a String object
    • addPhaseFractionToPhase

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

      addPhaseFractionToPhase.

      Specified by:
      addPhaseFractionToPhase in interface SystemInterface
      Parameters:
      fraction - a double
      specification - a String object
      specifiedStream - a String object
      fromPhaseName - a String object
      toPhaseName - a String object
    • addPlusFraction

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

      addPlusFraction.

      Specified by:
      addPlusFraction in interface SystemInterface
      Parameters:
      componentName - a String object
      numberOfMoles - a double
      molarMass - a double
      density - a double
    • addSalt

      public void addSalt(String componentName, double value)

      addSalt.

      Specified by:
      addSalt in interface SystemInterface
      Parameters:
      componentName - a String object
      value - a double
    • addSolidComplexPhase

      public void addSolidComplexPhase(String type)

      addSolidComplexPhase.

      Specified by:
      addSolidComplexPhase in interface SystemInterface
      Parameters:
      type - a String object
    • addSolidPhase

      public void addSolidPhase()

      addSolidPhase.

    • addTBPfraction

      public void addTBPfraction(String componentName, double numberOfMoles, double molarMass, double density)
      method to add true boiling point fraction.
      Specified by:
      addTBPfraction in interface SystemInterface
      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

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

      addTBPfraction.

      Specified by:
      addTBPfraction in interface SystemInterface
      Parameters:
      componentName - a String object
      numberOfMoles - a double
      molarMass - a double
      density - a double
      criticalTemperature - a double
      criticalPressure - a double
      acentricFactor - a double
    • addToComponentNames

      public void addToComponentNames(String postfix)
      Add to component names.
      Specified by:
      addToComponentNames in interface SystemInterface
      Parameters:
      postfix - Component name to add
    • allowPhaseShift

      public boolean allowPhaseShift()

      Getter for property allowPhaseShift.

      Specified by:
      allowPhaseShift in interface SystemInterface
      Returns:
      a boolean
    • allowPhaseShift

      public void allowPhaseShift(boolean allowPhaseShift)

      Setter for property allowPhaseShift.

      Specified by:
      allowPhaseShift in interface SystemInterface
      Parameters:
      allowPhaseShift - a boolean
    • autoSelectMixingRule

      public void autoSelectMixingRule()

      autoSelectMixingRule.

      Specified by:
      autoSelectMixingRule in interface SystemInterface
    • autoSelectModel

      public SystemInterface autoSelectModel()

      autoSelectModel.

      Specified by:
      autoSelectModel in interface SystemInterface
      Returns:
      a SystemInterface object
    • calc_x_y

      public final void calc_x_y()

      calc_x_y.

      Specified by:
      calc_x_y in interface SystemInterface
    • calc_x_y_nonorm

      public final void calc_x_y_nonorm()

      calc_x_y_nonorm.

      Specified by:
      calc_x_y_nonorm in interface SystemInterface
    • calcHenrysConstant

      public double calcHenrysConstant(String component)

      calcHenrysConstant.

      Specified by:
      calcHenrysConstant in interface SystemInterface
      Parameters:
      component - a String object
      Returns:
      a double
    • calcInterfaceProperties

      public void calcInterfaceProperties()

      calcInterfaceProperties.

      Specified by:
      calcInterfaceProperties in interface SystemInterface
    • calcKIJ

      public void calcKIJ(boolean ok)

      calcKIJ.

      Specified by:
      calcKIJ in interface SystemInterface
      Parameters:
      ok - a boolean
    • changeComponentName

      public void changeComponentName(String name, String newName)

      changeComponentName.

      Specified by:
      changeComponentName in interface SystemInterface
      Parameters:
      name - a String object
      newName - a String object
    • checkStability

      public boolean checkStability()

      checkStability.

      Specified by:
      checkStability in interface SystemInterface
      Returns:
      a boolean
    • checkStability

      public void checkStability(boolean val)

      checkStability.

      Specified by:
      checkStability in interface SystemInterface
      Parameters:
      val - a boolean
    • chemicalReactionInit

      public void chemicalReactionInit()

      chemicalReactionInit.

      Specified by:
      chemicalReactionInit in interface SystemInterface
    • clearAll

      public void clearAll()

      clearAll.

      Specified by:
      clearAll in interface SystemInterface
    • clone

      public SystemThermo clone()

      clone.

      Specified by:
      clone in interface SystemInterface
      Overrides:
      clone in class Object
      Returns:
      a SystemInterface object
    • createDatabase

      public 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.

      Specified by:
      createDatabase in interface SystemInterface
      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

      public String[][] createTable(String name)

      createTable.

      Specified by:
      createTable in interface SystemInterface
      Parameters:
      name - a String object
      Returns:
      an array of String objects
    • addTBPfraction2

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

      addTBPfraction2.

      Specified by:
      addTBPfraction2 in interface SystemInterface
      Parameters:
      componentName - a String object
      numberOfMoles - a double
      molarMass - a double
      boilingPoint - a double
    • calculateDensityFromBoilingPoint

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

      public void addTBPfraction3(String componentName, double numberOfMoles, double density, double boilingPoint)
      Adds a TBP fraction to the system. Add TBP fraction using density and boiling point, calculating molar mass.
      Specified by:
      addTBPfraction3 in interface SystemInterface
      Parameters:
      componentName - the name of the component
      numberOfMoles - number of moles
      density - density of the component
      boilingPoint - boiling point
    • calculateMolarMassFromDensityAndBoilingPoint

      public double calculateMolarMassFromDensityAndBoilingPoint(double density, double boilingPoint)

      calculateMolarMassFromDensityAndBoilingPoint.

      Calculates molar mass from density and boiling point
      Specified by:
      calculateMolarMassFromDensityAndBoilingPoint in interface SystemInterface
      Parameters:
      density - a double
      boilingPoint - a double
      Returns:
      a double
    • addTBPfraction4

      public void addTBPfraction4(String componentName, double numberOfMoles, double molarMass, double density, double boilingPoint)
      Adds a TBP fraction to the system. Add TBP fraction using density and boiling point, calculating molar mass.
      Specified by:
      addTBPfraction4 in interface SystemInterface
      Parameters:
      componentName - the name of the component
      numberOfMoles - number of moles
      molarMass - molar mass
      density - density of the component
      boilingPoint - boiling point
    • deleteFluidPhase

      public void deleteFluidPhase(int phaseNum)

      deleteFluidPhase.

      Specified by:
      deleteFluidPhase in interface SystemInterface
      Parameters:
      phaseNum - a int
    • display

      public void display(String name)

      display.

      Specified by:
      display in interface SystemInterface
      Parameters:
      name - a String object
    • doMultiPhaseCheck

      public boolean doMultiPhaseCheck()

      Getter for property multiPhaseCheck.

      Specified by:
      doMultiPhaseCheck in interface SystemInterface
      Returns:
      a boolean
    • doSolidPhaseCheck

      public final boolean doSolidPhaseCheck()

      doSolidPhaseCheck.

      Specified by:
      doSolidPhaseCheck in interface SystemInterface
      Returns:
      a boolean
    • getAntoineVaporPressure

      public double getAntoineVaporPressure(double temp)

      getAntoineVaporPressure.

      Parameters:
      temp - a double
      Returns:
      a double
    • getBeta

      public final double getBeta()

      Getter for property beta. Gets value for heaviest phase.

      Specified by:
      getBeta in interface SystemInterface
      Returns:
      Beta value
    • getBeta

      public final double getBeta(int phaseNum)

      Getter for property beta for a specific phase.

      Specified by:
      getBeta in interface SystemInterface
      Parameters:
      phaseNum - Number of phase to get beta for.
      Returns:
      Beta value for
    • getCapeOpenProperties10

      public String[] getCapeOpenProperties10()

      getCapeOpenProperties10.

      Specified by:
      getCapeOpenProperties10 in interface SystemInterface
      Returns:
      an array of String objects
    • getCapeOpenProperties11

      public String[] getCapeOpenProperties11()

      getCapeOpenProperties11.

      Specified by:
      getCapeOpenProperties11 in interface SystemInterface
      Returns:
      an array of String objects
    • getCASNumbers

      public String[] getCASNumbers()

      getCASNumbers.

      Specified by:
      getCASNumbers in interface SystemInterface
      Returns:
      an array of String objects
    • getCharacterization

      public Characterise getCharacterization()

      Getter for property characterization.

      Specified by:
      getCharacterization in interface SystemInterface
      Returns:
      a Characterise object
    • getChemicalReactionOperations

      public ChemicalReactionOperations getChemicalReactionOperations()

      getChemicalReactionOperations.

      Specified by:
      getChemicalReactionOperations in interface SystemInterface
      Returns:
      a ChemicalReactionOperations object
    • getCompFormulaes

      public String[] getCompFormulaes()

      getCompFormulaes.

      Specified by:
      getCompFormulaes in interface SystemInterface
      Returns:
      an array of String objects
    • getCompIDs

      public String[] getCompIDs()

      getCompIDs.

      Specified by:
      getCompIDs in interface SystemInterface
      Returns:
      an array of String objects
    • getCompNames

      public String[] getCompNames()
      Get normalized names of all components in System.
      Specified by:
      getCompNames in interface SystemInterface
      Returns:
      Array of names of components in System.
    • getComponentNameTag

      public String getComponentNameTag()

      getComponentNameTag.

      Specified by:
      getComponentNameTag in interface SystemInterface
      Returns:
      a String object
    • getCorrectedVolume

      public double getCorrectedVolume()
      method to return fluid volume with Peneloux volume correction.

      need to call initPhysicalProperties() before this method is called

      Specified by:
      getCorrectedVolume in interface SystemInterface
      Returns:
      volume in unit m3
    • getCorrectedVolumeFraction

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

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

      public double getCp(String unit)
      Calculates the heat capacity at constant pressure (Cp) in the specified units. method to return specific heat capacity (Cp) in a specified unit.
      Specified by:
      getCp in interface SystemInterface
      Parameters:
      unit - Supported units are J/K, J/molK, J/kgK and kJ/kgK
      Returns:
      Cp in specified unit
    • getCv

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

      public double getCv(String unit)
      Calculates the heat capacity at constant volume (Cv) in the specified units. method to return specific heat capacity (Cp) in a specified unit.
      Specified by:
      getCv in interface SystemInterface
      Parameters:
      unit - Supported units are J/K, J/molK, J/kgK and kJ/kgK
      Returns:
      Cp in specified unit
    • getDensity

      public double getDensity()
      Get density of a fluid note: without Peneloux volume correction.
      Specified by:
      getDensity in interface SystemInterface
      Returns:
      density with unit kg/m3
    • getDensity

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

      public double getdPdVtn()
      getPdVtn.
      Returns:
      dpdv
    • getdVdPtn

      public double getdVdPtn()

      getdVdPtn.

      Specified by:
      getdVdPtn in interface SystemInterface
      Returns:
      a double
    • getdVdTpn

      public double getdVdTpn()

      getdVdTpn.

      Specified by:
      getdVdTpn in interface SystemInterface
      Returns:
      a double
    • getEmptySystemClone

      public SystemInterface getEmptySystemClone()

      getEmptySystemClone.

      Specified by:
      getEmptySystemClone in interface SystemInterface
      Returns:
      a SystemInterface object
    • getEnthalpy

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

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

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

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

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

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

      public double getFlowRate(String flowunit)
      method to return flow rate of fluid.
      Specified by:
      getFlowRate in interface SystemInterface
      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

      public String getFluidInfo()

      Getter for property info.

      Specified by:
      getFluidInfo in interface SystemInterface
      Returns:
      a String object
    • getFluidName

      public String getFluidName()

      getFluidName.

      Specified by:
      getFluidName in interface SystemInterface
      Returns:
      a String object
    • getGamma

      public double getGamma()
      method to return heat capacity ratio/adiabatic index/Poisson constant.
      Specified by:
      getGamma in interface SystemInterface
      Returns:
      kappa
    • getGasPhase

      public final PhaseInterface getGasPhase()

      getGasPhase.

      Specified by:
      getGasPhase in interface SystemInterface
      Returns:
      a PhaseInterface object
    • getGibbsEnergy

      public double getGibbsEnergy()

      getGibbsEnergy.

      Specified by:
      getGibbsEnergy in interface SystemInterface
      Returns:
      a double
    • getHeatOfVaporization

      public double getHeatOfVaporization()

      getHeatOfVaporization.

      Specified by:
      getHeatOfVaporization in interface SystemInterface
      Returns:
      a double
    • getHelmholtzEnergy

      public double getHelmholtzEnergy()

      getHelmholtzEnergy.

      Specified by:
      getHelmholtzEnergy in interface SystemInterface
      Returns:
      a double
    • getHydrateCheck

      public boolean getHydrateCheck()

      Getter for property hydrateCheck.

      Specified by:
      getHydrateCheck in interface SystemInterface
      Returns:
      a boolean
    • getIdealLiquidDensity

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

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

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

      getInterfacialTension.

      Specified by:
      getInterfacialTension in interface SystemInterface
      Parameters:
      phase1 - phase number of phase1
      phase2 - phase number of phase2
      unit - a String object
      Returns:
      interfacial tension with specified unit
    • getInterfacialTension

      public double getInterfacialTension(String phase1, String phase2)
      method to return interfacial tension between two phases.
      Specified by:
      getInterfacialTension in interface SystemInterface
      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

      public double getInternalEnergy()
      method to return internal energy (U) in unit J.
      Specified by:
      getInternalEnergy in interface SystemInterface
      Returns:
      internal energy in unit Joule (J)
    • getInternalEnergy

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

      public InterphasePropertiesInterface getInterphaseProperties()

      getInterphaseProperties.

      Specified by:
      getInterphaseProperties in interface SystemInterface
      Returns:
      a InterphasePropertiesInterface object
    • getJouleThomsonCoefficient

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

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

      public double getKappa()
      method to return heat capacity ratio/adiabatic index/Poisson constant.
      Specified by:
      getKappa in interface SystemInterface
      Returns:
      kappa
    • getKinematicViscosity

      public double getKinematicViscosity()

      getKinematicViscosity.

      Specified by:
      getKinematicViscosity in interface SystemInterface
      Returns:
      a double
    • getKinematicViscosity

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

      public final PhaseInterface getLiquidPhase()

      getLiquidPhase.

      Specified by:
      getLiquidPhase in interface SystemInterface
      Returns:
      a PhaseInterface object
    • getLiquidVolume

      public double getLiquidVolume()

      getLiquidVolume.

      Specified by:
      getLiquidVolume in interface SystemInterface
      Returns:
      a double
    • getLowestGibbsEnergyPhase

      public PhaseInterface getLowestGibbsEnergyPhase()

      getLowestGibbsEnergyPhase.

      Specified by:
      getLowestGibbsEnergyPhase in interface SystemInterface
      Returns:
      a PhaseInterface object
    • getMass

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

      public int getMaxNumberOfPhases()

      Getter for property maxNumberOfPhases.

      Specified by:
      getMaxNumberOfPhases in interface SystemInterface
      Returns:
      Gets the maximum allowed number of phases to use.
    • getMixingRule

      public MixingRuleTypeInterface getMixingRule()

      getMixingRule.

      Specified by:
      getMixingRule in interface SystemInterface
      Returns:
      A MixingRuleTypeInterface
    • getMixingRuleName

      public String getMixingRuleName()

      getMixingRuleName.

      Specified by:
      getMixingRuleName in interface SystemInterface
      Returns:
      a String object
    • getModelName

      public String getModelName()

      Getter for property modelName.

      Specified by:
      getModelName in interface SystemInterface
      Returns:
      a String object
    • getMolarComposition

      public double[] getMolarComposition()

      Returns the overall mole composition vector in unit mole fraction.

      Specified by:
      getMolarComposition in interface SystemInterface
      Returns:
      an array of type double
    • getWeightBasedComposition

      public double[] getWeightBasedComposition()

      Returns the overall composition vector in unit mass fraction.

      Specified by:
      getWeightBasedComposition in interface SystemInterface
      Returns:
      an array of type double
    • getMolarMass

      public double getMolarMass()
      Get molar mass of system.
      Specified by:
      getMolarMass in interface SystemInterface
      Returns:
      molar mass in unit kg/mol
    • getMolarMass

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

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

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

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

      public double[] getMolecularWeights()

      getMolecularWeights.

      Specified by:
      getMolecularWeights in interface SystemInterface
      Returns:
      an array of type double
    • getMoleFraction

      public double getMoleFraction(int phaseNumber)

      getMoleFraction.

      Specified by:
      getMoleFraction in interface SystemInterface
      Parameters:
      phaseNumber - a int
      Returns:
      a double
    • getMoleFractionsSum

      public double getMoleFractionsSum()

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

      Specified by:
      getMoleFractionsSum in interface SystemInterface
      Returns:
      a double
    • getNormalBoilingPointTemperatures

      public double[] getNormalBoilingPointTemperatures()

      getNormalBoilingPointTemperatures.

      Specified by:
      getNormalBoilingPointTemperatures in interface SystemInterface
      Returns:
      an array of type double
    • getNumberOfComponents

      public int getNumberOfComponents()

      Get number of components added to System.

      Specified by:
      getNumberOfComponents in interface SystemInterface
      Returns:
      the number of components in System.
    • getNumberOfOilFractionComponents

      public int getNumberOfOilFractionComponents()

      getNumberOfOilFractionComponents.

      Specified by:
      getNumberOfOilFractionComponents in interface SystemInterface
      Returns:
      a int
    • getNumberOfPhases

      public final int getNumberOfPhases()

      Getter for property numberOfPhases.

      Specified by:
      getNumberOfPhases in interface SystemInterface
      Returns:
      Number of phases used
    • getOilFractionIDs

      public int[] getOilFractionIDs()

      getOilFractionIDs.

      Specified by:
      getOilFractionIDs in interface SystemInterface
      Returns:
      an array of
      invalid reference
      int
      objects
    • getOilFractionLiquidDensityAt25C

      public double[] getOilFractionLiquidDensityAt25C()

      getOilFractionLiquidDensityAt25C.

      Specified by:
      getOilFractionLiquidDensityAt25C in interface SystemInterface
      Returns:
      an array of type double
    • getOilFractionMolecularMass

      public double[] getOilFractionMolecularMass()

      getOilFractionMolecularMass.

      Specified by:
      getOilFractionMolecularMass in interface SystemInterface
      Returns:
      an array of type double
    • getOilFractionNormalBoilingPoints

      public double[] getOilFractionNormalBoilingPoints()

      getOilFractionNormalBoilingPoints.

      Specified by:
      getOilFractionNormalBoilingPoints in interface SystemInterface
      Returns:
      an array of type double
    • getPC

      public final double getPC()

      Getter for property PC.

      Specified by:
      getPC in interface SystemInterface
      Returns:
      Critical pressure in unit bara.
    • getPhase

      public final PhaseInterface getPhase(int i)
      Get phase number i from SystemInterface object.
      Specified by:
      getPhase in interface SystemInterface
      Parameters:
      i - Phase number
      Returns:
      a PhaseInterface object
    • getPhase

      public PhaseInterface getPhase(PhaseType pt)

      getPhase.

      Specified by:
      getPhase in interface SystemInterface
      Parameters:
      pt - a PhaseType object
      Returns:
      a PhaseInterface object
    • getPhase

      public PhaseInterface getPhase(String phaseTypeName)

      getPhase.

      Specified by:
      getPhase in interface SystemInterface
      Parameters:
      phaseTypeName - a String object
      Returns:
      a PhaseInterface object
    • getPhaseFraction

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

      public final int getPhaseIndex(int index)

      Indexed getter for property phaseIndex.

      Specified by:
      getPhaseIndex in interface SystemInterface
      Parameters:
      index - Phase number
      Returns:
      PhaseIndex to index into phaseArray.
    • getPhaseIndex

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

      public int getPhaseIndex(String phaseTypeName)

      Get property phaseIndex corresponding to a phase.

      Specified by:
      getPhaseIndex in interface SystemInterface
      Parameters:
      phaseTypeName - a String object
      Returns:
      PhaseIndex to index into phaseArray.
    • getPhaseNumberOfPhase

      public int getPhaseNumberOfPhase(PhaseType pt)

      Get phase number of phase of specific type.

      Specified by:
      getPhaseNumberOfPhase in interface SystemInterface
      Parameters:
      pt - Phase type to look for.
      Returns:
      Phase number
    • getPhaseOfType

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

      public final PhaseInterface[] getPhases()

      getPhases.

      Specified by:
      getPhases in interface SystemInterface
      Returns:
      an array of PhaseInterface objects
    • getPressure

      public final double getPressure()
      method to return pressure.
      Specified by:
      getPressure in interface SystemInterface
      Returns:
      pressure in unit bara
    • getPressure

      public final double getPressure(int phaseNumber)

      method to return pressure of phase.

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

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

      public SystemProperties getProperties()
      Get physical properties of System.
      Specified by:
      getProperties in interface SystemInterface
      Returns:
      System properties
    • getProperty

      public double getProperty(String prop)

      getProperty.

      Specified by:
      getProperty in interface SystemInterface
      Parameters:
      prop - a String object
      Returns:
      a double
    • getProperty

      public double getProperty(String prop, int phaseNum)

      getProperty.

      Specified by:
      getProperty in interface SystemInterface
      Parameters:
      prop - a String object
      phaseNum - a int
      Returns:
      a double
    • getProperty

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

      getProperty.

      Specified by:
      getProperty in interface SystemInterface
      Parameters:
      prop - a String object
      compName - a String object
      phaseNum - a int
      Returns:
      a double
    • getResultTable

      public String[][] getResultTable()

      getResultTable.

      Specified by:
      getResultTable in interface SystemInterface
      Returns:
      an array of String objects
    • getSoundSpeed

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

      public 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
      Specified by:
      getSoundSpeed in interface SystemInterface
      Parameters:
      unit - Supported units are m/s, km/h
      Returns:
      speed of sound in m/s
    • getStandard

      public StandardInterface getStandard()

      Getter for property standard.

      Specified by:
      getStandard in interface SystemInterface
      Returns:
      a StandardInterface object
    • getStandard

      public StandardInterface getStandard(String standardName)

      Getter for property standard.

      Specified by:
      getStandard in interface SystemInterface
      Parameters:
      standardName - a String object
      Returns:
      a StandardInterface object
    • getSumBeta

      public final double getSumBeta()
      Get sum of phase beta values.
      Returns:
      Sum of beta beta values
    • isBetaValid

      public boolean isBetaValid()
      Verify if sum of beta is 1. Used to check if System needs to be flashed.
      Returns:
      True if the sum of beta is close to 1.
    • getTC

      public final double getTC()

      Get critical temperature.

      Specified by:
      getTC in interface SystemInterface
      Returns:
      Critical temperature in unit Kelvin
    • getTemperature

      public final double getTemperature()
      Get temperature.
      Specified by:
      getTemperature in interface SystemInterface
      Returns:
      temperature in unit Kelvin
    • getTemperature

      public double getTemperature(int phaseNumber)

      method to return temperature from a specific phase.

      Specified by:
      getTemperature in interface SystemInterface
      Parameters:
      phaseNumber - phase to get temperature of
      Returns:
      temperature in unit Kelvin
    • getTemperature

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

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

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

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

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

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

      public final double getVolume()
      method to return fluid volume.
      Specified by:
      getVolume in interface SystemInterface
      Returns:
      volume in unit m3*1e5
    • getVolume

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

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

      public OilAssayCharacterisation getOilAssayCharacterisation()

      getOilAssayCharacterisation.

      Specified by:
      getOilAssayCharacterisation in interface SystemInterface
      Returns:
      a OilAssayCharacterisation object
    • getWaxCharacterisation

      public WaxCharacterise getWaxCharacterisation()

      getWaxCharacterisation.

      Specified by:
      getWaxCharacterisation in interface SystemInterface
      Returns:
      a WaxCharacterise object
    • getWaxModel

      public WaxModelInterface getWaxModel()

      getWaxModel.

      Specified by:
      getWaxModel in interface SystemInterface
      Returns:
      a WaxModelInterface object
    • getWtFraction

      public double getWtFraction(int phaseNumber)

      getWtFraction.

      Specified by:
      getWtFraction in interface SystemInterface
      Parameters:
      phaseNumber - a int
      Returns:
      a double
    • getZ

      public 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.
      Specified by:
      getZ in interface SystemInterface
      Returns:
      compressibility factor Z
    • getZvolcorr

      public double getZvolcorr()
      method to return Z volume corrected gas compressibility.
      Specified by:
      getZvolcorr in interface SystemInterface
      Returns:
      double Z volume corrected
    • hasPhaseType

      public boolean hasPhaseType(PhaseType pt)
      Verify if system has a phase of a specific type.
      Specified by:
      hasPhaseType in interface SystemInterface
      Parameters:
      pt - PhaseType to look for
      Returns:
      True if system contains a phase of requested type
    • hasPlusFraction

      public boolean hasPlusFraction()

      Getter for property hasPlusFraction.

      Specified by:
      hasPlusFraction in interface SystemInterface
      Returns:
      a boolean
    • hasTBPFraction

      public boolean hasTBPFraction()

      hasTBPFraction.

      Returns:
      a boolean
    • init

      public 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.
      Specified by:
      init in interface SystemInterface
      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

      public void init(int type, 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.
      Specified by:
      init in interface SystemInterface
      Parameters:
      type - - 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

      public final void init_x_y()

      init_x_y.

      Specified by:
      init_x_y in interface SystemInterface
    • initAnalytic

      public void initAnalytic(int type)

      initAnalytic.

      Parameters:
      type - a int. 0 to initialize and 1 to reset, 2 to calculate T and P derivatives, 3 to calculate all derivatives and 4 to calculate all derivatives numerically
    • initAnalytic

      public void initAnalytic(int type, int phaseNum)

      initAnalytic.

      Parameters:
      type - a int
      phaseNum - a int
    • initBeta

      public final void initBeta()

      Calculate system beta values using Phase.getNumberOfMolesInPhase and getTotalNumberOfMoles.

      Specified by:
      initBeta in interface SystemInterface
    • initNumeric

      public void initNumeric()
      initNumeric.
      Specified by:
      initNumeric in interface SystemInterface
    • initNumeric

      public void initNumeric(int type)

      initNumeric.

      Parameters:
      type - a int
    • initNumeric

      public void initNumeric(int initType, int phasen)

      initNumeric.

      Parameters:
      initType - a int
      phasen - a int
    • initPhysicalProperties

      public void initPhysicalProperties()
      Initialize / calculate all physical properties for all phases and interfaces.
      Specified by:
      initPhysicalProperties in interface SystemInterface
    • initPhysicalProperties

      public void initPhysicalProperties(PhysicalPropertyType ppt)
      Initialize / calculate a specified physical properties for all phases and interfaces.
      Specified by:
      initPhysicalProperties in interface SystemInterface
      Parameters:
      ppt - PhysicalPropertyType enum object.
    • initRefPhases

      public void initRefPhases()

      initRefPhases.

      Specified by:
      initRefPhases in interface SystemInterface
    • initTotalNumberOfMoles

      public final void initTotalNumberOfMoles(double change)

      initTotalNumberOfMoles.

      Specified by:
      initTotalNumberOfMoles in interface SystemInterface
      Parameters:
      change - a double
    • isChemicalSystem

      public final boolean isChemicalSystem()

      isChemicalSystem.

      Specified by:
      isChemicalSystem in interface SystemInterface
      Returns:
      a boolean
    • isChemicalSystem

      public final void isChemicalSystem(boolean temp)

      isChemicalSystem.

      Specified by:
      isChemicalSystem in interface SystemInterface
      Parameters:
      temp - a boolean
    • isForcePhaseTypes

      public boolean isForcePhaseTypes()

      isForcePhaseTypes.

      Specified by:
      isForcePhaseTypes in interface SystemInterface
      Returns:
      a boolean
    • isInitialized

      public boolean isInitialized()

      isInitialized.

      Specified by:
      isInitialized in interface SystemInterface
      Returns:
      a boolean
    • isImplementedCompositionDeriativesofFugacity

      public boolean isImplementedCompositionDeriativesofFugacity()

      isImplementedCompositionDeriativesofFugacity.

      Specified by:
      isImplementedCompositionDeriativesofFugacity in interface SystemInterface
      Returns:
      a boolean
    • isImplementedCompositionDeriativesofFugacity

      public void isImplementedCompositionDeriativesofFugacity(boolean isImpl)

      isImplementedCompositionDeriativesofFugacity.

      Specified by:
      isImplementedCompositionDeriativesofFugacity in interface SystemInterface
      Parameters:
      isImpl - a boolean
    • isImplementedPressureDeriativesofFugacity

      public boolean isImplementedPressureDeriativesofFugacity()

      isImplementedPressureDeriativesofFugacity.

      Specified by:
      isImplementedPressureDeriativesofFugacity in interface SystemInterface
      Returns:
      a boolean
    • isImplementedTemperatureDeriativesofFugacity

      public boolean isImplementedTemperatureDeriativesofFugacity()

      isImplementedTemperatureDeriativesofFugacity.

      Specified by:
      isImplementedTemperatureDeriativesofFugacity in interface SystemInterface
      Returns:
      a boolean
    • isMultiphaseWaxCheck

      public boolean isMultiphaseWaxCheck()

      isMultiphaseWaxCheck.

      Specified by:
      isMultiphaseWaxCheck in interface SystemInterface
      Returns:
      a boolean
    • isNumericDerivatives

      public boolean isNumericDerivatives()

      Getter for property numericDerivatives.

      Specified by:
      isNumericDerivatives in interface SystemInterface
      Returns:
      a boolean
    • isPhase

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

      public void normalizeBeta()

      normalizeBeta.

      Specified by:
      normalizeBeta in interface SystemInterface
    • orderByDensity

      public 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 .

      Specified by:
      orderByDensity in interface SystemInterface
    • getEffectiveDensityForOrdering

      private double getEffectiveDensityForOrdering(int phaseNum)
      Get effective density for phase ordering. Solid-like phases (SOLID, ASPHALTENE, WAX, HYDRATE) return a very high density to ensure they sort to the end.
      Parameters:
      phaseNum - phase number
      Returns:
      effective density for ordering purposes
    • phaseToSystem

      public SystemInterface phaseToSystem(int phaseNumber)

      phaseToSystem.

      Specified by:
      phaseToSystem in interface SystemInterface
      Parameters:
      phaseNumber - a int
      Returns:
      a SystemInterface object
    • phaseToSystem

      public SystemInterface phaseToSystem(int phaseNumber1, int phaseNumber2)

      phaseToSystem.

      Specified by:
      phaseToSystem in interface SystemInterface
      Parameters:
      phaseNumber1 - a int
      phaseNumber2 - a int
      Returns:
      a SystemInterface object
    • phaseToSystem

      public SystemInterface phaseToSystem(PhaseInterface newPhase)

      phaseToSystem.

      Specified by:
      phaseToSystem in interface SystemInterface
      Parameters:
      newPhase - a PhaseInterface object
      Returns:
      a SystemInterface object
    • phaseToSystem

      public SystemInterface phaseToSystem(String phaseName)

      phaseToSystem.

      Specified by:
      phaseToSystem in interface SystemInterface
      Parameters:
      phaseName - a String object
      Returns:
      a SystemInterface object
    • readFluid

      public void readFluid(String fluidName)

      readFluid.

      Specified by:
      readFluid in interface SystemInterface
      Parameters:
      fluidName - a String object
    • readObject

      public SystemInterface readObject(int ID)

      readObject.

      Specified by:
      readObject in interface SystemInterface
      Parameters:
      ID - a int
      Returns:
      a SystemInterface object
    • readObjectFromFile

      public SystemInterface readObjectFromFile(String filePath, String fluidName)

      readObjectFromFile.

      Specified by:
      readObjectFromFile in interface SystemInterface
      Parameters:
      filePath - a String object
      fluidName - a String object
      Returns:
      a SystemInterface object
    • reInitPhaseInformation

      public void reInitPhaseInformation()
      Re-initialize phasetype, beta and phaseindex arrays, same initialization which is used in constructor.
    • reInitPhaseType

      public void reInitPhaseType()

      reInitPhaseType.

      Specified by:
      reInitPhaseType in interface SystemInterface
    • removeComponent

      public void removeComponent(String name)

      removeComponent.

      Specified by:
      removeComponent in interface SystemInterface
      Parameters:
      name - Name of the component to remove. See NeqSim database for component in the database.
    • removePhase

      public void removePhase(int specPhase)

      removePhase.

      Specified by:
      removePhase in interface SystemInterface
      Parameters:
      specPhase - a int
    • removePhaseKeepTotalComposition

      public void removePhaseKeepTotalComposition(int specPhase)

      removePhaseKeepTotalComposition.

      Specified by:
      removePhaseKeepTotalComposition in interface SystemInterface
      Parameters:
      specPhase - a int
    • renameComponent

      public void renameComponent(String oldName, String newName)

      renameComponent.

      Specified by:
      renameComponent in interface SystemInterface
      Parameters:
      oldName - a String object
      newName - a String object
    • replacePhase

      public void replacePhase(int repPhase, PhaseInterface newPhase)

      replacePhase.

      Specified by:
      replacePhase in interface SystemInterface
      Parameters:
      repPhase - a int
      newPhase - a PhaseInterface object
    • reset

      public void reset()
      Set mole fractions of all components to 0.
      Specified by:
      reset in interface SystemInterface
    • reset_x_y

      public void reset_x_y()

      reset_x_y.

      Specified by:
      reset_x_y in interface SystemInterface
    • resetCharacterisation

      public void resetCharacterisation()

      resetCharacterisation.

      Specified by:
      resetCharacterisation in interface SystemInterface
    • resetDatabase

      public void resetDatabase()

      resetDatabase.

      Specified by:
      resetDatabase in interface SystemInterface
    • resetPhysicalProperties

      public void resetPhysicalProperties()

      resetPhysicalProperties.

      Specified by:
      resetPhysicalProperties in interface SystemInterface
    • save

      public void save(String name)

      Save System object to file.

      Specified by:
      save in interface SystemInterface
      Parameters:
      name - File path to save to.
    • saveFluid

      public void saveFluid(int ID)

      saveFluid.

      Specified by:
      saveFluid in interface SystemInterface
      Parameters:
      ID - a int
    • saveFluid

      public void saveFluid(int ID, String text)

      saveFluid.

      Specified by:
      saveFluid in interface SystemInterface
      Parameters:
      ID - a int
      text - a String object
    • saveObject

      public void saveObject(int ID, String text)

      saveObject.

      Specified by:
      saveObject in interface SystemInterface
      Parameters:
      ID - a int
      text - a String object
    • saveObjectToFile

      public void saveObjectToFile(String filePath, String fluidName)

      saveObjectToFile.

      Specified by:
      saveObjectToFile in interface SystemInterface
      Parameters:
      filePath - a String object
      fluidName - a String object
    • saveToDataBase

      public void saveToDataBase()

      saveToDataBase.

      Specified by:
      saveToDataBase in interface SystemInterface
    • setAllComponentsInPhase

      public void setAllComponentsInPhase(int phaseNum)

      setAllComponentsInPhase.

      Specified by:
      setAllComponentsInPhase in interface SystemInterface
      Parameters:
      phaseNum - a int
    • setAttractiveTerm

      public void setAttractiveTerm(int i)

      setAttractiveTerm.

      Specified by:
      setAttractiveTerm in interface SystemInterface
      Parameters:
      i - a int
    • setBeta

      public final 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.

      Specified by:
      setBeta in interface SystemInterface
      Parameters:
      b - Beta value to set.
    • setBeta

      public final void setBeta(int phaseNum, double b)

      Setter for property beta for a given phase.

      Specified by:
      setBeta in interface SystemInterface
      Parameters:
      phaseNum - Phase number to set beta for.
      b - Beta value to set.
    • setBmixType

      public void setBmixType(int bmixType)

      setBmixType.

      Specified by:
      setBmixType in interface SystemInterface
      Parameters:
      bmixType - a int
    • setComponentNames

      public void setComponentNames(String[] componentNames)

      setComponentNames.

      Specified by:
      setComponentNames in interface SystemInterface
      Parameters:
      componentNames - an array of String objects
    • setComponentNameTag

      public void setComponentNameTag(String nameTag)

      setComponentNameTag.

      Specified by:
      setComponentNameTag in interface SystemInterface
      Parameters:
      nameTag - a String object
    • setComponentNameTagOnNormalComponents

      public void setComponentNameTagOnNormalComponents(String nameTag)

      setComponentNameTagOnNormalComponents.

      Specified by:
      setComponentNameTagOnNormalComponents in interface SystemInterface
      Parameters:
      nameTag - a String object
    • setEmptyFluid

      public void setEmptyFluid()
      Set the flow rate (moles) of all components to zero.
      Specified by:
      setEmptyFluid in interface SystemInterface
    • setFluidInfo

      public void setFluidInfo(String info)

      Setter for property info. .

      Specified by:
      setFluidInfo in interface SystemInterface
      Parameters:
      info - a String object
    • setFluidName

      public void setFluidName(String fluidName)

      setFluidName.

      Specified by:
      setFluidName in interface SystemInterface
      Parameters:
      fluidName - a String object
    • setForcePhaseTypes

      public void setForcePhaseTypes(boolean forcePhaseTypes)

      setForcePhaseTypes.

      Specified by:
      setForcePhaseTypes in interface SystemInterface
      Parameters:
      forcePhaseTypes - a boolean
    • setHeavyTBPfractionAsPlusFraction

      public boolean setHeavyTBPfractionAsPlusFraction()

      setHeavyTBPfractionAsPlusFraction.

      Specified by:
      setHeavyTBPfractionAsPlusFraction in interface SystemInterface
      Returns:
      a boolean
    • setHydrateCheck

      public void setHydrateCheck(boolean hydrateCheck)

      setHydrateCheck.

      Specified by:
      setHydrateCheck in interface SystemInterface
      Parameters:
      hydrateCheck - a boolean
    • setImplementedCompositionDeriativesofFugacity

      public void setImplementedCompositionDeriativesofFugacity(boolean implementedCompositionDeriativesofFugacity)

      setImplementedCompositionDeriativesofFugacity.

      Specified by:
      setImplementedCompositionDeriativesofFugacity in interface SystemInterface
      Parameters:
      implementedCompositionDeriativesofFugacity - a boolean
    • setImplementedPressureDeriativesofFugacity

      public void setImplementedPressureDeriativesofFugacity(boolean implementedPressureDeriativesofFugacity)

      setImplementedPressureDeriativesofFugacity.

      Specified by:
      setImplementedPressureDeriativesofFugacity in interface SystemInterface
      Parameters:
      implementedPressureDeriativesofFugacity - a boolean
    • setImplementedTemperatureDeriativesofFugacity

      public void setImplementedTemperatureDeriativesofFugacity(boolean implementedTemperatureDeriativesofFugacity)

      setImplementedTemperatureDeriativesofFugacity.

      Specified by:
      setImplementedTemperatureDeriativesofFugacity in interface SystemInterface
      Parameters:
      implementedTemperatureDeriativesofFugacity - a boolean
    • setLastTBPasPlus

      public boolean setLastTBPasPlus()

      setLastTBPasPlus.

      Returns:
      a boolean
    • setMaxNumberOfPhases

      public void setMaxNumberOfPhases(int maxNumberOfPhases)

      Setter for property maxNumberOfPhases.

      Specified by:
      setMaxNumberOfPhases in interface SystemInterface
      Parameters:
      maxNumberOfPhases - The maximum allowed number of phases to use.
    • setMixingRule

      public final void setMixingRule(MixingRuleTypeInterface mr)
      method to set mixing rule used for the fluid.
      Specified by:
      setMixingRule in interface SystemInterface
      Parameters:
      mr - MixingRuleTypeInterface enum
    • setMixingRule

      public void setMixingRule(String typename, String GEmodel)

      setMixingRule.

      Specified by:
      setMixingRule in interface SystemInterface
      Parameters:
      typename - a String object
      GEmodel - a String object
    • setMixingRuleGEmodel

      public void setMixingRuleGEmodel(String name)

      setMixingRuleGEmodel.

      Parameters:
      name - a String object
    • setModel

      public SystemInterface setModel(String model)

      setModel.

      Specified by:
      setModel in interface SystemInterface
      Parameters:
      model - a String object
      Returns:
      a SystemInterface object
    • setModelName

      public void setModelName(String modelName)
      Setter for property modelName.
      Parameters:
      modelName - New value of property modelName.
    • setMolarComposition

      public void setMolarComposition(double[] molefractions)

      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.

      Specified by:
      setMolarComposition in interface SystemInterface
      Parameters:
      molefractions - an array of type double
    • setMolarCompositionOfPlusFluid

      public 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.
      Specified by:
      setMolarCompositionOfPlusFluid in interface SystemInterface
      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

      public 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.
      Specified by:
      setMolarCompositionPlus in interface SystemInterface
      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

      public void setMolarFlowRates(double[] moles)

      setMolarFlowRates.

      Specified by:
      setMolarFlowRates in interface SystemInterface
      Parameters:
      moles - an array of type double
    • setComponentFlowRates

      public void setComponentFlowRates(double[] componentFlowRates, String unit)

      setComponentFlowRates.

      Specified by:
      setComponentFlowRates in interface SystemInterface
      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"
    • setMolarFractions

      private void setMolarFractions(double[] molefractions, String type)
      Wrapper function for addComponent to set fluid type and specify mole fractions.
      Parameters:
      molefractions - Component mole fraction of each component.
      type - Type of fluid. Supports "PlusFluid", "Plus" and default.
    • setMultiPhaseCheck

      public void setMultiPhaseCheck(boolean multiPhaseCheck)
      method to specify if calculations should check for more than two fluid phases.
      Specified by:
      setMultiPhaseCheck in interface SystemInterface
      Parameters:
      multiPhaseCheck - 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).
    • doEnhancedMultiPhaseCheck

      public 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).
      Specified by:
      doEnhancedMultiPhaseCheck in interface SystemInterface
      Returns:
      true if enhanced stability analysis is enabled
    • setEnhancedMultiPhaseCheck

      public 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).
      Specified by:
      setEnhancedMultiPhaseCheck in interface SystemInterface
      Parameters:
      enhancedMultiPhaseCheck - true to enable enhanced multi-phase detection
    • setMultiphaseWaxCheck

      public void setMultiphaseWaxCheck(boolean multiphaseWaxCheck)

      setMultiphaseWaxCheck.

      Specified by:
      setMultiphaseWaxCheck in interface SystemInterface
      Parameters:
      multiphaseWaxCheck - a boolean
    • setNumberOfPhases

      public void setNumberOfPhases(int number)

      Setter for property numberOfPhases.

      Specified by:
      setNumberOfPhases in interface SystemInterface
      Parameters:
      number - Number of phases to use.
    • setNumericDerivatives

      public void setNumericDerivatives(boolean numericDerivatives)

      Setter for property numericDerivatives.

      Specified by:
      setNumericDerivatives in interface SystemInterface
      Parameters:
      numericDerivatives - a boolean
    • setComponentCriticalParameters

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

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

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

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

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

      public void setBinaryInteractionParameter(String component1, String component2, double value)
      Set binary interaction parameter for all phase mixing rules.
      Specified by:
      setBinaryInteractionParameter in interface SystemInterface
      Parameters:
      component1 - name of first component
      component2 - name of second component
      value - kij value
    • setPC

      public final void setPC(double PC)

      Getter for property PC.

      Specified by:
      setPC in interface SystemInterface
      Parameters:
      PC - Critical pressure to set in unit bara.
    • setPhase

      public 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

      Specified by:
      setPhase in interface SystemInterface
      Parameters:
      phase - a PhaseInterface object
      index - Phase index to insert object at
    • setPhaseIndex

      public final void setPhaseIndex(int index, int phaseIndex)

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

      Specified by:
      setPhaseIndex in interface SystemInterface
      Parameters:
      index - a int
      phaseIndex - a int
    • setPhaseType

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

      public void setPhaseType(int phaseToChange, String phaseName)
      Change the phase type of a given phase.
      Specified by:
      setPhaseType in interface SystemInterface
      Parameters:
      phaseToChange - the phase number of the phase to set phase type
      phaseName - String to set
    • setAllPhaseType

      public void setAllPhaseType(PhaseType pt)
      Set phase type of all phases.
      Specified by:
      setAllPhaseType in interface SystemInterface
      Parameters:
      pt - PhaseType to set phases as.
    • invertPhaseTypes

      public void invertPhaseTypes()

      invertPhaseTypes.

      Specified by:
      invertPhaseTypes in interface SystemInterface
    • setPressure

      public final void setPressure(double newPressure)
      method to set the pressure of a fluid (same pressure for all phases).
      Specified by:
      setPressure in interface SystemInterface
      Parameters:
      newPressure - pressure in unit bara (absolute pressure in bar)
    • setPressure

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

      public void setSolidPhaseCheck(boolean solidPhaseCheck)

      Setter for property solidPhaseCheck.

      Specified by:
      setSolidPhaseCheck in interface SystemInterface
      Parameters:
      solidPhaseCheck - a boolean
    • setSolidPhaseCheck

      public void setSolidPhaseCheck(String solidComponent)

      setSolidPhaseCheck.

      Specified by:
      setSolidPhaseCheck in interface SystemInterface
      Parameters:
      solidComponent - a String object
    • setStandard

      public void setStandard(String standardName)

      Setter for property standard.

      Specified by:
      setStandard in interface SystemInterface
      Parameters:
      standardName - a String object
    • setTC

      public final void setTC(double TC)

      Getter for property TC.

      Specified by:
      setTC in interface SystemInterface
      Parameters:
      TC - Critical temperature to set
    • setTemperature

      public void setTemperature(double newTemperature)

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

      Specified by:
      setTemperature in interface SystemInterface
      Parameters:
      newTemperature - Temperature in unit Kelvin
    • setTemperature

      public final void setTemperature(double newTemperature, int phaseNum)

      Set the temperature of a single phase in the fluid.

      Specified by:
      setTemperature in interface SystemInterface
      Parameters:
      newTemperature - Temperature in unit Kelvin
      phaseNum - a int
    • setTemperature

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

      public void setTotalFlowRate(double flowRate, String flowunit)

      setTotalFlowRate.

      Specified by:
      setTotalFlowRate in interface SystemInterface
      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

      public void setTotalNumberOfMoles(double totalNumberOfMoles)

      Setter for property totalNumberOfMoles.

      Specified by:
      setTotalNumberOfMoles in interface SystemInterface
      Parameters:
      totalNumberOfMoles - Total molar flow rate of fluid in unit mol/sec
    • setUseTVasIndependentVariables

      public void setUseTVasIndependentVariables(boolean useTVasIndependentVariables)

      setUseTVasIndependentVariables.

      Specified by:
      setUseTVasIndependentVariables in interface SystemInterface
      Parameters:
      useTVasIndependentVariables - a boolean
    • tuneModel

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

      tuneModel.

      Specified by:
      tuneModel in interface SystemInterface
      Parameters:
      model - a String object
      val - a double
      phaseNum - a int
    • useTVasIndependentVariables

      public boolean useTVasIndependentVariables()

      useTVasIndependentVariables.

      Returns:
      a boolean
    • useVolumeCorrection

      public void useVolumeCorrection(boolean volcor)

      useVolumeCorrection.

      Specified by:
      useVolumeCorrection in interface SystemInterface
      Parameters:
      volcor - a boolean
    • write

      public String write()

      write.

      Returns:
      a String object
    • write

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

      write.

      Specified by:
      write in interface SystemInterface
      Parameters:
      name - a String object
      filename - a String object
      newfile - a boolean
    • getKvector

      public double[] getKvector()

      getKvector - return vector of equilibrium constants.

      Specified by:
      getKvector in interface SystemInterface
      Returns:
      an array of type double
    • getzvector

      public double[] getzvector()

      getzvector - return vector of total molar composition.

      Specified by:
      getzvector in interface SystemInterface
      Returns:
      an array of type double
    • toJson

      public String toJson()

      toJson - return String with json inormation of fluid.

      Specified by:
      toJson in interface SystemInterface
      Returns:
      a String object
    • toCompJson

      public String toCompJson()

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

      Specified by:
      toCompJson in interface SystemInterface
      Returns:
      a String object
    • setForceSinglePhase

      public void setForceSinglePhase(PhaseType phasetype)

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

      Specified by:
      setForceSinglePhase in interface SystemInterface
      Parameters:
      phasetype - a PhaseType object
    • setForceSinglePhase

      public void setForceSinglePhase(String phasetype)

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

      Specified by:
      setForceSinglePhase in interface SystemInterface
      Parameters:
      phasetype - a String object
    • getComponentIndex

      private int getComponentIndex(String componentName)
    • setMolarCompositionOfNamedComponents

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

      public void setMixingRuleParametersForComponent(String compName)

      setMixingRuleParametersForComponent.

      Parameters:
      compName - a String object
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface SystemInterface
      Overrides:
      equals in class Object