Heat gap boundary condition with unstructured meshes

General discussion about Elmer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Heat gap boundary condition with unstructured meshes

Post by mzenker »

Hi Peter,
raback wrote: I just put a new case on the svn: MortarPoisson2D. That might give you a clue of the possibilities.
I have tested the case, with minimal modifications. Here is the sif file for reference:

Code: Select all

! Test case for 2D nonconforming mortar elements

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "pieces"
  Include Path ""
  Results Directory ""
End
  
Simulation
  Max Output Level = 4
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady State
  Steady State Max Iterations = 1
  Output Intervals = 1
  
  Output Intervals = 0
  Post File = mortar.ep
!  Output File = case.result

  Simulation Timing = Logical True
End 

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.67e-08
  Permittivity of Vacuum = 8.8542e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

Body 1
  Target Bodies(1) = 1
  Name = "Body"
  Equation = 1
  Material = 1
  Body Force = 1
End


Solver 1
  Equation = Heat Equation
  Procedure = "HeatSolve" "HeatSolver"
  Variable = -dofs 1 Temperature
  Exec Solver = Always
  Stabilize = True
  Bubbles = False
  Lumped Mass Matrix = False
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  Nonlinear System Max Iterations = 100
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3

  Nonlinear System Relaxation Factor = 1.0  
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStabl
  Linear System Max Iterations = 5000
  Linear System Convergence Tolerance = 1.0e-8
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 20
  Linear System Precondition Recompute = 1
 
  Optimize Bandwidth = False

  Apply Mortar BCs = Logical True
  Export Lagrange Multiplier = Logical True

!  No Explicit Constrained Matrix = Logical True

  Linear System Timing = Logical True
  Solver Timing = Logical True
  Linear System Timing Cumulative = Logical True
  Solver Timing Cumulative = Logical True
End

Solver 2
! Settings mainly for timing and verification
  Exec Solver = never

  Equation = SaveScalars
  Procedure = "SaveData" "SaveScalars"

  Filename = scalars.dat

  Variable 1 = Temperature
  Operator 1 = dofs
  Operator 2 = partitions
  Operator 3 = min
  Operator 4 = max
  Operator 5 = norm
  Operator 6 = cpu time
  Operator 7 = wall time

!  File Append = Logical True

! Reduce just to one file when parallel
  Parallel Reduce = Logical True
  Default Parallel Operator = String max
  Parallel Operator 1 = String sum
End 

Solver 3
  Exec Solver = after simulation
  Equation = VtuOutput
  Procedure = "ResultOutputSolve" "ResultOutputSolver"
  Output File Name = case
  Vtu Format = Logical True
  Single Precision = Logical True
End 

Equation 1
  Name = "Heat"
  Active Solvers(1) = 1
End

Material 1
  Name = "Ideal"
  Heat Conductivity = 1
  Heat Capacity = 1
  Density = 1
End

Body Force 1
  Name = "Heating"
  Heat Source = 1.0

  Mesh Translate 1 = -4.0
End


Boundary Condition 1
  Target Boundaries(5) = 1 4 5 9 10 
  Name = "Cold"
  Temperature = 0
End

Boundary Condition 2
  Target Boundaries(3) = 3 7 11
  Name = "Adiabatic"
End

Boundary Condition 3
  Target Boundaries(1) = 2
  Name = "Mortar Left Master"
  Mortar BC = Integer 4 
End

Boundary Condition 4
  Target Boundaries(1) = 8
  Name = "Mortar Left Target"  
End

Boundary Condition 5
  Target Boundaries(1) = 6
  Name = "Mortar Right Master"
  Mortar BC = Integer 6 
End

Boundary Condition 6
  Target Boundaries(1) = 12
  Name = "Mortar Right Target"  
End


$fprintf( stderr, "TEST CASE 1\n")$
RUN
$fprintf( stderr,"END TEST CASE 1: Target NRM=0.45853175\n");
This is what I get:

[img]result.png[/img]

I must say I do not fully understand what the case is supposed to do.
As far as I understand, we have a body with two duplicated internal boundaries which is supposed to be heated by a volumetric heat source. I don't understand what the "Mesh translate" in the Body Force is supposed to do.

In the temperature distribution, I see that only the segment in the middle gets heated. Is that the expected result?

Thank you for some additional explanations...

Matthias
Attachments
result.png
(43.17 KiB) Not downloaded yet
Last edited by mzenker on 07 Nov 2013, 18:05, edited 1 time in total.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Heat gap boundary condition with unstructured meshes

Post by raback »

Hi

This is fairly new developments it requires quite a fresh solver. The mesh rotation was something left from the previous sif. You should get roughly the same temperature as with the reference case as seen in the attached picture.

-Peter
Attachments
Mortar Poisson example with nonconforming meshes
Mortar Poisson example with nonconforming meshes
MortarPoissonExample.png (60.49 KiB) Viewed 7883 times
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Heat gap boundary condition with unstructured meshes

Post by mzenker »

Hi Peter,

with a fresh binary, I can reproduce your picture. :)
So I understand that we now can have heat flowing through two geometrically identical boundaries with nonconformal meshes.

Some questions:

1. Does this also work with other solvers, in particular the Static Current Solver?
2. Would it work if it was three bodies with different numbers?
3. Would it work with curved interfaces?
4. Would it work in 3D?
5. Would it work if there was only partial overlap of the boundaries?

If you can put "Yes" to questions 1 to 4, this would really be a big step forwards.
"Yes" to question 4 would simply be great, and save me a huge amount of work!

Thank you,

Matthias

BTW how do I attach a picture so that it is displayed?
polakse
Posts: 6
Joined: 08 Oct 2013, 20:33
Antispam: Yes
Location: Colorado, USA

Re: Heat gap boundary condition with unstructured meshes

Post by polakse »

mzenker wrote: 1. Does this also work with other solvers, in particular the Static Current Solver?
2. Would it work if it was three bodies with different numbers?
3. Would it work with curved interfaces?
4. Would it work in 3D?
5. Would it work if there was only partial overlap of the boundaries?
Good questions - I'm curious about all these aspects too!
mzenker wrote: BTW how do I attach a picture so that it is displayed?
Use the "Img" button on the toolbar above where you are typing your post. It will insert

Code: Select all

[img][/img]
tags. Just paste a URL of the image you want to display within these tags.

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

Re: Heat gap boundary condition with unstructured meshes

Post by raback »

Hi Matthias
mzenker wrote: 1. Does this also work with other solvers, in particular the Static Current Solver?
2. Would it work if it was three bodies with different numbers?
3. Would it work with curved interfaces?
4. Would it work in 3D?
5. Would it work if there was only partial overlap of the boundaries?
1. It should work with all modern or modernized solvers using DefUtils for the strategic steps. I think it should work for StatCurrentSolver. Just add the flag to the solver section.
2. You need to have BC-BC correspondence. Body numbering is not relevant.
3. Basically yes, there could be problems in finding the corresponding element for given node.
4. Yes.
5. I would think so, you just need to have the correct BC the smaller one. I don't by heart remember which one.

Even though this looks good on paper there is a caveat. The resulting linear system may be much more difficult to solve than the original one. Also other problems are possible as this is really quite fresh development. Now basically almost similar functionality has been available with the periodic boundary conditions with zero translation. This is just more versatile as it may also be used for dynamical cases and the projector is more advanced allowing even edge elements to be used (AV Solver).

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

Re: Heat gap boundary condition with unstructured meshes

Post by mzenker »

Hi Scott,

thanks for your reply, but ....
polakse wrote:
mzenker wrote: BTW how do I attach a picture so that it is displayed?
Use the "Img" button on the toolbar above where you are typing your post. It will insert

Code: Select all

[img][/img]
tags. Just paste a URL of the image you want to display within these tags.
I knew that - but how do I display an ATTACHED picture (i.e. a picture which I uploaded to the forum)?
See here for an example.

Matthias
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Re: Heat gap boundary condition with unstructured meshes

Post by Takala »

