Cantera  3.2.0a2
Loading...
Searching...
No Matches

Generated CLib API for Cantera's MultiPhase class. More...

Collaboration diagram for ctmix Library:

Detailed Description

Generated CLib API for Cantera's MultiPhase class.

Warning
This library is an experimental part of the Cantera API and may be changed or removed without notice.

Functions

int32_t mix_new ()
 Instantiate MultiPhase object using default constructor.
 
int32_t mix_addPhase (int32_t handle, int32_t p, double moles)
 Add a phase to the mixture.
 
int32_t mix_init (int32_t handle)
 Process phases and build atomic composition array.
 
int32_t mix_updatePhases (int32_t handle)
 Set the states of the phase objects to the locally-stored state within this MultiPhase object.
 
int32_t mix_nElements (int32_t handle)
 Number of elements.
 
int32_t mix_elementIndex (int32_t handle, const char *name)
 Returns the index of the element with name.
 
int32_t mix_nSpecies (int32_t handle)
 Number of species, summed over all phases.
 
int32_t mix_speciesIndex (int32_t handle, int32_t k, int32_t p)
 Return the global index of the species belonging to phase number.
 
double mix_temperature (int32_t handle)
 Temperature [K].
 
int32_t mix_setTemperature (int32_t handle, const double T)
 Set the temperature [K].
 
double mix_minTemp (int32_t handle)
 Minimum temperature for which all solution phases have valid thermo data.
 
double mix_maxTemp (int32_t handle)
 Maximum temperature for which all solution phases have valid thermo data.
 
double mix_charge (int32_t handle)
 Total charge summed over all phases (Coulombs).
 
double mix_phaseCharge (int32_t handle, int32_t p)
 Charge (Coulombs) of phase with index.
 
double mix_pressure (int32_t handle)
 Pressure [Pa].
 
int32_t mix_setPressure (int32_t handle, double P)
 Set the pressure [Pa].
 
double mix_nAtoms (int32_t handle, const int32_t kGlob, const int32_t mGlob)
 Returns the Number of atoms of global element.
 
int32_t mix_nPhases (int32_t handle)
 Number of phases.
 
double mix_phaseMoles (int32_t handle, const int32_t n)
 Return the number of moles in phase n.
 
int32_t mix_setPhaseMoles (int32_t handle, const int32_t n, const double moles)
 Set the number of moles of phase with index n.
 
int32_t mix_setMoles (int32_t handle, int32_t nLen, const double *n)
 Sets all of the global species mole numbers.
 
int32_t mix_setMolesByName (int32_t handle, const char *x)
 Set the moles via a string containing their names.
 
double mix_speciesMoles (int32_t handle, int32_t kGlob)
 Returns the moles of global species.
 
double mix_elementMoles (int32_t handle, int32_t m)
 Total moles of global element.
 
int32_t mix_equilibrate (int32_t handle, const char *XY, const char *solver, double rtol, int32_t max_steps, int32_t max_iter, int32_t estimate_equil)
 Equilibrate a ThermoPhase object.
 
int32_t mix_getChemPotentials (int32_t handle, int32_t muLen, double *mu)
 Returns a vector of Chemical potentials.
 
double mix_enthalpy (int32_t handle)
 The enthalpy of the mixture [J].
 
double mix_entropy (int32_t handle)
 The entropy of the mixture [J/K].
 
double mix_gibbs (int32_t handle)
 The Gibbs function of the mixture [J].
 
double mix_cp (int32_t handle)
 Heat capacity at constant pressure [J/K].
 
double mix_volume (int32_t handle)
 The total mixture volume [m^3].
 
int32_t mix_speciesPhaseIndex (int32_t handle, const int32_t kGlob)
 Returns the phase index of the Kth "global" species.
 
double mix_moleFraction (int32_t handle, const int32_t kGlob)
 Returns the mole fraction of global species k.
 
int32_t mix_del (int32_t handle)
 Delete MultiPhase object.
 
int32_t mix_cabinetSize ()
 Return size of MultiPhase storage.
 
