nrc-cnrc / EGSnrc

Toolkit for Monte Carlo simulation of ionizing radiation — Trousse d'outils logiciels pour la simulation Monte Carlo du rayonnement ionisant
http://nrc-cnrc.github.io/EGSnrc
GNU Affero General Public License v3.0
220 stars 146 forks source link

Check and document photon splitting requirement for Awall calculations with cavity #494

Open NCDiaz opened 5 years ago

NCDiaz commented 5 years ago

I am calculating the Awall correction factor for a spherical graphite chamber (3 mm wall, ri = 1.1 cm, rout = 1.4 cm, 1.25 MeV photons ) with the code "Cavity" (for Windows 64 bit, downloaded (08/2018). The results of Awall seem not correct, (Awall > 1). The cavity dose results are > than Dideal. This should not happen for this spherical chamber. The calculations were repeated with the code CAVSPHnrc and the results are different, with Awall being < 1, as expected for this spherical graphite chambers.

Thank for your support.

Kind regards,

Néstor

mainegra commented 5 years ago

@NCDiaz it is hard to say what the issue is without seen your input file.

In any case, I tried the calculation for a 1.25 MeV parallel beam and a spherical chamber in vacuum at the origin. To reproduce you result I "forget" to apply a translation to the start shape of the parallel source (at origin by default):

   :start source:
        ...
        :start shape:
            library = egs_circle
            radius = 1.45
            #:start transformation:
               translation = 0 0 -100
            #:stop transformation:
        :stop shape:
       ...
    :stop source:

In this case particles will be starting at the center of the chamber and I get:

Geometry                        Cavity dose            Awall
-------------------------------------------------------------------
setup                     6.086897e-15 +/- 0.21063  % 1.02581 +/- 0.045  %
Dideal = 5.9337e-15 +/- 0.213  %

If instead, I use the transformation by removing the comment above, then particles start 100 cm away from the center of the chamber and the result is:

Geometry                        Cavity dose            Awall
-------------------------------------------------------------------
setup                     3.553500e-14 +/- 0.07924  % 0.98331 +/- 0.015  %
Dideal = 3.6138e-14 +/- 0.080  %

The key here is that shapes are by default at the origin, and beam directions are by default in the positive Z-direction.

Here is the result if I put the chamber inside an air phantom:

Geometry                        Cavity dose            Awall
-------------------------------------------------------------------
setup                     3.531552e-14 +/- 0.07959  % 0.97729 +/- 0.015  %
Dideal = 3.6136e-14 +/- 0.080  %

Let us know if this explains your issue!

rtownson commented 5 years ago

They posted this issue on the google+ page with the input file, and it looks like your guess is correct @mainegra!

https://plus.google.com/112643244371584187068/posts/5sAUpvLGVLW

ftessier commented 5 years ago

:1st_place_medal: @mainegra!

NCDiaz commented 5 years ago

I am calculating the Awall correction factor for a spherical graphite chamber (3 mm wall, ri = 1.1 cm, rout = 1.4 cm, 1.25 MeV photons ) with the code "Cavity" (for Windows 64 bit, downloaded (08/2018). The results of Awall seem not correct, (Awall > 1). The cavity dose results are > than Dideal. This should not happen for this spherical chamber. The calculations were repeated with the code CAVSPHnrc and the results are different, with Awall being < 1, as expected for this spherical graphite chambers.

Thank for your support.

Kind regards,

Néstor

Hi, Ernesto. Thank you for your prompt answer. I am including the input file after this text. As you can see, the parallel beam originates at the center of the coordinate system, and the chamber is displaced 4 cm in Z i.e. the midpoint of the chamber is 0 0 4. I have seen the input file with egs_view and the tracks cover the entire chamber.

Thank you for your support.

Regards,

Néstor

NCDiaz commented 5 years ago

#

CHAMBER SP-01

#

---------------

GEOMETRY

---------------

:start geometry definition:

----------------------

spherical chamber

------------------------

  :start geometry:
      name = chamber
      library = egs_spheres
      midpoint = 0 0 4
      radii = 1.1 1.4
      :start media input:
          media = air graphite
          set medium = 1 1
      :stop media input:
  :stop geometry:
 #--------------------------
 #   A Vacuum box surrounding the chamber
 #--------------------------
    :start geometry:
       name = outer_vacuum_box
       library = egs_box
       box size = 4 4 12
       :start media input:
         media = vacuum
       :stop media input:
     :stop geometry:
 # -------------------------
     :start geometry:
        name = chamber_in_vacuum
        library = egs_genvelope
        base geometry = outer_vacuum_box
        inscribed geometries = chamber
     :stop geometry:
     simulation geometry = chamber_in_vacuum
 # ---------------------------

:stop geometry definition:

---------------------------

MEDIA DEFINITION

---------------------------

:start media definition:

---------------------------

Cutoff energies

ae = 0.521 # lowest energy for electrons ( kinetic + 0.511) ap = 0.01 # lowest energy for photons (kinetic) ue = 2.511 # maximum energy for electrons (kinetic + 0.511) up = 2 # maximum energy for photons (kinetic) media :start air: density correction file = air_dry_nearsealevel :stop air: :start graphite: density correction file = carbon_graphite_icru90_1.8g_cm3 :stop graphite: :stop media definition:

---------------------------

SOURCE DEFINITION

---------------------------

:start source definition: :start source: library = egs_parallel_beam name = Parallel_beam charge = 0 :start shape: library = egs_circle radius = 2 :stop shape: :start spectrum: type = monoenergetic energy = 1.25 :stop spectrum: direction = 0 0 1 :stop source: :stop source definition:

----------------------------

RUN CONTROL

----------------------------

:start run control: ncase = 1000000 :stop run control:

----------------------------

SCORING OPTIONS

----------------------------

:start scoring options: calculation type = Awall :start calculation geometry: geometry name = chamber_in_vacuum cavity regions = 1 cavity mass = 0.006717041 :stop calculation geometry:

:stop scoring options:

----------------------------

:start ausgab object definition: :start ausgab object: name = tracks library = egs_track_scoring :stop ausgab object: :stop ausgab object definition:

----------------------------

:start MC transport parameter: ESTEPE = 0.10 :stop MC transport parameter:


De: Ernesto Mainegra notifications@github.com Enviado: lunes, 5 de noviembre de 2018 20:15 Para: nrc-cnrc/EGSnrc Cc: NCDiaz; Mention Asunto: Re: [nrc-cnrc/EGSnrc] Awall calculations with cavity seem not correct. (#494)

@NCDiazhttps://github.com/NCDiaz it is hard to say what the issue is without seen your input file.

In any case, I tried the calculation for a 1.25 MeV parallel beam and a spherical chamber in vacuum at the origin. To reproduce you result I "forget" to apply a translation to the start shape of the parallel source (at origin by default):

:start source: ... :start shape: library = egs_circle radius = 1.45

:start transformation:

           translation = 0 0 -100
        #:stop transformation:
    :stop shape:
   ...
:stop source:

In this case particles will be starting at the center of the chamber and I get:

Geometry Cavity dose Awall

setup 6.086897e-15 +/- 0.21063 % 1.02581 +/- 0.045 % Dideal = 5.9337e-15 +/- 0.213 %

If instead, I use the transformation by removing the comment above, then particles start 100 cm away from the center of the chamber and the result is:

Geometry Cavity dose Awall

setup 3.553500e-14 +/- 0.07924 % 0.98331 +/- 0.015 % Dideal = 3.6138e-14 +/- 0.080 %

The key here is that shapes are by default at the origin, and beam directions are by default in the positive Z-direction.

Here is the result if I put the chamber inside an air phantom:

Geometry Cavity dose Awall

setup 3.531552e-14 +/- 0.07959 % 0.97729 +/- 0.015 % Dideal = 3.6136e-14 +/- 0.080 %

Let us know if this explains your issue!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/nrc-cnrc/EGSnrc/issues/494#issuecomment-435999548, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AqrNJouW6eR_Y3bo6TfO0QpfrfEGMfJ_ks5usI5SgaJpZM4YNT-S.

mainegra commented 5 years ago

@NCDiaz as it turns out, there is indeed an issue which has to be addressed: In the cavity documentation users should be cautioned that an Awall calculation requires the splitting number to be set > 1 in the variance reduction block! Or/And the calculation should abort if the calculation type is set to Awall and no splitting is requested.

NCDiaz commented 5 years ago

Hi, after including the splitting, as suggested by Mainegra, the Awall calculations seem ok. Thanks. :-)