Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some puzzles about the initialization methods of photosource. #109

Open
xiaowang119 opened this issue Nov 25, 2024 · 2 comments
Open

Some puzzles about the initialization methods of photosource. #109

xiaowang119 opened this issue Nov 25, 2024 · 2 comments

Comments

@xiaowang119
Copy link

In my case, a laser beam is expected to radiate at a Polyethylene target. But two photosources was always found in initialization progress.

The first group:
ContinuousPhotonSource
ContinuousPhotonSourceSpectrum

And the second:
PhotonSourceDistribution
PhotonSourceSpectrum

How can i define a laser beam?

@bwvdnbro
Copy link
Owner

There are a number of parts to your question, but the short answer is: you will need to write some new C++ code to achieve what you want.

The code supports two types of photon sources: discrete sources, corresponding to the PhotonSourceDistribution and PhotonSourceSpectrum parameter blocks, and continuous sources, corresponding to the ContinuousPhotonSource and ContinousPhotonSourceSpectrum blocks. The first group is very particularly used for sources inside the simulation box and assumes (this is hard-coded) isotropically emitting point sources. The second type is more general and corresponds to an arbitrary model that generates photon packets with a certain starting position and direction. Historically, this was implemented to model an isotropic radiation field that falls in from outside the simulation box, but I think it could also be used to model a laser beam.

Practically, you will need to set type: None for the PhotonSourceDistribution in your parameter file, so that the model only uses the ContinousPhotonSource to generate photons. You then need to implement a C++ class that contains the logic for your laser beam model. This class should inherit from the existing ContinuousPhotonSource class in the code (you can look at DistantStarContinuousPhotonSource for an example implementation) and implement the appropriate functions to generate random photon packets. You then also need to register this class in ContinuousPhotonSourceFactory to make it available in the parameter file.

However, from your short description, I am not sure CMacIonize is really suitable for what you are trying to do. The code was written to model the ionization state of an interstellar medium irradiated by the light of stellar sources, and only contains atomic data relevant for that scenario. You will need to add a lot of additional physics to model a laser beam irradiating a polyethylene material. I would also like to point out that active development of the code stopped in 2021, so I cannot offer much support to help you in the process.

@xiaowang119
Copy link
Author

Thank you very much! Your suggestions are extremely helpful, and I believe they will greatly benefit me. If necessary, I will further modify the program according to my specific application scenarios. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants