Simulation of the heating of two moving beams

In this page, we will present a problem, a more complex version of the one solved at LBeam1.html. Suppose we want to simulate the heating of two long L-shaped pieces. The heat supplied follows the equation :e2t*sin(x+y)*cosh(x+y). A scheme of this problem is shown in figure 1.

Figure 1 : Scheme of the Problem

The heat supplied is shown as a map of isosurfaces, the blue color (lower left corner) representing the cooler temperatures, the red color (upper right corner) the higher temperature. The pieces are moving, approach until they collide, stand for a while, and then separate. This means that sometimes it is possible to integrate both pieces separately, while sometimes the calculation has to be accomplished in a single mesh.

Here you can find the OOCSMP listing. Both pieces move parallel to the X-axis. When their distance is less than a given small interval, both pieces are concatenated, otherwise, they approach or separate. The distance is computed by means of the RIGHTX and LEFTX predefined methods, that return the rightmost and leftmost X coordinate. These methods can be invoked on meshes or on domains. In OOCSMP, if a method doesn't receive parameters, it can be invoked with or without the trailing parentheses. In this way, one doesn't have to worry about whether the requested information is implemented as a method or as an attribute.

When both pieces collide, the resolution method for the first mesh has to handle the resolution of both meshes. In order to accomplish this, the method has to reconfigure its internal vectors, recalculate Jacobians, change the boundary conditions in the resulting inner borders, copy the solutions from the second mesh, etc. This is a different situation from the concatenation that occurs in the declarative section of the LPiece objects, which occurs before the solvers have been created, and the compiler knows that it has to handle the solution of both sub-meshes. This is a more efficient concatenation.

When both pieces are joined, only one STEP message has to be sent to the first mesh in order to solve the equation in the whole domain. When the meshes separate, two STEP messages have to be passed to both meshes.

After some time before the concatenation, both meshes detach. The DETACH predefined method reconfigures both solvers, changes the boundary conditions at the bond borders, etc. This situation is treated as a discrete event (handled by the FCNSW method). Blocks INSW and FCNSW are the OOCSMP discrete event handlers. They are overloaded in such a way that they can act as 'event handlers' (as in this program) or as normal OOCSMP blocks (when they appear to the right of an assignment).

Finally, we choose two graphical output forms, a graphic to show the nodes of both grids ( GRIDPLOT instruction) and another to view the solution of the PDEs ( ISOPLOT instruction) in the form of a map of isosurfaces. The latter is able to distinguish if both meshes are separated or they have been concatenated (plotting only one or both of them).

There is also a similar problem, but with static meshes

Theory pages:
Main page
FEM (i)
FEM (ii)
FDM (i)
Example pages:
1-d Heat Equation
2-d steady state Heat Equation
2-d Heat Equation
1-d non diffusive transport equation
1-d diffusive transport equation
2-d Non diffusive transport equation
Mesh generation with OOCSMP
Moving grids
Application pages:
Heating of two beams
Heating of two moving beams
Solving the equation Ut+Uxx+Uxy+Uyx=0
Solving the equation Ut+Uxx+Uxy+Uyx=0 using MGEN
Heat 1d using several outputs
Solving the Heat equation with a CA
Comparing a CA with the FEM
Gordon's sine equation

Other courses
Other pages

Last modified 22/12/99 by Juan de Lara (, need help for using this courses?.

The OOCSMP code - The SODA code