amentumspace / g4pbc

A periodic boundary condition package for the Geant4 Monte Carlo toolkit
https://www.amentum.io/simulation
5 stars 7 forks source link

Setting reflecting surface #4

Closed jincairen closed 5 years ago

jincairen commented 5 years ago

Hi, I'm sorry to bother you! Your codes can achieve periodic boundry condition, but I'd like to realize "reflecting surface"condition. So I want to know if it is possible for me to modify your codes to satisfy my need. Let me express my need more clearly. I have been trying to simulate neutron transportation using Geant4, and my model consists of several tubes, whose centers are located in the same point. My neutron source is a tube too. All these tubes share the same center. In order to get the relationship between the neutron flux and the radius of different side surfaces of those tubes, I want to set those upper and lower surfaces of tubes as reflecting surfaces (i.e., a particle track that hits a reflecting surface is reflected specularly, just like MCNP.), but I haven’t found out how to achieve this.

In other words, I want to have all particles (not only neutrons) which have been transported to a “reflecting surface” to reflect specularly. In fact, I need the reflecting surface because I use this function in MCNP. In order to compare GEANT4 and MCNP, I want my model and input paramers to be the same in two codes.

Now that you have achieved periodic boundry condition, I'm wondering if I can use your codes to achieve that "reflecting surface" function. If yes, can you tell me how to achieve this. I'm a postgraduate and I'm new to geant4, so maybe my question is stupid. Thank you and best regards.

jcren.

driwancornelius commented 5 years ago

Hi Jincai,

Thank you for the question and interest in the g4pbc module.

A reflecting surface behaviour is possible. You can activate it by setting the final argument of the constructor of the G4PeriodicBoundaryPhysics class to true, as described here

Please note that the reflecting surface is considerably slower than the default cyclic boundary behaviour.

Best regards, Iwan

jincairen commented 5 years ago

Hi Jincai,

Thank you for the question and interest in the g4pbc module.

A reflecting surface behaviour is possible. You can activate it by setting the final argument of the constructor of the G4PeriodicBoundaryPhysics class to true, as described here

Please note that the reflecting surface is considerably slower than the default cyclic boundary behaviour.

Best regards, Iwan

Hi, Iwan! Thank you for your reply and your work! I'm wondering that the g4pbc package can apply to which version of geant4, as I didn't find relevant info.

Thank you sincerely and best regards. jcren.

driwancornelius commented 5 years ago

Hi jcren,

It has been tested with the latest release, version geant4.10.05 Running the example application and tests, to assure correct operation, is advised.

Best regards, Iwan

jincairen commented 5 years ago

Great, thank you sincerely. Best regards, jcren.

jincairen commented 5 years ago

Hi, Iwan. I found out that the periodic boundry surfaces in your package are all planes which are perpendicular to one axis. However, I'd like to set one plane that consists one axis as reflecting boundry ( or periodic boundry). Let me express more clearly. As you can see from attachment 1, the model is a sphere. My model is just a small sector of the sphere, just as showed in attachment 2 and 3. I'd like to set the two side surfaces (the green surface) as reflecting or periodic boundry. Is it possible to achieve such a function using your package?

Thank you and best regards, jcren. attachment1 attachment2 attachment3

driwancornelius commented 5 years ago

Hi jcren,

Such functionality is not provided by the g4pbc package. You would need to implement it in your own code.

Best regards, Iwan

jincairen commented 5 years ago

Thank you, Iwan. Best regards, jcren.