MTDATA – Phase Diagram Software from the National Physical Laboratory

 

 

 

Home 

News 

Products 


Training and Support 

FAQs 

Links 

Agents 

Other Services 

 

Services 

 


 

MTDATA Application Programming Interface

Most use of MTDATA is carried out interactively ie through typing in the composition of a material and a temperature or range of temperatures and asking the program to calculate the amount of the phases in equilibrium and their compositions. There are two ways of using MTDATA in a non interactive way. The first way is through the use of MTDATA macros which allow a series of commands to be entered in a file using the MTDATA internal command line language. Although quite sophisticated and lengthy sets of calculations can be carried out in this way the method of interaction is rather limiting. A better method is to develop software in a high level computer language eg Fortan, Visual Basic, C, Java etc which can call core MTDATA subroutines for setting the temperature and compositions, initiating the computation and interpreting the results. These results can then be used as a basis for modelling sophisticated processes. Some examples of where this approach might be beneficial are;

  • Using MTDATA within a package to model the kinetics of phase transformations (eg welding, casting, soldering, ageing)

  • Complex gas /plasma chemistry with temperature and composition gradients (CVD processing or lighting simulations)

  • On-line control of a process (eg extraction of materials involving different streams of reactants and products)

  • Development of specific toolkits using a simple user interface for using the thermodynamic properties and phase equilibria provided by MTDATA to predict other properties eg thermophysical properties such as surface tension and viscosity.

The MTDATA api routines could be called either from a stand-alone program or from code written within another commercial software product such as COMSOL, FLUENT or Excel.

The names of the MTDATA routines are designed to be as close as possible to what a typical user would type into a command line version of MTDATA. This makes the code written using the api, to some extent, self documenting. So, for example in Fortran a typical code segment could be:

c Initialise the API
      Res = INITIALISE_MTDATA(mode)

c Read in thermodynamics datafile
      Call OPEN_MPI_FILE("def.mpi", "def.mpr", res)

c Set conditions
      For i = 1 To NUM_COMPONENTS()
          Call SET_COMPONENT_AMOUNT(i, cmpamt(i))
      Next
      Call SET_PRESSURE(101325)
      Call SET_TEMPERATURE(1000)

; Calculate
      Call COMPUTE_EQUILIBRIUM()

; Read results
      H = SYSTEM_ENTHALPY()
      For I = 1 to NUM_PHASES(Initial)
          Print PHASE_MASS(I, 0, Initial)
      Next

It should be possible with some persistence to link the MTDATA api to code written in any computer language and it has been tested out successfuly with several. The easiest language to use to link into the api is Fortran (the bulk of MTDATA is written in Fortran). Languages such as C and programming environments such as VBA in Excel and Matlab/ COMSOL are also relatively easy although there are some issues associated with transferring character strings and arrays. Other newer higher level languages such as Java and vb.net have additional problems with datatypes.

The method for linking the MTDATA api to COMSOL has been documented by Zhiheng Huang et al.

For further information please contact Hugh Davies or Jim Robinson. 

Updated 7 October 2011