1 / 71

P HI T S

P HI T S. Multi-Purpose P article and H eavy I on T ransport code S ystem. Basic Lecture I: Geometry and Source Definition. Jun. 2013 revised. title. 1. PHITS : P article and H eavy I on T ransport code S ystem.

Download Presentation

P HI T S

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHITS Multi-Purpose Particle and Heavy Ion Transport code System Basic Lecture I: Geometry and Source Definition Jun. 2013 revised title 1

  2. PHITS: Particle and Heavy Ion Transport code System • Monte Carlo code for simulating the motions of various particles in 3-dimensional space using several nuclear reaction models and nuclear data libraries. target What is PHITS ? 2

  3. Purpose of This Lecture Learn input format of PHITS, and how to define simple geometry and source term You can obtain this kind of results at the end of this lecture (Particle fluence around cylindrical water irradiated by 290 MeV proton beam) Purpose 3

  4. General Description Geometry Source Summary Homework Table of Contents • General definition • Boolean operator • How to define cell with many surfaces • Macrobody and SimpleGEO • How to add material Contents 4

  5. Format of PHITS input Calculation condition can be specified by text file Input file consists of several sections [Section Name] ←start of this section Basic format keyword(parameter) = value or character (“space” means nothing) or parameter1 parameter2 parameter3 … • Parameters are separated by “space” • You can write 200 characters in one line • Insert more than 6 spaces in successive line Parameters can be given in mathematic equations: e.g. 1.0+exp(-2.0) General description 5

  6. Input support command *You can write sections in arbitrary order [ ]off skip this section qp: skip from this line to the next section q: equivalent to [end] section Comment marks C in the first 5 column of the line $ and # in the middle of the line (but # cannot be used in the [cell] section) General description 6

  7. Main components of input • In the PHITS simulation, you have to specify the geometry of 3-dimensional virtual space and information of source particles, and then you can tally various quantities by simulating particle motions in the virtual space •  ⇒ ① Geometry •     ② Source •     ③ Tally Three fundamental components See sample input “lec01.inp” General description 7

  8. Result of the sample input xz_track_all.eps phits.out Version Number Display of the result Summary of the calculation General description 8

  9. Output File phits.out • PHITS Logo + Version information • Input Echo • Echo of the parameters specified in the input file • Description of the parameter and its default value is also written • Memory status • You can check how many memories are used in the calculation • Batch information (You will learn about “Batch” in Lecture 3) • Summary of PHITS simulation • Numbers of events such as source generation and nuclear reaction occurred • Information on transported particles • Numbers of secondary particles generated • CPU time • Numbers of library data and reaction models used Error information is usually given in the console Window, but occasionally in the output file! General description 9

  10. Sample input [Title] title comments [Parameters] define parameters [Source] define source [Material] define materials [Surface] define surfaces [Cell] define cells [T-Track] track length tally [End] This consists of 8 sections. ② Source Production of particles lec01.inp ① Geometry Definition of 3D virtual space ③ Tally Observation of quantities General description 10

  11. List of “section” General description 11

  12. List of tally ※ You can set several tallies at once to obtain various information on the particle transport. General description 12

  13. Main components of input • In the PHITS simulation, you have to specify the geometryof 3-dimensional virtual space and information of source particles, and then you can tally various quantities by simulating particle motions in the virtual space •  ⇒ ① Geometry •     ② Source •     ③ Tally [Material] define materials [Surface] define surfaces [Cell] define cells Using 3 sections General description 13

  14. General Description Geometry Source Summary Homework Table of Contents • General definition • Boolean operator • How to define cell with many surfaces • Macrobody and SimpleGEO • How to add material Contents 14

  15. 3D virtual space in PHITS lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. [ C e l l ] 100 1 -1. -10 101 -1 10 This part usually takes the longest time to make an input file • 3D virtual space consists of a number of cells defined in the XYZ coordinate space • You can use infinite space. But, you have to fill them with certain material (, or define them as void). Geometry (General definition) 15

  16. How to setup geometry You can setup 3D virtual space using GG (General Geometry) or CG(Combinational Geometry) concepts, but only GG concept will be described in this tutorial ! lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. [ C e l l ] 100 1 -1. -10 101 -1 10 Three steps to make geometry  1) define material[Material] section  2) define surface[Surface] section  3) define cell[Cell] section Geometry (General definition) 16

  17. Define material Material number, (Atom & density)… lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. [ C e l l ] 100 1 -1. -10 101 -1 10 1H : 16O = 2 : 1    ⇒ H2O(water) Several ways to express material • 1H 2.0 16O 1.0 (Positive density: Atomic ratio) • 1H -2.0/18.0 16O -16.0/18.0 (Negative density: mass ratio) • 1001 2.0 8016 1.0 (Atom can be expressed by Z*1000 + A) • 6000 1.0 (A=0: Natural abundance) Geometry (General definition) 17

  18. Define surface • Surface number, Shape, Parameters • Parameters are expressed in the unit of “cm” surface of sphere (so) having its center at the origin of the XYZ coordinate system with radius of 500 cm lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. [ C e l l ] 100 1 -1. -10 101 -1 10 Various types of surfaces can be used in PHITS • s, so (Sphere) • px, py, pz(plane) • cx, cy, cz(cylinder) • rpp(rectangular) • etc. (see Manual 4.8) Geometry (General definition) 18

  19. Define cell Cell number, material number, density, surface numbers 100: Cell number 1 : Material number -1. : Material density = 1.0 g/cm3 (If positive, =1024 atoms/cm3) -10 : Inside surface 10 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. [ C e l l ] 100 1 -1. -10 101 -1 10 101: Cell number -1 : Outer region (density is not necessary) 10 : Outside surface 10 Geometry (General definition) 19

  20. Exercise 1 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. [ C e l l ] 100 1 -1. -10 101 -1 10 • Exercise: • Define a surface of a sphere with 5 cm radius and its center in the origin of the XYZ coordinate system. • “10”in the 1st line of [Surface] section is “surface number”. Let’s use “11” for new surface number. Geometry (General definition) 20

  21. Exercise 2 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. [ C e l l ] 100 1 -1. -10 101 -1 10 • Exercise: • Add spherical water cell with 5 cm radius to the system. • “100” in the 1st line of [Cell] section is “cell number”. Let’s use “102” for new cell number. Geometry (General definition) 21

  22. Answers 1 and 2 lec01.inp [ P a r a m e t e r s ] icntl = 8 file(6) = phits.out Set 8 when you confirm the geometry Procedure for confirming your geometry Change “icntl” parameter in the [Parameters] section. Execute PHITS See an eps file“xz_track_all.eps” Your image xz_track_all.eps Geometry (General definition) 22

  23. Geometry error(overlapped region) lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. [ C e l l ] 100 1 -1. -10 101 -1 10 102 1 -1. -11 Some part of cell 100 overlaps cell 102.  ⇒Overlapped region!! PHITS always identifies the region where the tracing particle in, so PHITS confuses when one location is defined by more than 2 regions (but does not outputs error!) The desired result xz_track_all.eps Geometry (General definition) 23

  24. Geometry error(undefined region) You can use infinite space. But, you have to fill them with certain material (, or define them as void). Otherwise… • When PHITS notices that the particle location is not defined by any cells, it immediately stops the trace of the particle and outputs warning • When PHITS loses more than 100 particles, it immediately stops the execution and outputs error A little bit better than overlapped region error (at least you would notify…) Geometry (General definition) 24

  25. General Description Geometry Source Summary Homework Table of Contents • General definition • Boolean operator • How to define cell with many surfaces • Macrobody and SimpleGEO • How to add material Contents 25

  26. Cell can be defined by surfaces and cells using Boolean operators Cell definition using Boolean operators A(+11) A(-11) example Geometry (Boolean Operator) 26

  27. Boolean operator (NOT) lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. [ C e l l ] 100 1 -1. -10 #102 101 -1 10 102 1 -1. -11 NOT is expressed by using “#”. Cells are usually defined by Boolean operator & surface numbers, but cell number can be also used for Boolean operator NOT (represented by “#”) The correct result xz_track_all.eps Geometry (Boolean Operator) 27

  28. Boolean operator (AND) [ C e l l ] 100 1 -1. -10 #102 101 -1 10 102 1 -1. -11 lec01.inp equivalent [ C e l l ] 100 1 -1. -10 #( -11) 101 -1 10 102 1 -1. -11 equals to cell number 102. “11” is the surface number. equivalent [ C e l l ] 100 1 -1. -10 ( 11) 101 -1 10 102 1 -1. -11 change “NOT” operator to “AND” operator *Cells are basically defined using AND (“blank”). Geometry (Boolean Operator) 28

  29. Exercise 3 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. 12 sz 11. 5. [ C e l l ] 100 1 -1. -10 #102 #103 101 -1 10 102 1 -1. -11 103 1 -1. -12 sphere having its center in the XYZ coordinate (0, 0, 11) with radius of 5 cm Exercise: Where is cell “103” in the right panel? Geometry (Boolean Operator) 29

  30. Answer 3 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. 12 sz 11. 5. [ C e l l ] 100 1 -1. -10 #102 #103 101 -1 10 102 1 -1. -11 103 1 -1. -12 sx, sy, sz can be used. Universal expression s is used with the XYZ coordinate of its center and its radius. Expected result xz_track_all.eps Geometry (Boolean Operator) 30

  31. Exercise 4 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. 12 sz 8. 5. [ C e l l ] 100 1 -1. -10 #102 #103 101 -1 10 102 1 -1. -11 103 1 -1. -12 Change the center of this sphere Exercise: An overlap of the two spheres causes the geometry error (overlapped region). ←Let’s exclude this overlap region from cells 102&103 and create a new cell 104 Expected result xz_track_all.eps Geometry (Boolean Operator) 31

  32. Answer 4 An example of answers lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 mat[2] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. 12 sz 8. 5. [ C e l l ] 100 1 -1. -10 #102 #103 #104 101 -1 10 102 1 -1. 12 -11 103 1 -1. 11 -12 104 2 -1. -11 -12 To distinguish between the regions by colors, “mat[2]” is set in the [material] section. Geometry (Boolean Operator) 32

  33. Boolean operator (OR) lec01.inp [ C e l l ] 100 1 -1. -10 #102 #103 #104 101 -1 10 102 1 -1. 12 -11 103 1 -1. 11 -12 104 2 -1. -11 -12 equivalent [ C e l l ] 100 1 -1. -10 #(-11 : -12) 101 -1 10 102 1 -1. 12 -11 103 1 -1. 11 -12 104 2 -1. -11 -12 Boolean operator “OR” is expressed by “:”. NOT(#) is easier to use, but it costs more memories in PC It is better to express cells using “AND” and “OR” operators Geometry (Boolean Operator) 33

  34. Onion geometry onion.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 11 so 5. 12 so 10. 13 so 15. 14 so 20. 15 so 25. [ C e l l ] 101 1 -1. -11 102 1 -1. 11 -12 103 1 -1. 12 -13 104 1 -1. 13 -14 105 1 -1. 14 -15 106 1 -1. 15 [ M a t e r i a l ] mat[1] 1H 2 16O 1 [ S u r f a c e ] 11 so 5. 12 so 10. 13 so 15. 14 so 20. 15 so 25. [ C e l l ] 101 1 -1. -11 102 1 -1. -12 #101 103 1 -1. -13 #101 #102 104 1 -1. -14 #101 #102 #103 105 1 -1. -15 #101 #102 #103 #104 106 1 -1. 15 A bad example of PHITS input file using unnecessary “#”s → Become time consuming! Geometry (Boolean Operator) 34

  35. General Description Geometry Source Summary Homework Table of Contents • General definition • Boolean operator • How to define cell with many surfaces • Macrobody and SimpleGEO • How to add material Contents 35

  36. How to make a box A box can be defined using 6 planes Geometry (cell with many surfaces) 36

  37. Cell (cube) [ C e l l ] 100 1 -1. -10 #102 #103 #104 #105 101 -1 10 102 1 -1. 12 -11 103 1 -1. 11 -12 104 2 -1. -11 -12 105 1 -1. 13 -14 15 -16 17 -18 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 mat[2] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. 12 sz 8. 5. 13 px -5. 14 px 5. 15 py -5. 16 py 5. 17 pz 15. 18 pz 25. To distinguish between two regions divided by a plane, symbols “+” or “-” are used. +side -side Let’s execute PHITS and see the result to confirm whether a cube is correctly defined or not. X axis X=x0 Geometry (cell with many surfaces) 37

  38. Main components of input • In the PHITS simulation, you have to specify the geometry of 3-dimensional virtual space and information of source particles, and then you can tallyvarious quantities by simulating particle motions in the virtual space •  ⇒ ① Geometry •     ② Source • ③ Tally [T-Track] track length tally 検出器については基礎実習(II)で説明します。 Geometry (cell with many surfaces) 38

  39. Exercise 5 lec01.inp [ T - T R A C K ] mesh = xyz x-type = 2 nx = 200 xmin = -20. xmax = 20. y-type = 1 ny = 1 -5.0 5.0 z-type = 2 nz = 200 zmin = -20. zmax = 20. part = all e-type = 1 ne = 1 0.0 1000.0 unit = 1 axis = xz file = xz_track_all.out [ T - T R A C K ] mesh = xyz x-type = 2 nx = 200 xmin = -20. xmax = 20. y-type = 1 ny = 1 -5.0 5.0 z-type = 2 nz = 200 zmin = -10. zmax = 30. part = all e-type = 1 ne = 1 0.0 1000.0 unit = 1 axis = xz file = xz_track_all.out Shift this region so that you can see the whole of the box. 10cm along z-direction Expected result xz_track_all.eps Before the setting xz_track_all.eps Geometry (cell with many surfaces) 39

  40. How to make a cylinder A cylinder can be defined using an infinite cylindrical tube and two planes Geometry (cell with many surfaces) 40

  41. Cell (cylinder) [ C e l l ] 100 1 -1. -10 #102 #103 #104 #105 #106 101 -1 10 102 1 -1. 12 -11 #106 103 1 -1. 11 -12 #106 104 2 -1. -11 -12 #106 105 1 -1. 13 -14 15 -16 17 -18 #106 106 1 -1. -19 20 -21 lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 mat[1] 1H 2 16O 1 [ S u r f a c e ] 10 so 500. 11 so 5. 12 sz 8. 5. 13 px -5. 14 px 5. 15 py -5. 16 py 5. 17 pz 15. 18 pz 25. 19 cz 1. 20 pz -9. 21 pz 29. The inside and outside correspond to “-” and “+” symbols, respectively. Let’s execute PHITS and see the result to confirm whether a cylinder is correctly defined or not. Geometry (cell with many surfaces) 41

  42. General Description Geometry Source Homework Summary Table of Contents • General definition • Boolean operator • How to define cell with many surfaces • Macrobody and SimpleGEO • How to add material Contents 42

  43. Macro body How to make boxes [ S u r f a c e ]     ・     ・     ・ 22 rpp xmin xmax ymin ymax zmin zmax zmax Z xmin Y zmin xmax X ymin ymax How to make cylinders [ S u r f a c e ]     ・     ・     ・ 23 rcc vx vy vz hx hy hz r Radius: r Vector from (vx vy vz) to center coordinate of top face: (hx hy hz) Center coordinate of bottom face: (vx vy vz) Macrobody and SimpleGEO 43

  44. SimpleGEO • GUI interface to make geometry of many Monte Carlo codes • A free software developed in CERN (registration required*) Simple GEO + Recommendation setting of PHITS (\simplegeo) http://theis.web.cern.ch/theis/simplegeo/ Macrobody and SimpleGEO 44

  45. How to use SimpleGEO Setup your geometry by placing spheres, rectangles, cylinders etc. Convert the geometry into PHITS input format (only [cell] and [surface] sections), using macro bodies Copy the output geometry and paste into PHITS input file Execute PHITS Import the tally output file into SimpleGEO, and draw the results combined with 3D geometry Examples of SimpleGEO + PHITS results Macrobody and SimpleGEO 45

  46. General Description Geometry Source Summary Homework Table of Contents • General definition • Boolean operator • How to define cell with many surfaces • Macrobody and SimpleGEO • How to add material Contents 46

  47. How to add materials lec01.inp [ M a t e r i a l ] mat[1] 1H 2 16O 1 $ 1.0 g/cm3 mat[2] 1H 2 16O 1 $ 1.0 g/cm3 mat[3] 197Au 100 $ 19.32 g/cm3 mat[4] 63CU 0.6915 65Cu 0.3085 $ 8.93 g/cm3 mat[5] 14N 8 16O 2 $ 1.20e-3 g/cm3 mat[6] 12C 2 1H 4 $ 0.9 g/cm3 “$”means “comment out” gold(density: 19.32 g/cm3)    197Au 100 copper(density: 8.93 g/cm3)     63Cu 0.6915 65Cu 0.3085 air(density: 1.20x10-3g/cm3)    14N 8 16O 2 polyethylene(density: 0.9g/cm3) 12C 2 1H 4 Geometry (How to add material) 47

  48. Change material in cell lec01.inp [ C e l l ] 100 1 -1. -10 #102 #103 #104 #105 #106 101 -1 10 102 3 -19.32 12 -11 #106 103 4 -8.93 11 -12 #106 104 2 -1. -11 -12 #106 105 5 -1.20e-03 13 -14 15 -16 17 -18 #106 1066 -0.9 -19 20 -21 *Each material (number) has own color. Let’s execute PHITS and see the result. Expected result xz_track_all.eps Geometry (How to add material) 48

  49. Change the colors lec01.inp [ M a t N a m e C o l o r ] mat name color 1 Water pastelblue 2 Water pastelblue 3 Gold orangeyellow 4 Copper darkred 5 Air pastelcyan 6 C2H4 white You can specify the name and color of each material (number). Expected result xz_track_all.eps Geometry (How to add material) 49

  50. Color definition by Angel Geometry (How to add material) 50

More Related