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

Discussion Overview

The discussion revolves around solving the 2D heat equation, specifically the Laplace equation, using the Finite Element Method (FEM) and the Galerkin method. Participants explore the setup of the problem, boundary conditions, and integration techniques relevant to the formulation.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant presents a formulation for the average temperature function and weighting functions for a rectangular element, aiming to apply the Galerkin method.
  • Another participant points out that the equation being solved is the Laplace equation rather than the heat equation, emphasizing the absence of heat sources.
  • Some participants express confusion about how to incorporate boundary conditions into their solutions, questioning whether a source term is necessary.
  • A participant discusses the integration by parts technique and its application to the double integral, noting issues with terms canceling out during the integration process.
  • Another participant shares a method for solving the Laplace equation with specified boundary conditions, suggesting a series solution approach.
  • One participant admits unfamiliarity with FEM, indicating a potential gap in understanding the method's application.
  • A later reply seeks clarification on conceptual issues related to evaluating integrals over the 2D element.

Areas of Agreement / Disagreement

There is disagreement regarding the classification of the equation being solved, with some participants asserting it is the Laplace equation while others initially refer to it as the heat equation. The discussion remains unresolved on how to properly set up the boundary conditions and the necessity of source terms.

Contextual Notes

Participants express uncertainty about the proper setup of the Galerkin method and the implications of boundary conditions. There are unresolved mathematical steps related to the integration process and the evaluation of terms in the context of the 2D element.

Who May Find This Useful

This discussion may be useful for individuals interested in numerical methods for solving partial differential equations, particularly in the context of FEM and the Galerkin method, as well as those exploring boundary value problems in mathematical physics.

bob012345
Gold Member
Messages
2,330
Reaction score
1,047
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
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K