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$
2
$\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$
  • $\begingroup$ Thanks! What about the boundary conditions!? $\endgroup$ – Mat Demon Nov 24 '19 at 12:18
  • $\begingroup$ The boundary conditions do not come into play for the shape functions calculation. $\endgroup$ – Loïc Nov 24 '19 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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