Showing posts with label heat equations. Show all posts
Showing posts with label heat equations. Show all posts

Tuesday, February 7, 2017

Finite Element Methods on Surfaces

In this post, we return to one of the roots of Nested Tori, namely, visualization of problems solved using finite element methods. There's quite a few projects that I worked on for that PhD, whose scattered results have not managed to make it on here today, concerning curved domains. For some topics we have covered, see posts with the tag finite element methods. These include, e.g., basic diffusion in planar domains, wave equations in planar domains using symplectic methods, and electromagnetic wave simulation using vector finite elements. These posts will be a useful preview of today's post.

Our first two examples concern heat diffusion on evolving surfaces with two interesting topologies: the sphere and the torus. The evolution is fairly simple: rotation about an axis. The heat source remains fixed in the surrounding 3D space, and focuses on a fixed (in the ambient space) spot on the sphere; the rotation carries the heat away and it spreads throughout the sphere (or torus).




Next, we consider a case where the solution can't be effected by an obvious or simple change of coordinates (i.e. in the terminology of fluids and continuum mechanics, switching from Eulerian to Lagarangian coordinates): heat on a bouncing sphere that stretches and shrinks vertically. Here the heat source builds with time and cuts off midway to just let the heat spread:


The implementation of all of these cases are via surface finite elements in the Eulerian description: the surface is considered a material that moves through space, but the spatial coordinates are fixed.

Our last example is a wave equation on a sphere, using surface finite elements and symplectic methods. The oscillating quantity $u$ is depicted as displacement along the normal direction of a sphere (so that, for example, if $u$ has some small positive value at one point and decreases rapidly to 0 as you move away, it looks like a small lump over that point). The initial condition is a ruffly structure (with speed 0), and we just let it go.
Enjoy!

Thursday, October 25, 2012

Fun with FEniCS

Today's entry is also inspired by another talk. We had Anders Logg of Simula Research and one of the developers at The FEniCS Project come by, all the way from Norway. FEniCS is one of the main pieces of software I am learning to use. Now, I started the day not thinking I would really encounter nested tori (and don't think, of course, every post is going to be about them!). But believe it or not, they made completely unexpected side entrance. I was testing out its capabilities for time evolution (simply solving the heat equation on a square with zero Dirichlet boundary conditions) and got it running with some trivial initial data. But as another interesting test run, I figured I should try some nontrivial initial data. My basic goal was to see if I could recreate this (from Wikipedia, LOL):


Now, where was I gonna get that horseshoe?

From nested tori, of course. If you slice a torus at an angle (this can easily be tested out with a good chef's knife and a bagel), you may get completely different-looking slices depending on the angle. In the plane of the bagel slice, of course, you get an annulus... the one that you spread cream cheese on. Completely perpendicular, you will get either two circle-like curves (if the knife cuts through the hole), a figure 8 (if the knife just grazes the hole), or a single oval like curve (if the knife cuts the side). Changing the angle will make any of these configurations into an annulus. For example, the two circles will "reach out to touch each other" as the angle changes, and then the other ends start wrapping around the hole. Just before those ends join, it becomes something like a letter "C" or a horseshoe (pause the movie about halfway in and look at the red):



Anyway, supplying the initial data as 1 inside the horseshoe and 0 outside (the interpolating part of the software actually enforces continuity, albeit with some very steep slopes), we get this:


Now just how exactly did I determine what was "inside" the horseshoe and "outside" it? I used level sets. That's where the nested tori come in. But I will have to leave my dear readers in suspense, and tell you about it in another entry. But this has been quite an adventure!