ESM Software Software for Materials Science

ChemApp

ChemApp Functions

Only three stages of programming are necessary to proceed from initialization of the ChemApp routine to the calculation of results:

  1. Initialize the interface, read a thermodynamic datafile, and adjust the chemical system
  2. Set initial conditions for the equilibrium calculation
  3. Perform the calculation and collect results

Initialization functions

  • TQINI() - initialize the interface
  • TQGIO(Option, Ival, Noerr) - get the value of an output option
  • TQCIO(Option, Ival, Noerr) - change the value of an output option
  • TQRFIL(File, Noerr) - read a thermodynamic datafile
  • TQGSU(Option, Unit, Noerr) - get a system unit
  • TQCSU(Option, Unit, Noerr) - change a system unit

Functions for identifying the chemical system

  • TQINS(Name, IndexS, NoErr) - get the index number for a system component
  • TQGNS(Name, IndexS, NoErr) - get the name for a system component
  • TQNOS(Nscom, NoErr) - get the number of system components
  • TQSTSC(IndexS, Stoi, Wmass, NoErr) - get the stoichiometry of a system component
  • TQCSC(Name, NoErr) - change the system components
  • TQINP(Name, IndexP, NoErr) - get the index number for a phase
  • TQGNP(IndexP, Name, NoErr) - get the name for a phase
  • TQNOP(NPhase, NoErr) - get the number of phases
  • TQINPC(Name, IndexP, IndexC, NoErr) - get the index number for a phase constituent
  • TQGNPC(IndexP, IndexC, Name, NoErr) - get the name for a phase constituent
  • TQNOPC(IndexP, NPCon, NoErr) - get the number of phase constituents
  • TQSTPC(IndexP, IndexC, Stoi, Wmass, NoErr) - get the stoichiometry of phase constituents

Functions to get and change the status of a chemical system

  • TQGSP(IndexP, Option, NoErr) - get the status of a phase
  • TQCSP(IndexP, Option, NoErr) - change the status of a phase
  • TQGSPC(IndexP, IndexC, Option, NoErr) - get the status of a phase constituent
  • TQCSPC(IndexP, IndexC, Option, NoErr) - change the status of a phase constituent

Functions for defining a calculation

  • TQSETC(Option, IndexP, Index, Val, NumCon, NoErr) - set an equilibrium condition
  • TQREMC(NumCon, NoErr) - remove an equilibrium condition
  • TQSTTP(IdentS, Vals, NoErr) - set name, temperature and pressure for a stream
  • TQSTCA((IdentS, IndexP, IndexC, Val, NoErr) - set constituent amounts for a stream
  • TQSTEC(Option, IndexP, Val, NoErr) - set an equilibrium condition with input conditions defined by streams
  • TQSTRM(IdentS, NoErr) - remove a stream

Functions for calculating and getting results

  • TQCE(Option, IndexP, IndexC, Vals, NoErr) - calculate chemical equilibrium
  • TQCLIM(Option, Val, NoErr) - change limits of target variables
  • TQGETR(Option, IndexP, Index, Val, NoErr) - get calculated equilibrium results
  • TQGDPC(Option, IndexP, IndexC, Val, NoErr) - get thermodynamic properties
  • TQLE(NoErr) - list results from a calculation
  • TQERR(Mess, NoErr) - get an error message