int32_t mix_parentHandle (int32_t handle)
 Return handle to parent of MultiPhase object.
 

Function Documentation

◆ mix_new()

int32_t mix_new ( )

Instantiate MultiPhase object using default constructor.

Wraps C++ constructor: undefined

Returns
Object handle if successful and -1 for exception handling.

Definition at line 42 of file ctmix.cpp.

◆ mix_addPhase()

int32_t mix_addPhase ( int32_t  handle,
int32_t  p,
double  moles 
)

Add a phase to the mixture.

Wraps C++ method: void MultiPhase::addPhase(shared_ptr<ThermoPhase>, double)

Parameters
handleHandle to queried MultiPhase object.
pInteger handle to ThermoPhase object. pointer to the phase object
molestotal number of moles of all species in this phase

Definition at line 52 of file ctmix.cpp.

◆ mix_init()

int32_t mix_init ( int32_t  handle)

Process phases and build atomic composition array.

Wraps C++ method: void MultiPhase::init()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 63 of file ctmix.cpp.

◆ mix_updatePhases()

int32_t mix_updatePhases ( int32_t  handle)

Set the states of the phase objects to the locally-stored state within this MultiPhase object.

Wraps C++ method: void MultiPhase::updatePhases()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 74 of file ctmix.cpp.

◆ mix_nElements()

int32_t mix_nElements ( int32_t  handle)

Number of elements.

Wraps C++ getter: size_t MultiPhase::nElements()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 85 of file ctmix.cpp.

◆ mix_elementIndex()

int32_t mix_elementIndex ( int32_t  handle,
const char *  name 
)

Returns the index of the element with name.

Wraps C++ method: size_t MultiPhase::elementIndex(const string&)

Parameters
handleHandle to queried MultiPhase object.
nameString name of the global element

Definition at line 95 of file ctmix.cpp.

◆ mix_nSpecies()

int32_t mix_nSpecies ( int32_t  handle)

Number of species, summed over all phases.

Wraps C++ getter: size_t MultiPhase::nSpecies()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 105 of file ctmix.cpp.

◆ mix_speciesIndex()

int32_t mix_speciesIndex ( int32_t  handle,
int32_t  k,
int32_t  p 
)

Return the global index of the species belonging to phase number.

Wraps C++ method: size_t MultiPhase::speciesIndex(size_t, size_t)

Parameters
handleHandle to queried MultiPhase object.
klocal index of the species within the phase
pindex of the phase

Definition at line 115 of file ctmix.cpp.

◆ mix_temperature()

double mix_temperature ( int32_t  handle)

Temperature [K].

Wraps C++ getter: double MultiPhase::temperature()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 125 of file ctmix.cpp.

◆ mix_setTemperature()

int32_t mix_setTemperature ( int32_t  handle,
const double  T 
)

Set the temperature [K].

Wraps C++ setter: void MultiPhase::setTemperature(const double)

Parameters
handleHandle to queried MultiPhase object.
Tvalue of the temperature (Kelvin)

Definition at line 135 of file ctmix.cpp.

◆ mix_minTemp()

double mix_minTemp ( int32_t  handle)

Minimum temperature for which all solution phases have valid thermo data.

Wraps C++ getter: double MultiPhase::minTemp()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 146 of file ctmix.cpp.

◆ mix_maxTemp()

double mix_maxTemp ( int32_t  handle)

Maximum temperature for which all solution phases have valid thermo data.

Wraps C++ getter: double MultiPhase::maxTemp()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 156 of file ctmix.cpp.

◆ mix_charge()

double mix_charge ( int32_t  handle)

Total charge summed over all phases (Coulombs).

Wraps C++ getter: double MultiPhase::charge()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 166 of file ctmix.cpp.

◆ mix_phaseCharge()

double mix_phaseCharge ( int32_t  handle,
int32_t  p 
)

Charge (Coulombs) of phase with index.

Wraps C++ method: double MultiPhase::phaseCharge(size_t)

Parameters
handleHandle to queried MultiPhase object.
pindex of the phase for which the charge is desired.

