Post processing FLUKA simulation results

Dear FLUKA experts,

I would like to make a comparison between the 2D plots obtained through FLUKA and FluDAG. For this purpose, I have tried to use Paraview and Visit. Saying that I am new to both tools, I did not suceed in obtaining the same type of plot that is possible using Flair.
In particular, I have seen that in this slide (from a presentation), the plots from from FLUKA and FLUDAG have the same settings.

How is it possible to have the figure at the right?

Regards,
Lovepreet

HI @Singh

You can use the gnuplot method in Flair, you need to specify a custom executable, point to the mainfludag executable, then the gnuplot method will work as I did in the above images. It may be a little slow depending on your geomety.

Thanks

Andy

Thanks for your reply, Sir.
Actually, I have tried this way before, but I get an error.

How can it be solved?

Thanks,
Lovepreet

Hi @Singh

My guess would be that you’ve started your plot location on a surface in the geometry possibly? Could you look at the files produced in fluka_577? It may offer some hints, dagmc might not be finding your dagmc.h5m file for example, but I’d need more diagnostic information to be sure.

Thanks

Andy

This is the content of the .log file
image
And I have tried also to plot the 1D curve in order to see if I am plotting correctly and it confirms that the deposition occurs between -1.5<z<1.5 as it should be looking at the geometry.

But, I am not able to produce the 2D plot. I am attaching here all the files.
new_forum.zip (693.2 KB)

Thanks
Lovepreet

Hi @Singh

Appologies for the delay! A couple of things, if you look at my branch fluka-cern-src in GitHub - makeclean/DAGMC: Direct Accelerated Geometry Monte Carlo Toolkit you’ll see some changes that will allow you to build with the new source.

Also, plotting!

You’ll need to make some changes to the fluka/input.py script in the flair folder, I still havent got around to putting in a patch yet.

You’ll need to make line 2580 look like this

		#if flugg:
		#	self.close()
		#	return None

		# If VOXELS are present, write the first active one
		if "VOXELS" in self.cards:
			for card in self.cards["VOXELS"]:
				if card.notIgnore():
					self.write(card.toStr(fmt=FlukaCard.FORMAT_FREE)+"\n")
					break
		if not flugg:
			self.write(geoline[1]+"\n")		# Write title
			self._writeGeometry(FlukaCard.FORMAT_FREE, FlukaCard.FORMAT_FREE)

With all those changes, you should be running and be able to plot results

Let me know if htis works for you

Thanks

Andy

PS - Loving the new update messages :slight_smile:

Screenshot from 2022-04-09 00-07-24

2 Likes

Hi @Singh

I forgot to mention, the bounds of the plot can be somewhat tricky. There is an issue when plotting FluDAG geometries when the blackhole is visible - I don’t really know why. So make sure your plot bounds are sized such that the blackhole won’t be visible. If you’re slicing the blackhole, you’ll get some error message from fluka along the lines of “medfluka region less than -33” or something like that.

If anyone from the FLUKA team has any idea why that would be, it only happens when there is too much blackhole, some is ok IIRC, but if there is a situation where a ray could traverse the blackhole and encounter another material on the otherside is when it seems to fail. Maybe @vasilis or @ceruttif could comment? It’s been an issue since we first implemented FluDAG but never got to the bottom of it.

Thanks

Andy

Hi @makeclean

Thanks again for your help.

I have solved the issue with the customized source and now it works!

Concerning the plotting issue, I haven’t managed to solve it yet. In particular, I made the changes suggested by you. After this, I run the simulation, and the same error

fluka run: 11.5306 s>e> ERROR: No None001_PLOTGEOM.STORE file

appears again. Am I missing any step?

Thanks!

Lovepreet

Hi @Singh

I think the penny has dropped for me, I’ve just realised you’re using my executable as wrote (I think), which has a custom magnetic field file in there too, which expects to read a file. In the src/fluka/app/CMakeLists.txt file if you modify

set(FLUKA_FILES bfield.cpp magfld.f plasma_source.cpp source.f)

to

set(FLUKA_FILES plasma_source.cpp source.f)

Then recompile, then you should be ok.

Thanks

Andy

Hi @makeclean

Actually, I do not have any problem with the source compilation and the simulation goes well. This both with your source and mine. The problem arises when I ask flair to plot the 2D figure. It gives me the error reported above. The issue now is related only to the plotting.

Thanks,

Lovepreet

Hi @Singh

Let me clear, are you using the build including my magnfld.f and associated magnfild.cpp? If you are you plot will not work, you will need to remove the magnetic files and rebuild, it is expecting to read a magnetic field file. During transport this isn’t a problem as no fields are on. So please do rebuild without the magnetic field files.

You will know if this is true by examining the log/out files from the plotting in some temporary fluka_* directory, if you see a “file not found message” then this is due to the magnetic field routine.

Thanks

Andy

Hi @makeclean

I am not using the magnetic files. I have attached the files I am using.
Ploting_issue.zip (5.1 KB)

It contains the CMakeLists, my custom source and the flair simulation with the error.

Thanks a lot!

Lovepreet

Hi @Singh

Ah, I think I know, have you created a symbolic link to your dagmc file? I think when plotting you need to have link like

ln -s my-fancy-long-name.h5m dagmc.h5m

Again, as long as you have that, the executable should be able to find it, and the changes to Flair.

Do you also have these options selected for your plot?

Screenshot from 2022-04-11 15-05-16

Let me know, if that doesn’t work we’ll need to a VC to live debug I think.

Thanks

Andy

Hi @makeclean

I always had the symbolic link and the options shown in your figure. However, it doesn’t work. I will write you an email for the VC.

Thanks

Lovepreet