pycalphad.models package


pycalphad.models.model_mqmqa module

class pycalphad.models.model_mqmqa.ModelMQMQA(*args, **kwargs)[source]

Bases: pycalphad.model.Model

Symbolic implementation of the modified quasichemical model in the quadruplet approximation developed by Pelton _et al._ 1. The formulation here largely follows the derivation by Poschmann _et al._ 2.

Following pycalphad convention, ModelMQMQA.G defines the energy for one “formula unit” of this phase. The MQMQA formulations by Pelton _et al._ and Poschmann _et al._ do not formally define the energy per formula unit in the same way as is done for the CEF. However, it is convienient to define one formula unit of an MQMQA phase to be the energy corresponding to one mole of quadruplets. In terms of the equations from Poschmann _et al._, which are largely followed in this class, that means \(\sum_{ab/xy} n_{ab/xy} = 1\) and therefore \(n_{ab/xy} = X_{ij/kl}\) by definition.

This class is only semantically a subclass of Model. It implements the API expected for a Model in a self-contained way without any need to rely on the Model superclass, but it is created as a subclass to satisfy various isinstance checks in the codebase. The subclassing on Model should be removed once a suitable abstract base class or protocol is defined.



Pelton, Chartrand, and Eriksson, The Modified Quasi-chemical Model: Part IV. Two-Sublattice Quadruplet Approximation, Metallurgical and Materials Transactions A, 32(6) (2001) 1409-1416 doi: 10.1007/s11661-001-0230-7


Poschmann, Bajpai, Fitzpatrick, and Piro, Recent developments for molten salt systems in Thermochimica, CALPHAD 75 (2021) 102341 doi: 10.1016/j.calphad.2021.102341

BMAG = 0
property CPM
property CPM_MIX
DOO = 0
property G
property GM
property GM_MIX
property HM
property HM_MIX
NT = 0
property SM
property SM_MIX
TC = 0
Z(dbe, species: pycalphad.variables.Species, A: pycalphad.variables.Species, B: pycalphad.variables.Species, X: pycalphad.variables.Species, Y: pycalphad.variables.Species)[source]
property ast

Return the full abstract syntax tree of the model.

beta = 0

Generate the symbolic form of all the contributions to this phase.


dbe ('') –

contributions = [('ref', 'reference_energy'), ('idmix', 'ideal_mixing_energy'), ('xsmix', 'excess_mixing_energy')]
curie_temperature = 0
degree_of_ordering = 0
property energy
property enthalpy
property entropy

Build the binary, ternary and higher order interaction term Here we use Redlich-Kister polynomial basis by default Here we use the Muggianu ternary extension by default Replace y_i -> y_i + (1 - sum(y involved in parameter)) / m, where m is the arity of the interaction parameter

property heat_capacity

Returns the ideal mixing energy in symbolic form.

property mixing_energy
property mixing_enthalpy
property mixing_entropy
property mixing_heat_capacity
moles(species, per_formula_unit=False)[source]

Number of moles of species or elements.

neel_temperature = 0
property normalization

Total number of moles of this phase.

Divide by this normalization factor to convert from J/mole-formula to J/mole-atoms


Returns energies contributed by pairs.

property reference_model
shift_reference_state(reference_states, dbe, contrib_mods=None, output=('GM', 'HM', 'SM', 'CPM'), fmt_str='{}R')[source]

Add new attributes for calculating properties w.r.t. an arbitrary pure element reference state.

  • reference_states (Iterable of ReferenceState) – Pure element ReferenceState objects. Must include all the pure elements defined in the current model.

  • dbe (Database) – Database containing the relevant parameters.

  • output (Iterable, optional) – Parameters to subtract the ReferenceState from, defaults to (‘GM’, ‘HM’, ‘SM’, ‘CPM’).

  • contrib_mods (Mapping, optional) – Map of {model contribution: new value}. Used to adjust the pure reference model contributions at the time this is called, since the models attribute of the pure element references are effectively static after calling this method.

  • fmt_str (str, optional) – String that will be formatted with the output parameter name. Defaults to “{}R”, e.g. the transformation of ‘GM’ -> ‘GMR’

property site_fractions: List[pycalphad.variables.SiteFraction]

Return a sorted list of site fractions used in the ast.

property state_variables: List[pycalphad.variables.StateVariable]

Return a sorted list of state variables used in the ast which are not site fractions.

static symbol_replace(obj, symbols)[source]

Substitute values of symbols into ‘obj’.

  • obj (symengine object) –

  • symbols (dict mapping symengine.Symbol to symengine object) –

Return type

symengine object

Module contents