Feasibility mapper for MATerials design
A simulation tool using pycalphad and Thermo_Calc.
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from fmat.core.compositions import generateCompositions, createComposition
from fmat.ref_data import periodic_table, materials
from fmat.core.pycalphad_run import pycalphad_eq, pycalphad_scheil
from fmat.core.GenerateEqScript import createEqScript
from fmat.core.ReadEqResult import getEqdata
from fmat.core.GenerateScheilScript import createScheilScript
from fmat.core.ReadScheilResult import getScheilSolidPhase
from fmat.plot.FeasibilityMap import plotMaps
# Create Compositions
comps = ['SS304L', 'NiCr', 'V']
eleAmountType = 'massFraction'
pressure = 101325
ngridpts = 41 # number of points along each dimension of the composition grid
TemperatureRange = (900, 2300, 10) #(lower limit, upper limit, temperature step)
indep_comps = [comps[1], comps[2]] # choose them automatically
for i in comps:
if i in periodic_table:
materials[i] = {i: 1}
elif i not in materials.keys():
materials['SS304L'] = {'Ni': 0.09611451943, 'Cr': 0.1993865031,
'Fe': 0.7044989775} # the composition of this element/alloys(in weight fractions)
maxNumSim = 250 # maximum number of simulations in each TCM file
# Equilibrium simulation settings
pressure = 101325
database = 'TCFE8' # <userDatabase>.TDB or TCFE8
eleAmountType = 'massFraction' # Candidates: massFraction massPercent moleFraction molePercent
output_Eq = f'{TemperatureRange[0]}-{TemperatureRange[1]}-{TemperatureRange[2]}-{comps[0]}-{comps[1]}-{comps[2]}-Eq'
# Create folder in curent path to store simulation results
from datetime import datetime
current_dateTime = datetime.now()
if '.tdb' in database or '.TDB' in database:
database_name = database.split('/')
path = f'./Simulation/{datetime.now().strftime("%m-%d-%Y")}-{comps[0]}-{comps[1]}-{comps[2]}-database-{database_name[-1][:-4]}'
else:
path = f'./Simulation/{datetime.now().strftime("%m-%d-%Y")}-{comps[0]}-{comps[1]}-{comps[2]}-database-{database}'
isExist = os.path.exists(path)
if not isExist:
os.makedirs(path)
print("The new directory is created!")
# Save compostion results
compositions_list = generateCompositions(indep_comps, ngridpts)
Compositions, numPoint, comp, numSimultion = createComposition(indep_comps, comps, compositions_list, materials, path)
settings = [TemperatureRange, numPoint, numSimultion, comp, comps, indep_comps, os.path.abspath(database), pressure, eleAmountType]
np.save(f'{path}/setting.npy', settings)
# Running with PyCalphad
pycalphad_eq(path)
pycalphad_scheil(path, 2000) # temperature to start scheil if not eq results
# Running with Thermo_Calc
# Create TCM files with path
createEqScript(path)
createScheilScript(path, 2000) # temperature to start scheil if not eq results
# Open TCM files with Thermo_Calc
# Collect results from Thermo_Calc
getEqdata(path)
getScheilSolidPhase(path)
# Plot deleterious phase diagram and crack susceptibility map
plotMaps(path, 'pycalphad')
Installation
pip (recommended)
feasibility map is suggested to be installed from PyPI.
pip install fmat
Development Versions
To install an editable development version with pip:
git clone https://github.com/HUISUN24/fmat.git
cd fmat
pip install -e .
Upgrading scheil later requires you to run git pull in this directory.
Run the automated tests using
pytest
Theory
Uses equilibrium and Scheil simulations to allow material design with properties
Metadata
Release files for fmat 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fmat-0.2.0.tar.gz | 46.5 kB | Without provenance | Details for fmat-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fmat-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for fmat-0.2.0-py3-none-any.whl |
Total release size: 108.4 kB
Release files / fmat-0.2.0.tar.gz
| Download URL | fmat-0.2.0.tar.gz |
|---|---|
| Size | 46.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9962f0f2168e79e628a3133b6ad3b03f2a9ec0936e3277dc7cdc3646fb59833
|
|
BLAKE2b-256 checksum How to use checksums |
7c198eafd7099f90eb0c64375b684c6dd8c856ba702af049100a75cd2b6f2630
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / fmat-0.2.0-py3-none-any.whl
| Download URL | fmat-0.2.0-py3-none-any.whl |
|---|---|
| Size | 61.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75589cadd9521af6d515e05a9ae00509181f6e43d87cc976d33f97e8e461cdd1
|
|
BLAKE2b-256 checksum How to use checksums |
f553a1341d78a54f44dfcde44b8e37aab70208d8ae7aacfef844933e35e3162d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for fmat 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.