Beispiel #1
0
def test_1d_reaction():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        None,
        Constant(REACTIVITY),
        Expression(f"{DIFFUSION_TERM} + {REACTION_TERM}", degree=4),
        EXACT,
        8.9e-4,
        6.3e-2,
    )
Beispiel #2
0
def test_1d_diffusion():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        None,
        None,
        Expression(DIFFUSION_TERM, degree=4),
        EXACT,
        6.3e-4,
        6.3e-2,
    )
Beispiel #3
0
def test_1d_convection():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        Constant(CONVECTIVITY),
        None,
        Expression(f"{DIFFUSION_TERM} + {CONVECTION_TERM}", degree=4),
        EXACT,
        1.1e-3,
        6.3e-2,
    )
Beispiel #4
0
def test_3d_reaction():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        None,
        Constant(REACTIVITY),
        Expression(f"{DIFFUSION_TERM} + {REACTION_TERM}", degree=4),
        EXACT,
        0.027,
        0.481,
    )
Beispiel #5
0
def test_3d_convection():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        Constant(CONVECTIVITY),
        None,
        Expression(f"{DIFFUSION_TERM} + {CONVECTION_TERM}", degree=4),
        EXACT,
        0.101,
        0.766,
    )
Beispiel #6
0
def test_3d_diffusion():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        None,
        None,
        Expression(DIFFUSION_TERM, degree=4),
        EXACT,
        0.025,
        0.480,
    )
Beispiel #7
0
def test_2d_reaction():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        None,
        Constant(REACTIVITY),
        Expression(f"{DIFFUSION_TERM} + {REACTION_TERM}", degree=4),
        EXACT,
        6.2e-3,
        2.2e-1,
    )
Beispiel #8
0
def test_2d_diffusion():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        None,
        None,
        Expression(DIFFUSION_TERM, degree=4),
        EXACT,
        5.4e-3,
        2.2e-1,
    )
Beispiel #9
0
def test_3d_convection_reaction():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        Constant(CONVECTIVITY),
        Constant(REACTIVITY),
        Expression(
            f"{DIFFUSION_TERM} + {CONVECTION_TERM} + {REACTION_TERM}",
            degree=4,
        ),
        EXACT,
        0.088,
        0.679,
    )
Beispiel #10
0
def test_2d_convection_reaction():
    assert_solves(
        MESH,
        Constant(DIFFUSIVITY),
        Constant(CONVECTIVITY),
        Constant(REACTIVITY),
        Expression(
            f"{DIFFUSION_TERM} + {CONVECTION_TERM} + {REACTION_TERM}",
            degree=4,
        ),
        EXACT,
        8.5e-3,
        2.2e-1,
    )