polakse wrote:
Takala wrote: I didnt quite understand why this happens. Could you share a geometry where this can be reproduced? For example a salome hdf file. Maybe it just need some small adjustment.
Eelis
Sure. A Salome .hdf file is attached. Thanks for the help.
Scott
As I thought: maybe the problem was that you tried to apply the heat gap boundary to the square that overlaps the cylinder face. I defined a new boundary geometry group in salome that doesn't do that. Very easy to do. See the attached example. I didn't try it, but this should work.

Moreover, why don't you define all of your boundary groups in salome? You only seem to define the bodies...

Cheers,

Eelis
Attachments
testCHT_heatgap_group.hdf.zip
(54.97 KiB) Downloaded 338 times
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Heat gap boundary condition with unstructured meshes

Post by mzenker »

Hi Peter,

thank you for clarifying! So in principle this could be very useful. But...
raback wrote: Even though this looks good on paper there is a caveat. The resulting linear system may be much more difficult to solve than the original one. Also other problems are possible as this is really quite fresh development.
(...)
I see. So it might not be a good idea to use this feature in computationally expensive simulations, which is often the case in 3D.

I thought that the problem of nonconformal meshes at body interfaces could elegantly be solved that way. But apart from the caveats mentioned above, I (re-)discovered that it is often not possible to generate the 3D mesh (e.g. in gmsh) as long as the interface mesh is not conformal. So the solution is still needed at the meshing tool level.

But anyway it is good to know that the mortar FE machinery exists.

Matthias
polakse
Posts: 6
Joined: 08 Oct 2013, 20:33
Antispam: Yes
Location: Colorado, USA

Re: Heat gap boundary condition with unstructured meshes

Post by polakse »

Eelis, thanks for your help. I'm intrigued by your suggestions, but I'm also pretty lost. As far as I can tell, the only difference in the example Salome .hdf you sent me and the one I provided is that you defined a face group for the circular face shared between the cylinder and the square bodies - is that correct?
Takala wrote: Moreover, why don't you define all of your boundary groups in salome? You only seem to define the bodies...
I didn't know there was some functionality to be gained by defining the surface boundaries as well. I was following this wiki page, which describes the process of using Salome to create multi-body meshes for Elmer. However, there's one difference I'm noticing between my model and the process described in that wiki... If I run "elmergrid 8 2 mesh.unv -autoclean" on the .unv output from Salome, and then load that mesh into Elmer, the entire outer shell of the model still shows up as a single surface. I have to run the "divide surface" command from the Elmer GUI to break up these surfaces. That occurs regardless of whether I use my original Salome model, or the version you have provided to me. After I "divide surfaces" (with either your mesh or mine), I end up with two separate volumes, and the circular shared face between the two volumes. This circular shared face (#4 for the example model I've provided) is the one I have been trying to perform the command "elmergrid 2 2 mesh -discont 4" on. In the aforementioned wiki tutorial, I got the impression that using the "divide surfaces" utility was only necessary if loading the .unv mesh directly into the GUI. For me, that does not seem to be the case. Perhaps I'm doing something wrong with the export from Salome?

Regardless, Peter's comments a few posts back make it sound like the heat gap discontinuity will only work on a boundary that is defined within a single body/material. That won't help me, because I have different materials on either side of the "heat gap" interface.

I apologize for my ignorance. Thanks for your help!
Scott
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Re: Heat gap boundary condition with unstructured meshes

Post by Takala »

Sorry, misunderstood Peter's post. Also, in the HeatGap example there seem to be a contact between two bodies (Why is this, Peter?).

In Salome, there are several techniques that might give you the correct mesh for this. However, I'm not 100% sure what is needed for the heat gap. As I understand it, there needs to be two bodies that both contain the same contact boundary. Both of these contact boundaries should be in the same geometry group. Is this enough, I don't know. But I do know that Peter can answer that question. Let's assume it is enough: then you could do a compound mesh that has a projection rule between the surfaces that are in contact (you need to tool in the contact surface in both bodies. Then you just create a geometry group that contain both of these surfaces.

But let's wait for Peter's answer since I'm not an expert on ElmerGrid and heat gap stuff.

Cheers,

Eelis
Post Reply