Cantera  3.3.0a1
Loading...
Searching...
No Matches
vcs_MultiPhaseEquil Class Reference

Cantera's Interface to the Multiphase chemical equilibrium solver. More...

#include <vcs_MultiPhaseEquil.h>

Detailed Description

Cantera's Interface to the Multiphase chemical equilibrium solver.

Class vcs_MultiPhaseEquil is designed to be used to set a mixture containing one or more phases to a state of chemical equilibrium.

Note, as currently constructed, the underlying ThermoPhase objects are shared between the MultiPhase object and this object. Therefore, mix is not a const argument, and the return parameters are contained in underlying ThermoPhase objects.

Definition at line 30 of file vcs_MultiPhaseEquil.h.

Public Member Functions

 vcs_MultiPhaseEquil (MultiPhase *mix, int printLvl)
 Constructor for the multiphase equilibrium solver.
 
int equilibrate (int XY, int estimateEquil=0, int printLvl=0, double err=1.0e-6, int maxsteps=VCS_MAXSTEPS, int loglevel=-99)
 Equilibrate the solution using the current element abundances stored in the MultiPhase object.
 
int equilibrate_TP (int estimateEquil=0, int printLvl=0, double err=1.0e-6, int maxsteps=VCS_MAXSTEPS, int loglevel=-99)
 Equilibrate the solution using the current element abundances stored in the MultiPhase object using constant T and P.
 
int equilibrate_HP (double Htarget, int XY, double Tlow, double Thigh, int estimateEquil=0, int printLvl=0, double err=1.0E-6, int maxsteps=VCS_MAXSTEPS, int loglevel=-99)
 Equilibrate the solution using the current element abundances stored in the MultiPhase object using either constant H and P or constant U and P.
 
int equilibrate_SP (double Starget, double Tlow, double Thigh, int estimateEquil=0, int printLvl=0, double err=1.0E-6, int maxsteps=VCS_MAXSTEPS, int loglevel=-99)
 Equilibrate the solution using the current element abundances stored in the MultiPhase object using constant S and P.
 
int equilibrate_TV (int XY, double xtarget, int estimateEquil=0, int printLvl=0, double err=1.0E-6, int maxsteps=VCS_MAXSTEPS, int logLevel=-99)
 Equilibrate the solution using the current element abundances stored in the MultiPhase object using constant V and constant T, H, U or S.
 

Protected Attributes

MultiPhasem_mix
 Pointer to the MultiPhase mixture that will be equilibrated.
 
int m_printLvl
 Print level from the VCSnonlinear package.
 
VCS_SOLVE m_vsolve
 The object that contains the problem statement and does all of the equilibration work.
 

Constructor & Destructor Documentation

◆ vcs_MultiPhaseEquil()

vcs_MultiPhaseEquil ( MultiPhase mix,
int  printLvl 
)

Constructor for the multiphase equilibrium solver.

This constructor will initialize the object with a MultiPhase object, setting up the internal equilibration problem. Note, as currently constructed, the underlying ThermoPhase objects are shared between the MultiPhase object and this object. Therefore, mix is not a const argument, and the return parameters are contained in underlying ThermoPhase objects.

Parameters
mixObject containing the MultiPhase object
printLvlDetermines the amount of printing to stdout that occurs for each call:
  • 0: No printing
  • 1: Minimal summary information
  • 2: Print the solution only
  • 3: Print the setup and then the solution only
  • 4: Print a table for each iteration
  • 5: Print more than a table for each iteration

Definition at line 18 of file vcs_MultiPhaseEquil.cpp.

◆ ~vcs_MultiPhaseEquil()

virtual ~vcs_MultiPhaseEquil ( )
inlinevirtual

Definition at line 54 of file vcs_MultiPhaseEquil.h.

Member Function Documentation

◆ equilibrate()

int equilibrate ( int  XY,
int  estimateEquil = 0,
int  printLvl = 0,
double  err = 1.0e-6,
int  maxsteps = VCS_MAXSTEPS,
int  loglevel = -99 
)

Equilibrate the solution using the current element abundances stored in the MultiPhase object.

Use the vcs algorithm to equilibrate the current multiphase mixture.

Parameters
XYInteger representing what two thermo quantities are held constant during the equilibration
estimateEquilinteger indicating whether the solver should estimate its own initial condition.
  • If 0, the initial mole fraction vector in the ThermoPhase object is used as the initial condition.
  • If 1, the initial mole fraction vector is used if the element abundances are satisfied.
  • if -1, the initial mole fraction vector is thrown out, and an estimate is formulated.
printLvlDetermines the amount of printing that gets sent to stdout from the vcs package (Note, you may have to compile with debug flags to get some printing).
errInternal error level
maxstepsmax steps allowed.
loglevelDetermines the amount of printing to the output file.

Definition at line 358 of file vcs_MultiPhaseEquil.cpp.

◆ equilibrate_TP()

int equilibrate_TP ( int  estimateEquil = 0,
int  printLvl = 0,
double  err = 1.0e-6,
int  maxsteps = VCS_MAXSTEPS,
int  loglevel = -99 
)

Equilibrate the solution using the current element abundances stored in the MultiPhase object using constant T and P.

Use the vcs algorithm to equilibrate the current multiphase mixture.

Parameters
estimateEquilinteger indicating whether the solver should estimate its own initial condition.
  • If 0, the initial mole fraction vector in the ThermoPhase object is used as the initial condition.
  • If 1, the initial mole fraction vector is used if the element abundances are satisfied.
  • if -1, the initial mole fraction vector is thrown out, and an estimate is formulated.
printLvlDetermines the amount of printing that gets sent to stdout from the vcs package (Note, you may have to compile with debug flags to get some printing).
errInternal error level
maxstepsmax steps allowed.
loglevelDetermines the amount of printing to the output file.

Definition at line 402 of file vcs_MultiPhaseEquil.cpp.

◆ equilibrate_HP()

int equilibrate_HP ( double  Htarget,
int  XY,
double  Tlow,
double  Thigh,
int  estimateEquil = 0,
int  printLvl = 0,
double  err = 1.0E-6,
int  maxsteps = VCS_MAXSTEPS,
int  loglevel = -99 
)

Equilibrate the solution using the current element abundances stored in the MultiPhase object using either constant H and P or constant U and P.

Use the vcs algorithm to equilibrate the current multiphase mixture. The pressure of the calculation is taken from the current pressure stored with the MultiPhase object.

Parameters
HtargetValue of the total mixture enthalpy or total internal energy that will be kept constant. Note, this is and must be an extensive quantity. units = Joules
XYInteger flag indicating what is held constant. Must be either HP or UP.
TlowLower limit of the temperature. It's an error condition if the temperature falls below Tlow.
ThighUpper limit of the temperature. It's an error condition if the temperature goes higher than Thigh.
estimateEquilinteger indicating whether the solver should estimate its own initial condition.
  • If 0, the initial mole fraction vector in the ThermoPhase object is used as the initial condition.
  • If 1, the initial mole fraction vector is used if the element abundances are satisfied.
  • if -1, the initial mole fraction vector is thrown out, and an estimate is formulated.
printLvlDetermines the amount of printing that gets sent to stdout from the vcs package (Note, you may have to compile with debug flags to get some printing). See main constructor call for meaning of the levels.
errInternal error level
maxstepsmax steps allowed.
loglevelDetermines the amount of printing to the output file.

Definition at line 121 of file vcs_MultiPhaseEquil.cpp.

◆ equilibrate_SP()

int equilibrate_SP ( double  Starget,
double  Tlow,
double  Thigh,
int  estimateEquil = 0,
int  printLvl = 0,
double  err = 1.0E-6,
int  maxsteps = VCS_MAXSTEPS,
int  loglevel = -99 
)

Equilibrate the solution using the current element abundances stored in the MultiPhase object using constant S and P.

Use the vcs algorithm to equilibrate the current multiphase mixture. The pressure of the calculation is taken from the current pressure stored with the MultiPhase object.

Parameters
StargetValue of the total mixture entropy that will be kept constant. Note, this is and must be an extensive quantity. units = Joules/K
TlowLower limit of the temperature. It's an error condition if the temperature falls below Tlow.
ThighUpper limit of the temperature. It's an error condition if the temperature goes higher than Thigh.
estimateEquilinteger indicating whether the solver should estimate its own initial condition.
  • If 0, the initial mole fraction vector in the ThermoPhase object is used as the initial condition.
  • If 1, the initial mole fraction vector is used if the element abundances are satisfied.
  • If -1, the initial mole fraction vector is thrown out, and an estimate is formulated.
printLvlDetermines the amount of printing that gets sent to stdout from the vcs package (Note, you may have to compile with debug flags to get some printing). See main constructor call for meaning of the levels.
errInternal error level
maxstepsmax steps allowed.
loglevelDetermines the amount of printing to the output file.

Definition at line 235 of file vcs_MultiPhaseEquil.cpp.

◆ equilibrate_TV()

int equilibrate_TV ( int  XY,
double  xtarget,
int  estimateEquil = 0,
int  printLvl = 0,
double  err = 1.0E-6,
int  maxsteps = VCS_MAXSTEPS,
int  logLevel = -99 
)

Equilibrate the solution using the current element abundances stored in the MultiPhase object using constant V and constant T, H, U or S.

Use the vcs algorithm to equilibrate the current multiphase mixture. The pressure of the calculation is taken from the current pressure stored with the MultiPhase object.

Parameters
XYInteger flag indicating what is held constant. Must be either TV, HV, UV, or SV.
xtargetValue of the total thermodynamic parameter to be held constant in addition to V. Note, except for T, this must be an extensive quantity. units = Joules/K or Joules
estimateEquilinteger indicating whether the solver should estimate its own initial condition.
  • If 0, the initial mole fraction vector in the ThermoPhase object is used as the initial condition.
  • If 1, the initial mole fraction vector is used if the element abundances are satisfied.
  • if -1, the initial mole fraction vector is thrown out, and an estimate is formulated.
printLvlDetermines the amount of printing that gets sent to stdout from the vcs package (Note, you may have to compile with debug flags to get some printing). See main constructor call for meaning of the levels.
errInternal error level
maxstepsmax steps allowed.
logLevelDetermines the amount of printing to the output file.

Definition at line 25 of file vcs_MultiPhaseEquil.cpp.

Member Data Documentation

◆ m_mix

MultiPhase* m_mix
protected

Pointer to the MultiPhase mixture that will be equilibrated.

Equilibrium solutions will be returned via this variable.

Definition at line 217 of file vcs_MultiPhaseEquil.h.

◆ m_printLvl

int m_printLvl
protected

Print level from the VCSnonlinear package.

(Note, you may have to compile with debug flags to get some printing).

  • 0: No IO from the routine whatsoever
  • 1: One line print statements from equilibrate_XY() functions
  • 2: Problem statement information from vcs_Cantera_update_vprob(); Final state of the system from vcs_solve_TP()
  • 3: Several more setup tables; Problem initialization routine
  • 4: One table for each iteration within vcs_solve_TP()
  • 5: Multiple tables for each iteration within vcs_solve_TP()

Definition at line 231 of file vcs_MultiPhaseEquil.h.

◆ m_vsolve

VCS_SOLVE m_vsolve
protected

The object that contains the problem statement and does all of the equilibration work.

The problem statement may contain some subtleties. For example, the element constraints may be different than just an element conservation contraint equations. There may be kinetically frozen degrees of freedom. There may be multiple electrolyte phases with zero charge constraints. All of these make the problem statement different than the simple element conservation statement.

VCS_SOLVE will have different ordering for species and element constraints than this object.

Definition at line 245 of file vcs_MultiPhaseEquil.h.


The documentation for this class was generated from the following files: