Ejemplo n.º 1
0
def test_benchmark_3():
    my_model = model.Model()
    # my_source = source.ZAlignedCylinderSource(materialName="water", cylinderRadius=154, \
    # 	       cylinderCenter=[0,0,54.15], cylinderLength=108.3)
    my_source = source.ZAlignedCylinderSource(material_name="water", cylinder_radius=154, \
            cylinder_center=[0,0,54.15], cylinder_length=108.3)
    my_source.add_photon(0.4, 3.2276e+013)
    my_source.add_photon(0.8, 5.6483e+013)
    my_source.add_photon(1.3, 2.2593e+013)
    my_source.add_photon(1.7, 6.6166e+013)
    my_source.add_photon(2.2, 3.2276e+011)
    my_source.add_photon(2.5, 2.4207e+011)
    my_source.add_photon(3.5, 9.6828e+007)
    my_source.points_per_dimension = [16, 16, 16]
    my_model.add_source(my_source)
    my_model.add_shield(shield.ZAlignedInfiniteAnnulus("iron", cylinder_inner_radius=154, \
            cylinder_center=[0,0,54.15], cylinder_outer_radius=154+2.54, density=7.8))
    my_model.add_shield(shield.SemiInfiniteXSlab("concrete", x_start=220, \
            x_end=311, density=2.4))
    my_model.set_filler_material('air', density=0.00129)
    my_model.set_buildup_factor_material(material.Material('concrete'))
    my_model.add_detector(detector.Detector(311, 0, 54.15))
    result = my_model.calculate_exposure()
    expected_dose_rate = 1.890E0
    diff = (result - expected_dose_rate) / expected_dose_rate * 100
    # convert from mR/hr to R/hr
    print("")
    print('test_benchmark_3')
    print("At 311 cm, dose = ", result, " mR/hr, ", diff, "%")
    assert True
Ejemplo n.º 2
0
def test_benchmark_5():
    my_model = model.Model()
    my_source = source.BoxSource(material_name="water", box_center=[136.5,0,239.95], \
            box_dimensions=[273,273,479.9])
    my_source.add_photon(0.4, 1.4307e+014)
    my_source.add_photon(0.8, 2.5037e+014)
    my_source.add_photon(1.3, 1.0015e+014)
    my_source.add_photon(1.7, 2.9329e+014)
    my_source.add_photon(2.2, 1.4307e+012)
    my_source.add_photon(2.5, 1.0730e+012)
    my_source.add_photon(3.5, 4.2920e+008)
    my_source.points_per_dimension = [16, 16, 16]
    my_model.add_source(my_source)
    my_model.add_shield(shield.SemiInfiniteXSlab("iron", x_start=273, \
            x_end=275.54, density=7.8))
    my_model.add_shield(shield.SemiInfiniteXSlab("concrete", x_start=365.1, \
            x_end=465.5, density=2.4))
    my_model.set_filler_material('air', density=0.00129)
    my_model.set_buildup_factor_material(material.Material('concrete'))
    my_model.add_detector(detector.Detector(456.5, 0, 239.95))
    result = my_model.calculate_exposure()
    expected_dose_rate = 3.009e+00
    diff = (result - expected_dose_rate) / expected_dose_rate * 100
    print("")
    print('test_benchmark_5')
    print("At 456.5 cm, dose = ", result, " mR/hr, ", diff, "%")
    assert True
