Interpolation of temperature between two overlapping meshes

Numerical methods and mathematical models of Elmer
Post Reply
diana.carlson
Posts: 24
Joined: 21 Oct 2009, 09:49

Interpolation of temperature between two overlapping meshes

Post by diana.carlson »

Hi there
Shown in the figure is the geometry of my problem which consists of two overlapping meshes. Appended in the figures is their respective body index and node number. I name the background mesh ‘a’ and the other one ‘b’. The conductive heat equation is the problem’s governing equation. I want to interpolate the temperature from mesh ‘a’ (body 1) to the top-left corner node (node number 131) of mesh ‘b’ (body 2). Interpolation must be done only from 3 nodes (72, 73, 82) of the mesh ‘a’ element that contains node 131. Would you please give me some help? I attached the mesh files to this post as well.
Thanks,
Diana Carlson, NY
2BoxNodes.JPG
2BoxNodes.JPG (57.84 KiB) Viewed 4549 times
2boxBodies.JPG
2boxBodies.JPG (43.97 KiB) Viewed 4549 times
Attachments
2box.rar
(1.92 KiB) Downloaded 286 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Interpolation of temperature between two overlapping meshes

Post by raback »

Hi Diana

If you want to use the automatic interpolation (as in the other topic by Martina) routines from mesh to mesh they work better if you really have two separate meshes. I know they are difficult to visualize so this was perhaps just for visualization. Of course if you do generate your own interpolation it doesn't make much difference.

Your case is somewhat peculiar and there are no existing solution. If it remains small you might use N^2 algorithms where you loop over all nodes needing interpolation and use PointInElement to check in which element they lie in. If they lie in an element with some passive nodes, you could generate your own interpolation routine where you construct a new element using only the active nodes, and interpolate the value in that element. So in your case constructing a 303 element of the 404 element with one passive node.

Still I would look for other options. Perhaps you could have a overlapping between the meshes so that the interpolation would take place where the submodel is the same as the main model. Then this problem of passive nodes would not occur.

-Peter
diana.carlson
Posts: 24
Joined: 21 Oct 2009, 09:49

Re: Interpolation of temperature between two overlapping meshes

Post by diana.carlson »

Hi peter
Actually my first problem is to require Elmer distinguish between mesh 'a' and 'b'. In other words both of meshes are defined in a single category of files (header, element, nodes, boundary) and I don't know for example how to define them as oldmesh and newmesh for InterpolateMeshToMesh. The problems you mentioned are coming then. I get headache when I think about them. I'm following the Martina case as well but still couldn't grasp anything. Jesus only knows how impatiently I'm waiting for your answers.
Thanks, Diana Carlson
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Interpolation of temperature between two overlapping meshes

Post by raback »

Each solver may have a mesh of its own which is defined by the keyword "Mesh" in the Solver section, for example

Code: Select all

Mesh = "localmesh"
While the default mesh is defined in the Simulation section, for example

Code: Select all

Mesh DB = "." "globalmesh"
Now assuming that you have two different instances of the heat equation where the Variable is named "globalTemp" and "localTemp", for example. The interpolation should be automatically called when you would have a BC something like

Code: Select all

localTemp = Equals globalTemp
The dependence would invoke the calling of "VariableGet" that automatically checks in which mesh the variable is initially computed and maps it to the mesh where the field is needed. It might be a good idea to make this kind of test among the cases. (In Martinas topic a bunch of fields are interpolated and for this purpose a small solver is used, here no user code would be needed).

When you would have solvers with different meshes the correct mesh is given in structure "Solver % Mesh".

-Peter
diana.carlson
Posts: 24
Joined: 21 Oct 2009, 09:49

Re: Interpolation of temperature between two overlapping meshes

Post by diana.carlson »

Dear Peter
I tried as many possibilities as I could have imagined but they didn't work. I think there is still something unclear for me. One of the "SIF' files I used is

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "GlobalMesh"
End

Simulation
  Coordinate System = Cartesian
  Simulation Type = Transient
  Steady State Max Iterations = 1
  Output Intervals = 1
  Timestepping Method = BDF
  BDF Order = 2
  Timestep intervals = 10
  Timestep Sizes = 0.1
  Solver Input File = case.sif
  Output File = "case.result"
  
  Post File = case.ep
End

Body 1
  Equation = 1
  Material = 1
  Initial condition = 1
End

Body 2
  Equation = 1
  Material = 1
  Initial condition = 1
End

Material 1
  Name = "Aluminium (generic)"
  Heat Conductivity = 237.0e5
  Heat Capacity = 897.0
  Density = 2700.0
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-8
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  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 = 1
  Linear System Precondition Recompute = 1
  Mesh = "LocalMesh"
End

Equation 1
  Active Solvers(1) = 1
End


Initial Condition 1
  Temperature = 0
End
! Bottom of big square
Boundary Condition 1
  Target Boundaries(1) = 1
  Temperature = 100
End
! Top of small rectangle
Boundary Condition 2
  Target Boundaries(1) = 7
  localTemp = Equals globalTemp
End
With this SIF file, the program simply ignores the globalmesh and performs all calculations on the LocalMesh as if there is no globalmesh.
I defined meshes in two separate folders naming them globalmesh and LocalMesh. My other problem is that I don't know which parts of the geometry (that I attached earlier in this post) must be defined in each of these of folders.
Thanks, Diana Carlson
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Interpolation of temperature between two overlapping meshes

Post by raback »

In revision 4333 there is now a test case "fem/tests/multimesh" related to multiple meshes. I hope that it clears some of the confusion for potential users of the feature. One thing worth noting is that the multiple meshes use the same definitions in the sif file. Hence the bodies and the boundaries should be uniquely numbered even in the union of the meshes.

-Peter
Post Reply