chemapp.basic

This module provides the complete basic ChemApp library API for use in Python programs.

Module Contents

Classes

AmountUnit

Available amount units.

ChemAppError

Errors generated by the ChemApp API's standard error reporting mechanism.

ConditionVariable

Available variables for setting conditions in equilibrium calculations.

ConfigurationOption

Configuration options for ChemApp.

EnergyUnit

Available energy units.

FunctionData

Available data items that can be requested for functions.

FunctionSumVariable

Available function sum data for ChemSage.dat with functions.

InteractionVariable

Enum to specific the type of interaction parameter to extract.

IoOption

Input/output options used by tqgio() and

LimitVariable

Limit variables that can be set during target calculations.

PhaseConstituentData

Available data items that can be requested for phase constituents.

PhaseConstituentVariable

Available variables for extracting thermodynamic properties of phase

PhaseMapVariable

Variables that can be used to adjust conditions as part of phase map

PressureUnit

Available pressure units.

Quantity

Quantities available for setting units.

ResultVariable

Result variables available after equilibrium calculations.

SolutionModel

Available solution models.

Status

Status values for phases and phase constituents.

StreamVariable

Available variables for stream properties that can be extracted.

TargetVariable

Variables that can be used in target calculations to arrive at a specified

TemperatureUnit

Available temperature units.

VolumeUnit

Available volume units.

Functions

disable_logging()

Turn off logging of ChemApp calls to 'calls.log'

enable_logging()

Set the ChemApp calls to be output including returns to 'calls.log'

tqbond(indexp, indexa, indexb, indexc, indexd)

