FEM 2D Node Equations: Setting Up & Examples

In summary, the conversation discusses setting up the node equations for a 2D heated plate with boundary conditions. The problem is a simple 2D plate with one edge at 100C, opposite edge at 0C, and the other two edges at 75C and 50C. The equations for a 1D rod element with two nodes are shown as a reference, and the goal is to find a 2D analog using a triangular element with three nodes. The equations involve a 2D finite element basis for the test and approximate functions, and the resulting matrix equation will have a system matrix and a drive vector, with the boundary line integral becoming the drive vector and the area integral becoming the system matrix.
  • #1
bob012345
Gold Member
2,066
891
TL;DR Summary
I wish to set up the node equations for a 2D heated plate with boundary conditions.
I wish to set up the node equations for a 2D heated plate with boundary conditions. I understand how to do this in 1D but have not found a suitable example problem worked out in 2D and examples I have seen are very involved and complex. @pasmith showed me you to set up the 1D problem as follows;

##N_i## are test functions with [itex]T[/itex] approximated by ##T_1N_1(x) + T_2N_2(x)##. If so, then ##\frac{d^2T}{dx^2} + kT(x) = -f(x)##where ##f(x)## is a known source term gives ;
$$\begin{multline}
\int_{x_1}^{x_2} N_i(x)\frac{d^2T}{dx^2} + kN_i(x)T(x) + N_i(x)f(x)\,dx \\=
\left[ N_i(x)\frac{dT}{dx}\right]_{x_1}^{x_2}
+\int_{x_1}^{x_2} -\frac{dN_i}{dx}\frac{dT}{dx} + kN_i(x)T(x) + N_i(x)f(x)\,dx
\end{multline}$$which results in ;
$$\begin{multline}
\begin{pmatrix}
\int_{x_1}^{x_2} \left(\frac{dN_1}{dx}\right)^2\,dx & \int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx \\
\int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx & \int_{x_1}^{x_2} \left(\frac{dN_2}{dx}\right)^2\,dx
\end{pmatrix}
\begin{pmatrix} T_1 \\ T_2 \end{pmatrix} \\
- k\begin{pmatrix} \int_{x_1}^{x_2} N_1^2(x)\,dx & \int_{x_1}^{x_2} N_1(x)N_2(x)\,dx \\
\int_{x_1}^{x_2} N_1(x)N_2(x)\,dx & \int_{x_1}^{x_2} N_2^2(x)\,dx \end{pmatrix}
\begin{pmatrix} T_1 \\ T_2 \end{pmatrix} \\
=
\begin{pmatrix}
N_1(x_2) \frac{dT}{dx}(x_2) - N_1(x_1) \frac{dT}{dx}(x_1) \\
N_2(x_2) \frac{dT}{dx}(x_2) - N_2(x_1) \frac{dT}{dx}(x_1) \end{pmatrix} +
\begin{pmatrix}
\int_{x_1}^{x_2} N_1(x)f(x)\,dx \\
\int_{x_1}^{x_2} N_2(x)f(x)\,dx
\end{pmatrix}.\end{multline}$$

I wish to amend this for a 2D problem. My book starts with an element equation ##u(x, y) = a_0 + a_{1,1}x + a_{1,2} y## and test functions like this ##N_1 = 1/ 2Ae [(x_2 y_3 − x_3 y_2) + (y_2 − y_3)x + (x_3 − x_2)y]## but I can't seem to put things together.
 
Last edited:
Physics news on Phys.org
  • #2
Have you looked at FreeFEM++ ? The docs may give useful 2D examples and the software itself is quite nice for 2D problems.
 
  • Like
Likes bob012345
  • #3
Paul Colby said:
Have you looked at FreeFEM++ ? The docs may give useful 2D examples and the software itself is quite nice for 2D problems.
Thanks. Looks like that will be useful but I still need help figuring the element equations for my simple 2D case so I can work out a limited example by hand for teaching purposes. Basically this thing in two dimensions;
$$\begin{multline}
\int_{x_1}^{x_2} N_i(x)\frac{d^2T}{dx^2} + N_i(x)f(x)\,dx \\=
\left[ N_i(x)\frac{dT}{dx}\right]_{x_1}^{x_2}
+\int_{x_1}^{x_2} -\frac{dN_i}{dx}\frac{dT}{dx} + N_i(x)f(x)\,dx
\end{multline}$$
 
  • #4
There is no unique answer to your question. But first I would write the integral on the left as integral over the 2D domain. This will contain a ##\nabla^2 T## term. Integration by parts, see Green’s theorem, will leave you with a line integral over the boundary plus a ##\nabla N\cdot \nabla T## term. Both sides of the equation are zero. This means the boundary line integral which involves your boundary condition will become the drive vector of the ensuing matrix equation while the area integral becomes the system matrix times the vector of unknowns.

So, one must chose a 2D finite element basis for the ##N_i## and the ##T_i##. Now I notice while typing that your setting the problem up as a weak form of the heat equation. Typically people start by writing a Lagrangian form and then apply the galarkin (sp) approach.

[second thoughts] okay, the ##f(x)## term is the source or drive term in your heat flow problem. I think the line integral may vanish but I can’t tell just by staring at it.
 
Last edited:
  • Like
Likes bob012345
  • #5
Thanks, By not unique I assume you mean what hat functions and what kind of grid I choose, triangle ect. I really should have said I was starting with this;

$$\begin{multline}
\begin{pmatrix}
\int_{x_1}^{x_2} \left(\frac{dN_1}{dx}\right)^2\,dx & \int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx \\
\int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx & \int_{x_1}^{x_2} \left(\frac{dN_2}{dx}\right)^2\,dx
\end{pmatrix}
\begin{pmatrix} T_1 \\ T_2 \end{pmatrix} \\

=
\begin{pmatrix}
N_1(x_2) \frac{dT}{dx}(x_2) - N_1(x_1) \frac{dT}{dx}(x_1) \\
N_2(x_2) \frac{dT}{dx}(x_2) - N_2(x_1) \frac{dT}{dx}(x_1) \end{pmatrix} +
\begin{pmatrix}
\int_{x_1}^{x_2} N_1(x)f(x)\,dx \\
\int_{x_1}^{x_2} N_2(x)f(x)\,dx
\end{pmatrix}.\end{multline}$$
 
  • #6
This is the one dimensional problem. The surface terms ##\frac{dT}{dx}## are the heat flow at the boundary points. These are determined by the physical properties of the problem what ever that may be.

Generalization to 2 dimensions means replacing ##\frac{dT^2}{d^2x}## with ##\nabla^2T## and defining the 2D region etc. What is your problem statement?

l might add that you are subdivided the problem into just two finite elements. In general people will use more. Also you must choose the form of your 2D elements.
 
  • #7
Paul Colby said:
This is the one dimensional problem. The surface terms ##\frac{dT}{dx}## are the heat flow at the boundary points. These are determined by the physical properties of the problem what ever that may be.

Generalization to 2 dimensions means replacing ##\frac{dT^2}{d^2x}## with ##\nabla^2T## and defining the 2D region etc. What is your problem statement?

l might add that you are subdivided the problem into just two finite elements. In general people will use more. Also you must choose the form of your 2D elements.
The problem I am trying to develop as an example is a simple 2D plate with one edge 100C, opposite edge 0C, then the other edges 75C and 50C. No other heat source. I am looking at the equilibrium situation. I did it with the student using finite difference but now the student wants to see it done with the FEM. We previously did a 1D rod using FEM. The equations I showed above were the element equations for the 1D rod element with two nodes. We used 5 elements and thus assembled a stiffness matrix. I was just showing that as a reference meaning I am looking for a 2D analog. I assume if it a triangular element it will have three nodes? Thanks.
 
  • #8
Okay, let's try an approach based on minimizing a Lagrangian.

##L = \int_{x_1=0}^{x^2=1}\int_{y_1=0}^{y_2=1} \left[(\frac{\partial T}{\partial x})^2+(\frac{\partial T}{\partial y})^2\right]dxdy##

Variation of this functional yields the heat equation,

##\nabla^2 T = 0##

which is the equation you wish to solve subject to fixed temperatures on the boundary. We introduce a square grid of points or nodes on the unit square. We represent ##T##, our solution, as a sum of basis functions where each basis element is zero on all nodes but one where it is one,

## T(x,y) = \sum_k c_kN_k(x,y) + \sum_m d_m N_m(x,y)##

Clearly all we need to do is find the temperature at the interior nodes points. The temperature at all the other points are interpolated by our basis. The basis element at node, ##k=(i,j)##, is one and ramps down linearly to zero at ##(i+1,j), (i-1,j), (i,j+1), (i,j-1)##. I've split the above basis expansion into a sum over nodes interior to the region, ##c_k## which are our unknowns, and those on the boundary, ##d_m##, which are known.

If you plug ##T(x,y)## into ##L## and integrate you get a quadratic form in the ##c_k## and ##d_m##. The coefficients of this form are integrals over overlapping basis elements. Variation with respect to the ##c_k## will yield the matrix equation,

##A_{k'k}c_k = B_{k'm}d_m##

which one solves for the ##c_k##.
 
  • Like
Likes bob012345
  • #9
bob012345 said:
I assume if it a triangular element it will have three nodes? Thanks.
Well, here you have many possibilities. The elements I use in the previous post have 4 corner nodes and one central node (a pyramid). The reason for this choice is simplicity of the mesh or grid. Your problem domain is rectangular which make this choice very simple.
 
  • Like
Likes bob012345
  • #10
Schaum's outline on Finite Element Methods has some worked out 2D problems. I think it is a good starting point when writing a simple 2D FEM:
https://www.amazon.com/dp/0070087148/?tag=pfamazon01-20
There's also 'FEM in 50 lines of matlab' : https://www.math.hu-berlin.de/~cc/cc_homepage/download/1999-AJ_CC_FS-50_Lines_of_Matlab.pdf
and the online programming examples database of John Burkhardt:
https://people.sc.fsu.edu/~jburkardt/
Check for instance the matlab, python, c++ or fortran section and in the alphabetical list go to FEM2Dxxxx.
 
  • Like
Likes bob012345

1. What is FEM 2D Node Equations?

FEM 2D Node Equations, or Finite Element Method 2D Node Equations, is a numerical technique used to solve partial differential equations in two dimensions. It is commonly used in engineering and scientific fields to model and analyze physical systems.

2. How do you set up FEM 2D Node Equations?

The first step in setting up FEM 2D Node Equations is to discretize the domain into smaller elements, such as triangles or quadrilaterals. Then, the governing partial differential equations are converted into a system of algebraic equations using variational formulations. Finally, boundary conditions are applied to solve the system of equations and obtain a numerical solution.

3. What are some examples of problems that can be solved using FEM 2D Node Equations?

FEM 2D Node Equations can be used to solve a wide range of problems, including heat transfer, fluid flow, structural analysis, and electromagnetic fields. It is a versatile method that can be applied to various physical systems with complex geometries and boundary conditions.

4. What are the advantages of using FEM 2D Node Equations?

One of the main advantages of FEM 2D Node Equations is its ability to handle complex geometries and boundary conditions. It also provides a more accurate solution compared to other numerical methods, as the domain is discretized into smaller elements. Additionally, FEM 2D Node Equations can be easily extended to solve problems in three dimensions.

5. Are there any limitations to FEM 2D Node Equations?

While FEM 2D Node Equations are a powerful tool for solving partial differential equations, they do have some limitations. The accuracy of the solution depends on the number and size of the elements used, which can significantly increase the computational cost for complex problems. Additionally, FEM 2D Node Equations may not be suitable for problems with highly discontinuous solutions or singularities.

Similar threads

  • Differential Equations
Replies
7
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
671
Replies
3
Views
737
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
891
  • Special and General Relativity
Replies
4
Views
1K
Replies
3
Views
1K
Replies
3
Views
940
  • Classical Physics
Replies
0
Views
148
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
Back
Top