Leakage fraction

Extremely new to openMC so apologies if this is a silly question.

I’m trying to store the output leakage fraction as a variable but I can’t find a direct way to reference it. I can do it for keff and the others (e.g. sp.keff, sp.col_tra) but there is no equivalent for the leakage fraction. I tried consulting the dir(openmc.StatePoint) but I didn’t see it there. Did I miss it or do u have to do some sort of surface tally yourself to find the leakage fraction?

Kind regards

1 Like

There doesn’t appear to be getter in the Statepoint class to directly access the leakage fraction, but you can fetch it with the global_tallies getter:

# Assuming sp is a pre-loaded statepoint
gt = sp.global_tallies 
leakage_mean = gt[gt['name'] == 'leakage'][0]['mean']
leakage_std_dev = gt[gt['name'] == 'leakage'][0]['std_dev']
1 Like

Hi Kevin

Thanks for the response. Delving deeper into the global tallies is what I needed. In my case global tallies gives a matrix where the (4,4) element is the leakage fraction. Unsure if this is the case in general but here it is.

sp = openmc.StatePoint(‘statepoint.80.h5’)
print(sp.global_tallies[3][3])
0.9961333333333335