Elmer heat transfer solver difficulty

Numerical methods and mathematical models of Elmer
mcterry
Posts: 10
Joined: 04 Mar 2018, 01:05
Antispam: Yes

Elmer heat transfer solver difficulty

Post by mcterry »

While I CAN successfully run the tutorial simulation TemperatureFieldOfSolidObject, I have not yet been able to get my own simulations in Windows 10 to run successfully. I am using GMSH to successfully build and mesh 3D structures. I can import the meshes into Elmer and build .sif files, both with the Elmer GUI and manually. I have done both very simple and more complex 3D structures. So far, all of my simulations for output temperatures seem to diverge.
I attach copies of the 'Solver log' for both the successful run of TemperatureFieldOfSolidObject (called 'Solver log_good.txt') and an example of one of my failed runs of my own model ('Solver log_1.txt'). Examining and comparing these, I identify a few lines that are different surrounding the HeatSolve portion of the logs. It is helpful to open each of these files with Notepad++, for example, so that line numbers can be identified, The four suspicious lines that I see in 'Solver log_1.txt' are lines numbers 45-46 with calls to SingleSolver and lines 57-58 with calls to DefUtils::DefaultDirichletBCs:.
Since the HeatSolver in my runs appears to be diverging, I became suspicious that my naming of Dirichlet boundary conditions (i.e., a fixed temperature) on one or more of the external mesh boundaries is not being properly input or recognized.
I have checked my .sif files against the successful tutorials' .sif files many times, and I have been unable to identify any issue. (I HAVE encountered the often-reported interaction of the Elmer GUI with input files. While this is an inconvenience, I believe that I have found ways to overcome that issue with frequent re-editing.)
I have also experimented using Body Force heat load inputs of both simple constant values as well as .dll executables from my own custom Fortran 90 routines.
In my experience of using GMSH, I have noted the differences in generation of the Elmer input file 'mesh.boundary' that can result from using either the Elmer GUI, or the program ElmerGrid. I have done several experiments to see if that is a source of possible boundary condition difficulties, but to date I cannot isolate the source of my difficulty in this area.
If someone can identify other clues of problems from my log file, or if you have had any similar problems, I would very much appreciate learning about it. I am eager to have a successful path from GMSH through Elmer that produces good physics! Thank you.
Attachments
Solver log_1.txt
My run that diverges
(20.25 KiB) Downloaded 282 times
Solver log_good.txt
From the Elmer tutorial
(5.93 KiB) Downloaded 286 times
mcterry
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer heat transfer solver difficulty

Post by mzenker »

Hi,

first, it is always a good idea to post the sif file so someone can have a look at it.
In your log file, I see that you seem to do coordinate scaling with a factor of 1.0e-9, i.e. your structures seem to be in the nm range. Is that on purpose?

HTH,

Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmer heat transfer solver difficulty

Post by raback »

Hi

Have you defined the level of the heat equation either by having Dirichlet or Robin conditions? Otherwise there might not be uniquely defined solution that leads to gradual divergence even for simple problems.

-Peter
mcterry
Posts: 10
Joined: 04 Mar 2018, 01:05
Antispam: Yes

Re: Elmer heat transfer solver difficulty

Post by mcterry »

Matthias and Peter,

Thank you for the suggestions. The coordinate scaling to the nm level IS intentional. My Body Force heat load is chosen accordingly. [My understanding is that for heat transfer in Elmer, the Body Force in SI units should be in W/Kg (rather than the perhaps more conventional W/m^3). Therefore, I divide a volumetric value [W/m^3] by the corresponding material density [Kg/m^3] to get the input value in W/Kg.]
I attach both a copy of my .sif and an image of the very simple model I am trying to get to run. This model is a stack of two rectangular prisms. Body 1 is the prism shown in red at the top and this body has the uniform heat load. Peter, my intended Dirichlet boundary condition is to set the rectangular (actually square, shown in red) bottom face of Body 2 (aqua color) to a temperature (rise) of zero. The way I have posed this simple problem seems to me conceptually very similar to the Elmer tutorial example TemperatureFieldOfSolidObject. I did not specify conditions (Dirichlet or Neumann) on the remaining outer boundaries of this model. I hope that this is all right. The solution I expect to see would have a distribution of positive temperature rise from the heated Body 1 down to the constrained bottom face of Body 2 whose T rise is clamped to zero.
Attachments
model geometry
model geometry
simple prism model.png (29.42 KiB) Viewed 6077 times
case_sif_debug.pdf
read-only .sif
(40.21 KiB) Downloaded 299 times
mcterry
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Elmer heat transfer solver difficulty

Post by raback »

Hi

You have pretty rough preconditioner. Try to use ILU2, for example.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer heat transfer solver difficulty

Post by mzenker »

Hi,

just a thought: is your mesh conformal at the interface between the two prisms?

Matthias
mcterry
Posts: 10
Joined: 04 Mar 2018, 01:05
Antispam: Yes

Re: Elmer heat transfer solver difficulty

Post by mcterry »

