Picongpu: Unit Conversion

Created on 18 Sep 2019  路  10Comments  路  Source: ComputationalRadiationPhysics/picongpu

Hi, I am visualizing the output of TNSA from hdf5. I can plot by using visit the charge density. But I am not sure what unit is that and how can I convert from charge density to density? Can we get the output in SI unit?

visit0000

plugin question

Most helpful comment

Btw there is also Visit plugin to read openPMD files. I personally do not have experience with it, but should be fitting here.

All 10 comments

@StevE-Ong we write hdf5 output according to the openPMD standard. All values are normalized with conversion to SI given by the unitSI field, which should be part of the hdf5 file. AFAIK it is not possible to get file output in SI directly. (nor do we believe it is a particularly good idea to have one, thus the conversion unit).

Btw there is also Visit plugin to read openPMD files. I personally do not have experience with it, but should be fitting here.

Thank your for reply. It took me half a day to figure out what is the real density just to check if my input is correct. I think it is a good idea to get an output in SI unit directly. Although there are plugins and openPMD but that will took me another few days to figure out how to do.

I can understand your issue with the non-SI output. But we use an adapted unit system in order to match mean values to a range around 1.0 thus allowing to output only values in single precision floats without running into over- or under-flow issues. This "drawback" allows for higher precision and less disk-space used.

So there is no other way to quickly check my value other than openPMD and plugin? I am not a user of them and it may take me a few days to figure out how to do it. I just need a multiplication factor.

By the way, where can I know what is the normalization of Lorentz force and Maxwell's equations used in picongpu?

If you just need quickly a multiplication factor, you can also extract the conversion factor from the standard output of PIConGPU. In the stdout/output you can find (before the actual simulation starts) all conversion factors printed, as e.g.:

PIConGPUVerbose PHYSICS(1) | UNIT_SPEED 2.99792e+08
PIConGPUVerbose PHYSICS(1) | UNIT_TIME 7.27564e-17
PIConGPUVerbose PHYSICS(1) | UNIT_LENGTH 2.18118e-08
PIConGPUVerbose PHYSICS(1) | UNIT_MASS 3.16782e-27
PIConGPUVerbose PHYSICS(1) | UNIT_CHARGE 5.57162e-16
PIConGPUVerbose PHYSICS(1) | UNIT_EFIELD 2.34276e+13
PIConGPUVerbose PHYSICS(1) | UNIT_BFIELD 78146.2
PIConGPUVerbose PHYSICS(1) | UNIT_ENERGY 2.84709e-10

So for your plot, you would need to multiply the electric field with UNIT_EFIELD to get to V/m. And for the charge density you would need to multiply by UNIT_CHARGE / UNIT_LENGTH^3 to convert to C * m^-3. To get to a particle density (assuming electrons) you need to divide by the elementary charge.

Ah...Thank you very much. This is easier for me.

Great that this helped you. For a more regular visualization/data analysis the automated conversion provided by the VisIt plugin or the openPMD-api might of course be more convenient. But for a quick check, copying the factors printed is definitely the faster way.

I will close this issue now. If this did not solve your problem, please feel free to reopen the issue (or just write another entry below).

@StevE-Ong sorry, my answer probably was not clear. What I wanted to express is that we use openPMD for data markup: basically, there are some required attributes for all data sets, and unitSI is one of such attributes. However, openPMD is not a file format itself, so e.g. with output in hdf5 you can totally use your normal workflows operating with hdf5 files and not our openPMD tools. Just query for the unitSI attribute of the corresponding data set for conversions (or I am not particularly sure what is the correct hdf5 term for that, but my viewer shows it in the attributes panel).
Ofc, there is also a quick way for simple cases that @PrometheusPi suggested.

For a quick look, try
https://github.com/openPMD/openPMD-viewer/

openPMD-api also has and gets more sophisticated unit handling here.

For VisIt, the linked plugin should receive all kinds of reports if it is hard/unable to build. If this plugin is too hard to build, we have to port it upstream directly into VisIt or find a better solution, such as integration in package managers. Please do not hesitate to open an issue therein and we can push this further to make it more useful!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbontoiu picture cbontoiu  路  3Comments

berceanu picture berceanu  路  4Comments

sbastrakov picture sbastrakov  路  3Comments

HighIander picture HighIander  路  4Comments

steindev picture steindev  路  4Comments