Exemplo n.º 1
0
def test_nichita_problem_5(model, expected_phase_split):
    P = convert_bar_to_Pa(76)
    T = 270

    result = stability_test(model, P, T, model.mixture.z)

    assert result.phase_split == expected_phase_split
Exemplo n.º 2
0
def test_nichita_problem_2(model, pressure, expected_phase_split):
    P = convert_bar_to_Pa(pressure)
    T = 277.6

    result = stability_test(model, P, T, model.mixture.z)

    assert result.phase_split == expected_phase_split
Exemplo n.º 3
0
def test_stochastic_consistency(sample_model):
    num_of_realizations = 10
    P = sample_model.P
    T = sample_model.T
    z = sample_model.z
    for run in range(num_of_realizations):
        result = stability_test(sample_model, P, T, z)
        assert result.x.sum() == pytest.approx(1.0, rel=1e-5)
Exemplo n.º 4
0
def test_nichita_problem_5(model, expected_phase_split):
    P = convert_bar_to_Pa(76)
    T = 270

    result = stability_test(model,
                            P,
                            T,
                            model.mixture.z,
                            solver_args=PygmoSelfAdaptiveDESettings(20,
                                                                    500,
                                                                    seed=seed))

    assert result.phase_split == expected_phase_split