Implementation of an anisotropic source from MCNP in source_newgen.f

Hello everyone,

This is a follow-up to my previous post regarding the implementation of a neutron source in FLUKA using source_newgen.f Angular distribution with source_newgen.f.

I am running simulations with FLUKA to validate a geometry by comparing calculated dose distributions with experimental measurements and MCNP simulations. However, I still observe discrepancies, and I suspect the source implementation might be the reason.

In MCNP the source is defined with the following card:

SDEF par=n erg=d1 rad=d2 pos=-15 0 0 ext=d3 axs=1 0 0 vec=1 0 0 dir=d4

where

  • d1 is the energy distribution, which I implemented in FLUKA through an external .txt file
  • d2 and d3 describe the spatial distribution of the source (a cylinder, for which radius and height are provided).

My main doubt is about d4, which in MCNP represents the angular distribution (anisotropy) along the x-axis. It has a parabolic shape with negative concavity and its maximum around 90°.

In FLUKA I tried to reproduce this behavior by sampling:

direction_cosx = sample_discrete_file("AngleX.txt")

where AngleX.txt is a two-column file: first column = cos(theta), second column = intensity (not normalized; I assume FLUKA normalizes automatically).

Now my question: If I want to replicate what MCNP does, what should I do for the y and z direction cosines?

So far I have tried two approaches:

  1. Spherical coordinates
    call SFECFE(SINT,COST)
    direction_cosx = sample_discrete_file("AngleX.txt", 1D0)
    direction_cosy = SINT * sqrt(1 - direction_cosx*direction_cosx)
    direction_cosz = COST * sqrt(1 - direction_cosx*direction_cosx)

  2. Isotropic sampling for y and z
    call sample_isotropic_direction(direction_cosx, direction_cosy, direction_cosz)
    direction_cosx = sample_discrete_file("AngleX.txt", 1D0)

But when I look at neutron fluence with USRBIN, both options seem incorrect:

  • With spherical coordinates I see preferred directions at 0° and 180°.

  • With isotropic sampling, I get peaks at 45° and 135°.

In both cases, the expected maximum at 90° does not appear.


Could anyone clarify the correct way to implement the anisotropic angular distribution from MCNP into FLUKA? Am I misunderstanding how to treat the y and z direction cosines when cosx is sampled from a custom distribution?

Thanks in advance for your help.

Best regards,
Giorgia

Dear Giorgina,

Your first approach is the correct one, but I would use the sample_spectrum_file() function to have a continuous distribution of the angles.

Now, without the used input and source files, it is difficult to tell why you are not getting what you expect. Could you upload them?

Cheers,
David

Dear David,

thank you for your feedback. With the option sample_spectrum_file() my angular distribution now seems to be the correct one. I will run a few more simulations to further verify this, and I’ll get back to you afterwards.

Just to make sure I understood correctly: the main difference between sample_discrete_file() and sample_spectrum_file() is that the former only samples from the exact values listed in the input .txt file, while the latter builds a continuous distribution from the values provided. Is that correct?

Best regards,
Giorgia

Dear Giorgia,

It’s good to hear that it works now.

Yes, that is the difference between those sampling functions.

Cheers,
David