Calculate a quadruplet or pair fraction (only for the models SUBG, QUAS and

tqcdat(i1, i2, i3, i4, i5, val)

Change selected data of a specified phase constituent or of a specified

tqce(option[, indexp, indexc, vals])

Calculate the equilibrium with the current settings of global conditions or

tqcel(option[, indexp, indexc, vals])

Calculate the equilibrium with current settings of global conditions or

tqcen(option[, indexp, indexc, vals])

Calculate the equilibrium, taking results from the previous equilibrium

tqcenl(option[, indexp, indexc, vals])

Calculate the equilibrium, taking results from the previous equilibrium

tqcfct(indexf, option, indexc, indexr, indexx, value)

Change a coefficient in a function.

tqchar(indexp, indexc)

Get the charge of a phase constituent.

tqcio(option, ival)

Redirect input and output from ChemApp to another unit than the default, or

tqclim(option, val)

Modify the upper and lower limits of the target variables pressure,

tqclos(unit)

Close a file that has been previously opened using TQOPNA, TQOPNB, TQOPNT,

tqcnsc(indexs, name)

Change the name of the specified system component.

tqconf(option[, valuea, valueb, valuec])

Set a configuration option.

tqcprt()

Get the ChemApp copyright message.

tqcsp(indexp, status)

Change the status of the specified phase.

tqcspc(indexp, indexc, status)

Change the status of a specified phase constituent.

tqcsu(option, unit)

Change the unit for the specified quantity.

tqcsum(option, indexp, indexc, nval, value)

Change a pre-factor of a function for an phase constituent.

tqefct(indexf)

Get the number of expressions of a function.

tqerr()

Get the current error message. All ChemApp error messages are written

tqgdat(indexp, indexc, option[, indexr])

Get selected thermodynamic data of a specified phase constituent loaded

tqgdpc(option, indexp, indexc)

Get thermodynamic data for a phase constituent.

tqgetr(option[, indexp, index])

Get calculation results obtained by the last call to tqce, tqcel, tqmap, or

tqgfct(indexf, option[, indexc, indexr])

Get a property of the specified function.

tqgio(option)

Get the unit number and language used for error messages, and the unit

tqgnlc(indexp, indexl, indexc)

Get the name of the specified sublattice constituent.

tqgnp(indexp)

Get the name of a specified phase.

tqgnpc(indexp, indexc)

Get the name of the specified phase constituent.

tqgnsc(indexs)

Get the name of the specified system component.

tqgpar(indexp, object, indexx)

Get selected excess Gibbs energy or excess magnetic parameters of a

tqgsp(indexp)

Get the status of a specified phase.

tqgspc(indexp, indexc)

Get the status of the specified phase constituent.

tqgsu(option)

Get the unit that is currently in use for a specified quantity.

tqgsum(option, indexp, indexc)

List all functions and pre-factors of a phase constituent that make the

tqgted()

Get the ChemApp license expiration date.

tqgthi()

Get the HASP dongle type and id.

tqgtid()

Get the user ID of the ChemApp library license holder.

tqgtlc(indexp, indexl, indexc)

Get the calculated equilibrium sublattice site fraction.

tqgtnm()

Get the name of the ChemApp library license holder.

tqgtpi()

Get the program ID.

tqgtrh()

Retrieve information stored in the header of a transparent file.

tqifct(indexf)

Get the name of a function.

tqini()

Use this method to initialise ChemApp.

tqinlc(name, indexp, indexl)

Get the index number of the specified sublattice constituent.

tqinp(name)

Get the zero-based index number of a specified phase.

tqinpc(name, indexp)

Get the zero-based index number of the specified phase constituent.

tqinsc(name)

Get the zero-based index number of the specified system component.

tqlite()

Check whether the type of ChemApp currently used is ChemApp light.

tqlpar(indexp, object)

List all excess Gibbs energy or all excess magnetic interactions of a

tqmap(option, indexp, indexc, vals)

Perform a one-dimensional phase mapping calculation, giving all phase

tqmapl(option, indexp, indexc, vals)

Perform a one-dimensional phase mapping calculation and list the results

tqmodl(indexp)

Get the solution model name for the specified phase

tqnexc(indexp)

Get the number of ternary exceptions of a phase.

tqnfct()

Get the total number of functions.

tqnolc(indexp, indexl)

Get the number of sublattice constituents of the specified sublattice.

tqnop()

Get the total number of phases.

tqnopc(indexp)

Get the total number of constituents in the specified phase.

tqnosc()

Get the total number of system components.

tqnosl(indexp)

Get the number of sublattices of the specified phase.

tqnpar(indexp, option)

Get the number of excess/interaction parameters of a phase.

tqopen(file_path, unit)

Open a file for reading or writing by ChemApp.

tqopna(file_path, unit)

Open an ASCII thermochemical data file for reading by ChemApp.

tqopnt(file_path, unit)

Open a transparent thermochemical data file for reading by ChemApp.

tqpcis(indexp, indexc)

Check if the specified phase constituent is permitted as an incoming

tqrcst()

Read a thermodynamic data-file in transparent format.

tqremc(numcon)

Remove a condition from the equilibrium calculation.

tqrfil()

Read a thermodynamic data-file in ASCII format.

tqsetc(option, indexp, indexc, val)

Set a condition for the equilibrium calculation.

tqshow()

Display the present settings.

tqsize()

Get ChemApp's internal array dimensions.

tqstca(idents, indexp, indexc, val)

Set a phase constituent amount for the specified stream.

tqstec(option, indexp, val)

Set an invariant state variable for the equilibrium calculation when the

tqstpc(indexp, indexc)

Get the stoichiometry and molecular mass of the specified phase constituent.

tqstrm(idents)

Remove a stream.

tqstsc(indexs)

Get the stoichiometry and molecular mass of a system component.

tqsttp(idents, T, P)

Define a stream and set its temperature and pressure.

tqstxp(idents, option)

Get the calculated thermodynamic properties of a stream.

tqused()

Get the dimensions of the currently loaded thermochemical system.

tqvers()

Get the ChemApp version number.

tqwasc(file)

Write a thermodynamic data-file in ASCII format.

tqwstr(option, text)

Write a character string to the Fortran units associated with 'LIST' and

class chemapp.basic.AmountUnit

Bases: enum.Enum

Available amount units.

Amount

mol

gram

kg

tonne

pound

class chemapp.basic.ChemAppError

Bases: ChemAppPyError

Errors generated by the ChemApp API’s standard error reporting mechanism.

It is possible to acquire the ChemApp error number via the errno property. If this is not applicable, it will return 0.

property errno: int

<int> The error number of ChemApp, if applicable. Defaults to 0.

Return type:

int

class chemapp.basic.ConditionVariable

Bases: enum.Enum

Available variables for setting conditions in equilibrium calculations.

Value

Variable

Description

P

Total pressure

Last entered (pressure or volume) takes precedence. Default value is 1 bar.

VT

Total volume

Last entered (pressure or volume) takes precedence. Note that the use of this option to perform calculations at constant volume is discouraged, see Appendix B.4 for details.

T

Temperature

Default value is 1000 K.

A

Amount of phase

VAL >=0 defines a formation target calculation; VAL <0 a precipitation target calculation for a mixture phase. In a formation target calculation, the target variable is varied until unit activity and zero amount of the target phase is achieved. A precipitation target is defined as one where the target phase is the only one formed at equilibrium, and the second most stable phase has unit activity.

IA

Incoming amount

Valid for phase constituents and system components. Not permitted for TQSTEC.

MU

Chemical potential

Valid only for phase constituents. Not permitted for TQSTEC.

AC

Relative activity,

Valid only for phase constituents. Not permitted for TQSTEC.

CP, H, S, G, V,

Heat capacity, Enthalpy, Entropy, Gibbs energy, Volume

Valid for the entire system or for a phase. Extensive properties are either calculated for the equilibrium phases and are then dependent on the reference state chosen in the data-file, or for the chemical reaction when streams are defined, in which case they are relative to the state defined by the stream conditions.

AT

Relative activity

Relative activity of a phase constituent as target.

XT

Mole fraction

Mole fraction of a phase constituent as target.

XPT

Mole fraction

Mole fraction of a system component in a phase as target.

class chemapp.basic.ConfigurationOption

Bases: enum.Enum

Configuration options for ChemApp.

Parameters:

E – The electron configuration option.

class chemapp.basic.EnergyUnit

Bases: enum.Enum

Available energy units.

Energy

J

cal

Btu

kWh

class chemapp.basic.FunctionData

Bases: enum.Enum

Available data items that can be requested for functions.

FunctionData

Description

H

Enthalpy

S

Entropy

Cp

Cp function coefficients

Tt

Temperature of transition

Ht

Heat of transition

V

Volume

class chemapp.basic.FunctionSumVariable

Bases: enum.Enum

Available function sum data for ChemSage.dat with functions.

Option

Meaning

G

Gibbs energy function parameters

V

Volumetric expansion parameters

class chemapp.basic.InteractionVariable

Bases: enum.Enum

Enum to specific the type of interaction parameter to extract.

Option

Meaning

G

Gibbs energy function excess parameters

M

Magnetic interaction parameters

class chemapp.basic.IoOption

Bases: enum.Enum

Input/output options used by tqgio() and tqcio().

Option

Meaning

Default value

FILE

Unit from which the thermodynamic data-file is read

10

ERROR

Unit to which error messages are directed

6

LIST

Unit to which optional equilibrium output lists are directed

6

LANGUAGE

Language used for error messages (1=English, 2=German, 3=French, 4=Swedish, 5=Finnish)

1

class chemapp.basic.LimitVariable

Bases: enum.Enum

Limit variables that can be set during target calculations.

Option

Variable Limit

Default Value

PLOW

Low pressure limit

1E-50 bar

PHIGH

High pressure limit

1E7 bar

VLOW

Low volume limit

1E-7 dm3

VHIGH

High volume limit

1E50 dm3

TLOW

Low temperature limit

298.15 K

THIGH

High temperature limit

6000 K

class chemapp.basic.PhaseConstituentData

Bases: enum.Enum

Available data items that can be requested for phase constituents.

OPTION

Variable

H

Enthalpy/J at 298.15K

S

Entropy/J*K-1 at 298.15K

Cp

Heat capacity expression/J.K-1 or Helgeson terms for the models PIHZ, HELZ, HTSZ, HTWZ or HTDZ

V

Molar volume data in input order of a condensed phase constituent

Gc

Critical properties in input order of a gas phase constituent

Ht

Transformation enthalpy/J at the upper temperature limit for a Cp range

M

Curie/Neel temperature and average magnetic moment per atom for a magnetic phase constituent

Tt

Upper temperature limit/K for a Cp range

Ch

Charge of an aqueous phase constituent

class chemapp.basic.PhaseConstituentVariable

Bases: enum.Enum

Available variables for extracting thermodynamic properties of phase constituents.

Value

Description

CP

Heat capacity

G

Gibbs energy

H

Enthalpy

S

Entropy

T

Temperature (used to retrieve the upper limit of the current temperature interval for a given phase constituent or a stoichiometric condensed phase)

V

Volume

class chemapp.basic.PhaseMapVariable

Bases: enum.Enum

Variables that can be used to adjust conditions as part of phase map calculations.

Option

Variable

Comment

PF / PN

Total pressure

Pressure is the search variable. The upper and lower bounds of the pressure search interval are in VALS(1) and VALS(2). Use option ‘PF’ for the first call to tqmap(), and ‘PN’ for all subsequent ones.

TF / TN

Temperature

Temperature is the search variable. The upper and lower bounds of the temperature search interval are in VALS(1) and VALS(2). Use option ‘TF’ for the first call to tqmap(), and ‘TN’ for all subsequent ones.

IA0 / IAF / IAN

Incoming amount

Incoming amount is the search variable. The upper and lower bounds of the composition search interval are in VALS(1) and VALS(2). If incoming amounts for more than one substance need to be defined, all except the last one have to be called using ‘IA0’ as option to tqmap(). Once ‘IAF’ is passed for the last incoming amount, the first calculation is made. Use option ‘IAN’ for all subsequent ones.

class chemapp.basic.PressureUnit

Bases: enum.Enum

Available pressure units.

Option

bar

atm

Pa

kPa

psi

torr

class chemapp.basic.Quantity

Bases: enum.Enum

Quantities available for setting units.

Quantity

Unit

Pressure

bar

atm

Pa

kPa

psi

torr

Volume

dm3

cm3

m3

ft3

in3

Temperature

K

C

F

Energy

J

cal

Btu

kWh

Amount

mol

gram

kg

tonne

pound

class chemapp.basic.ResultVariable

Bases: enum.Enum

Result variables available after equilibrium calculations.

Option

Variable

Comment

P

Total pressure

VT

Total volume

T

Temperature

A

Equilibrium amount

IA

Incoming amount

Not valid for phases or for the entire system

MU, AC

Chemical potential, Activity/fugacity

Relative values for phases and constituents; absolute values for system components; fugacities in current pressure unit for gas phase constituents.

pH, Eh

pH, Eh/V

The calculation of pH and Eh/V requires that the constituents H+ in the aqueous phase and H2 in the gas phase be present in the thermochemical data-file. If pH and Eh/V cannot be calculated, theoutput VAL=0.0 will be returned. In order for ChemApp to recognize H+ and H2 in the data-file, the names of the system components hydrogen and aqueous electron must be ‘H’ and ‘EA’, respectively (see TQCNSC).

CP, H, S, G, V,

Heat capacity, Enthalpy, Entropy, Gibbs energy, Volume

Not valid for system components. Extensive properties for the equilibrium state dependent on the inherent reference state of the data. However, when the entire system is selected and streams are used, the values represent balances, i.e. the extensive property for the equilibrium state minus the sum of values for all streams. To obtain the total volume in this case, use option ‘VT’.

CPM, HM, SM, GM, VM

Heat capacity/ amount unit, Enthalpy/ amount unit, Entropy/ amount unit, Gibbs energy/ amount unit, Volume/ amount unit

Not valid for system components. Partial values are returned for constituents, integral values for phases. Values are valid for default or selected amount units.

X

Fraction

Mass or mole fraction of a system component in the system, depending on the default or selected amount unit.

XP

Fraction

Mass or mole fraction of a system component in a phase, depending on the default or selected amount unit.

AP

Equilibrium amount

Equilibrium amount of (a) system component(s) in a phase.

class chemapp.basic.SolutionModel

Bases: enum.Enum

Available solution models.

Model

Description

BDEF

Binary defect formalism

GAYE

Gaye-Kapoor-Frohberg cell formalism with or without non-oxidic solutes

HOCH

Hoch-Arpshofen formalism

HOCHM

Hoch-Arpshofen formalism with magnetism

IDBS

Gaseous model - C-H-O-S-N-Ar superfluid formalism

IDMX

Ideal mixing

IDVT

Gaseous model - Virial equation with Tsonopoulos second virial coefficient correlation

PURE

Stoichiometric condensed phase

QKTO

General polynomial Kohler/Toop formalism

QKTOM

General polynomial Kohler/Toop formalism with magnetism

QSOL

Modified quasichemical formalism with nonoxidic solutes

QUAS

Modified quasichemical formalism

QUSL

Two-sublattice equivalent fraction formalism as a polynomial

QUSLM

Two-sublattice equivalent fraction formalism as a polynomial with magnetism

RKMP

Redlich-Kister-Muggianu polynomial

RKMPM

Redlich-Kister-Muggianu polynomial with magnetism

SUBE

Extended compound energy formalism

SUBEM

Extended compound energy formalism with magnetism

SUBG

Quadruplet quasichemical model

SUBGM

Quadruplet quasichemical model with magnetism

SUBI

Two-sublattice ionic formalism

SUBL

Compound energy formalism

SUBLM

Compound energy formalism with magnetism

SUBM

Two-sublattice equivalent fraction formalism

SUBMM

Two-sublattice equivalent fraction formalism with magnetism

SUBO

Two-sublattice order/disorder formalism

SUBOM

Two-sublattice order/disorder formalism with magnetism

SUBQ

Quadruplet quasichemical model with composition-dependent coordination numbers

SUBQM

Quadruplet quasichemical model with composition-dependent coordination numbers with magnetism

SUBS

Species chemical potential/bond energy formalism

WAGN

Unified interaction parameter formalism

WAGNM

Unified interaction parameter formalism with magnetism

HELZ

Aqueous model - Revised Helgeson-Kirkham-Flowers formalism

HTDZ

Aqueous model - Helgeson-Tanger-Shock formalism (Davies)

HTSZ

Aqueous model - Helgeson-Tanger-Shock formalism (ideal)

HTWZ

Aqueous model - Helgeson-Tanger-Shock formalism (Debye-Hueckel)

IDDZ

Aqueous model - Davies formalism

IDWZ

Aqueous model - Ideal aqueous mixing

PIHZ

Aqueous model - Helgeson-Tanger-Shock formalism (Pitzer)

PIMZ

Aqueous model - Pitzer formalism

PITZ

Aqueous model - Pitzer formalism with fixed alpha-1 and alpha-2

PIWZ

Aqueous model - Pitzer formalism without E-theta and E-theta’

SITZ

Aqueous model - Specific ion-interaction formalism

class chemapp.basic.Status

Bases: enum.Enum

Status values for phases and phase constituents.

Status

Description

ENTERED

The phase or constituent is included in the equilibrium calculation. An included phase is not necessarily stable at equilibrium.

DORMANT

The phase or constituent is excluded from the mass balances (it will appear with zero amount at equilibrium), but its activity is calculated. If the calculated activity for a phase is greater than one, it would be stable if entered.

ELIMINATED

The phase or constituent is ignored in the equilibrium calculation

class chemapp.basic.StreamVariable(*args, **kwds)

Bases: enum.Enum

Available variables for stream properties that can be extracted.

Option

Variable

Unit

CP

Heat capacity

[current energy unit]/K

H

Enthalpy

[current energy unit]

S

Entropy

[current energy unit]/K

G

Gibbs energy

[current energy unit]

V

Volume

[current volume unit]

class chemapp.basic.TargetVariable

Bases: enum.Enum

Variables that can be used in target calculations to arrive at a specified target condition.

Option

Variable

Description

P

Total pressure

Pressure is a target variable. The value VALS(1) serves as an initial estimate, VALS(2) is not used.

V

Total volume

Volume is a target variable. The value VALS(1) serves as an

initial estimate, VALS(2) is not used.

T

Temperature

Temperature is a target variable. The value VALS(1) serves as an initial estimate, VALS(2) is not used.

IA, IA0, MU

Incoming amount, Chemical potential

Incoming amount is a target variable. The values VALS(1) and VALS(2) denote lower and upper limits, respectively. When defining streams, the constituent is included in the last stream considered. If incoming amounts for more then one substance need to be defined, all except the last one have to be called using ‘IA0’ as option to TQCE/TQCEL. Once ‘IA’ is passed for the last incoming amount, the first calculation is made.

Blank

Calculate without any target variable, VALS is not used.

class chemapp.basic.TemperatureUnit

Bases: enum.Enum

Available temperature units.

Temperature

K

C

F

class chemapp.basic.VolumeUnit

Bases: enum.Enum

Available volume units.

Volume

dm3

cm3

m3

ft3

in3

chemapp.basic.disable_logging()

Turn off logging of ChemApp calls to ‘calls.log’

Return type:

None

chemapp.basic.enable_logging()

Set the ChemApp calls to be output including returns to ‘calls.log’

Return type:

None

chemapp.basic.tqbond(indexp, indexa, indexb, indexc, indexd)

Calculate a quadruplet or pair fraction (only for the models SUBG, QUAS and QSOL).

Note that the second sublattice constituent index = (total number of constituents of the first sublattice + the second sublattice constituent index). The index numbers may be entered in any order, but two sublattice constituents must belong to the first sublattice and two to the second

Parameters:
  • indexp (int) – zero-based phase index

  • indexa (int) – zero-based sublattice constituent index

  • indexb (int) – zero-based sublattice constituent index

  • indexc (int) – zero-based sublattice constituent index

  • indexd (int) – zero-based sublattice constituent index

Returns:

quadruplet or pair fraction

Return type:

float

chemapp.basic.tqcdat(i1, i2, i3, i4, i5, val)

Change selected data of a specified phase constituent or of a specified phase from a thermodynamic data-file in ASCII format. If a phase is included with more than one copy in the data-file, then all copies of the phase will be identically changed.

Parameters:
  • i1 (int) – zero-based index number as described below

  • i2 (int) – zero-based index number as described below

  • i3 (int) – zero-based index number as described below

  • i4 (int) – zero-based index number as described below

  • i5 (int) – zero-based index number as described below

  • val (float) – new value of the selected quantity for the specified phase constituent of for the specified phase

Return type:

int

Values of i1-i5 required when calling TQCDAT:

  • Enthalpy: 1, 0, 0, I, M

    I = number of phase constituent

    M = number of phase

  • Entropy: 1, 0, 1, I, M

    I = number of phase constituent

    M = number of phase

  • Heat capacity: 1, INDEXR, N, I, M

    INDEXR = number of Cp expression

    N = number of term in the Cp expression

    I = number of phase constituent

    M = number of phase

    __Note__: The Cp expression will normally contain 4 terms, Cp = a + b*T + c*T2 + d/T2, but can also include six terms of variable powers of temperature. The maximum value of N is thus 10. For the models PIHZ, HELZ, HTSZ, HTWZ and HTDZ, one expression (INDEXR=1) contains seven Helgeson terms. Heat capacity data will be returned also for files with stored values of standard Gibbs energy.

  • Heat of transformation: 1, INDEXR, N, I, M

    INDEXR = number of Cp expression (this number must always be less than the total number of Cp expressions)

    N = the total number of terms in the Cp expressions + 1

    I = number of phase constituent

    M = number of phase

  • Molar volume: 4, 1, 1, I, M

    I = number of phase constituent

    M = number of phase

  • Coefficients of the equation of state: 4, INDEXR, N, I, M

    INDEXR = 2: thermal expansion (= a + b*T + c/T + d/T2)

    INDEXR = 3: compressibility (= a + b*T + c*T2 + d*T3) or bulk modulus (= a + b*(T-T0) + c*(T2-T02) + d*(1/T-1/T0)), depending on the equation of state being used

    INDEXR = 4: pressure derivative of the bulk modulus (= a + b*(T-T0)*ln(T/T0))

    N = number of coefficient

    I = number of phase constituent

    M = number of phase

  • Critical temperature of a constituent of a gas phase modelled with IDVT or

    IDVD: 4, 1, 1, I, 1

    I = number of phase constituent

  • Critical pressure of a constituent of a gas phase modelled with IDVT or

    IDVD: 4, 1, 2, I, 1

    I = number of phase constituent

  • Critical volume of a constituent of a gas phase modelled with IDVT or

    IDVD: 4, 1, 3, I, 1

    I = number of phase constituent

  • Acentric factor of a constituent of a gas phase modelled with IDVT or

    IDVD: 4, 1, 4, I, 1

    I = number of phase constituent

  • Dipole moment of a constituent of a gas phase modelled with IDVD:

    4, 1, 5, I, 1

    I = number of phase constituent

  • Curie/Neel temperature of a phase constituent of a magnetic phase:

    7, 1, 1, I, M

    I = number of phase constituent

    M = number of phase

  • Average magnetic moment/atom of a phase constituent of a magnetic phase:

    7, 1, 2, I, M

    I = number of phase constituent

    M = number of phase

  • Excess Curie temperature term of a magnetic phase:

    10, INDEXX, NOEXPR, 1, M

    INDEXX = number of interaction according to the order of the datafile

    NOEXPR = number of Redlich-Kister expression of interaction INDEXX

    M = number of phase

    Note: NOEXPR = 1 for the Redlich-Kister term with power zero, and so on.

  • Excess magnetic moment term of a magnetic phase:

    10, INDEXX, NOEXPR, 2, M

    INDEXX = number of interaction according to the order of the datafile

    NOEXPR = number of Redlich-Kister expression of interaction INDEXX

    M = number of phase

    Note: NOEXPR = 1 for the Redlich-Kister term with power zero, and so on.

  • Excess Gibbs energy coefficient: 13, INDEXX, NOEXPR, N, M

    INDEXX = number of interaction according to the order of the datafile

    NOEXPR = number of expression of interaction INDEXX

    N = number of term

    M = number of phase

    Note: The standard excess Gibbs energy expression contains maximum 6 terms of a + b*T + c*T*ln(T) + d*T2 + e*T3 + f/T (+g*P + h*P2). NOEXPR = 1 for the Redlich-Kister term with power zero, and so on. For phases not containing any Redlich-Kister terms and SUBG excepted, NOEXPR is one. SUBG involves excess Gibbs energy expressions containing six terms with variable powers of temperature. For any of these terms NOEXPR = 2. Excess Gibbs energy expressions with factor P (= pressure) have term numbers (MIT+1) to (MIT+MIT) where MIT is the number of temperature dependent terms used in the standard expression.

  • Stoichiometry: 16 ,1, INDEXC, I, M

    INDEXC = number of system component

    I = number of phase constituent

    M = number of phase

    Note: Since changing the stoichiometry might lead to erroneous calculations for several solution models, this option is intended for expert users only.

chemapp.basic.tqce(option, indexp=-1, indexc=-1, vals=None)

Calculate the equilibrium with the current settings of global conditions or streams.

Parameters:
  • option (chemapp.core.TargetVariable) – option indicating the target variable for the calculation

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • vals (Tuple[float, float] | None) – initial estimate of the target variable, or the lower and upper limits of an incoming amount, if necessary

Return type:

None

chemapp.basic.tqcel(option, indexp=-1, indexc=-1, vals=None)

Calculate the equilibrium with current settings of global conditions or streams, and list the results in the form of a ChemSage format output table.

Parameters:
  • option (chemapp.core.TargetVariable) – option indicating the target variable for the calculation

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • vals (Tuple[float, float] | None) – initial estimate of the target variable, or the lower and upper limits of an incoming amount, if necessary

Return type:

None

chemapp.basic.tqcen(option, indexp=-1, indexc=-1, vals=None)

Calculate the equilibrium, taking results from the previous equilibrium calculation as initial estimates

Parameters:
  • option (chemapp.core.TargetVariable) – option indicating the target variable for the calculation

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • vals (Tuple[float, float] | None) – initial estimate of the target variable, or the lower and upper limits of an incoming amount, if necessary

Return type:

None

chemapp.basic.tqcenl(option, indexp=-1, indexc=-1, vals=None)

Calculate the equilibrium, taking results from the previous equilibrium calculation as initial estimates, and list the results in the form of a ChemSage format output table.

Parameters:
  • option (chemapp.core.TargetVariable) – option indicating the target variable for the calculation

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • vals (Tuple[float, float] | None) – initial estimate of the target variable, or the lower and upper limits of an incoming amount, if necessary

Return type:

None

chemapp.basic.tqcfct(indexf, option, indexc, indexr, indexx, value)

Change a coefficient in a function.

Note

You can only use this function if the ChemSage.dat contains functions, which is available when exporting from FactSage 8.1+

Parameters:
  • indexf (int) – Index number for the function as obtained by calling TQIFCT/TQNFCT For Volume only: Index number for the solution phase

  • option (chemapp.core.FunctionData) – property type (FunctionData enumeration) For Volume only Index number for the constituent of phase indexf

  • indexc (int) – For Volume only zero-based function index, only used for V

  • indexr (int) – Index number for the Cp range, not being used for H and S For Volume only Index number for the molar volume function as obtained by calling TQIFCT/TQNFCT

  • indexx (int) –

    Index number for a coefficient

    This can be maximum 4 when no extra powers are entered, else up to [(number of extra powers)+4]. The number of extra powers is maximum 6. The extra powers cannot be modified. Only affecting Cp and Volume

  • value (float) – New value of the coefficient

Return type:

None

chemapp.basic.tqchar(indexp, indexc)

Get the charge of a phase constituent.

Parameters:
  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

Returns:

phase constituent charge

Return type:

float

chemapp.basic.tqcio(option, ival)

Redirect input and output from ChemApp to another unit than the default, or select a different language for the error messages than the default.

Parameters:
  • option (chemapp.core.IoOption) – input/output option

  • ival (int) – a legal unit number, or to a language index

Return type:

None

chemapp.basic.tqclim(option, val)

Modify the upper and lower limits of the target variables pressure, volume or temperature.

Find more information on the available values for LimitVariable in the chemapp.core.LimitVariable documentation.

Parameters:
Return type:

None

chemapp.basic.tqclos(unit)

Close a file that has been previously opened using TQOPNA, TQOPNB, TQOPNT, or TQOPEN.

Parameters:

unit (int) – unit number under which the file was opened

Return type:

None

chemapp.basic.tqcnsc(indexs, name)

Change the name of the specified system component.

Parameters:
  • indexs (int) – zero-based system component index

  • name (str) – new name

Return type:

None

chemapp.basic.tqconf(option, valuea=-1, valueb=-1, valuec=-1)

Set a configuration option.

Parameters:
  • option (chemapp.core.ConfigurationOption) – configuration option

  • valuea (int) – configuration value A

  • valuea – configuration value B

  • valuea – configuration value C

  • valueb (int) –

  • valuec (int) –

Return type:

None

chemapp.basic.tqcprt()

Get the ChemApp copyright message.

Returns:

ChemApp copyright message

Return type:

str

chemapp.basic.tqcsp(indexp, status)

Change the status of the specified phase.

Find more information on the available values for Status in the chemapp.core.Status documentation.

Parameters:
Return type:

None

chemapp.basic.tqcspc(indexp, indexc, status)

Change the status of a specified phase constituent.

Find more information on the available values for Status in the chemapp.core.Status documentation.

Parameters:
  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • status (chemapp.core.Status) – new phase constituent status

Return type:

None

chemapp.basic.tqcsu(option, unit)

Change the unit for the specified quantity.

Find more information on the available values for the units in the respective parts of the documentation:

  • Option: chemapp.core.Quantity

  • PressureUnit: chemapp.core.PressureUnit

  • VolumeUnit: chemapp.core.VolumeUnit

  • TemperatureUnit: chemapp.core.TemperatureUnit

  • EnergyUnit: chemapp.core.EnergyUnit

  • AmountUnit: chemapp.core.AmountUnit

Parameters:
Return type:

None

chemapp.basic.tqcsum(option, indexp, indexc, nval, value)

Change a pre-factor of a function for an phase constituent.

Note

You can only use this function if the ChemSage.dat contains functions, which is available when exporting from FactSage 8.1+

The pre-factor is the coefficient of the function in the Gibbs energy function. The existing factors can be listed with chemapp.basic.tqgsum.

Parameters:
  • option (chemapp.core.FunctionSumVariable) – Either Gibbs (‘G’) or volume (‘V’) functions

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based constituent index

  • nval (int) – zero-based index of the factor in the list of functions

  • value (float) – new value for the pre-factor

Return type:

None

chemapp.basic.tqefct(indexf)

Get the number of expressions of a function.

Note

You can only use this function if the ChemSage.dat contains functions, which is available when exporting from FactSage 8.2+

Parameters:

indexf (int) – zero-based function index

Returns:

number of expressions

Return type:

str

chemapp.basic.tqerr()

Get the current error message. All ChemApp error messages are written sequentially to the unit/file associated with ERROR. Use tqcio to change the associated unit/file and on how to prevent the automatic output of error messages.

Note

This routine typically does not need to be called actively. Any error that is interrupting program flow will be raised as an expression, containing the error message that tqerr() would yield.

Returns:

error message

Return type:

str

chemapp.basic.tqgdat(indexp, indexc, option, indexr=0)

Get selected thermodynamic data of a specified phase constituent loaded from a thermodynamic data-file in ASCII format.

Parameters:
  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • option (chemapp.core.PhaseConstituentData) – option

  • indexr (int) – zero-based index number of a Cp expression (only used for options Cp, Tt, and Ht)

Returns:

thermodynamic coefficients

Return type:

List[float]

chemapp.basic.tqgdpc(option, indexp, indexc)

Get thermodynamic data for a phase constituent.

Find more information on the available values for PhaseConstituentVariable in the chemapp.core.PhaseConstituentVariable documentation.

Parameters:
  • option (chemapp.core.PhaseConstituentVariable) – option identifying the thermodynamic quantity

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

Returns:

thermodynamic quantity. The return value (for a single constituent, selected using INDEXP and INDEXC) is dimensionless and is calculated for the default temperature, or for the last temperature set with TQSETC or TQSTEC, or calculated using TQCE/TQMAP

Return type:

float

Note

To obtain quantities having dimensions, the return value needs to be multiplied by R*T (gas constant times temperature).

chemapp.basic.tqgetr(option, indexp=-1, index=-1)

Get calculation results obtained by the last call to tqce, tqcel, tqmap, or tqmapl.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.ResultVariable

Parameters:
  • option (chemapp.core.ResultVariable) – option indicating the state variable to retrieve

  • indexp (int) – zero-based phase index

  • index (int) – zero-based phase constituent or system component index

Returns:

retrieved float value or array of float values. indexp and index values determine when a single value or array is returned. See the table below for an explanation.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/basic/index.html#chemapp.basic.tqgetr

Return type:

float|List[float]

chemapp.basic.tqgfct(indexf, option, indexc=0, indexr=0)

Get a property of the specified function.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.FunctionData

Note

You can only use this function if the ChemSage.dat contains functions, which is available when exporting from FactSage 8.1+

Parameters:
  • indexf (int) – Index number for the function as obtained by calling TQIFCT/TQNFCT For Volume only: Index number for the solution phase

  • option (chemapp.core.FunctionData) – property type For Volume only Index number for the constituent of phase indexf

  • indexc (int) – For Volume only zero-based function index, only used for V, default=0

  • indexr (int) – Index number for the Cp range, not being used for H and S, default=0 For Volume only Index number for the molar volume function as obtained by calling TQIFCT/TQNFCT

Return type:

None

chemapp.basic.tqgio(option)

Get the unit number and language used for error messages, and the unit number for the thermodynamic data-file and optional output lists, respectively.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.IoOption

Parameters:

option (chemapp.core.IoOption) – input/output option

Returns:

file unit number or language index

Return type:

int

chemapp.basic.tqgnlc(indexp, indexl, indexc)

Get the name of the specified sublattice constituent.

Parameters:
  • indexp (int) – zero-based phase index

  • indexl (int) – zero-based sublattice index

  • indexc (int) – zero-based sublattice constituent index

Returns:

sublattice constituent name

Return type:

str

chemapp.basic.tqgnp(indexp)

Get the name of a specified phase.

Parameters:

indexp (int) – zero-based phase index

Returns:

phase name

Return type:

str

chemapp.basic.tqgnpc(indexp, indexc)

Get the name of the specified phase constituent.

Parameters:
  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

Returns:

phase constituent name

Return type:

str

chemapp.basic.tqgnsc(indexs)

Get the name of the specified system component.

Parameters:

indexs (int) – zero-based system component index

Returns:

phase constituent name

Return type:

str

chemapp.basic.tqgpar(indexp, object, indexx)

Get selected excess Gibbs energy or excess magnetic parameters of a specified phase from a thermodynamic data-file in ASCII format.

Parameters:
  • indexp (int) – zero-based phase index

  • option – interaction variation, either (‘G’) excess Gibbs energy interactions or (‘M’) excess magnetic interactions

  • indexx (int) – zero-based interaction index

  • object (chemapp.core.InteractionVariable) –

Returns:

  • intnoexpr, the number of temperature-dependent expressions of interaction indexx.

  • intnvala, the number of values of each temperature dependent expression.

  • List[float]'noexpr' by 'nvala' values, i.e. 'noexpr'*'nvala' values of the quantity requested.

Return type:

Tuple[int, int, List[float]]

chemapp.basic.tqgsp(indexp)

Get the status of a specified phase.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.Status

Parameters:

indexp (int) – zero-based phase index

Returns:

status

Return type:

Status

chemapp.basic.tqgspc(indexp, indexc)

Get the status of the specified phase constituent.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.Status

Parameters:
  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

Returns:

phase constituent status

Return type:

Status

chemapp.basic.tqgsu(option)

Get the unit that is currently in use for a specified quantity.

Quantity

Unit

Pressure

bar

atm

Pa

kPa

psi

torr

Volume

dm3

cm3

m3

ft3

in3

Temperature

K

C

F

Energy

J

cal

Btu

kWh

Amount

mol

gram

kg

tonne

poudn

Parameters:

option (chemapp.core.Quantity) – the quantity for which the current unit is requested

Returns:

unit being used

Return type:

unit

chemapp.basic.tqgsum(option, indexp, indexc)

List all functions and pre-factors of a phase constituent that make the Gibbs energy function or volume function

The lists factors and names are of the exact length of nofct.

Parameters:
  • option (chemapp.core.FunctionSumVariable) – (‘G’) Gibbs energy functions or (‘V’) volume functions

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based constituent index

Returns:

  • int – total number of functions used

  • List[float] – pre-factors / coefficients of the used functions

  • List[str] – names of functions

  • .. note:: – You can only use this function if the ChemSage.dat contains functions, which is available when exporting from FactSage 8.1+

Return type:

Tuple[int, List[float], List[str]]

chemapp.basic.tqgted()

Get the ChemApp license expiration date.

Returns:

license expiry date

Return type:

int

chemapp.basic.tqgthi()

Get the HASP dongle type and id.

Returns:

(dongle type, dongle id)

Return type:

Tuple[str,int]

chemapp.basic.tqgtid()

Get the user ID of the ChemApp library license holder.

Returns:

User ID

Return type:

str

chemapp.basic.tqgtlc(indexp, indexl, indexc)

Get the calculated equilibrium sublattice site fraction.

Parameters:
  • indexp (int) – zero-based phase index

  • indexl (int) – zero-based sublattice index

  • indexc (int) – zero-based sublattice constituent index

Returns:

sublattice site fraction

Return type:

float

chemapp.basic.tqgtnm()

Get the name of the ChemApp library license holder.

Returns:

ChemApp user name

Return type:

str

chemapp.basic.tqgtpi()

Get the program ID.

Returns:

Program ID

Return type:

str

chemapp.basic.tqgtrh()

Retrieve information stored in the header of a transparent file.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/basic/index.html#chemapp.basic.tqgtrh

Returns:

(ver, nwp, vnw, nrp, vnr, dtc, dte, id, usr, rem) as described in the table.

Return type:

Tuple[int, str, List[int], str, List[int], List[int], List[int], str, str, str]

chemapp.basic.tqifct(indexf)

Get the name of a function.

Parameters:

indexf (int) – index of the function

Returns:

name of the function

Return type:

str

Note

You can only use this function if the ChemSage.dat contains functions, which is available when exporting from FactSage 8.1+

chemapp.basic.tqini()

Use this method to initialise ChemApp.

It must be called before any other ChemApp subroutine, or whenever you wish to reinstate the complete set of default values and units, and read a thermodynamic data-file.

Return type:

None

chemapp.basic.tqinlc(name, indexp, indexl)

Get the index number of the specified sublattice constituent.

Parameters:
  • name (str) – sublattice constituent name

  • indexp (int) – zero-based phase index

  • indexl (int) – zero-based sublattice index

Returns:

zero-based index

Return type:

int

chemapp.basic.tqinp(name)

Get the zero-based index number of a specified phase.

Parameters:

name (str) – phase name

Returns:

zero-based index

Return type:

int

chemapp.basic.tqinpc(name, indexp)

Get the zero-based index number of the specified phase constituent.

The required indexp can be found using tqinp().

Parameters:
  • name (str) – phase constituent name

  • indexp (int) – zero-based phase index

Returns:

zero-based index

Return type:

int

chemapp.basic.tqinsc(name)

Get the zero-based index number of the specified system component.

Parameters:

name (str) – system component name

Returns:

zero-based index

Return type:

int

chemapp.basic.tqlite()

Check whether the type of ChemApp currently used is ChemApp light.

Returns:

Light Version

Return type:

bool

chemapp.basic.tqlpar(indexp, object)

List all excess Gibbs energy or all excess magnetic interactions of a specified phase from a thermodynamic data-file in ASCII format.

The third item of the returned tuple will likely be removed in the future. It is obsolete.

Parameters:
  • indexp (int) – zero-based phase index (int)

  • option – interaction variation (‘G’) excess Gibbs energy interactions or (‘M’) excess magnetic interactions

  • object (chemapp.core.InteractionVariable) –

Returns:

  • int – the total number of interactions.

  • List[str] – all interaction strings

  • List[int] – lengths of each of the previous strings

Return type:

Tuple[int, List[str], List[int]]

chemapp.basic.tqmap(option, indexp, indexc, vals)

Perform a one-dimensional phase mapping calculation, giving all phase transitions within a defined interval.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.PhaseMapVariable

Parameters:
  • option (chemapp.core.PhaseMapVariable) – option indicating the search variable for the calculation

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • vals (List[float]) – array of two floats, the lower and upper limits of the search variable

Returns:

whether more calls to tqmap is necessary

Return type:

bool

chemapp.basic.tqmapl(option, indexp, indexc, vals)

Perform a one-dimensional phase mapping calculation and list the results in the form of a ChemSage format output table.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.PhaseMapVariable

Parameters:
  • option (chemapp.core.PhaseMapVariable) – option indicating the search variable for the calculation

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • vals (List[float]) – array of two floats, the lower and upper limits of the search variable

Returns:

whether more calls to tqmap is necessary

Return type:

bool

chemapp.basic.tqmodl(indexp)

Get the solution model name for the specified phase

Parameters:

indexp (int) – zero-based phase index

Returns:

solution model name

Return type:

SolutionModel

chemapp.basic.tqnexc(indexp)

Get the number of ternary exceptions of a phase.

Parameters:

indexp (int) – zero-based phase index

Returns:

number of ternary oexceptions

Return type:

int

chemapp.basic.tqnfct()

Get the total number of functions.

Returns:

total number of functions

Return type:

int

Note

You can only use this function if the ChemSage.dat contains functions, which is available when exporting from FactSage 8.1+

chemapp.basic.tqnolc(indexp, indexl)

Get the number of sublattice constituents of the specified sublattice.

Parameters:
  • indexp (int) – zero-based phase index

  • indexl (int) – zero-based sublattice index

Returns:

number of sublattice constituents

Return type:

int

chemapp.basic.tqnop()

Get the total number of phases.

Returns:

number of phases

Return type:

int

chemapp.basic.tqnopc(indexp)

Get the total number of constituents in the specified phase.

Parameters:

indexp (int) – zero-based phase index

Returns:

number of phase constituents

Return type:

int

chemapp.basic.tqnosc()

Get the total number of system components.

Returns:

number of system components

Return type:

int

chemapp.basic.tqnosl(indexp)

Get the number of sublattices of the specified phase.

Parameters:

indexp (int) – zero-based phase index

Returns:

number of sublattices

Return type:

int

chemapp.basic.tqnpar(indexp, option)

Get the number of excess/interaction parameters of a phase.

Parameters:
Returns:

number of excess parameters

Return type:

int

chemapp.basic.tqopen(file_path, unit)

Open a file for reading or writing by ChemApp.

The file_path is instantiated as a pathlib.Path object.

Parameters:
  • file_path (str | pathlib.Path) – path of the file to open

  • unit (int) – unit number under which to open the file

Return type:

None

chemapp.basic.tqopna(file_path, unit)

Open an ASCII thermochemical data file for reading by ChemApp.

The file_path is instantiated as a pathlib.Path object.

Parameters:
  • file_path (str | pathlib.Path) – path of the file to open

  • unit (int) – unit number under which to open the file

Return type:

None

chemapp.basic.tqopnt(file_path, unit)

Open a transparent thermochemical data file for reading by ChemApp.

The file_path is instantiated as a pathlib.Path object.

Parameters:
  • file_path (str | pathlib.Path) – path of the file to open

  • unit (int) – unit number under which to open the file

Return type:

None

chemapp.basic.tqpcis(indexp, indexc)

Check if the specified phase constituent is permitted as an incoming species.

Parameters:
  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

Returns:

permittance

Return type:

bool

chemapp.basic.tqrcst()

Read a thermodynamic data-file in transparent format.

Return type:

None

chemapp.basic.tqremc(numcon)

Remove a condition from the equilibrium calculation.

Parameters:

numcon (int) – condition number

Return type:

None

chemapp.basic.tqrfil()

Read a thermodynamic data-file in ASCII format.

Return type:

None

chemapp.basic.tqsetc(option, indexp, indexc, val)

Set a condition for the equilibrium calculation.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.ConditionVariable

Parameters:
  • option (chemapp.core.ConditionVariable) – option indicating the variable to set

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent or system component index

  • val (float) – condition value

Returns:

condition number

Return type:

int

chemapp.basic.tqshow()

Display the present settings.

tqshow displays information about the currently set conditions and streams, and is useful for debugging. Its output is stored on the unit/file associated with LIST.

It does not, effectively, print the output.

Return type:

None

chemapp.basic.tqsize()

Get ChemApp’s internal array dimensions.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/basic/index.html#chemapp.basic.tqsize

Returns:

(na, nb, nc, nd, ne, nf, ng, nh, ni, nj, nk)

Return type:

Tuple[int, int, int, int, int, int, int, int, int, int, int]

chemapp.basic.tqstca(idents, indexp, indexc, val)

Set a phase constituent amount for the specified stream.

Parameters:
  • idents (str) – stream name

  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

  • val (float) – phase constituent amount

Return type:

None

chemapp.basic.tqstec(option, indexp, val)

Set an invariant state variable for the equilibrium calculation when the input conditions are defined by streams.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.ConditionVariable

Parameters:
  • option (chemapp.core.ConditionVariable) – option indicating the variable to set

  • indexp (int) – zero-based phase index

  • val (float) – condition value

Return type:

None

chemapp.basic.tqstpc(indexp, indexc)

Get the stoichiometry and molecular mass of the specified phase constituent.

Parameters:
  • indexp (int) – zero-based phase index

  • indexc (int) – zero-based phase constituent index

Returns:

Stoichiometric coefficients for all system components, and the molar mass of the phase constituent

Return type:

Tuple[List[float], float]

chemapp.basic.tqstrm(idents)

Remove a stream.

Parameters:

idents (str) – stream name

Return type:

None

chemapp.basic.tqstsc(indexs)

Get the stoichiometry and molecular mass of a system component.

Parameters:

indexs (int) – zero-based system component index

Returns:

Stoichiometric coefficients of the system component, and the molar mass of the system component

Return type:

Tuple[List[float], float]

chemapp.basic.tqsttp(idents, T, P)

Define a stream and set its temperature and pressure.

Parameters:
  • idents (str) – stream name

  • T (float) – temperature of the stream

  • P (float) – pressure of the stream

Return type:

None

The input variable idents can have a maximum length of 150 characters. VALS must be a list of 2 real values, containing the temperature and pressure of the stream. These are entered with the default unit, or a unit set using tqcsu(). A stream is a means for transferring non-reacted matter to a reaction zone. It has constant temperature and pressure, and contains one or more phases of fixed composition. Stream input is required whenever differences in extensive properties between the initial and the equilibrium state are desired; for example, in calculations of the heat evolving from a combustion process, or of the entropy change caused by a phase transition. The maximum number of streams which are defined must not be greater than the maximum number of constituents permitted in the ChemApp version currently used (see tqsize(), parameter ‘NA’).

chemapp.basic.tqstxp(idents, option)

Get the calculated thermodynamic properties of a stream.

More information:

https://python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/core/index.html#chemapp.core.StreamVariable

Parameters:
Returns:

thermodynamic quantity

Return type:

float

chemapp.basic.tqused()

Get the dimensions of the currently loaded thermochemical system.

Returns:

  • Tuple[int, int, int, int, int, int, int, int, int, int, int] – (na, nb, nc, nd, ne, nf, ng, nh, ni, nj, nk)

  • More information

  • https (//python.gtt-technologies.de/doc/chemapp/autoapi/chemapp/basic/index.html#chemapp.basic.tqused)

Return type:

Tuple[int, int, int, int, int, int, int, int, int, int, int]

chemapp.basic.tqvers()

Get the ChemApp version number.

Returns:

ChemApp version number

Return type:

int

chemapp.basic.tqwasc(file)

Write a thermodynamic data-file in ASCII format.

Parameters:

file (str | pathlib.Path) – name of the data file

Return type:

None

chemapp.basic.tqwstr(option, text)

Write a character string to the Fortran units associated with ‘LIST’ and ‘ERROR’.

Parameters:
  • option (chemapp.core.IoOption) – either ‘LIST’ or ‘ERROR’

  • text (str) – a character string of arbitrary length (be reasonable! ;)

Return type:

None