Page 1 of 1

questions about decoding. the .percPoints File

Posted: Mon Feb 06, 2017 1:15 am
by terryphi
Hi There,

I wrote a quick python script to decode the .percPoints file. I tried to attach it, but it looks like '.py' and '.txt' file extensions aren't allowed, it's copied and pasted below.

At anyrate, looking at the output (this is from the simple 8 cube input example btw):

edit: looks like the image got cut. Here's the Imgur link: http://imgur.com/a/K95kp
Image

based on this wiki page: http://serpent.vtt.fi/mediawiki/index.p ... imulations

assuming that the format lines up with description in the .live file.

The first three numbers are the X,Y, and Z coordinates.
The next three are the directional cosines

if it's the same as the .live file, it looks like the next one is the neutron energy
entry 8 is the statistical weight,
,and entry 9 is the simulation time.

If that's the case: three questions:
1) how can a precursor have a neutron energy?
2) why are the simulation times all over the place? How do I set the simulation time parameters?
3) How can I make it have more precursors?


Code: Select all

#Precursor postin file human readable format converter.
import array
import csv

fileObj = open(".precpoints",'r')
fileContents = fileObj.read()
fileObj.close()

dataLength = len(fileContents)
chunks = dataLength/72

#okay, now divide this up into 72 byte chunks. each 72 byte chunk is a neutron.

#itterate chunk by chunk

chunkArray = []
for idxA in range(0,dataLength,72):
    #There are 9 doubles in each chunk
    #itterate double by double
    rawNumbers = [] #store the numbers in here.
    for idxB in range(idxA,idxA + 8*9,8):
        #pull out a 8 byte segment
        segment = fileContents[idxB:idxB+8]
        ###debugData = map(bin,bytearray(segment))
        value = array.array('d',segment)[0]
        rawNumbers.append(value)
    #end for loop B
    chunkArray.append(tuple(rawNumbers))
#end for loop A

with open("./precPoints.txt", "w") as the_file:
    csv.register_dialect("custom", delimiter="\t", skipinitialspace=True)
    writer = csv.writer(the_file, dialect="custom")
    for tup in chunkArray:
        writer.writerow(tup)

the_file.close()

copy pasta of the output:

Code: Select all

93.55756321048183	75.59100014762498	74.4205652670489	1.0	0.0	0.0	0.0007051930210933904	1.0634445245428215	4.0

53.470342440418484	-98.69872263472291	33.991159461998144	1.0	0.0	0.0	2.191626029019371	24.948273596731315	0.0

93.09702138587959	16.656402102511446	41.43946342601799	1.0	0.0	0.0	2.8137160445129075	1.0634445245428215	4.0

47.23529493508718	58.27233715643474	59.941331196975156	1.0	0.0	0.0	0.0014932494738709447	1.0634445245428215	4.0

25.989312685618884	47.264679323723826	49.52495290180415	1.0	0.0	0.0	0.013877707741167472	1.0634445245428217	4.0

87.75654236126346	78.32979776549573	66.28859622205717	1.0	0.0	0.0	1.5578317288842174	0.08749863344634286	7.0

49.837888658926666	-87.45506777173664	-67.68419738751544	1.0	0.0	0.0	0.012468698199077028	2.3377778629934176	3.0

18.21647495980481	-32.26961273586493	55.36122997714853	1.0	0.0	0.0	0.05894904417913636	0.4666592383450891	5.0

77.95945356685822	30.827933959701546	-6.685855762080194	1.0	0.0	0.0	0.0024736730608484023	10.993423599443307	1.0

58.089545057780825	47.54410906684491	27.196792083847118	1.0	0.0	0.0	0.0005004598146257901	2.3377778629934176	3.0

33.70141261299294	1.6612142040164695	22.047463551852246	1.0	0.0	0.0	0.016416985180426884	24.94827359673132	0.0

-78.8081701131219	52.63187609900142	37.126096223253626	1.0	0.0	0.0	0.0008220274028837671	1.0634445245428215	4.0

56.61812314919224	-25.953457647878384	-45.52603506700702	1.0	0.0	0.0	0.0011635284260403166	0.190253399353412	6.0

44.56543240638847	2.115033762473916	16.92915383424297	1.0	0.0	0.0	0.0061209210930260076	7.3139807369032885	2.0

10.720552958763317	77.62048896492053	-58.40338176966027	1.0	0.0	0.0	0.004706159161120928	10.993423599443307	1.0

21.910945351075572	46.85201367217409	-45.20862513823124	1.0	0.0	0.0	0.13964359653066474	1.0634445245428215	4.0

83.96752850712244	-64.57569664203217	93.13066197831084	1.0	0.0	0.0	0.03300562688161622	1.0634445245428215	4.0

