Solving 2D Heat Equation w/ FEM & Galerkin Method

  • I
  • Thread starter bob012345
  • Start date
  • Tags
    2d Fem
In summary, you are solving the Laplace equation in a rectangular region with known boundary conditions. You find a solution as a sum of solutions of the two problems given, and you have conceptual issues with the second problem around the 2D element.
  • #1
bob012345
Gold Member
2,066
891
TL;DR 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

$$\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 Delta2
Physics news on Phys.org
  • #2
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 berkeman and bob012345
  • #3
wrobel said:
it is not the heat equation it is the Laplace
There are no heat sources. Only boundary edge temperature constrains.
 
  • #4
I understand. Nevertheless it is the Laplace equation.
 
  • Like
Likes bob012345
  • #5
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.
 
  • #6
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 bob012345
  • #7
oh, I have just noticed the word "FEM" that is not my field sorry
 
  • Like
Likes bob012345
  • #8
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:

1. What is the 2D heat equation?

The 2D heat equation is a mathematical model that describes how temperature changes over time in a two-dimensional space. It takes into account factors such as heat sources, thermal conductivity, and boundary conditions.

2. What is the FEM method?

The Finite Element Method (FEM) is a numerical technique used to solve differential equations, such as the 2D heat equation. It involves dividing the problem domain into smaller, simpler elements and using mathematical approximations to solve the equations for each element.

3. What is the Galerkin method?

The Galerkin method is a variation of the FEM method that uses a weighted residual approach to solve the equations for each element. This allows for a more accurate solution by taking into account the variations in the problem domain.

4. How does FEM and Galerkin method solve the 2D heat equation?

FEM and Galerkin method solve the 2D heat equation by discretizing the problem domain into smaller elements and then using mathematical approximations to solve the equations for each element. The solutions from each element are then combined to obtain a solution for the entire problem domain.

5. What are the advantages of using FEM and Galerkin method for solving the 2D heat equation?

Some advantages of using FEM and Galerkin method for solving the 2D heat equation include the ability to handle complex geometries, the ability to model various boundary conditions, and the ability to obtain accurate solutions with relatively few elements. It is also a versatile method that can be applied to a wide range of problems in engineering and science.

Similar threads

  • Differential Equations
Replies
9
Views
2K
  • Differential Equations
Replies
1
Views
668
  • Differential Equations
Replies
3
Views
2K
Replies
3
Views
794
Replies
4
Views
769
  • Differential Equations
Replies
5
Views
2K
  • Differential Equations
Replies
1
Views
772
Replies
1
Views
1K
Replies
5
Views
1K
Replies
4
Views
1K
Back
Top