Skip to content

Calculate gives the wrong result if pressure and temperature are not both specified. #116

@bocklund

Description

@bocklund

In the binary example, we see the following code produce this plot

from pycalphad import calculate
from pycalphad.plot.utils import phase_legend
import numpy as np

legend_handles, colorlist = phase_legend(my_phases_nbre)

fig = plt.figure(figsize=(9,6))
ax = fig.gca()
for name in my_phases_nbre:
    result = calculate(db_nbre, ['NB', 'RE'], name, T=2800, output='GM')
    ax.scatter(result.X.sel(component='RE'), result.GM,
               marker='.', s=5, color=colorlist[name.upper()])
ax.set_xlim((0, 1))
ax.legend(handles=legend_handles, loc='center left', bbox_to_anchor=(1, 0.6))
plt.show()

image

But changing the temperature to 300 or 1000000 gives the same plot (and the same values from calculate). If you specify pressure in calculate e.g. result = calculate(db_nbre, ['NB', 'RE'], name, T=2800, P=101325, output='GM') the resulting plot is
image

Further changes to temperature produce expected results. The energy surface plotted when P is not specified gives a similar result to T>=6000 (piecewise max in TDB). I assume this is a bug and not the intended result?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions