- #1

- 1,872

- 820

- 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.

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.

$$\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.

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: