MTDATA – Phase Diagram Software from the National Physical Laboratory

 

 

 

Home 

News 

Products 


Training and Support 

FAQs 

Links 

Agents 

Other Services 

 

Services 

 

 

SET

Function:

The SET command is most commonly used to fix the system temperature, system pressure or volume and initial amounts or masses of components, individually or in total, prior to a calculation. It can also be used to fix partial pressures, molalities, amounts or masses of individual species at equilibrium (see CLASSIFY FREE), to associate group names with system compositions or to assign values to named USER_VARIABLEs.

Parameters:

lgt_molality(*)

lgt_pressure(*)

molality(*)

n(*)

pressure(*)

temperature(*)

volume_ideal_gas

system_volume

w(*)

x(*)

user_variable(*)

<”group name”>

Defaults:

pressure = 101325 Pa

temperature = UNDEFINED

volume = UNDEFINED

n = undefined (all components and system amount)

w = undefined (all components and system mass)

Examples:

set temperature = 1010 pressure = 1e5 n(3) = 0.25 !

set pressure(23) = 1.2E-5 !

set lgt_pressure(CO<gas>) = -7.0 !

set v 0.01 !

set n(SiO2) = 0.1 !

set n(Fe<liquid>) = 0.12 !

set x(1) = 0.123 x(SiO2<LIQUID>) = 0.5 !

set w = 1 w(1) = 0.1 w(3) = 0.5 !

set user_variable(hold) = h !

set temperature = user_variable(told) !

set user_variable(g1) = g(Cr) !

set "start" 0.1 0.2 0.7 "end" 0.7 0.6 0.1 !

Parameter values:


MOLALITY(*), LGT_MOLALITY(*) 

takes the values <user supplied value> / UNDEFINED

The MOLALITY and LGT_MOLALITY parameters are used to assign a value to the equilibrium molality of a chosen substance in aqueous solution. In one case the required value itself is entered, in the other case its base ten logarithm. The substance in question is identified in brackets using its number or formula plus phase label as displayed by the command LIST SYSTEM SUBSTANCES. To cancel a previously established SETting, the keyword UNDEFINED should be entered in place of a numeric value.

PRESSURE[(*)] , LGT_PRESSURE(*) 

takes the values <user supplied value>/ USER_VARIABLE(*) / UNDEFINED   where [ ] indicates an optional entry

The PRESSURE parameter is used, with no substance name or formula appended in brackets, to set the total equilibrium pressure of the system under study. Values should be entered in pascals.

set pressure 101325 !

set pressure=user_variable(po2) !

The PRESSURE and LGT_PRESSURE parameters are used, with a substance number or substance formula plus phase name appended in brackets, to assign an equilibrium partial pressure value to a selected substance from the gas phase. In one case the required value itself is entered, in the other case its base ten logarithm.

set pressure(15) 101325*0.21 !
set lgt_press(O2<g>) -4 !

To cancel a previously established SETting, the keyword UNDEFINED should be entered in place of a numeric value.

N[(*)]

takes the values <user supplied value>/ USER_VARIABLE(*) / UNDEFINED   where [ ] indicates an optional entry

The parameter N, with no brackets appended, is used to set a value for the sum of the amounts (in moles) of all components in the currently DEFINEd system.

set n 100 !

Where brackets are appended and contain either a valid component number, as displayed by LIST SYSTEM COMPONENTS, or a substance formula without a phase label, the parameter N is used to set amounts (in moles) of individual components. A substance formula can only be entered if the system components are elements, in which case amounts for each component are calculated from the substance amount specified and used to supplement existing SETtings. If a component number is given, the amount of that component is set to the value entered.

set n(2) 0.567 !
set n(CO2) 0.2 !
set n(2)=user_variable(dave) !

Where brackets are appended and contain a substance formula with a phase label attached, as displayed by LIST SYSTEM SUBSTANCES, the parameter N is used to SET the equilibrium amount of the chosen substance. Equilibrium amounts cannot be SET for gaseous substances if the total system pressure has been SET already.

set n(O2<g>) 1.64E-5 !

To cancel a previously established SETting, the keyword UNDEFINED should be entered in place of a numeric value.


TEMPERATURE

TEMPERATURE takes the values <user supplied value> / USER_VARIABLE(*)/ UNDEFINED

The TEMPERATURE parameter is used to set the TEMPERATURE of the currently defined system to a specified value or to a value stored in a named USER_VARIABLE. In the latter case, TEMPERATURE should be followed by the keyword USER_VARIABLE with the appropriate USER_VARIABLE name appended in brackets. TEMPERATURE values should be given in kelvin. Entry of the keyword UNDEFINED cancels any previously established SETtings.

set temperature 1273 !
set temp user_variable(temp7) !

VOLUME_IDEAL_GAS

takes the values <user supplied value> / UNDEFINED

The VOLUME_IDEAL_GAS parameter is used to set the ideal gas VOLUME of the currently defined system to a specified value, in metres cubed. Entry of the keyword UNDEFINED cancels any previously established SETtings.

SYSTEM_VOLUME

takes the values <user supplied value> / UNDEFINED

The SYSTEM_VOLUME parameter is used to set the total VOLUME of the currently defined system to a specified value, in metres cubed. Entry of the keyword UNDEFINED cancels any previously established SETtings.

W[(*)]

takes the values <user supplied value>/ USER_VARIABLE(*) / UNDEFINED where [ ] indicates an optional entry

The parameter W, with no brackets appended, is used to set a value for the sum of the masses (in kilograms) of all components in the currently DEFINEd system.

set w 1 !

With brackets appended, containing a valid component number, as displayed by LIST SYSTEM COMPONENTS, the parameter W is used to SET the overall mass (in kilograms) of a particular component.

set w(1) 53.9 !
set w(1)=user_variable(wal) !

To cancel a previously established SETting, the keyword UNDEFINED should be entered in place of a numeric value.

X(*)

takes the values <user supplied value> / UNDEFINED

The X parameter is used to assign a value to the equilibrium mole fraction of a chosen substance. The substance in question is identified in brackets using its number or formula plus phase label as displayed by the command LIST SYSTEM SUBSTANCES. To cancel a previously established SETting, the keyword UNDEFINED should be entered in place of a numeric value.

USER_VARIABLE(*)

takes the values H / GIBBS_ENERGY[(*)] / PRESSURE[(*)] /TEMPERATURE[(*)] / VOLUME /X(*) / W(*) / ACTIVITY(*) / USER_VARIABLE(*) / SUM(*:*) / DIFFERENCE(*:*) / PRODUCT(*:*) / RATIO(*:*) / LOG10(*) / LN(*) / <user supplied value> where [ ] indicates an optional entry

SET USER_VARIABLE is used to update the value of an existing USER_VARIABLE, named in brackets, or to establish a new USER_VARIABLE and assign it a value, if the name given in brackets is not already in use. Values can be calculated properties, accessed using keywords identical to those described in connection with LIST PROPERTY, copied from other USER_VARIABLES or entered explicitly as numbers.

H

assigns the named USER_VARIABLE a value equal to the total enthalpy of the system under consideration.

GIBBS_ENERGY(*)

assigns the named USER_VARIABLE a value equal to the total Gibbs energy of the system under consideration or the partial Gibbs energy of a particular component named in brackets. The CLASSIFY command should be used to establish appropriate reference states.

set user_variable(gtot) = gibbs_energy !
set user(g1) = gibb(Cr) !

TEMPERATURE(*)

assigns the named USER_VARIABLE a value equal to the temperature of the system under consideration or, in the case of a phase boundary calculation, the temperature of the nth phase boundary within a specified temperature RANGE, the required boundary number n being supplied in brackets. For example:

set user_variable(tsys) = temperature !
set user_var(bound2) = temperature(2) !

PRESSURE(*)

assigns the named USER_VARIABLE a value equal to the total pressure of the system under consideration or the partial pressure of a particular gaseous species named in brackets. For example:

set user_variable(ptot) = pressure !
set user_var(po2) = press(O2<g>) !

VOLUME

assigns the named USER_VARIABLE a value equal to the total volume of the system under consideration.

X(*)

assigns the named USER_VARIABLE a value equal to the mole fraction of a component, named in brackets, either in a particular phase (if a phase name in angular brackets is appended to the component name) or in the system as a whole. For example:

set user_variable(x2) = x(Si) !
set user(xcao) = x(CaO<LIQUID_OXIDE>) !

W(*)

assigns the named USER_VARIABLE a value equal to the mass fraction of a component, named in brackets, either in a particular phase (if a phase name in angular brackets is appended to the component name) or in the system as a whole. For example:

set user_v(w1) w(CaCl2) !
set_user_variable(wfe) w(Fe<BCC_A2>) !

ACTIVITY(*)

assigns the named USER_VARIABLE a value equal to the activity of a particular component named in brackets. The CLASSIFY command should be used to establish appropriate reference states.

USER_VARIABLE(*)

assigns the named USER_VARIABLE a value equal to that of a another named USER_VARIABLE. For example:

set user_var(tnew) = user_var(told) !

SUM(*:*)

assigns the named USER_VARIABLE a value equal to the result of adding one calculated property, user variable or constant to another. The property names, user variable names or numbers should be entered in brackets, separated by a colon, following the SUM keyword. For example:

set user_variable(gtot) = sum(gibbs_energy:user_v(g12)) !
set u_v(xsum) = sum(x(Cr<LIQUID>):x(Ni<LIQUID>)) !

DIFFERENCE(*:*)

assigns the named USER_VARIABLE a value equal to the result of subtracting one calculated property, user variable or constant from another. The property names, user variable names or numbers should be entered in brackets, separated by a colon, following the DIFFERENCE keyword. That specified second is subtracted from that specified first. For example:

set user_var(hdiff) = difference(h:user_v(h1)) !
set user_v(tcel) = diff(temperature:273.15) !

PRODUCT(*:*)

assigns the named USER_VARIABLE a value equal to the result of multiplying one calculated property, user variable or constant by another. The property names, user variable names or numbers should be entered in brackets, separated by a colon, following the PRODUCT keyword. For example:

set user_variable(gnew) = product(5:gibbs_energy) !

RATIO(*:*)

assigns the named USER_VARIABLE a value equal to the result of dividing one calculated property, user variable or constant by another. The property names, user variable names or numbers should be entered in brackets, separated by a colon, following the RATIO keyword. That specified first is divided by that specified second. For example:

set user_var(halfg) = ratio(gibbs_energy:2) !
set us_var(feox) = rat(x(FeO<LIQUID>:x(Fe2O3<LIQUID>)) !

LOG10(*)

assigns the named USER_VARIABLE a value equal to the base ten logarithm of a calculated property, user variable or constant. The property name, user variable name or number should be given in brackets following the LOG10 keyword.

LN(*)

assigns the named USER_VARIABLE a value equal to the natural logarithm of a calculated property, user variable or constant. The property name, user variable name or number should be given in brackets following the LN keyword. 

<user supplied value>

assigns the named USER_VARIABLE a specified numeric value. One particular user variable is worth mentioning. MTDATA uses a penalty function which represents the contribution to the sum of the squares of the errors arising from the case where an experimental value cannot be calculated. The default value is set at 1012. This can now be changed by assigning a new value to the user variable "penalty_function". For example

set user(penalty_function) = 1E6 !

Care should be taken in changing the default value.

<”group name”>

 

The <”group name”> option is used to assign a name to a particular set of component amounts or masses, for later reference within a RANGE command. The chosen group name, in quotes, should be followed by one number for each component in the currently DEFINEd system. These numbers are interpreted as masses in kilograms if the total system mass is SET to one kilogram or amounts in moles otherwise. For example:

set “start” 0.1 0.2 0.7 “end” 0.7 0.2 0.1 !


General comments:

The best method to use in setting up a system composition will depend on the system being studied and the type of calculation being undertaken. In general different methods should not be used at the same time. Compositions may be set:

1) By entering the amounts (or masses) of numbered components individually. For example:

    set n(1) 0.2 n(2) 0.5 n(3) 0.3 !
    set w(1) 10 w(2) 30 w(3) 56 w(4) 4 !

2) By entering a blank component number, then the required component amounts (or masses) in turn within a single SET command. For example:

    set n( ) 0.2 0.5 0.3 !
    set w( ) 10 30 56 4 !

3) By entering the total system amount (or mass) and the individual amounts (or masses) of all but one of the components (the other component amount (or mass) being UNDEFINED). For example:

    set n 1 n(2) 0.5 n(3) 0.3 !
    set w 100 w(1) 10 w(2) 30 w(4) 4 !

4)  By entering amounts of substances specified by formula without a phase label. For example:

    set n(C2H6) 1 n(N2) 80 n(O2) 20 !

If an amount is entered for a specific substance, identified by number or formula and phase label, it is interpreted as the amount of that substance required at equilibrium. Setting equilibrium constraints upon substances (amounts or partial pressures, for example) as well as overall amounts for each system component, will generally produce an insoluble problem. Consequently, if an equilibrium constraint is applied to a particular substance, it is necessary to FREE the amounts of one or more of the components contained by that substance, or allow those component amounts to be determined by the program. For example, if the equilibrium partial pressure of O2<g> was fixed it would be necessary to CLASSIFY FREE either oxygen or another component containing oxygen.

 

Updated 9 June 2011