Exporting data from Elmer to Paraview

Post processing utility for Elmer
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Exporting data from Elmer to Paraview

Post by Roland »

Hi,
After having solved a heat transfer problem with Elmer I would like to know how to calculate the heat flux in Paraview.
Thus my questions are:
1/ In Paraview the temperature gradient is given by the Gradient filter. But, as the heat flux neads also the thermal conductivity, how is it possible to export this thermal concuctivity from Elmer to Paraview?
2/ If we need for example the heat flux on a given boundary surface (in 3D), and having defined physical surface/bodies groups in gmsh (which are then defined in Elmer by physical surface/bodies numbers after importing the gmsh meshed geometry in Elmer), how is it possible in Paraview to get these physical surface/bodies entities, in order to select the right ones?
Thanks for any help!
Roland
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Exporting data from Elmer to Paraview

Post by kevinarden »

Have you considered the flux solver in Elmer?

Solver 3
Exec Solver = after all
Equation = "flux compute"
Procedure = "FluxSolver" "FluxSolver"
Calculate Flux = Logical True
Flux Variable = String Temperature
Flux Coefficient = String "Heat Conductivity"
Linear System Solver = "Iterative"
Linear System Iterative Method = "cg"
Linear System Preconditioning = ILU0
Linear System Residual Output = 10
Linear System Max Iterations = Integer 500
Linear System Convergence Tolerance = 1.0e-10
End

2. There is a geometry ID out put, you can use the paraview threshold filter with the geometry ID to show individual or groups of bodies.
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Exporting data from Elmer to Paraview

Post by Roland »

Hi Kevin,
Thanks for your reply.
1/I knew that there is a flux solver in Elmer. But as all the graphical post processing is done in Paraview and as one could also like to calculate other things than the heat flux, is there more generally a way to do that in Paraview?
2/ Concerning the geometry Id with the threeshold filter in Paraview I don't see something which alows the selection of a body, or of a body's boundary surface... For instance here attached is a drawing of a block which is heated by its left vertical boundary (an imposed Dirichlet temperature) plotted in Paraview. The problem has been solver in Elmer from an imported gmsh meshed geometry in which physical groups have been defined (inlet, outlet, etc...). How is it possible, when postprocessing the results in Paraview, to select these physical groups, like for instance the left vertical heating boundary in order to calculate the inward heat flux? More generally how is it possible to transfer from Elmer to Paraview the material properties, the physical groups (bodies, boundaries, etc...) ? I saw that this is possible from OpenFoam to Paraview, so is this also possible from Elmer to Paraview?
Thanks for some help about that!
Roland
Attachments
heating_block.PNG
(154.32 KiB) Not downloaded yet
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Exporting data from Elmer to Paraview

Post by kevinarden »

Bodies, you go to filters, threshold, select geometry IDs, set lower and upper body id, and apply.
Boundary surfaces, I do not know.
The rest of the questions, I do not know.
bodies.PNG
(493 KiB) Not downloaded yet
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Exporting data from Elmer to Paraview

Post by Roland »

Hi,
Thank you Kevin for this.
But I still wonder if it is possible:
1/ to be able in Paraview to get the physical groups (bodies, but also boundaries) which have been defined in Elmer
2/to be able to export from Elmer to Paraview the material properties, etc...
3/in paraview to calculate and then plot combinations of the dependant variables, meaning for instance the heat flux in a heat transfer problem, or also the Joule losses on an electromagnetic problem, etc...
Thank you in advance for any help!
Roland
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Exporting data from Elmer to Paraview

Post by kevinarden »

I believe it is possible, but beyond my capability to do so.
I think it would require code changes from the Elmer team.
Possibly some python coding in paraview.

paraview is python based and allows python scripts to be executed interactively.
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Exporting data from Elmer to Paraview

Post by Roland »

Hi
Yes this is probably possible by coding in Paraview but for the moment (as I am not a code programmer.../ perhaps later I will learn the Python code) I would like to do that without additional coding.
And as I saw (see just some YouTube videos) that, when analyzing data from an OpenFoam model in Paraview , the different physical groups appear in Paraview, I wonder if this is not also possible with an Elmer model?
Perhaps somebody from Elmer (Peter ?)can give some recommendations about that?
Thanks for some help!
Roland
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Exporting data from Elmer to Paraview

Post by raback »

Hi Roland,

For vtu output of Elmer you can say

Code: Select all

Vtu Part collection = Logical True
(if you use the Simulation section to set "Post File = case.vtu" add it there with namespace "vtu: " as prefix). Note that you should give some nice names to the entities to help to identify them in Paraview.

Also by default geometry ids are saved. Because bodies and boundaries are all numbered starting from 1 there is a offset 100 for BC's so the id's would not be mixed. So the BC1 is 101 etc. You can use "Threshold" filter in Paraview to select the entities. E.g. upper and lower value 101 for "Geometry Ids" shows the 1st boundary.

It may be often favorable to compute the lumped quantities inside Elmer using SaveScalars or some other utility solver. This way you do not need to always use Paraview and some operations are best done when you know what the internal basis functions are. There is some risk that data is lost in translation. For nodal elements this is not an issue but for p-elements, Hcurl and Hdiv elements it may well be - so maybe this risk does not concern you.

-Peter
Roland
Posts: 230
Joined: 12 Apr 2018, 11:29
Antispam: Yes

Re: Exporting data from Elmer to Paraview

Post by Roland »

Hi,
Thanks a lot Peter for these very interesting explanations. I saw also this in one of the older forum threads and run your Guithub "BlockDomainsVtuParts" example. Now with your current complementary explanations the things are more clear. I will try this and keep you informed.
Concerning the lumped quantities, I understand your arguments. I will dig a little more in the possibilities of the SaveScalar solver. Say that, as it is best to make the graphical data analysis with Paraview, it would be more confortable to stay in paraview ( once you are in it...) also for the lumped quantities... But I understand that when you use several softwares there may be some translation problems.
Still many thanks and we keep us informed.
Roland
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Exporting data from Elmer to Paraview

Post by raback »

Hi Roland,

I have never used Paraview for line plots. I don't know how it fares there. My choices are:

0D/1D -> SaveScalars/SaveLine -> Matlab/octave
2D/3D -> VtuOutput -> Paraview

-Peter
Post Reply