Exemple #1
0
def test_mcnp6_tally_vol_proton_volume_set():
    tally = Tally(
        "Flux", "Proton", 12, "Volume", "Volume 12", "Proton Flux in Cell 12", 100.0
    )
    assert_equal(
        "C Proton Flux in Cell 12\n" + "F14:h 12\n" + "SD14 100.000000\n",
        tally.mcnp(1, "mcnp6"),
    )
Exemple #2
0
def test_mcnp5_tally_surf_flux():
    tally = Tally(
        "Flux",
        "Neutron",
        12,
        "Surface",
        "Surface 12",
        "Neutron Flux across surface 12",
        -1.0,
    )
    assert_equal("C Neutron Flux across surface 12\nF12:n 12\n", tally.mcnp(1, "mcnp5"))
Exemple #3
0
def test_mcnp5_tally_surf_current():
    tally = Tally(
        "Current",
        "Neutron",
        12,
        "Surface",
        "Surface 12",
        "Neutron Current across surface 12",
        -1.0,
    )
    assert_equal(
        "C Neutron Current across surface 12\nF11:n 12\n", tally.mcnp(1, "mcnp5")
    )
Exemple #4
0
def test_mcnp5_tally_surf_flux_norm():
    tally = Tally(
        "Flux",
        "Neutron",
        12,
        "Surface",
        "Surface 12",
        "Neutron Flux across surface 12",
        -1.0,
        1.0e13,
    )
    assert_equal(
        "C Neutron Flux across surface 12\nF12:n 12\nFM12 1.000000e+13\n",
        tally.mcnp(1, "mcnp5"),
    )
Exemple #5
0
def test_mcnp6_tally_vol_norm():
    tally = Tally(
        "Flux",
        "Gamma",
        12,
        "Volume",
        "Volume 12",
        "Photon Flux in Cell 12",
        -1.0,
        1.0e13,
    )
    assert_equal(
        "C Photon Flux in Cell 12\nF14:p 12\nFM14 1.000000e+13\n",
        tally.mcnp(1, "mcnp6"),
    )
Exemple #6
0
def test_mcnp5_tally_surf_current_norm():
    tally = Tally(
        "Current",
        "Neutron",
        12,
        "Surface",
        "Surface 12",
        "Neutron Current across surface 12",
        -1.0,
        1.0e13,
    )
    assert_equal(
        "C Neutron Current across surface 12\nF11:n 12\nFM11 1.000000e+13\n",
        tally.mcnp(1, "mcnp5"),
    )
Exemple #7
0
def test_mcnp_mesh_tally_cyl():
    particle = "Neutron"
    geometry = "Cylinder"
    origin = [1, 2, 3]
    i_mesh = [5, 10, 20, 25]
    j_mesh = [2, 12]
    k_mesh = [45]
    i_ints = [1, 2, 3, 1]
    j_ints = [1]
    k_ints = [1]
    e = [0, 10, 100]
    e_ints = [1, 1, 2]
    tal_name = "Mesh Tally XYZ Neutron"
    vec = [-1, 4, -2]
    axs = [12, -2, 5]

    tally = Tally(
        particle,
        geometry,
        origin,
        i_mesh,
        j_mesh,
        k_mesh,
        i_ints,
        j_ints,
        k_ints,
        e,
        e_ints,
        tal_name=tal_name,
        axs=axs,
        vec=vec,
    )
    mcnp_tally = (
        "C Mesh Tally XYZ Neutron\n"
        + "FMESH14:n GEOM=CYL\n"
        + "          AXS=-1.000000 4.000000 -2.000000\n"
        + "          VEC=12.000000 -2.000000 5.000000\n"
        + "          ORIGIN=1.000000 2.000000 3.000000\n"
        + "          IMESH=5.000000 10.000000 20.000000 25.000000 IINTS=1 2 3 1\n"
        + "          JMESH=2.000000 12.000000 JINTS=1\n"
        + "          KMESH=45.000000 KINTS=1\n"
        + "          EMESH=0.000000 10.000000 100.000000\n"
        + "          EINTS=1 1 2"
    )
    assert_equal(mcnp_tally, tally.mcnp(1, "mcnp6"))
Exemple #8
0
def test_mcnp_mesh_tally_xyz():
    particle = "Neutron"
    geometry = "Cartesian"
    origin = [1, 2, 3]
    i_mesh = [5, 10, 20, 25]
    j_mesh = [2, 12]
    k_mesh = [45]
    i_ints = [1, 2, 3, 1]
    j_ints = [1]
    k_ints = [1]
    e = [0, 10, 100]
    e_ints = [1, 1, 2]
    tal_name = "Mesh Tally XYZ Neutron"
    out = "IJ"

    tally = Tally(
        particle,
        geometry,
        origin,
        i_mesh,
        j_mesh,
        k_mesh,
        i_ints,
        j_ints,
        k_ints,
        e,
        e_ints,
        tal_name=tal_name,
    )
    mcnp_tally = (
        "C Mesh Tally XYZ Neutron\n"
        + "FMESH14:n GEOM=XYZ\n"
        + "          ORIGIN=1.000000 2.000000 3.000000\n"
        + "          IMESH=5.000000 10.000000 20.000000 25.000000 IINTS=1 2 3 1\n"
        + "          JMESH=2.000000 12.000000 JINTS=1\n"
        + "          KMESH=45.000000 KINTS=1\n"
        + "          EMESH=0.000000 10.000000 100.000000\n"
        + "          EINTS=1 1 2\n"
        + "          OUT=IJ"
    )
    assert_equal(mcnp_tally, tally.mcnp(1, "mcnp6", out))
Exemple #9
0
def test_mcnp5_tally_surf_current():
    tally = Tally("Current","Neutron",12,"Surface","Surface 12","Neutron Current across surface 12",-1.0)
    assert_equal("C Neutron Current across surface 12\nF11:N 12\n",tally.mcnp(1,"mcnp5"))
Exemple #10
0
def test_mcnp6_tally_vol_proton():
    tally = Tally(
        "Flux", "Proton", 12, "Volume", "Volume 12", "Proton Flux in Cell 12", -1.0
    )
    assert_equal("C Proton Flux in Cell 12\nF14:h 12\n", tally.mcnp(1, "mcnp6"))
Exemple #11
0
def test_mcnp5_tally_surf_flux():
    tally = Tally("Flux","Neutron",12,"Surface","Surface 12","Neutron Flux across surface 12",-1.0)
    assert_equal("C Neutron Flux across surface 12\nF12:N 12\n",tally.mcnp(1,"mcnp5"))
Exemple #12
0
def test_mcnp6_tally_vol():
    tally = Tally(
        "Flux", "Gamma", 12, "Volume", "Volume 12", "Photon Flux in Cell 12", -1.0
    )
    assert_equal("C Photon Flux in Cell 12\nF14:p 12\n", tally.mcnp(1, "mcnp6"))
Exemple #13
0
def test_mcnp5_tally_surf_flux_norm():
    tally = Tally("Flux","Neutron",12,"Surface","Surface 12","Neutron Flux across surface 12",-1.0,1.0e13)
    assert_equal("C Neutron Flux across surface 12\nF12:N 12\nFM12 1.000000e+13\n",tally.mcnp(1,"mcnp5"))
Exemple #14
0
def test_mcnp6_tally_vol():
    tally = Tally("Flux","Gamma",12,"Volume","Volume 12","Photon Flux in Cell 12",-1.0)
    assert_equal("C Photon Flux in Cell 12\nF14:P 12\n",tally.mcnp(1,"mcnp6"))
Exemple #15
0
def test_mcnp6_tally_vol_norm():
    tally = Tally("Flux","Gamma",12,"Volume","Volume 12","Photon Flux in Cell 12",-1.0,1.0e13)
    assert_equal("C Photon Flux in Cell 12\nF14:P 12\nFM14 1.000000e+13\n",tally.mcnp(1,"mcnp6"))
Exemple #16
0
def test_mcnp5_tally_surf_current_norm():
    tally = Tally("Current","Neutron",12,"Surface","Surface 12","Neutron Current across surface 12",-1.0,1.0e13)
    assert_equal("C Neutron Current across surface 12\nF11:N 12\nFM11 1.000000e+13\n",tally.mcnp(1,"mcnp5"))
Exemple #17
0
def test_mcnp6_tally_vol_proton():
    tally = Tally("Flux","Proton",12,"Volume","Volume 12","Proton Flux in Cell 12",-1.0)
    assert_equal("C Proton Flux in Cell 12\nF14:H 12\n",tally.mcnp(1,"mcnp6"))
Exemple #18
0
def test_mcnp6_tally_vol_proton_volume_set():
    tally = Tally("Flux","Proton",12,"Volume","Volume 12","Proton Flux in Cell 12",100.0)
    assert_equal("C Proton Flux in Cell 12\n"+\
                 "F14:H 12\n"+\
                 "SD14 100.000000\n",tally.mcnp(1,"mcnp6"))