TC-Python is an Application Programming Interface (API) which makes it possible to perform Thermo-Calc calculations from Python™ code. It is developed for a general-purpose next-generation API, and provides state-of-the-art usability for a large number of technical and scientific tasks. Henrik Lasu, MSc, and Dr. Ralf Rettig, both software developers at Thermo-Calc Software, discuss the advantages of TC-Python in this blog post.
TC-Python covers nearly all functionality available in all Thermo-Calc products, not only thermodynamic calculations. It is a fluent API that relies heavily on builder pattern with method chaining. For many of our products, such as the Precipitation Module, Scheil calculations and Property Models, TC-Python provides an API for the first time. The API is easy to use, has good default values, and provides meaningful error messages.
Access to Thermo-Calc Functionalities
TC-Python is developed with focus on user-friendliness and modern object-oriented design. The access to all Thermo-Calc functionality is to a great extent unified. For example, all method and class names follow the same pattern and there is a single overall architecture which makes the usage of the different modules similar. All kinds of calculations can be combined without having to worry about interference. The following modules are available:
Single equilibrium calculation
Batch equilibrium calculations
Single-axis (property) diagrams
Support for Digital Twins and Material Lifecycles
TC-Python is also a powerful tool for Integrated Computational Materials Engineering (ICME), and is applied for developing digital twins of production process and material lifecycles in various industries. Based on the programming language Python™, which embraces an enormous ecosystem for technical, scientific and also many other fields of applications, TC-Python can easily be integrated with other commercial and open-source applications. Examples of these are:
High-throughput calculation of material properties and processing condition
Optimization of material compositions and processes based on material properties
Reproducible calculations following good scientific practice
Providing material data for other applications, such as Finite Element Method (FEM) and Computational Fluid Dynamics (CFD)
Programming user-specific tools required for daily operations
Scientific model development
Solving specific tasks that are currently not available in the Thermo-Calc Graphical User Interface (GUI)
Any material engineer who requires quick information about material properties, especially if these are not directly available through the graphical user interface, will enjoy TC-Python. It is perfect for high-throughput calculations and optimizations. Companies that aim to digitialize their material development, or require very specialized calculations on a daily basis, can quickly develop them with TC-Python and the Python™ ecosystem. Python™ allows providing small user-specific applications that can even be applied by their non-scientific workforce.
A Vast Code Library Applicable to Most Industries
TC-Python is a broad library that can be applied in practically any industry involved in material processing or application. Currently, the metal industry are keen users, as it supports in realizing the digital transformation of the industry through virtual material and process models. This includes steel, light-metals, semiconductors, heat treatment, casting and rolling.
In-house Experience Promotes User Experience
TC-Python is even a widely applied inhouse tool at Thermo-Calc Software. It is used in business areas such as rapid prototyping of models, algorithms and software, validation calculations, database development, continuous integration and massive-parallel computations. Thermo-Calc users benefit from the internal applications. Thermo-Calc developers learn directly about the user experience of the API, and thereby build up vast application knowledge.
Getting Started with TC-Python
Everyone who uses Thermo-Calc and has an interest in programming can use TC-Python. There is no need to be an experienced programmer. Still, the more used one is to a modern object-oriented language, with a rich set of third-party tools, the easier it is to get started. The best way to get familiarized is to watch the video tutorial Getting Started with TC-Python. It is also advisable to run and modify the examples that are installed with Thermo-Calc software.
TC-Python is available from Thermo-Calc version 2018a and can be used with all operating systems supported by Thermo-Calc. It has been extended ever since. Also in the 2020b release, new features are available for TC-Python. If you are interested in TC-Python, please contact firstname.lastname@example.org.
Graduated in Materials Science and Engineering at the University of Erlangen in Germany in 2006. Ralf Rettig finished his PhD on modelling the precipitation of TCP-phases in nickel-based superalloys in 2010. After working as a group leader for high temperature materials at the University of Erlangen, he joined Thermo-Calc Software in Stockholm in 2016. Dr. Rettig has been working on a variety of projects, especially on the development of TC-Python and the Process Metallurgy Module. Dr. Rettig enjoys bringing software development and engineering together.
Henrik Lasu, MSc
Has worked as a software developer since 1999, and joined Thermo-Calc Software in 2012. He has a master of science in mathematics from the Royal Institute of Technology (Kungliga Tekniska Högskolan) in Stockholm. Preferring the programming languages Python™ and Java, Henrik Lasu is also a full stack developer who enjoys writing code in all parts of Thermo-Calc software. Together with Dr. Ralf Rettig and the Thermo-Calc development team, he founded and evolved TC-Python.