Flood source & energy spectrum

Dear Experts,
I want to define a photon source (with energy spectrum) and source type: FLOOD (distributed over a spherical surface and direction towards the centre of the sphere).

I am using “source_newgen.f” (which is given with example) + spectrum.dat file (for energy spectrum)
Source type “FLOOD” given through BEAMPOS CARD and in 2nd BEAMPOS CARD, co-ordinate of the centre is given with Type: POSITIVE.

Whether my settings are correct.
However, it seems to me that when I am using “source_newgen.f”, then Source Type: FLOOD is not taken from BEAMPOS CARD. If I am correct, how to define source type: FLOOD (distributed over a spherical surface and direction towards the centre of the sphere) in source.f subroutine ?

Any suggestion will be helpful to me.
Thanking you in advance.

Dear @ArghyaC

You are correct, when a source user routine is used, some of the beam settings in the input file are disregarded. These include the extended sources specified on a BEAMPOS card.

To sample a FLOOD source in a source routine you can use the SFLOOD subroutine:

CALL SFLOOD ( XXX, YYY, ZZZ, UXX, VYY, WZZ )

which returns a random position and direction on the surface of a sphere of unit radius, generating a uniform and isotropic field inside the sphere.

Cheers,
David

Thank you very much for your reply.
When I inserted CALL SFLOOD ( XXX, YYY, ZZZ, UXX, VYY, WZZ ) without any numerical values of ( XXX, YYY, ZZZ, UXX, VYY, WZZ ), it is giving compilation error.

What will be the values of ( XXX, YYY, ZZZ, UXX, VYY, WZZ ) for a FLOOD source of radius 10 cm and centred at (0,0,0) producing uniform radiation field inside the sphere.

Is there any specific place in the “source_newgen.f” where I need to add this line ?

I have attached my .inp, .f and .dat file.

flood_source.inp (1.3 KB)
source_newgen.f (18.7 KB)
source_hist_example.dat (133 Bytes)

Kindly look into the file and give me some suggestions.

Thanking you in advance.

Dear @ArghyaC

The XXX, YYY, … WZZ variables are the output of the SFLOOD() subroutine.

In source_newgen.f you need to define them first, then call SFLOOD(), finally assign the variables to the appropriate coordinate and direction variables.

To scale the sphere to a specific radius, the coordinates need to be multiplied with the radius.

See: source_newgen.f (18.9 KB)

Cheers,
David

Thank you very much. I will try this and let you know.

2 posts were split to a new topic: How to verify histogram sampling with source_newgen.f?