In an effort to establish a successful path GMSH --> Elmer --> "good physics", I have continued simplifying my model. I have not been successful in reworking the simple 3D model I reported above. I examined my mesh to try to determine if it is non-conformal, and trying clean-up steps has not helped. I also tried using preconditioners ILUn with n=0,1,2,....,8 and I increased the limiting number of non-linear solver iterations from 20 up to 50. I am still seeing a diverging solution process and temperature output that does not make sense.
Now I set up a simpler steady-state heat conduction problem in 2D. The whole Elmer problem directory is attached - it is quite small. This is a simple rectangular strip consisting of three bodies, from a heat source, through a conductor, to a heat sink. The source is given a uniform Body Force heat load, and the sink has a Dirichlet temperature condition of zero. This Elmer run fails immediately without much diagnostic information.
I hope that someone can get this to run. I don't think it can get much simpler that this.
Attachments
Heatstrip.zip
.zip file of a small 2D heat conduction problem for Elmer
(10.45 KiB) Downloaded 308 times
mcterry
mcterry
Posts: 10
Joined: 04 Mar 2018, 01:05
Antispam: Yes

Re: Elmer heat transfer solver difficulty

Post by mcterry »

After a bit more experimentation, I finally did succeed in getting the heatstrip 2D model to run successfully. I post the successful .sif and temperature output images below. I have been unable to get either of the following two alternate Dirichlet boundary condition .sif commands to execute - I do not know why they do not work.
Target Coordinates(2,3) real 0. -6.2 0. 1. -6.2 0.
Target Nodes(2) 7 8
Attachments
T output.png
T output.png (13.89 KiB) Viewed 6004 times
case_sif.pdf
(40.96 KiB) Downloaded 299 times
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Elmer heat transfer solver difficulty

Post by mzenker »

Hi,

I have played a bit with your case. The Target Coordinates BC works for me, see attached sif. I have put the heat source into the gold block to see an effect. The polycarbonate has such a tiny heat conductivity that almost no heat seems to make it into the other bodies. I didn't try the Target Nodes - anyway, i wouldn't use them as the numbering may change in mesh conversion.
I have also changed the output format since I use ParaView as postprocessor.

HTH,

Matthias
Attachments
case.sif
(2.73 KiB) Downloaded 359 times
mcterry
Posts: 10
Joined: 04 Mar 2018, 01:05
Antispam: Yes

Re: Elmer heat transfer solver difficulty

Post by mcterry »

After more investigation, I have been able to isolate a difficulty I was having with 3D steady-state heat conduction simulations using GMSH --> Elmer and finally get good results. Since my problem of interest has cylindrical symmetry about the z-axis, I originally tried building my geometry by combining 3D cylinders in GMSH, along with using Boolean operations. And sometimes I used a combination of stacked cylinders, along with cylindrical extrusion (through 2*pi radians) of planar objects built up from GMSH primitives. But my meshes from these geometries always seemed to have some internal non-conformality as evidenced by a failure of heat to conduct across internal Body interfaces in Elmer. This occurred even though I did not encounter meshing errors from GMSH.
My next step was to go back to successful 2D heat conduction runs using GMSH --> Elmer when I built 2D geometries by linear extrusion of lines, I then tried the analogous approach with 3D cylindrical models. That is, I built a planar "slice" of my final 3D structure in the x-z plane using points, lines, and surfaces in GMSH, and then extruded the slice through 2*pi radians about the z-axis to get my final 3D structure. Then, after meshing and porting to Elmer, I was always able to get a good thermal solution, and the problem with non-conducting internal Body interfaces vanished.
(From this experience, I concluded that stacking 3D geometrical structures in GMSH somehow resulted in non-conformal Body-interface meshes. Personally, I have been unable to clean up meshes built this way using BooleanFragmentation or other tools such that they would run in Elmer. So my current work-around is to build up geometries in GMSH and extrude to higher dimensions as much as possible.)
Next, I am ready to move from steady-state to transient thermal problems. In my first attempts, I am encountering a new kind of error that I will appreciate some advice about. One item of background information that may or may not be relevant is that in my successful 3D steady-state thermal calculations, I used a call to a user-defined Fortran function for Body Force (heat load) that had dependence on mesh point spatial coordinates as well as material densities. As I progress to the transient problem, I need to successfully pass the current value of model physical time to my Fortran function along with the previous time-independent variables. Since I am computing with Windows 10, I need to compile my Fortran source code into a .dll file, and I am doing this with using 'elmerf90' without compilation errors. (Thanks to the ElmerSolverManual for good guidance on how to set up communication between Fortran UDFs and Elmer.)
However, my first attempts at Elmer transient runs are resulting in an error 'Program received signal SIGSEGV: Segmentation fault - invalid memory reference.; Backtrace for this error: #0 ffffffffffffffff' in the Solver Log (attached). I do not know how to select options in my 'elmerf90' compilation to get debugging information (or whether this is even possible). I also attach a copy of my .sif for added information.
Again, I will greatly appreciate any suggestions for solving this problem.
Attachments
case_check.sif
my .sif for the transient run
(3.37 KiB) Downloaded 321 times
Solver Log_1.txt
a Solver Log file showing the reported error
(2.71 KiB) Downloaded 246 times
Post Reply