MTDATA – Phase Diagram Software from the National Physical Laboratory

 Products

 Training and Support

 Other Services

SET

Function:

allows the user to specify the temperature, pressure/volume, amounts of components and/or substances and equilibrium constraints such as partial pressure or system_enthalpy prior to a calculation.

 Parameters: temperature volume_ideal_gas system_volume x(*) n(*) pressure(*) lgt_pressure(*) w(*) lgt_molality(*) molality(*) <"group name"> user_variable(*) co_mol_fr(*) co_wt_fr(*) system_enthalpy mass_phase(*) activity(*)

 Defaults: pressure = 101325 Pa temperature = undefined

 Examples: set temperature=1010 pressure=1e5 n(3)=0.25 ! set pressure(23) = 1.2E-5 ! set lgt_pressure(CO) = -7.0 ! set temperature = 1000 1100 1200 ! set n(SiO2) = 0.1 ! set n(Fe) = 0.12 ! set x(1) = 0.123 x(SiO2) = 0.5 ! set w=1 w(1)=0.1 w(3)=0.5 ! set user(g298) gibbs ! set user(hg) diff(h:gibbs) !

Parameter values:

TEMPERATURE         takes the value <temperature list>

 The units of temperature are KELVIN.

PRESSURE               takes the values <pressure>/UNDEFINED
 sets the equilibrium pressure of the system in PASCAL. UNDEFINED Fixed PRESSURE and VOLUME are mutually exclusive settings, so that if the volume is fixed, the pressure is reset by the program to be UNDEFINED.

 VOLUME_IDEAL_GAS takes the values /UNDEFINED
 sets the equilibrium ideal gas volume in metre cubed. UNDEFINED Fixed PRESSURE and VOLUME_IDEAL_GAS are mutually exclusive settings, so that if pressure is fixed, ideal gas volume is reset by the program to be UNDEFINED.

 SYSTEM_VOLUME takes the values /UNDEFINED
 sets the equilibrium system volume in metre cubed. SYSTEM_VOLUME is identical to the VOLUME_IDEAL_GAS if the gas phase is the only phase present at equilibrium or if the condensed phases present in equilibrium have not been modelled with pressure dependence.

 PRESSURE(*) takes the values /UNDEFINED
 PRESSURE(*) is used to set the equilibrium partial pressure of a substance, specified as a valid substance number or a valid substance formula and phase label, for example CO2, as displayed in LIST SYSTEM SUBSTANCES. Partial pressures and mole fractions are the only constraints allowed for gaseous substances at equilibrium if the total pressure has been defined. For example: set p(21) = 0.124 !  set p(I) = 0.001 ! sets an equilibrium constraint on the partial pressure (in  atmospheres) of substance 21 or of substance I. The * in the PRESSURE(*) parameter must be replaced by a valid substance name or number (obtained from LIST SYSTEM SUBSTANCES  ! ). This would be an over determined problem unless the appropriate component (or temperature or pressure) were to be CLASSIFied as FREE. This free item should be initialised to a reasonably close value. The parameter may also be used to set the equilibrium value for the ratio of two partial pressures. For example: set p(3:5)=0.123 !

 LGT_PRESSURE(*)  (i.e. Log10(pressure)) takes the values /UNDEFINED This parameter allows the specification of a substance for which the log base 10 of the partial pressure at equilibrium is to be fixed. For example: set l_p(51) = -6.1 l_p(SiO) = -2 ! sets  equilibrium constraints on the partial pressure (in atmospheres) of substance 51 and SiO. The * in the LGT_PRESSURE(*) parameter must be replaced by a valid substance name or number (obtained from List System Substances). This would be an over determined problem unless the appropriate components were CLASSIFied as  FREE. MOLALITY(*) takes the values /UNDEFINED MOLALITY(*) is used to set the equilibrium molality in aqueous solution of a substance, specified as a valid substance number or a valid substance formula and phase label, as displayed in LIST SYSTEM SUBSTANCES.
LGT_MOLALITY (i.e. Log10(molality) takes the values <user-defined>/UNDEFINED

 LGT_PRESSURE(*) takes the values /UNDEFINED
 LGT_MOLALITY(*) takes the values /UNDEFINED
 N, N(*) takes the values / UNDEFINED/ USER_VARIABLE(*) N is used to set the total number of moles of the components in the system. N(*) is used to define: (i) the molar quantities of components in the system. In this case * can be either (a) a valid component number taken from LIST SYSTEM COMPONENTS, or (b) a substance formula without the phase label. This method of specifying components amounts is available only if the components are elements, and the substance formula belongs to the system. The program converts the number of moles of substance formula into moles of the relevant components. (ii) the equilibrium molar amounts of substances. In this case, * represents a valid substance formula and a phase label, taken from LIST SYSTEM SUBSTANCES. The program will not accept constraints of this kind on gaseous substance amounts if the total pressure has been defined.
 W, W(*) takes the values /UNDEFINED/ USER_VARIABLE(*) W is used to set the total mass of the components in the system. W(*) See general comments. W(*) is used to specify, in kilograms, the mass of component in the system. * is a valid component number taken from LIST SYSTEM COMPONENTS.
 X(*) takes the values /UNDEFINED In contrast to N(*) and W(*), X(*) can be used only to specify the equilibrium mole fraction of a (stable) phase. * can be either a valid substance number or substance formula with phase label, taken from LIST SYSTEM SUBSTANCES. For example: set x(3)=0.123 !   set x(SiO2) 0.5 ! may be used to set the equilibrium value for the mole fraction of substance number 3 within its phase or substance  SiO2 in the Liquid phase (L is assumed to be an unique abbreviation for Liquid). This would be an over determined  problem unless the appropriate component (or temperature or pressure) were to be CLASSIFied as FREE. This free item should be initialised to a reasonably close value. This parameter may also be used to set the equilibrium value for the ratio of two mole fractions. For example: set x(3:5)=0.123 ! CO_MOL_FR(*) takes the values UNDEFINED/ The component mole fraction parameter allows an equilibrium constraint to be placed on the equilibrium calculation to be made. The component mole fraction is NOT the same as species mole fraction at equilibrium that may be set via SET X(*).  For example: set  co_mol_fr(2) = 0.0975 ! or set  co_mol(Fe) = 0.0975 ! sets the equilibrium mole fraction of component 2 or component Fe in the LIQUID phase as 0.0975. This would be an  over determined problem unless the appropriate component (or temperature or pressure) were to be CLASSIFied as FREE. This free item should be initialised to a reasonably close value. This parameter may also be used to set the equilibrium value for the ratio of two component mole fractions. For example: set co_mol_fr(Fe:Cr)=0.123 ! CO_WT_FR(*) takes the values UNDEFINED/ The component weight fraction parameter allows an equilibrium constraint to be placed on the equilibrium calculation to be made.  For example: set co_wt_fr(4) = 0.125 ! or set co_wt_fr(Fe) = 0.125 ! sets the equilibrium weight fraction on component 4 or Fe in the BCC phase as 0.125. This would be an over determined problem unless the appropriate component (or temperature or pressure) were to be CLASSIFied as FREE. This free item should be initialised to a reasonably close value. This parameter may also be used to set the equilibrium value for the ratio of two component weight fractions. For example: set co_wt_fr(Fe:Cr)=0.123 ! SYSTEM_ENTHALPY takes the value UNDEFINED/ This parameter allows the system enthalpy at equilibrium to be fixed. For example: set system_enthalpy = 0.0 ! or set system_enthalpy = -74600.0 ! This would be an overdetermined system unless a component, pressure or more usually temperature were CLASSified as FREE. With a temperature CLASSified FREE this could be used, for example, to calculate the final temperature for  an adiabatic combustion of hydrogen or methane starting at room temperature. In general the user will need to set the system enthalpy appropriate to the problem. MASS_PHASE(*) takes the value UNDEFINED/ This parameter allows a phase mass at equilibrium to be fixed. For example: set mass_phase(3) = 0.01 ! or set mass_phase(bcc) = 0.99 ! This would be an overdetermined system unless a component, temperature or pressure were CLASSified as FREE. Care must be taken to set a problem with a unique solution, so for example setting the mass as zero would not be appropriate. ACTIVITY(*) takes the value UNDEFINED/ This parameter allows a component activity at equilibrium to be fixed. For example: set activity(3) = 0.2 ! or set activity(PbO) = 0.2 ! This would be an overdetermined system unless a component, temperature or pressure were CLASSified as FREE.

 <"Group name"> is used to assign a set of compositions to a particular name or character string. This name would then be used in the STEP command to specify the range of compositions over which calculations are to be performed. USER_VARIABLE(*) takes the values of UNDEFINED/ H/ GIBBS_ENERGY(*)/ TEMPERATURE(*)/  PRESSURE(*)/ VOLUME(*)/ X(*), W(*)/ ACTIVITY(*)/ N_AMOUNT(*)/ MASS(*)/ USER_VARIABLE(*)/ SUM(*)/ DIFFERENCE(*)/ PRODUCT(*)/ RATIO(*)/ LOG10(*)/ LN(*)/ EXP(*)/ SQUARE_ROOT(*)/ / <'character value'> It is used to assign a thermodynamic quantity, composition, number or character string to a user named variable. For example set user(g298) gibbs ! set user(hg) diff(h:gibbs) !

General comments:

There are three methods of setting the overall composition of the system. More than one method should not be used at the same time. The composition may be set:

(i) by moles of components (or the total number of moles and all but one of the components),

(ii) by mass of components (or the total mass and the mass of all but one of the components),

(iii) by specifying amounts in moles by substance formula (without phase label).

If the amount of a substance, identified either by number or by formula and phase label, is entered this is interpreted as the amount of that substance that should be present at equilibrium.

If the components are not elements, the substances cannot be referred to by name, only by number. This means that equilibrium amounts cannot be SET using moles or masses, only by fixing the mole fraction, molality or partial pressure.

Setting quantities of a substance in the equilibrium system, as well as overall amounts of components could result in an overdetermined problem, which will in general be insoluble. For this reason, if a particular substance is constrained to an equilibrium amount, then the amount of one or more of the system components it contains cannot also be defined. For example, if the equilibrium partial pressure of oxygen (O2<gas>)is set, then it is not possible simultaneously to fix the moles of all the components. In such a case it would be necessary to CLASSIFY either oxygen or another component with which it forms compounds as FREE.

The same considerations apply if the partial pressure of a mixed molecule is fixed as for NH3<gas> in example shown on this page. It is difficult to generalise the rules and the user is advised to consider each case carefully and, if necessary, to experiment.

Updated 9 June 2011