Class ComponentUMRCPA

All Implemented Interfaces:
Serializable, Cloneable, ComponentCPAInterface, ComponentEosInterface, ComponentInterface, ThermodynamicConstantsInterface

public class ComponentUMRCPA extends ComponentPR implements ComponentCPAInterface

ComponentSrkCPA class.

Version:
$Id: $Id
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

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

      int cpaon
    • xsite

      double[] xsite
    • xsitedni

      private double[][] xsitedni
    • xsiteOld

      double[] xsiteOld
    • xsitedV

      double[] xsitedV
    • xsitedT

      double[] xsitedT
    • xsitedTdT

      double[] xsitedTdT
  • Constructor Details

    • ComponentUMRCPA

      public ComponentUMRCPA(String name, double moles, double molesInPhase, int compIndex)

      Constructor for ComponentSrkCPA.

      Parameters:
      name - Name of component.
      moles - Total number of moles of component.
      molesInPhase - Number of moles in phase.
      compIndex - Index number of component in phase object component array.
    • ComponentUMRCPA

      public ComponentUMRCPA(int number, double TC, double PC, double M, double a, double moles)

      Constructor for ComponentSrkCPA.

      Parameters:
      number - a int. Not used.
      TC - Critical temperature [K]
      PC - Critical pressure [bara]
      M - Molar mass
      a - Acentric factor
      moles - Total number of moles of component.
  • Method Details

    • createComponent

      public void createComponent(String name, double moles, double molesInPhase, int compIndex)

      Helper function to create component. Typically called from constructors.

      Specified by:
      createComponent in interface ComponentInterface
      Overrides:
      createComponent in class Component
      Parameters:
      name - Name of component.
      moles - Total number of moles of component in system.
      molesInPhase - Number of moles in phase.
      compIndex - Index number of component in phase object component array.
    • clone

      public ComponentUMRCPA clone()

      clone.

      Specified by:
      clone in interface ComponentInterface
      Overrides:
      clone in class ComponentPR
      Returns:
      a ComponentInterface object
    • getVolumeCorrection

      public double getVolumeCorrection()

      getVolumeCorrection.

      Specified by:
      getVolumeCorrection in interface ComponentInterface
      Overrides:
      getVolumeCorrection in class ComponentPR
      Returns:
      a double
    • setAttractiveTerm

      public void setAttractiveTerm(int i)

      setAttractiveTerm.

      Specified by:
      setAttractiveTerm in interface ComponentInterface
      Overrides:
      setAttractiveTerm in class ComponentEos
      Parameters:
      i - a int
    • seta

      public void seta(double a)

      seta.

      Specified by:
      seta in interface ComponentInterface
      Overrides:
      seta in class ComponentEos
      Parameters:
      a - a double
    • setb

      public void setb(double a)

      setb.

      Specified by:
      setb in interface ComponentInterface
      Overrides:
      setb in class ComponentEos
      Parameters:
      a - a double
    • calca

      public double calca()

      calca.

      Specified by:
      calca in interface ComponentEosInterface
      Overrides:
      calca in class ComponentPR
      Returns:
      a double
    • calcb

      public double calcb()

      calcb.

      Specified by:
      calcb in interface ComponentEosInterface
      Overrides:
      calcb in class ComponentPR
      Returns:
      a double
    • dFdN

      public double dFdN(PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFdN.

      Specified by:
      dFdN in interface ComponentEosInterface
      Overrides:
      dFdN in class ComponentEos
      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • dFdNdT

      public double dFdNdT(PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFdNdT.

      Specified by:
      dFdNdT in interface ComponentEosInterface
      Overrides:
      dFdNdT in class ComponentEos
      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • dFdNdV

      public double dFdNdV(PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFdNdV.

      Specified by:
      dFdNdV in interface ComponentEosInterface
      Overrides:
      dFdNdV in class ComponentEos
      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • dFdNdN

      public double dFdNdN(int j, PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFdNdN.

      Specified by:
      dFdNdN in interface ComponentEosInterface
      Overrides:
      dFdNdN in class ComponentEos
      Parameters:
      j - a int
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • dFCPAdNdN

      public double dFCPAdNdN(int j, PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFCPAdNdN.

      Parameters:
      j - a int
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • dFCPAdN

      public double dFCPAdN(PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFCPAdN.

      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • dFCPAdNdV

      public double dFCPAdNdV(PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFCPAdNdV.

      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • dFCPAdNdT

      public double dFCPAdNdT(PhaseInterface phase, int numberOfComponents, double temperature, double pressure)

      dFCPAdNdT.

      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      Returns:
      a double
    • calc_hCPAdn

      public double calc_hCPAdn()

      calc_hCPAdn.

      Returns:
      a double
    • dFCPAdXi

      public double dFCPAdXi(int site, PhaseInterface phase)

      dFCPAdXi.

      Specified by:
      dFCPAdXi in interface ComponentCPAInterface
      Parameters:
      site - a int
      phase - a PhaseInterface object
      Returns:
      a double
    • dFCPAdXidni

      public double dFCPAdXidni(int site, PhaseInterface phase)

      dFCPAdXidni.

      Parameters:
      site - a int
      phase - a PhaseInterface object
      Returns:
      a double
    • dFCPAdXidXj

      public double dFCPAdXidXj(int sitei, int sitej, int compj, PhaseInterface phase)

      dFCPAdXidXj.

      Specified by:
      dFCPAdXidXj in interface ComponentCPAInterface
      Parameters:
      sitei - a int
      sitej - a int
      compj - a int
      phase - a PhaseInterface object
      Returns:
      a double
    • dFCPAdVdXi

      public double dFCPAdVdXi(int site, PhaseInterface phase)

      dFCPAdVdXi.

      Specified by:
      dFCPAdVdXi in interface ComponentCPAInterface
      Parameters:
      site - a int
      phase - a PhaseInterface object
      Returns:
      a double
    • dFCPAdNdXi

      public double dFCPAdNdXi(int site, PhaseInterface phase)

      dFCPAdNdXi.

      Specified by:
      dFCPAdNdXi in interface ComponentCPAInterface
      Parameters:
      site - a int
      phase - a PhaseInterface object
      Returns:
      a double
    • dFCPAdNdXidXdV

      public double dFCPAdNdXidXdV(PhaseInterface phase)

      dFCPAdNdXidXdV.

      Parameters:
      phase - a PhaseInterface object
      Returns:
      a double
    • calc_lngi

      public double calc_lngi(PhaseInterface phase)

      calc_lngi.

      Parameters:
      phase - a PhaseInterface object
      Returns:
      a double
    • calc_lngidV

      public double calc_lngidV(PhaseInterface phase)

      calc_lngidV.

      Parameters:
      phase - a PhaseInterface object
      Returns:
      a double
    • calc_lngij

      public double calc_lngij(int j, PhaseInterface phase)

      calc_lngij.

      Parameters:
      j - a int
      phase - a PhaseInterface object
      Returns:
      a double
    • getXsite

      public double[] getXsite()

      getXsite.

      Specified by:
      getXsite in interface ComponentCPAInterface
      Returns:
      an array of type double
    • setXsite

      public void setXsite(double[] xsite)
      Setter for property xsite.
      Parameters:
      xsite - New value of property xsite.
    • setXsite

      public void setXsite(int i, double xsite)

      setXsite.

      Specified by:
      setXsite in interface ComponentCPAInterface
      Parameters:
      i - a int
      xsite - a double
    • getXsitedV

      public double[] getXsitedV()

      getXsitedV.

      Specified by:
      getXsitedV in interface ComponentCPAInterface
      Returns:
      an array of type double
    • setXsitedV

      public void setXsitedV(int i, double xsitedV)

      setXsitedV.

      Specified by:
      setXsitedV in interface ComponentCPAInterface
      Parameters:
      i - a int
      xsitedV - a double
    • getXsitedT

      public double[] getXsitedT()

      getXsitedT.

      Specified by:
      getXsitedT in interface ComponentCPAInterface
      Returns:
      an array of type double
    • getXsitedTdT

      public double[] getXsitedTdT()

      getXsitedTdT.

      Specified by:
      getXsitedTdT in interface ComponentCPAInterface
      Returns:
      an array of type double
    • setXsitedT

      public void setXsitedT(int i, double xsitedT)

      setXsitedT.

      Specified by:
      setXsitedT in interface ComponentCPAInterface
      Parameters:
      i - a int
      xsitedT - a double
    • setXsitedTdT

      public void setXsitedTdT(int i, double xsitedTdT)

      setXsitedTdT.

      Specified by:
      setXsitedTdT in interface ComponentCPAInterface
      Parameters:
      i - a int
      xsitedTdT - a double
    • getXsiteOld

      public double[] getXsiteOld()

      getXsiteOld.

      Specified by:
      getXsiteOld in interface ComponentCPAInterface
      Returns:
      an array of type double
    • setXsiteOld

      public void setXsiteOld(double[] xsiteOld)
      Setter for property xsite.
      Parameters:
      xsiteOld - an array of type double
    • setXsiteOld

      public void setXsiteOld(int i, double xsiteOld)

      setXsiteOld.

      Specified by:
      setXsiteOld in interface ComponentCPAInterface
      Parameters:
      i - a int
      xsiteOld - a double
    • getXsitedni

      public double[][] getXsitedni()

      Getter for the field xsitedni.

      Returns:
      the xsitedni
    • getXsitedni

      public double getXsitedni(int xNumb, int compNumbi)

      Getter for the field xsitedni.

      Parameters:
      xNumb - a int
      compNumbi - a int
      Returns:
      a double
    • setXsitedni

      public void setXsitedni(double[][] xsitedni)

      Setter for the field xsitedni.

      Parameters:
      xsitedni - the xsitedni to set
    • setXsitedni

      public void setXsitedni(int xnumb, int compnumb, double val)

      setXsitedni.

      Specified by:
      setXsitedni in interface ComponentCPAInterface
      Parameters:
      xnumb - a int
      compnumb - a int
      val - a double
    • getSurfaceTenisionInfluenceParameter

      public double getSurfaceTenisionInfluenceParameter(double temperature)

      getSurfaceTenisionInfluenceParameter.

      Specified by:
      getSurfaceTenisionInfluenceParameter in interface ComponentInterface
      Overrides:
      getSurfaceTenisionInfluenceParameter in class ComponentPR
      Parameters:
      temperature - a double
      Returns:
      a double