Ejemplo n.º 3
0
def test_benchmark_2():
	myModel = model.Model()
	mySource = source.ZAlignedCylinderSource(material_name="water", cylinder_radius=154, \
		       cylinder_center=[0,0,54.15], cylinder_length=108.3)
	mySource.add_photon(0.4,3.2276e+013)
	mySource.add_photon(0.8,5.6483e+013)
	mySource.add_photon(1.3,2.2593e+013)
	mySource.add_photon(1.7,6.6166e+013)
	mySource.add_photon(2.2,3.2276e+011)
	mySource.add_photon(2.5,2.4207e+011)
	mySource.add_photon(3.5,9.6828e+007)
	mySource.points_per_dimension = [16,16,16]
	myModel.add_source(mySource)
	myModel.add_shield(shield.ZAlignedInfiniteAnnulus("iron", cylinder_inner_radius=154, \
		       cylinder_center=[0,0,54.15], cylinder_outer_radius=154+2.54, density=7.8))
	myModel.set_filler_material('air',density=0.00129)
	myModel.set_buildup_factor_material(material.Material('iron'))
	myModel.add_detector(detector.Detector(220,0,50.15))
	result = myModel.calculate_exposure()
	expected_dose_rate = 6.294e+04
	diff = (result - expected_dose_rate)/expected_dose_rate * 100
	print("")
	print('test_benchmark_2')
	print("At 220 cm, dose = ", result, " mR/hr, ", diff, "%")
	assert True
Ejemplo n.º 4
0
 def test_Case2(self):
     # a point source with infinite yz shields
     myModel = model.Model()
     mySource = source.PointSource(0, 0, 0)
     mySource.add_photon(1.0, 3e10)
     myModel.add_source(mySource)
     myModel.add_shield(
         shield.SemiInfiniteXSlab(material_name="iron",
                                  x_start=10,
                                  x_end=20))
     myModel.add_detector(detector.Detector(100, 0, 0))
     myModel.set_buildup_factor_material(material.Material('iron'))
     result = myModel.calculate_exposure()
     assert result == pytest.approx(7.057332942044014e-06 * 1000 *
                                    3600)  # convert from R/sec to mR/hr
Ejemplo n.º 5
0
 def test_Case0(self):
     # point source with no shielding
     # reference dose calculated from Principles of Radiation Shielding, A. B. Chilton, J. K. Shultis, R. E. Faw
     # from the reference, pages 132, 157, and 159, th dose rate is 271.8 mR/hr
     # Microshield gives 271.8 mR/hr at an air density of 1e-12g/cc
     myModel = model.Model()
     mySource = source.ZAlignedCylinderSource(material_name='air', \
      cylinder_center=[0,0,500],cylinder_length=1000, \
      cylinder_radius=50,density=1e-12)
     mySource.points_per_dimension = [40, 20, 400]
     photonEnergy = 1.0  # MeV
     photonIntensity = 3E10  # photons/sec
     mySource.add_photon(photonEnergy, photonIntensity)
     myModel.add_source(mySource)
     myModel.add_detector(detector.Detector(0, 0, 1000.01))
     result = myModel.calculate_exposure()
     assert result == pytest.approx(271.628)
Ejemplo n.º 6
0
 def test_Case0(self):
     # point source with no shielding
     # reference dose calculated from Principles of Radiation Shielding, A. B. Chilton, J. K. Shultis, R. E. Faw
     myModel = model.Model()
     mySource = source.PointSource(0, 0, 0)
     photonEnergy = 1.0  # MeV
     photonIntensity = 3E10  # photons/sec
     mySource.add_photon(photonEnergy, photonIntensity)
     myModel.add_source(mySource)
     myModel.add_detector(detector.Detector(100, 0, 0))
     result = myModel.calculate_exposure()
     photonFlux = photonIntensity / (4 * math.pi * 100**2
                                     )  # photons/sec/cm2
     responseFunction = 1.835E-8 * 1.0 * 2.787E-02  #
     analyticalDose = photonFlux * responseFunction  # R/sec
     # the "other code" gives 440.1 mR/hr at an air density of 1e-12g/cc
     assert result == pytest.approx(analyticalDose * 1000 *
                                    3600)  # convert from R/sec to mR/hr
