33template<> MultiPhaseCabinet* MultiPhaseCabinet::s_storage = 0;
36template<> ThermoPhaseCabinet* ThermoPhaseCabinet::s_storage;
46 return MultiPhaseCabinet::add(make_shared<MultiPhase>());
56 MultiPhaseCabinet::at(handle)->addPhase(ThermoPhaseCabinet::at(p), moles);
67 MultiPhaseCabinet::at(handle)->init();
78 MultiPhaseCabinet::at(handle)->updatePhases();
89 return static_cast<int32_t
>(MultiPhaseCabinet::at(handle)->nElements());
100 return static_cast<int32_t
>(MultiPhaseCabinet::at(handle)->elementIndex(name,
true));
111 return static_cast<int32_t
>(MultiPhaseCabinet::at(handle)->nSpecies());
121 return static_cast<int32_t
>(MultiPhaseCabinet::at(handle)->speciesIndex(k, p));
131 return MultiPhaseCabinet::at(handle)->temperature();
141 MultiPhaseCabinet::at(handle)->setTemperature(T);
152 return MultiPhaseCabinet::at(handle)->minTemp();
162 return MultiPhaseCabinet::at(handle)->maxTemp();
172 return MultiPhaseCabinet::at(handle)->charge();
182 return MultiPhaseCabinet::at(handle)->phaseCharge(p);
192 return MultiPhaseCabinet::at(handle)->pressure();
202 MultiPhaseCabinet::at(handle)->setPressure(P);
209 double mix_nAtoms(int32_t handle,
const int32_t kGlob,
const int32_t mGlob)
213 return MultiPhaseCabinet::at(handle)->nAtoms(kGlob, mGlob);
223 return static_cast<int32_t
>(MultiPhaseCabinet::at(handle)->nPhases());
233 return MultiPhaseCabinet::at(handle)->phaseMoles(n);
243 MultiPhaseCabinet::at(handle)->setPhaseMoles(n, moles);
254 auto& obj = MultiPhaseCabinet::at(handle);
267 MultiPhaseCabinet::at(handle)->setMolesByName(x);
278 return MultiPhaseCabinet::at(handle)->speciesMoles(kGlob);
288 return MultiPhaseCabinet::at(handle)->elementMoles(m);
294 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)
298 MultiPhaseCabinet::at(handle)->equilibrate(XY, solver, rtol, max_steps, max_iter, estimate_equil);
309 auto& obj = MultiPhaseCabinet::at(handle);
311 obj->getChemPotentials(mu);
322 return MultiPhaseCabinet::at(handle)->enthalpy();
332 return MultiPhaseCabinet::at(handle)->entropy();
342 return MultiPhaseCabinet::at(handle)->gibbs();
352 return MultiPhaseCabinet::at(handle)->cp();
362 return MultiPhaseCabinet::at(handle)->volume();
372 return static_cast<int32_t
>(MultiPhaseCabinet::at(handle)->speciesPhaseIndex(kGlob));
382 return MultiPhaseCabinet::at(handle)->moleFraction(kGlob);
392 MultiPhaseCabinet::del(handle);
404 return MultiPhaseCabinet::size();
Headers for the MultiPhase object that is used to set up multiphase equilibrium problems (see Chemica...
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Template for classes to hold pointers to objects.
CTMIX - Generated CLib Cantera interface library.
int32_t mix_nElements(int32_t handle)
Number of elements.
double mix_moleFraction(int32_t handle, const int32_t kGlob)
Returns the mole fraction of global species 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.
int32_t mix_setMoles(int32_t handle, int32_t nLen, const double *n)
Sets all of the global species mole numbers.
int32_t mix_del(int32_t handle)
Delete MultiPhase object.
int32_t mix_getChemPotentials(int32_t handle, int32_t muLen, double *mu)
Returns a vector of Chemical potentials.
double mix_volume(int32_t handle)
The total mixture volume [m^3].
int32_t mix_setMolesByName(int32_t handle, const char *x)
Set the moles via a string containing their names.
double mix_cp(int32_t handle)
Heat capacity at constant pressure [J/K].
double mix_phaseCharge(int32_t handle, int32_t p)
Charge (Coulombs) of phase with index p.
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_speciesIndex(int32_t handle, int32_t k, int32_t p)
Return the global index of the species belonging to phase number p with local index k within the phas...
int32_t mix_init(int32_t handle)
Process phases and build atomic composition array.
int32_t mix_nPhases(int32_t handle)
Number of phases.
int32_t mix_nSpecies(int32_t handle)
Number of species, summed over all phases.
double mix_maxTemp(int32_t handle)
Maximum temperature for which all solution phases have valid thermo data.
int32_t mix_cabinetSize()
Return size of MultiPhase storage.
double mix_charge(int32_t handle)
Total charge summed over all phases (Coulombs).
int32_t mix_speciesPhaseIndex(int32_t handle, const int32_t kGlob)
Returns the phase index of the Kth "global" species.
int32_t mix_setPressure(int32_t handle, double P)
Set the pressure [Pa].
double mix_gibbs(int32_t handle)
The Gibbs function of the mixture [J].
int32_t mix_new()
Instantiate MultiPhase object using default constructor.
double mix_nAtoms(int32_t handle, const int32_t kGlob, const int32_t mGlob)
Returns the Number of atoms of global element mGlob in global species kGlob.
int32_t mix_setPhaseMoles(int32_t handle, const int32_t n, const double moles)
Set the number of moles of phase with index n.
double mix_pressure(int32_t handle)
Pressure [Pa].
double mix_enthalpy(int32_t handle)
The enthalpy of the mixture [J].
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.
double mix_speciesMoles(int32_t handle, int32_t kGlob)
Returns the moles of global species k.
int32_t mix_elementIndex(int32_t handle, const char *name)
Returns the index of the element with name.
double mix_entropy(int32_t handle)
The entropy of the mixture [J/K].
int32_t mix_addPhase(int32_t handle, int32_t p, double moles)
Add a phase to the mixture.
double mix_elementMoles(int32_t handle, int32_t m)
Total moles of global element m, summed over all phases.
double mix_phaseMoles(int32_t handle, const int32_t n)
Return the number of moles in phase n.
double mix_temperature(int32_t handle)
Temperature [K].
Namespace for the Cantera kernel.
T handleAllExceptions(T ctErrorCode, T otherErrorCode)
Exception handler used at language interface boundaries.