当前位置: 首页>>代码示例>>Python>>正文


Python pycalphad.equilibrium函数代码示例

本文整理汇总了Python中pycalphad.equilibrium函数的典型用法代码示例。如果您正苦于以下问题:Python equilibrium函数的具体用法?Python equilibrium怎么用?Python equilibrium使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了equilibrium函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_eq_output_property

def test_eq_output_property():
    """
    Extra properties can be specified to `equilibrium`.
    """
    equilibrium(ALFE_DBF, ['AL', 'FE', 'VA'], ['LIQUID', 'B2_BCC'],
                {v.X('AL'): 0.25, v.T: (300, 2000, 500), v.P: 101325},
                output=['heat_capacity', 'degree_of_ordering'], pbar=False)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:7,代码来源:test_equilibrium.py

示例2: test_eq_on_endmember

def test_eq_on_endmember():
    """
    When the composition condition is right on top of an end-member
    the convex hull is still correctly constructed (gh-28).
    """
    equilibrium(ALFE_DBF, ['AL', 'FE', 'VA'], ['LIQUID', 'B2_BCC'],
                {v.X('AL'): [0.4, 0.5, 0.6], v.T: [300, 600], v.P: 101325}, pbar=False)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:7,代码来源:test_equilibrium.py

示例3: test_eq_b2_without_all_comps

def test_eq_b2_without_all_comps():
    """
    All-vacancy endmembers are correctly excluded from the computation when fewer than
    all components in a Database are selected for the calculation.
    """
    equilibrium(Database(ALNIPT_TDB), ['AL', 'NI', 'VA'], 'BCC_B2', {v.X('NI'): 0.4, v.P: 101325, v.T: 1200},
                verbose=True, pbar=False)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:7,代码来源:test_equilibrium.py

示例4: test_eq_overdetermined_comps

def test_eq_overdetermined_comps():
    """
    The number of composition conditions should yield exactly one dependent component.
    This is the overdetermined case.
    """
    equilibrium(ALFE_DBF, ['AL', 'FE'], 'LIQUID', {v.T: 2000, v.P: 101325,
                                                   v.X('FE'): 0.2, v.X('AL'): 0.8}, pbar=False)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:7,代码来源:test_equilibrium.py

示例5: test_eq_missing_component

def test_eq_missing_component():
    """
    Specifying a condition involving a non-existent component raises an error.
    """
    # No Co or Cr in this database ; Co condition specification should cause failure
    equilibrium(ALNIFCC4SL_DBF, ['AL', 'NI', 'VA'], ['LIQUID'],
                {v.T: 1523, v.X('AL'): 0.88811111111111107,
                 v.X('CO'): 0.11188888888888888, v.P: 101325}, pbar=False)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:8,代码来源:test_equilibrium.py

示例6: test_dilute_condition

def test_dilute_condition():
    """
    'Zero' and dilute composition conditions are correctly handled.
    """
    eq = equilibrium(ALFE_DBF, ["AL", "FE", "VA"], "FCC_A1", {v.T: 1300, v.P: 101325, v.X("AL"): 0}, pbar=False)
    assert_allclose(np.squeeze(eq.GM.values), -64415.84, atol=0.1)
    eq = equilibrium(ALFE_DBF, ["AL", "FE", "VA"], "FCC_A1", {v.T: 1300, v.P: 101325, v.X("AL"): 1e-8}, pbar=False)
    assert_allclose(np.squeeze(eq.GM.values), -64415.84069827)
    assert_allclose(eq.MU.values, [[[[-335723.04320981, -64415.8379852]]]], atol=0.1)
开发者ID:pycalphad,项目名称:pycalphad,代码行数:9,代码来源:test_equilibrium.py

示例7: test_eq_on_endmember

def test_eq_on_endmember():
    """
    When the composition condition is right on top of an end-member
    the convex hull is still correctly constructed (gh-28).
    """
    equilibrium(
        ALFE_DBF,
        ["AL", "FE", "VA"],
        ["LIQUID", "B2_BCC"],
        {v.X("AL"): [0.4, 0.5, 0.6], v.T: [300, 600], v.P: 101325},
        pbar=False,
    )
开发者ID:pycalphad,项目名称:pycalphad,代码行数:12,代码来源:test_equilibrium.py

示例8: test_eq_missing_component

def test_eq_missing_component():
    """
    Specifying a condition involving a non-existent component raises an error.
    """
    # No Co or Cr in this database ; Co condition specification should cause failure
    equilibrium(
        ALNIFCC4SL_DBF,
        ["AL", "NI", "VA"],
        ["LIQUID"],
        {v.T: 1523, v.X("AL"): 0.88811111111111107, v.X("CO"): 0.11188888888888888, v.P: 101325},
        pbar=False,
    )
开发者ID:pycalphad,项目名称:pycalphad,代码行数:12,代码来源:test_equilibrium.py

示例9: test_eq_output_property

def test_eq_output_property():
    """
    Extra properties can be specified to `equilibrium`.
    """
    equilibrium(
        ALFE_DBF,
        ["AL", "FE", "VA"],
        ["LIQUID", "B2_BCC"],
        {v.X("AL"): 0.25, v.T: (300, 2000, 500), v.P: 101325},
        output=["heat_capacity", "degree_of_ordering"],
        pbar=False,
    )
开发者ID:pycalphad,项目名称:pycalphad,代码行数:12,代码来源:test_equilibrium.py

示例10: test_eq_binary

def test_eq_binary():
    "Binary phase diagram point equilibrium calculation with magnetism."
    my_phases = ["LIQUID", "FCC_A1", "HCP_A3", "AL5FE2", "AL2FE", "AL13FE4", "AL5FE4"]
    comps = ["AL", "FE", "VA"]
    conds = {v.T: 1400, v.P: 101325, v.X("AL"): 0.55}
    eqx = equilibrium(ALFE_DBF, comps, my_phases, conds, pbar=False)
    assert_allclose(eqx.GM.values.flat[0], -9.608807e4)
开发者ID:pycalphad,项目名称:pycalphad,代码行数:7,代码来源:test_equilibrium.py

示例11: test_eq_binary

def test_eq_binary():
    "Binary phase diagram point equilibrium calculation with magnetism."
    my_phases = ['LIQUID', 'FCC_A1', 'HCP_A3', 'AL5FE2',
                 'AL2FE', 'AL13FE4', 'AL5FE4']
    comps = ['AL', 'FE', 'VA']
    conds = {v.T: 1400, v.P: 101325, v.X('AL'): 0.55}
    eqx = equilibrium(ALFE_DBF, comps, my_phases, conds, pbar=False)
    assert_allclose(eqx.GM.values.flat[0], -9.608807e4)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:8,代码来源:test_equilibrium.py

示例12: test_degree_of_ordering

def test_degree_of_ordering():
    "Degree of ordering should be calculated properly."
    my_phases = ['B2_BCC']
    comps = ['AL', 'FE', 'VA']
    conds = {v.T: 300, v.P: 101325, v.X('AL'): 0.25}
    eqx = equilibrium(ALFE_DBF, comps, my_phases, conds, output='degree_of_ordering', verbose=True)
    print('Degree of ordering: {}'.format(eqx.degree_of_ordering.sel(vertex=0).values.flatten()))
    assert np.isclose(eqx.degree_of_ordering.sel(vertex=0).values.flatten(), np.array([0.66663873]))
开发者ID:pycalphad,项目名称:pycalphad,代码行数:8,代码来源:test_model.py

示例13: test_eq_single_phase

def test_eq_single_phase():
    "Equilibrium energy should be the same as for a single phase with no miscibility gaps."
    res = calculate(ALFE_DBF, ['AL', 'FE'], 'LIQUID', T=[1400, 2500], P=101325,
                    points={'LIQUID': [[0.1, 0.9], [0.2, 0.8], [0.3, 0.7],
                                       [0.7, 0.3], [0.8, 0.2]]})
    eq = equilibrium(ALFE_DBF, ['AL', 'FE'], 'LIQUID',
                     {v.T: [1400, 2500], v.P: 101325,
                      v.X('AL'): [0.1, 0.2, 0.3, 0.7, 0.8]}, verbose=True, pbar=False)
    assert_allclose(eq.GM, res.GM, atol=0.1)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:9,代码来源:test_equilibrium.py

示例14: test_rose_nine

def test_rose_nine():
    "Nine-component rose diagram point equilibrium calculation."
    my_phases_rose = ['TEST']
    comps = ['H', 'HE', 'LI', 'BE', 'B', 'C', 'N', 'O', 'F']
    conds = dict({v.T: 1000, v.P: 101325})
    for comp in comps[:-1]:
        conds[v.X(comp)] = 1.0/float(len(comps))
    eqx = equilibrium(ROSE_DBF, comps, my_phases_rose, conds, pbar=False)
    assert_allclose(eqx.GM.values.flat[0], -5.8351e3)
开发者ID:hastelloy,项目名称:pycalphad,代码行数:9,代码来源:test_equilibrium.py

示例15: test_eq_four_sublattice

def test_eq_four_sublattice():
    """
    Balancing mass in a multi-sublattice phase in a single-phase configuration.
    """
    eq = equilibrium(ALNIFCC4SL_DBF, ['AL', 'NI', 'VA'], 'FCC_L12',
                     {v.T: 1073, v.X('NI'): 0.7601, v.P: 101325}, pbar=False)
    assert_allclose(np.squeeze(eq.X.sel(vertex=0).values), [1-.7601, .7601])
    # Not a strict equality here because we can't yet reach TC's value of -87260.6
    assert eq.GM.values < -87256.3
开发者ID:hastelloy,项目名称:pycalphad,代码行数:9,代码来源:test_equilibrium.py


注:本文中的pycalphad.equilibrium函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。