Definition at line 176 of file ctmix.cpp.

◆ mix_pressure()

double mix_pressure ( int32_t  handle)

Pressure [Pa].

Wraps C++ getter: double MultiPhase::pressure()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 186 of file ctmix.cpp.

◆ mix_setPressure()

int32_t mix_setPressure ( int32_t  handle,
double  P 
)

Set the pressure [Pa].

Wraps C++ setter: void MultiPhase::setPressure(double)

Parameters
handleHandle to queried MultiPhase object.
PSet the pressure in the MultiPhase object (Pa)

Definition at line 196 of file ctmix.cpp.

◆ mix_nAtoms()

double mix_nAtoms ( int32_t  handle,
const int32_t  kGlob,
const int32_t  mGlob 
)

Returns the Number of atoms of global element.

Wraps C++ method: double MultiPhase::nAtoms(const size_t, const size_t)

Parameters
handleHandle to queried MultiPhase object.
kGlobglobal species index
mGlobglobal element index

Definition at line 207 of file ctmix.cpp.

◆ mix_nPhases()

int32_t mix_nPhases ( int32_t  handle)

Number of phases.

Wraps C++ getter: size_t MultiPhase::nPhases()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 217 of file ctmix.cpp.

◆ mix_phaseMoles()

double mix_phaseMoles ( int32_t  handle,
const int32_t  n 
)

Return the number of moles in phase n.

Wraps C++ method: double MultiPhase::phaseMoles(const size_t)

Parameters
handleHandle to queried MultiPhase object.
nIndex of the phase.

Definition at line 227 of file ctmix.cpp.

◆ mix_setPhaseMoles()

int32_t mix_setPhaseMoles ( int32_t  handle,
const int32_t  n,
const double  moles 
)

Set the number of moles of phase with index n.

Wraps C++ method: void MultiPhase::setPhaseMoles(const size_t, const double)

Parameters
handleHandle to queried MultiPhase object.
nIndex of the phase
molesNumber of moles in the phase (kmol)

Definition at line 237 of file ctmix.cpp.

◆ mix_setMoles()

int32_t mix_setMoles ( int32_t  handle,
int32_t  nLen,
const double *  n 
)

Sets all of the global species mole numbers.

Wraps C++ setter: void MultiPhase::setMoles(const double*)

Parameters
handleHandle to queried MultiPhase object.
[in]nLenLength of array reserved for n.
nVector of doubles of length nSpecies() containing the global mole numbers (kmol).

Definition at line 248 of file ctmix.cpp.

◆ mix_setMolesByName()

int32_t mix_setMolesByName ( int32_t  handle,
const char *  x 
)

Set the moles via a string containing their names.

Wraps C++ setter: void MultiPhase::setMolesByName(const string&)

Parameters
handleHandle to queried MultiPhase object.
xstring x in the form of a composition map where values are the moles of the species.

Definition at line 261 of file ctmix.cpp.

◆ mix_speciesMoles()

double mix_speciesMoles ( int32_t  handle,
int32_t  kGlob 
)

Returns the moles of global species.

Wraps C++ method: double MultiPhase::speciesMoles(size_t)

Parameters
handleHandle to queried MultiPhase object.
kGlobGlobal species index k

Definition at line 272 of file ctmix.cpp.

◆ mix_elementMoles()

double mix_elementMoles ( int32_t  handle,
int32_t  m 
)

Total moles of global element.

Wraps C++ method: double MultiPhase::elementMoles(size_t)

Parameters
handleHandle to queried MultiPhase object.
mIndex of the global element

Definition at line 282 of file ctmix.cpp.

◆ mix_equilibrate()

int32_t mix_equilibrate ( int32_t  handle,
const char *  XY,
const char *  solver,
double  rtol,
int32_t  max_steps,
int32_t  max_iter,
int32_t  estimate_equil 
)

Equilibrate a ThermoPhase object.

Wraps C++ method: void MultiPhase::equilibrate(const string&, const string&, double, int, int, int)

Parameters
handleHandle to queried MultiPhase object.
XYString representation of what two properties are being held constant
solverName of the solver to be used to equilibrate the phase. If solver = 'element_potential', the ChemEquil element potential solver will be used. If solver = 'vcs', the VCS solver will be used. If solver = 'gibbs', the MultiPhaseEquil solver will be used. If solver = 'auto', the solvers will be tried in order if the initial solver(s) fail.
rtolRelative tolerance
max_stepsMaximum number of steps to take to find the solution
max_iterFor the 'gibbs' and 'vcs' solvers, this is the maximum number of outer temperature or pressure iterations to take when T and/or P is not held fixed.
estimate_equilFor MultiPhaseEquil solver, an integer 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.

Definition at line 292 of file ctmix.cpp.

◆ mix_getChemPotentials()

int32_t mix_getChemPotentials ( int32_t  handle,
int32_t  muLen,
double *  mu 
)

Returns a vector of Chemical potentials.

Wraps C++ getter: void MultiPhase::getChemPotentials(double*)

Parameters
handleHandle to queried MultiPhase object.
[in]muLenLength of array reserved for mu.
muChemical potential vector. Length = num global species. Units = J/kmol.

Definition at line 303 of file ctmix.cpp.

◆ mix_enthalpy()

double mix_enthalpy ( int32_t  handle)

The enthalpy of the mixture [J].

Wraps C++ getter: double MultiPhase::enthalpy()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 316 of file ctmix.cpp.

◆ mix_entropy()

double mix_entropy ( int32_t  handle)

The entropy of the mixture [J/K].

Wraps C++ getter: double MultiPhase::entropy()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 326 of file ctmix.cpp.

◆ mix_gibbs()

double mix_gibbs ( int32_t  handle)

The Gibbs function of the mixture [J].

Wraps C++ getter: double MultiPhase::gibbs()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 336 of file ctmix.cpp.

◆ mix_cp()

double mix_cp ( int32_t  handle)

Heat capacity at constant pressure [J/K].

Wraps C++ getter: double MultiPhase::cp()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 346 of file ctmix.cpp.

◆ mix_volume()

double mix_volume ( int32_t  handle)

The total mixture volume [m^3].

Wraps C++ getter: double MultiPhase::volume()

Parameters
handleHandle to queried MultiPhase object.

Definition at line 356 of file ctmix.cpp.

◆ mix_speciesPhaseIndex()

int32_t mix_speciesPhaseIndex ( int32_t  handle,
const int32_t  kGlob 
)

Returns the phase index of the Kth "global" species.

Wraps C++ method: size_t MultiPhase::speciesPhaseIndex(const size_t)

Parameters
handleHandle to queried MultiPhase object.
kGlobGlobal species index.

Definition at line 366 of file ctmix.cpp.

◆ mix_moleFraction()

double mix_moleFraction ( int32_t  handle,
const int32_t  kGlob 
)

Returns the mole fraction of global species k.

Wraps C++ method: double MultiPhase::moleFraction(const size_t)

Parameters
handleHandle to queried MultiPhase object.
kGlobIndex of the global species.

Definition at line 376 of file ctmix.cpp.

◆ mix_del()

int32_t mix_del ( int32_t  handle)

Delete MultiPhase object.

Wraps C++ destructor: undefined

Parameters
handleHandle to MultiPhase object.
Returns
Zero for success and -1 for exception handling.

Definition at line 386 of file ctmix.cpp.

◆ mix_cabinetSize()

int32_t mix_cabinetSize ( )

Return size of MultiPhase storage.

Wraps C++ reserved CLib function: custom code

Returns
Size or -1 for exception handling.

Definition at line 397 of file ctmix.cpp.

◆ mix_parentHandle()

int32_t mix_parentHandle ( int32_t  handle)

Return handle to parent of MultiPhase object.

Wraps C++ reserved CLib function: custom code

Parameters
handleHandle to queried MultiPhase object.
Returns
Parent handle or -1 for exception handling.

Definition at line 409 of file ctmix.cpp.