Introduction

The liquidus and solidus data for the Al-Si-Mg ternary system were calculated with open-source OpenCalphad - V 4.0 software coupled with COST507 thermodynamic database for light alloys. An interactive heatmap showing the equilibrium values for liquidus, solidus, and solidification range (delta_T) in the Al-Si-Mg system was created with R Markdown and plotly package in R programming language.

R Code

Load required packages.

library(ggplot2)
library(dplyr)
library(plotly)

Load the liquidus and solidus datasets.

liquidus_temp <- read.csv("C:/Open/Coursera/Al-Si-Mg/Al-Si-Mg_Liquidus.csv")
dim(liquidus_temp)
## [1] 1520    4
head(liquidus_temp)
##   wt_pct_Al wt_pct_Si wt_pct_Mg liquidus_C
## 1      84.9      15.0       0.1        612
## 2      85.0      14.9       0.1        610
## 3      85.1      14.8       0.1        609
## 4      85.2      14.7       0.1        607
## 5      85.3      14.6       0.1        606
## 6      85.4      14.5       0.1        604

The liquidus dataset has 1520 rows and 4 columns, where each row represents one individual chemical composition.

solidus_temp <- read.csv("C:/Open/Coursera/Al-Si-Mg/Al-Si-Mg_Solidus.csv")
dim(solidus_temp)
## [1] 1360    4
head(solidus_temp)
##   wt_pct_Al wt_pct_Si wt_pct_Mg solidus_C
## 1      84.9      15.0       0.1       575
## 2      85.0      14.9       0.1       575
## 3      85.1      14.8       0.1       575
## 4      85.2      14.7       0.1       575
## 5      85.3      14.6       0.1       575
## 6      85.4      14.5       0.1       575

The solidus dataset has 1360 rows and 4 columns, where each row represents one individual chemical composition.

Merge the liquidus and solidus datasets.

AlSiMg_data <- merge(liquidus_temp, solidus_temp)
dim(AlSiMg_data)
## [1] 1217    5
head(AlSiMg_data)
##   wt_pct_Al wt_pct_Si wt_pct_Mg liquidus_C solidus_C
## 1      84.2      15.0       0.8        607       557
## 2      84.3      14.9       0.8        605       557
## 3      84.3      15.0       0.7        607       557
## 4      84.4      14.8       0.8        604       557
## 5      84.4      14.9       0.7        606       557
## 6      84.4      15.0       0.6        608       559

Add a column that is the difference between liquidus and solidus.

AlSiMg_data <- AlSiMg_data %>% mutate(delta_T = liquidus_C - solidus_C)
head(AlSiMg_data)
##   wt_pct_Al wt_pct_Si wt_pct_Mg liquidus_C solidus_C delta_T
## 1      84.2      15.0       0.8        607       557      50
## 2      84.3      14.9       0.8        605       557      48
## 3      84.3      15.0       0.7        607       557      50
## 4      84.4      14.8       0.8        604       557      47
## 5      84.4      14.9       0.7        606       557      49
## 6      84.4      15.0       0.6        608       559      49

Create Heatmap with PLOTLY Package

f <- list(
  family = "Courier New, monospace",
  size = 18,
  color = "#7f7f7f"
)

x <- list(
  title = "wt. pct. Si",
  titlefont = f
)

y <- list(
  title = "wt. pct. Mg",
  titlefont = f
)
p <- plot_ly(x = AlSiMg_data$wt_pct_Si,
             y = AlSiMg_data$wt_pct_Mg,
             z = AlSiMg_data$delta_T,
             colorscale = "Greys",
             type = "heatmap",
             width = 900,
             height = 450,
             hoverinfo = 'text',
             text = ~ paste('</br> wt. % Si: ', AlSiMg_data$wt_pct_Si,
                            '</br> wt. % Mg: ', AlSiMg_data$wt_pct_Mg,
                            '</br> Liquidus: ', AlSiMg_data$liquidus_C,
                            '</br> Solidus : ', AlSiMg_data$solidus_C,
                            '</br> Delta_T : ', AlSiMg_data$delta_T))
p %>% layout(title = "Equilibrium Solidification Range [deg. C] in Al-Si-Mg Alloys",
             xaxis = x,
             yaxis = y,
             titlefont = f)