Skip to content

Instantly share code, notes, and snippets.

@marquezj
Created September 19, 2017 15:31
Show Gist options
  • Save marquezj/625407e8ff60fb4b41f1bf8f8db6a6c3 to your computer and use it in GitHub Desktop.
Save marquezj/625407e8ff60fb4b41f1bf8f8db6a6c3 to your computer and use it in GitHub Desktop.
This is a tutorial on how to install and run NJOY2016 with NCrystal
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tkittel
Copy link

tkittel commented Sep 5, 2018

Nice tutorial 👍

FYI the NCrystal syntax changed a bit in recent releases so instead of braggonly=1, one should now use bkgd=0.

@vedantkm
Copy link

Great tutorial - works great for the given example. I am trying to approach this for deuterium, but it breaks since this NCrystal is still v1. Will this 'hack' get upgraded with latest NCrystal version? - Thank you!

@marquezj
Copy link
Author

@vedantkm The short answer is no. We plan to call NCrystal directly from MCNP/OpenMC/PHITS and avoid this.

But if you do it, post a link here. Perhaps somebody finds it useful.

@vedantkm
Copy link

@marquezj - perhaps this is my misunderstanding of the NCrystal code - but how can NCrystal with MCNP/OpenMC generate TSLs/XS without using NJOY?

@marquezj
Copy link
Author

@vedantkm NCrystal creates an scattering object in memory. Three years ago, when I wrote this, NCrystal did not support inelastic scattering, but we used it to compute the structure factor.

Now, in NCrystal version 2, it computes everything that LEAPR supports (and a lot of more), and you could call it from NJOY to put it in ENDF format. But you can also call it directly from Monte Carlo to get the scattering cross section at a given energy and to sample the scattering events. This feature is already implemented for McStas and Geant4.

@vedantkm
Copy link

@marquezj - thank you - I see now!

Going through the NCrystal tutorial I cannot find how to couple NJOY with NCrystal v2 (other than this tutorial). I prefer calling NCrystal with NJOY as I need to create TSL files in ENDF/ACE format. Or does NCrystal secretly also create ENDF files? I have a .ncmat file that I wrote. Perhaps there is a ncmat2endf command?

Since I have VDOS (Phonon DOS), I would like to use NCrystal to construct Bragg edges and then feed it back into the NJOY to create ENDF+ACE files. Other than the route provided in this tutorial, I cannot see if it's possible directly with NCrystal.

@marquezj
Copy link
Author

@vedantkm NCrystal does not do anything secretly. It is free software, everything is there to see in the source. If you need to do something that has not been yet implemented (such as producing ENDF files), get the code and modify it. What I said is you could call it from NJOY, but you have to do it yourself.

@vedantkm
Copy link

@marquezj Thank you for the clarification! I will attempt to implement NJOY with newer version of NCrystal!

@marquezj
Copy link
Author

FYI, the "hack" presented in this gist has been superseded by a new release called NJOY+NCrystal:

https://github.com/highness-eu/NJOY-NCrystal-Library

@vedantkm
Copy link

vedantkm commented Aug 11, 2021

Thank you @marquezj. I finally got to utilize it. Unfortunately, the generated results from NJOY+Ncrystal are deviating significantly when compared to the FLASSH code. Perhaps, we should take the conversation private and discuss?

@marquezj
Copy link
Author

Well, I am not sure what that code does, but I would always compare with experimental data first.
Anyway, if you want to ask about NJOY+NCrystal just send me an email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment