1
$\begingroup$

I works on a project where I need to compute a modal analysis of an acoustic cavity. The cavity is rigid which translates the problem to the following equation

$$\frac{\partial^2p}{\partial{}x^2}+\frac{\partial^2p}{\partial{}y^2}+k^2p=0$$

and the boundary conditions

$$\partial_xp(y=0)=0,\quad\partial_xp(y=L_y)=0,\quad\partial_yp(x=0)=0,\quad\partial_yp(x=L_x).$$

I'm trying to solve the problem with the finite element method as especially with four-noded rectangular elements. I don't how to get the shape function for this rectangular 2D mesh since we only learnt the triangular mesh in class.

Regards.

$\endgroup$

1 Answer 1

3
$\begingroup$

I think the easiest way to calculate the shape functions is to go through the Lagrange polynomials. The pressure $p$ in element $e$ reads

$$p^e(x,y)\approx\sum_{i=1}^{i=4}N_i(x,y)p_i.$$

Let's start with the shape function of the first node $N_1(x,y)$. We want to generate a function with the properties

$$N_1(x_1,y_1)=1,\qquad{}N_1(x_{i\neq{}1},y_i{\neq{}1})=0.$$

If we proceed by separation of variable we can write the shape function as

$$N_1(x,y)=\ell_x(x)\ell_y(y)$$

and then we must find two functions $\ell_x(x)$ and $\ell_y(y)$ verifying

$$\ell_x(x_1)=1,\qquad{}\ell_y(y_1)=1.$$

Using the Lagrange polynomials we get

$$\ell_x(x)=\frac{x-x_2}{x_1-x_2},\qquad\ell_y(y)=\frac{y-y_4}{y_1-y_4}$$

and finally

$$N_1(x,y)=\frac{x-x_2}{x_1-x_2}\frac{y-y_4}{y_1-y_4}=\frac{1}{\Delta{}x\Delta{}y}(x-x_2)(y-y_4).$$

Using the same approach for the other shape functions leads to \begin{align*} &N_2=-\frac{1}{\Delta{}x\Delta{}y}(x-x_1)(y-y_3),\\ &N_3=\frac{1}{\Delta{}x\Delta{}y}(x-x_4)(y-y_2),\\ &N_4=-\frac{1}{\Delta{}x\Delta{}y}(x-x_3)(y-y_1). \end{align*}

$\endgroup$
3
  • $\begingroup$ Thanks! What about the boundary conditions!? $\endgroup$
    – Mat Demon
    Commented Nov 24, 2019 at 12:18
  • $\begingroup$ The boundary conditions do not come into play for the shape functions calculation. $\endgroup$
    – user33403
    Commented Nov 24, 2019 at 12:56
  • $\begingroup$ Why isn't $l_x(x_3) = 0$ or $l_y(y_3) = 0$ for $N_1(x,y)$? Also why is $N_3(x,y) = \frac{(x_4 - x)(y - y_2)}{(x_4 - x_3)(y_3 - y_2)}$ not zero for $(x_1, y_1)$ $\endgroup$
    – Olumide
    Commented Jan 15, 2022 at 4:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.