"TMP" Option

Report all good and bad behavior here
Post Reply
hartanto
Posts: 26
Joined: Sun Oct 21, 2012 11:28 am
Security question 1: No
Security question 2: 92
Location: University of Sharjah

"TMP" Option

Post by hartanto » Wed Nov 07, 2012 2:29 pm

Hello,

We tried to check the "tmp" option in SERPENT2 which is the Doppler Broadening pre-processor for the cross sections.

We tested the "tmp" option in the CANDU fuel bundle using 3 Serpent codes: 1.1.19, 2.1.8, and 2.1.9.

Serpent 1 gives consistent results between using the "tmp" option and the exact library. But in Serpent2, ~700 pcm discrepancy in k-inf is noticed.

Code: Select all

                     1.1.19              2.1.8              2.1.9
with "tmp"     1.11015  0.00001    1.10311  0.00002   1.10310  0.00002
exact lib      1.11019  0.00001    1.11019  0.00001   1.11020  0.00001
error (pcm)       -4.7              -708.9             -709.6

Donny

User avatar
Tuomas Viitanen
Posts: 65
Joined: Thu Mar 25, 2010 1:50 pm
Security question 2: 0
Location: VTT Technical Research Centre of Finland, Espoo

Re: "TMP" Option

Post by Tuomas Viitanen » Wed Nov 07, 2012 3:38 pm

Hello,

We are actually trying to fix this (or a very similar) issue right now. I noticed the same thing just yesterday. Stay tuned...

Tuomas

User avatar
Tuomas Viitanen
Posts: 65
Joined: Thu Mar 25, 2010 1:50 pm
Security question 2: 0
Location: VTT Technical Research Centre of Finland, Espoo

Re: "TMP" Option

Post by Tuomas Viitanen » Wed Nov 07, 2012 5:27 pm

Hi again,

We (in practice, Jaakko...) managed to find and fix at least one issue with the Doppler-preprocessor routine in Serpent versions 2.x.x. The problem appears when using the same ACE data for a nuclide in multiple temperatures. As a result of the problem, the same xs data becomes broadened multiple times, resulting in too high cross section temperatures for the nuclide in all materials. The bug fix will be included in the next update that will be distributed soon.

In the meanwhile (and only if your problem is not very complicated...), you may try to avoid the problem by cheating Serpent the following way:
Instead of defining

Code: Select all

mat fuel1 -10 tmp 1200
92235.09c -0.2
92238.09c -0.8

mat fuel2 -10 tmp 1000
92235.09c -0.2
92238.09c -0.8
you may change the ACE source of the second material to that of a lower temperature (09c -> 06c)

Code: Select all

mat fuel1 -10 tmp 1200
92235.09c -0.2
92238.09c -0.8
mat fuel2 -10 tmp 1000
92235.06c -0.2
92238.06c -0.8
which should produce the same result as the first option. This is, of course, really annoying, but this way you can at least check if your error is related to the same issue that just got fixed.

Regards,

Tuomas

hartanto
Posts: 26
Joined: Sun Oct 21, 2012 11:28 am
Security question 1: No
Security question 2: 92
Location: University of Sharjah

Re: "TMP" Option

Post by hartanto » Thu Nov 08, 2012 4:13 am

Thank you. I will try your suggestion. How about the on-the-fly Doppler Broadened based on the 0 K library? Has it been applied to the current Serpent 2.1.9?

Regards,

Donny

User avatar
Tuomas Viitanen
Posts: 65
Joined: Thu Mar 25, 2010 1:50 pm
Security question 2: 0
Location: VTT Technical Research Centre of Finland, Espoo

Re: "TMP" Option

Post by Tuomas Viitanen » Thu Nov 08, 2012 6:01 pm

The on-the-fly Doppler Broadening based on the explicit treatment of target motion at collision sites has been preliminarily implemented in Serpent and can be activated with line

Code: Select all

set dop 2
in the input. However, an error was found from the handling of elastic scattering events with on-the-fly Doppler just a few days ago. This issue can be fixed by replacing line 141 in dopmicroxs.c with

Code: Select all

StoreValuePair(nuc + NUCLIDE_PREV_COL_Z2, ncol, z2/ar, id);
and then replacing a line 75 in targetvelocity.c with

Code: Select all

V = sqrt(z2);
The on-the-fly mode is not very thoroughly tested (be careful!) and by using it the calculation times will increase by a factor of 2-4. Also remember that on-the-fly broadening should not be used for nuclides with with thermal scattering libraries.

Tuomas

User avatar
Jaakko Leppänen
Site Admin
Posts: 2377
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: "TMP" Option

Post by Jaakko Leppänen » Fri Nov 09, 2012 5:03 pm

The correction for the Doppler-preprocessor bug requires more than a few lines of editing, but it can be done. Remove lines 104-135 from dopplerbroad.c:

Code: Select all

	  /***** Get XSS, NXS and JXS arrays *********************************/
	      
	  /* Get pointer to ACE data */
		  
	  ace = (long)RDB[nuc + NUCLIDE_PTR_ACE];
	  CheckPointer(FUNCTION_NAME, "(ace)", ACE_ARRAY, ace);
	  
	  /* Pointer to XSS array */
	  
	  ptr = (long)ACE[ace + ACE_PTR_XSS];
	  CheckPointer(FUNCTION_NAME, "(xss)", ACE_ARRAY, ptr);
	  
	  XSS = &ACE[ptr];
	  
	  /* Read data to NXS array */
	  
	  ptr = (long)ACE[ace + ACE_PTR_NXS];
	  CheckPointer(FUNCTION_NAME, "(nxs)", ACE_ARRAY, ptr);
	  
	  for (n = 0; n < 16; n++)
	    NXS[n] = (long)ACE[ptr++];
	  
	  /* Read data to JXS array */
	  
	  ptr = (long)ACE[ace + ACE_PTR_JXS];
	  CheckPointer(FUNCTION_NAME, "(jxs)", ACE_ARRAY, ptr);
	  
	  for (n = 0; n < 32; n++)
	    JXS[n] = (long)ACE[ptr++];      
	  
	  /*******************************************************************/	  
and replace with:

Code: Select all

	  /***** Get NXS and JXS arrays **************************************/

	  /* Pointer to ace block */

	  ace = (long)RDB[nuc + NUCLIDE_PTR_ACE];
	  CheckPointer(FUNCTION_NAME, "(ace)", ACE_ARRAY, ace);

	  /* Read data to NXS array */
	  
	  ptr = (long)ACE[ace + ACE_PTR_NXS];
	  CheckPointer(FUNCTION_NAME, "(nxs)", ACE_ARRAY, ptr);
	  
	  for (n = 0; n < 16; n++)
	    NXS[n] = (long)ACE[ptr++];
	  
	  /* Read data to JXS array */
	  
	  ptr = (long)ACE[ace + ACE_PTR_JXS];
	  CheckPointer(FUNCTION_NAME, "(jxs)", ACE_ARRAY, ptr);
	  
	  for (n = 0; n < 32; n++)
	    JXS[n] = (long)ACE[ptr++];      
      
	  /********************************************************************/

	  /***** Make copies of ACE and XSS ***********************************/

	  /* Pointer to original ace block */

	  ptr = (long)RDB[nuc + NUCLIDE_PTR_ACE];
	  CheckPointer(FUNCTION_NAME, "(ace)", ACE_ARRAY, ptr);

	  /* Make a copy */

	  ace = ReallocMem(ACE_ARRAY, ACE_BLOCK_SIZE);
	  memcpy(&ACE[ace], &ACE[ptr], ACE_BLOCK_SIZE*sizeof(double));

	  /* Set pointer */

	  WDB[nuc + NUCLIDE_PTR_ACE] = (double)ace;

	  /* Pointer to XSS array */
	  
	  ptr = (long)ACE[ace + ACE_PTR_XSS];
	  CheckPointer(FUNCTION_NAME, "(xss)", ACE_ARRAY, ptr);

	  /* Make a copy */

	  loc0 = ReallocMem(ACE_ARRAY, NXS[0]);
	  memcpy(&ACE[loc0], &ACE[ptr], NXS[0]*sizeof(double));

	  /* Set pointer */

	  ACE[ace + ACE_PTR_XSS] = (double)loc0;

	  /* Pointer to data */

	  XSS = &ACE[loc0];
You also need to define variable loc0 (type long). That should do the trick.
- Jaakko

User avatar
Jaakko Leppänen
Site Admin
Posts: 2377
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: "TMP" Option

Post by Jaakko Leppänen » Wed Dec 12, 2012 3:07 pm

This problem was fixed in update 2.1.10.
- Jaakko

hartanto
Posts: 26
Joined: Sun Oct 21, 2012 11:28 am
Security question 1: No
Security question 2: 92
Location: University of Sharjah

Re: "TMP" Option

Post by hartanto » Sat Dec 29, 2012 8:46 am

Hello,

Do you have example of the NJOY input file to generate the 0 Kelvin cross sections? I want to try to the on-the-fly Doppler Broadening based on the explicit treatment of target, but I failed to generate the 0 K library.

Thank you,

Donny

User avatar
Tuomas Viitanen
Posts: 65
Joined: Thu Mar 25, 2010 1:50 pm
Security question 2: 0
Location: VTT Technical Research Centre of Finland, Espoo

Re: "TMP" Option

Post by Tuomas Viitanen » Wed Jan 02, 2013 2:26 pm

Here is an example of the input file I have used for 0 K libraries.

Code: Select all

moder
50 -51 
reconr
-51 -52
'Tape reconstructed from tape50, containing mat 9237'/ 
9237 0/
0.010000 0 0.100000 5.000000E-07/
0/
broadr
-51 -52 -53
9237 1/
0.010000 1e6 0.100000 5.000000E-07
0.00
0/
gaspr
-51 -53 -54
acer
-51 -54 0 55 56
1 1 1 .50/
'Temperature 0.00K, processed with NJOY 99.364'/
9237 0.00
1 1
/
stop
In case there are more experienced NJOY users out there, feel free to comment my input :) To by knowledge, this specific input should produce 0 K cross sections for U-238 (mat = 9237) with 0.01 reconstruction tolerance.

For the final version of the Serpent 2 cross section libraries, damage production cross sections will be added using the HEATR module and ures tables will be added for temperatures above zero Kelvin using PURR.

Happy New Year !

Tuomas

hartanto
Posts: 26
Joined: Sun Oct 21, 2012 11:28 am
Security question 1: No
Security question 2: 92
Location: University of Sharjah

Re: "TMP" Option

Post by hartanto » Tue Jan 08, 2013 8:08 am

Thank you. Happy new year too. :)

Post Reply