Ejemplo n.º 7
0
 def test_Case4(self):
     # a point source with infinite yz shields
     myModel = model.Model()
     mySource = source.PointSource(1, 2, 3)
     mySource.add_isotope_curies('Co-60', 3)
     myModel.add_source(mySource)
     myModel.add_shield(
         shield.SemiInfiniteXSlab(material_name="iron",
                                  x_start=10,
                                  x_end=20))
     myModel.add_shield(
         shield.SemiInfiniteXSlab(material_name="concrete",
                                  x_start=30,
                                  x_end=40))
     myModel.add_detector(detector.Detector(80, 90, 100))
     myModel.set_buildup_factor_material(material.Material('iron'))
     result = myModel.calculate_exposure()
     assert result == pytest.approx(
         0.6090081012193129)  # convert from R/sec to mR/hr
Ejemplo n.º 8
0
 def test_Case3(self):
     # a point source with infinite yz shields
     myModel = model.Model()
     mySource = source.PointSource(0, 0, 0)
     mySource.add_isotope_bq('Ar-41', 3e10)
     myModel.add_source(mySource)
     myModel.add_shield(
         shield.SemiInfiniteXSlab(material_name="iron",
                                  x_start=10,
                                  x_end=20))
     myModel.add_shield(
         shield.SemiInfiniteXSlab(material_name="concrete",
                                  x_start=30,
                                  x_end=40))
     myModel.add_detector(detector.Detector(100, 0, 0))
     myModel.set_buildup_factor_material(material.Material('iron'))
     result = myModel.calculate_exposure()
     assert result == pytest.approx(4.3979088503738596e-06 * 1000 *
                                    3600)  # convert from R/sec to mR/hr
Ejemplo n.º 9
0
def test_benchmark_0():
    my_model = model.Model()
    my_source = source.PointSource(0, 0, 0)
    my_source.add_photon(6.2, 1)
    my_model.add_source(my_source)
    my_model.set_filler_material('air', density=0.00122)
    my_model.set_buildup_factor_material(material.Material('air'))
    print("")
    print('test_benchmark_0')
    results = []
    for case in [[200, 1.194e-11], [1000, 3.332e-13], [3000, 9.096e-15],
                 [5000, 6.977e-16]]:
        distance = case[0]
        expected_dose_rate = case[1]
        my_model.add_detector(
            detector.Detector(distance * 12 * 2.54, 0, 57 * 12 * 2.54))
        result = my_model.calculate_exposure()
        diff = (result - expected_dose_rate) / expected_dose_rate * 100
        results.append([result, expected_dose_rate])
        print("At ", distance, " ft, dose = ", result, " mR/hr, ", diff, "%")
    assert True
Ejemplo n.º 10
0
 def test_Case0(self):
     # point source with no shielding
     # reference dose calculated from Principles of Radiation Shielding, A. B. Chilton, J. K. Shultis, R. E. Faw
     # from the reference, pages 132, 157, and 159, th dose rate is 64.66 mR/hr
     # Microshield gives 64.74 mR/hr at an air density of 1e-12g/cc
     myModel = model.Model()
     mySource = source.LineSource([0, 0, 0], [0, 0, 1000])
     mySource.points_per_dimension = 100
     photonEnergy = 1.0  # MeV
     photonIntensity = 3E10  # photons/sec
     mySource.add_photon(photonEnergy, photonIntensity)
     myModel.add_source(mySource)
     myModel.add_detector(detector.Detector(100, 0, 0))
     result = myModel.calculate_exposure()
     linearPhotonSource = photonIntensity / 1000
     photonFlux = linearPhotonSource / 100 * math.atan(
         1000 / 100)  # photons/sec/cm2
     responseFunction = 1.835E-8 * 1.0 * 2.787E-02 / 4 / math.pi  #
     analyticalDose = photonFlux * responseFunction  # R/sec
     assert result == pytest.approx(analyticalDose * 1000 *
                                    3600)  # convert from R/sec to mR/hr
Ejemplo n.º 11
0
def test_detector():
    a = detector.Detector(1, 2, 3)
    assert a.x == 1
    assert a.y == 2
    assert a.z == 3
    assert a.location == (1, 2, 3)