Solving 2D Heat Equation w/ FEM & Galerkin Method

  • Context: Undergrad 
  • Thread starter Thread starter bob012345
  • Start date Start date
  • Tags Tags
    2d Fem
Click For Summary
SUMMARY

This discussion focuses on solving the 2D Laplace equation using the Finite Element Method (FEM) and the Galerkin method. The user defines an average temperature function and corresponding weighting functions over a rectangular element with four nodes. The main issue arises during integration by parts, where the user finds that all terms cancel out, leading to confusion about the setup. The solution involves correctly evaluating the boundary conditions and the first term after integration by parts.

PREREQUISITES
  • Understanding of the 2D Laplace equation and its boundary conditions.
  • Familiarity with the Finite Element Method (FEM) and Galerkin method.
  • Knowledge of integration techniques, particularly integration by parts.
  • Basic concepts of temperature distribution in physical systems.
NEXT STEPS
  • Study the application of boundary conditions in solving the Laplace equation.
  • Learn about the derivation and application of the Galerkin method in FEM.
  • Explore integration by parts in multiple dimensions, specifically for FEM applications.
  • Investigate common pitfalls in FEM setups and how to troubleshoot them effectively.
USEFUL FOR

Mathematicians, engineers, and researchers involved in computational modeling, particularly those working with the Finite Element Method and heat transfer problems.

bob012345
Gold Member
Messages
2,308
Reaction score
1,031
TL;DR
Solving a 2D temperature problem but having an issue with the proper setup of the Galerkin method. All my terms are zero.
I want to solve the 2D heat equation

$$\frac{∂^2 {T}}{ ∂x^2} + \frac{∂^2 {T}}{ ∂y^2} = 0$$

The only boundary conditions is I will specify the edge temperatures but there are no heat sources.

So I create an average temperature function ##\tilde{T}## and weighting functions ##S_i## over a rectangular element with four nodes with i=1,2,3,4.
Screen Shot 2022-05-02 at 4.23.13 PM.png


Using numbers instead of letters for clarity I wish to solve first for the weighting functions assuming a form for my average temperature function;
$$\tilde{T} = b_1 + b_2x +b_3y +b_4xy$$

I solve for the coefficients to get my weighting functions and my average temperature function;

$$S_1 = (1 - \frac{x}{l}) (1 - \frac{y}{w})$$
$$S_2 = \frac{x}{l}(1 - \frac{y}{w})$$
$$S_3 = \frac{xy}{lw}$$
$$S_4 = \frac{y}{w}(1 - \frac{x}{l})$$

Then;
$$\tilde{T} = T^e = S_1T_1 + S_2T_2 + S_3T_3 + S_4T_4$$

Following the Galerkin method I minimize the Residual

$$\iint_A S_i R \,dA = \iint_A S_i (\frac{∂^2 \tilde{T}}{ ∂x^2} + \frac{∂^2 \tilde{T}}{ ∂y^2} )\,dA = 0$$

Now I use integration by parts to eliminate the second order derivative. This is just for the x derivative part of one of the four equations;

$$\iint_A S_i \frac{∂^2 \tilde{T}}{ ∂x^2}\,dA = \int_Y \Big[ S_i \frac{∂ \tilde{T}}{ ∂x} \Big |_{x_1}^{x_2} - \int_X \frac{∂S_i}{∂x} \frac{∂ \tilde{T}}{ ∂x} \,dX \Big] dY$$ where the index goes to 4.

My problem is when I integrate this to get my node equations all the terms go to zero. I mean the two integrals exactly cancel for each node variable. My question is this, did I set up this correctly with the integration by parts over a double integral? I used the integration of parts for the x integral then when manipulating the x derivative terms. Thanks.

EDIT: I think I found the issue. It is how to evaluate the first term after integration by parts. I was substituting the full expression for ##\frac{∂ \tilde{T}}{ ∂x}## back in when it should be evaluated as the slope at the limits of integration. I found it by revisiting my 1D reference problem. Thanks.
 
Last edited:
  • Like
Likes   Reactions: Delta2
Physics news on Phys.org
bob012345 said:
Summary: Solving a 2D temperature problem but having an issue with the proper setup of the Galerkin method. All my terms are zero.

I want to solve the 2D heat equation

∂2T∂x2+∂2T∂y2=0
it is not the heat equation it is the Laplace
 
  • Like
Likes   Reactions: berkeman and bob012345
wrobel said:
it is not the heat equation it is the Laplace
There are no heat sources. Only boundary edge temperature constrains.
 
I understand. Nevertheless it is the Laplace equation.
 
  • Like
Likes   Reactions: bob012345
wrobel said:
I understand. Nevertheless it is the Laplace equation.
I agree but can you tell me how I should include the boundary conditions? I am a bit fuzzy on that. Should there be some form of source term? Thanks.
 
To solve the Laplace equation ##\Delta u=0## in a rectangular region $$0\le x\le a,\quad 0\le y\le b$$ with known boundary conditions
$$u(x,0)=\alpha(x),\quad u(0,y)=\beta(y),\quad u(a,y)=\gamma(y),\quad u(x,b)=\psi(x)$$
you can find a solution as a sum of solutions of the following two problems
$$\Delta u_1=0,\quad u_1(x,0)=0=u_1(x,b)=0,\quad u_1(0,y)=\beta(y),\quad u_1(a,y)=\gamma(y)$$
and
$$\Delta u_2=0,\quad u_2(x,0)=\alpha(x),\quad u_2(x,b)=\psi(x),\quad u_2(0,y)=0= u_2(a,y)$$
Further
$$u_1=\sum_{k=0}^\infty v_k(x)\sin(\pi k y/b),\quad u_2=\sum_{k=0}^\infty w_k(y)\sin(\pi k x/a)$$
 
Last edited:
  • Like
Likes   Reactions: bob012345
oh, I have just noticed the word "FEM" that is not my field sorry
 
  • Like
Likes   Reactions: bob012345
I resolved how to do the calculations for this part;

$$ \int_X \frac{∂S_i}{∂x} \frac{∂ \tilde{T}}{ ∂x} \,dX dY$$

But am having conceptual issues with this part around the 2D element;
$$ \int_Y S_i \frac{∂ \tilde{T}}{ ∂x} \Big |_{x_1}^{x_2}$$

Any suggestions would be appreciated. Thanks.
 
Last edited:

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K