[fluka-discuss]: Importing external magnetic field map in MGFLD

From: Tamer Tolba <tamer.tolba_at_uni-hamburg.de>
Date: Tue, 11 Aug 2020 20:49:58 +0200

Dear FLUKA experts,

I am trying to import an external magnetic field map created by FEA
software (COMSOL), with data points sorted in mesh rather than
coordinate style* and saved in txt file in fluka MGFLD routine to apply
it in my FLUKA calculations.

(* i.e. the mag. filed components are sorted in the text file depending
on the exported mesh node coordinate, i.e. not following a specific
coordinate order, e.g. (X1,Y1,Z1), (X2, Y1, Z1)....).

I have 20059 data points. The data are sorted in the txt file as X(cm)  
Y(cm)   Z(cm)   Bx(T)   By(T)   Bz(T). Since I am not a fortran expert,
I tried to follow the recommendation from an old fluka case here
<http://www.fluka.org/web_archive/earchive/new-fluka-discuss/2419.html>.
Attached, please find my modified (from the fluka old case example)
magfld_n file. I tag with "TT" wherever I made an entry.

My questions are:

1- From the old fluka example, it seems that the code reads only the
values of the mag. filed components, rather than the coordinate and the
filed components values, am I right? If yes, does that mean that fluka
assumes "by default" a specific coordinate order, which the B_component
should be following during exportation by the COMSOL program?

2- If question #1 is correct, is there any way to make fluka reads the
data file as it is sorted (whether on fluka or fortran levels)? Which
means that it will need to read the all six variables, 3 coordinate
values and 3 B_component value.

3- Can a fluka expert have a glance on the code and tell me if I have
any mistakes. As I said I am not a fortran expert, so I might also have
mistakes on the programing level. I would really appreciate if you can
guide me to any exiting example code for my problem, which seems was an
old topic. At least this one from 2009 must have solved it somehow ;).

With my best regards,

Tamer Tolba

-- 
Dr. Tamer Tolba
Institut für Experimentalphysik,
Universität Hamburg ,
Luruper Chaussee 149,
22761 Hamburg - Germany
Tel.: +49 (0)40-8998-4872



__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info

Received on Tue Aug 11 2020 - 22:47:02 CEST

This archive was generated by hypermail 2.3.0 : Tue Aug 11 2020 - 22:47:19 CEST