-32.69621808023988	13.271629762738357	43.99915412322772	1.0	0.0	0.0	0.032288584839617766	2.3377778629934176	3.0

73.0870755854179	61.70907363455318	0.8544920993214553	1.0	0.0	0.0	0.02678801125979193	2.3377778629934176	3.0

61.72989174192501	-48.05332520442391	-21.290818503476725	1.0	0.0	0.0	0.0002655159307069134	7.3139807369032885	2.0

-2.4274213017235446	24.297243455633364	33.873333465426825	1.0	0.0	0.0	0.000692616439349045	2.3377778629934176	3.0

-13.02146328951878	0.8963368505557394	27.97731714567129	1.0	0.0	0.0	0.014171707714586654	24.948273596731315	0.0

-8.557042053061462	40.78554450162868	20.828053832748562	1.0	0.0	0.0	0.0006534203431613038	1.0634445245428217	4.0

-76.50138585871959	-67.81461778084685	18.128380556148052	1.0	0.0	0.0	0.0026890145927729128	24.948273596731315	0.0

91.95765228833082	76.98406046969474	40.15913006260671	1.0	0.0	0.0	0.011492457918529857	1.0634445245428217	4.0

46.652257073041476	71.87876674447416	3.5807519539063923	1.0	0.0	0.0	0.04464761745315657	7.3139807369032885	2.0

13.71003496998604	-79.00737013839874	76.89426226341439	1.0	0.0	0.0	2.370680369108958	1.0634445245428217	4.0

36.34461330420566	-66.93443461912726	44.584803067534175	1.0	0.0	0.0	0.0001448157888127257	0.08749863344634284	7.0

24.941097301501458	-86.32475541373658	-17.218633725467832	1.0	0.0	0.0	0.00017478857340710234	24.948273596731315	0.0

-48.35704160511471	39.50729989134929	4.854923522083042	1.0	0.0	0.0	0.07788376177089651	1.0634445245428215	4.0

-31.79635132006282	49.89318367067748	16.63301088691307	1.0	0.0	0.0	0.04333565639186168	2.337777862993418	3.0

29.157234937920105	-56.1671891863739	-65.92687224648586	1.0	0.0	0.0	0.002976900101786695	7.3139807369032885	2.0

83.00150935923487	-2.044882350329459	74.11190722617415	1.0	0.0	0.0	0.0016873506054258236	7.3139807369032885	2.0

62.18506667446262	-55.030870249164415	80.43490625792217	1.0	0.0	0.0	0.6577539787869551	1.0634445245428215	4.0

9.15606966667323	-40.349379207829415	23.033219033810493	1.0	0.0	0.0	0.014388049567617127	10.993423599443307	1.0

-26.743306977834404	40.8162509634135	57.37644918050062	1.0	0.0	0.0	0.2196170809745075	2.3377778629934176	3.0

12.477493669427863	43.26867936545301	-45.915352001792634	1.0	0.0	0.0	0.05630521912883823	1.0634445245428217	4.0

27.55189491908829	11.189294417696239	-35.39461331210175	1.0	0.0	0.0	0.0001755947389633032	2.3377778629934176	3.0

14.833710858532502	-82.34691535339856	-56.84976996382974	1.0	0.0	0.0	3.458394629791568	0.190253399353412	6.0

27.945660769620837	-81.04866204730659	29.902831221990688	1.0	0.0	0.0	0.009334609290308469	10.993423599443307	1.0

Re: questions about decoding. the .percPoints File

Posted: Mon Feb 06, 2017 6:36 pm
by Ville Valtavirta
Hi,

the script will surely be handy for everyone that wants to check the contents of their precursor (or .live) file. Thank you for posting it.

As for your questions:
1) The energy is the energy of the neutron that produced the precursor. It is not used for anything.
2) In the case of the precursors, the last value actually corresponds to the delayed neutron / precursor group. You shouldn't have to worry about the times of the particles.
3) The best way to get more precursors is to run a longer criticality source simulation (more active histories).

-Ville

Re: questions about decoding. the .percPoints File

Posted: Tue Feb 07, 2017 2:48 am
by terryphi
Ah, I see, thanks! Where can I find out more information about these delayed precursor groups? Is there a way to set the number of groups? What's the half life of each of these groups?

Re: questions about decoding. the .percPoints File

Posted: Tue Feb 07, 2017 9:55 am
by Ville Valtavirta
The precursor groups / delayed neutron groups come directly from the cross section libraries so they are different between ENDF and JEFF for example. You should be able to figure out the group structure using nuclear data tools such as http://www.oecd-nea.org/janis/ or http://www.nndc.bnl.gov/sigma/index.jsp.

The decay constants for the groups in a certain simulation are printed out in the <source>.main-file.

-Ville