User:Eml5526.s11.team2.sandhu/hw7

=Problem 7.4=

Given: The Governing Equation and Boundary Conditions
Governing equation was derived in meeting 32-4.
 * $$\displaystyle Q_{1}$$:Heat flow into w throgh $$\displaystyle \partial w$$
 * $$\displaystyle Q_{2}$$:Heat generated in w by heat source.
 * $$\displaystyle Q_{3}$$:Heat in w due to change in term u.


 * {| style="width:100%" border="0"

$$  \displaystyle Q_{1}=-\int_{\partial w}\mathbf{q}\mathbf{n}d(\partial w)=\int_{w}div\mathbf{q}dw $$      (7.4.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle Q_{2}=\int_{w}f(\mathbf{x},t)dw $$      (7.4.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle Q_{3}=\int_{w}\rho c\frac{\partial u}{\partial t}dw $$      (7.4.3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle Q_{1}+Q_{2}=Q_{3} $$      (7.4.4)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \mathbf{q}=-\mathbf{K}grad(u) $$      (7.4.5)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle div(\mathbf{K}grad(u))+f=\rho c\frac{\partial u}{\partial t} $$ (7.4.6)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Boundry Conditions

 * {| style="width:100%" border="0"

$$  \displaystyle u(\mathbf{x},t)]_{\Gamma _{g}}=g(\mathbf{x},t) $$      (7.4.7)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle (q.n)]_{\Gamma _{h}}=h(\mathbf{x},t) $$      (7.4.8)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle (q.n)]_{\Gamma _{H}}=H(u-u_{\infty }) $$      (7.4.9)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

WRF

 * {| style="width:100%" border="0"

$$  \displaystyle \int_{\Omega }w[div(Kgrad(u))+f-\rho c\frac{\partial u}{\partial t}]d\Omega =0 $$      (7.4.10)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle\begin{align} K=  & \int_{\Omega }wdiv(Kgrad(u))d\Omega =\frac{\partial }{\partial x_{i}}(K_{ij}\frac{\partial u}{\partial x_{j}})\\ & \int_{\Omega }n_{i}wK_{ij}\frac{\partial u}{\partial x_{j}}d(\partial\Omega)-\int_{\Omega }\frac{\partial w}{\partial x_{i}}K_{ij}\frac{\partial u}{\partial x_{j}}d(\Omega) \end{align} $$      (7.4.11)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle K=-\int_{\Gamma _{g}}wnqd\Gamma _{g}-\int_{\Gamma _{h}}wnqd\Gamma _{h}-\int_{\Gamma _{H}}wnqd\Gamma _{H}+\int_{\Omega }grad(w).K.grad(u)d\Omega $$      (7.4.12)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

We deliberately chose w i.e. i vanishes on essential boundry. So the first term vanishes too. In the first term we have unknown flux that we can not deal with right now. But other fluxes are defined.We can write our continuous form of components as:


 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{m}(w,u)=\int_{\Omega}w\rho c\frac{\partial u}{\partial t}d\Omega $$      (7.4.13)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{k} (w,u)=\int_{\Omega}grad(w)Kdiv(u)d\Omega+\int_{\Gamma_{H}}wHud\Gamma_{H} $$      (7.4.14)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{f}(w,u)=\int_{\Omega}wfd\Omega-\int_{\Gamma_{h}}whd\Gamma_{h}+\int_{\Gamma_{H}}wHu_{\infty }d\Gamma_{H} $$      (7.4.15)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

!Note this time f depeneds on both w and u.

Discrete WF

 * {| style="width:100%" border="0"

$$  \displaystyle w^{app}=\sum_{I=1}^{n}N(x,y)_{I}c_{I} $$      (7.4.16)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle u^{app}=\sum_{J=1}^{n}N(x,y)_{J}d_{J} $$      (7.4.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle grad(u)=grad(N(x,y)_{I})d_{I}=B(x,y)_{I}d_{I} $$      (7.4.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{m}(w,u)+\tilde{k}(w,u)=\tilde{f}(w,u) $$      (7.4.19) Now lets substitute everything in the equation above.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \sum_{I=1}^{n}c^{T}\left [\sum_{J=1}^{n}\left \{ \int_{\Omega }\rho cN_{I}N_{J}d_{I}^{s}d\Omega+\int_{\Omega}B_{I}KB_{J}d_{I}d\Omega -\int_{\Omega}N_{I}fd\Omega+\int_{\Gamma_{h}}N_{I}hd\Gamma_{h}+\int_{\Omega}N_{I}N_{J}(\Gamma_{H})H(d(\Gamma_{H})-d_{\infty })\right \} \right ]=0 $$      (7.4.20)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{\mathbf{d}}=\begin{bmatrix} \bar{de}\\ df
 * style="width:95%" |
 * style="width:95%" |

\end{bmatrix} $$     (7.4.21)
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{\mathbf{w}}=\begin{bmatrix} 0\\ wf
 * style="width:95%" |
 * style="width:95%" |

\end{bmatrix} $$     (7.4.22)
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{\mathbf{K}}=\begin{bmatrix} K_{E} &K_{EF} \\ K_{EF}^{T} & K_{F} \end{bmatrix} $$     (7.4.23)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Example of calculation of elements of K & M matrices when only one node lie on essential boundary.
 * {| style="width:100%" border="0"

$$  \displaystyle\begin{align} & K_{E}=\int_{\Omega }B_{1}.K.B_{1}d\Omega+\int\limits_ {{N_1}H{N_1}d{\Gamma _H}} &\\ & K_{EF}=\int_{\Omega }B_{1}.K.B_{J}d\Omega+\int\limits_ {{N_1}H{N_j}d{\Gamma _H}} & J=2,n\\ & K_{FF}=\int_{\Omega }B_{I}.K.B_{J}d\Omega+\int\limits_ {{N_i}H{N_j}d{\Gamma _H}} & I,J=2,n
 * style="width:95%" |
 * style="width:95%" |

\end{align} $$     (7.4.24)
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \tilde{\mathbf{M}}=\begin{bmatrix} M_{E} &M_{EF} \\ M_{EF}^{T} & M_{F} \end{bmatrix} $$     (7.4.25)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle\begin{align} & M_{E}=\int_{\Omega }N_{1}\rho cN_{1}d\Omega&\\ & M_{EF}=\int_{\Omega }N_{1}\rho cN_{J}d\Omega& j=2,n\\ & M_{FF}=\int_{\Omega }N_{I}\rho cN_{J}d\Omega& i,j=2,n
 * style="width:95%" |
 * style="width:95%" |

\end{align} $$     (7.4.26)
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$ \underline {\tilde c} = \left[ {\begin{array}{ccccccccccccccc} {\underline } \\ \hline \end{array}} \right] $$     (7.4.27)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \underline {\tilde c} = \left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right] $$     (7.4.28)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Structure of d matrix
 * {| style="width:100%" border="0"

$$  \displaystyle \underline {\tilde d} = \left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right] $$     (7.4.29)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Structure of K matrix for this type of problem
 * {| style="width:100%" border="0"

$$  \displaystyle {\left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right]_{_{1 \times \tilde n}}}^T{\left[ {\begin{array}{ccccccccccccccc} &\vline & && \\ \hline &\vline & && \\ &\vline & && \\ &\vline & && \end{array}} \right]_{\tilde n \times \tilde n}}{\left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right]_{_{\tilde n \times 1}}}+{\left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right]_{_{1 \times \tilde n}}}^T{\left[ {\begin{array}{ccccccccccccccc} {}&\vline & {}&{}&{} \\ \hline {}&\vline & {}&{}&{} \\ {}&\vline & {}&{\underline K _{HH}^H}&{} \\ {}&\vline & {}&{}&{} \end{array}} \right]_{\tilde n \times \tilde n}}{\left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right]_{_{\tilde n \times 1}}} $$     (7.4.30)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Components of force matrix
 * {| style="width:100%" border="0"

$$  \displaystyle {\left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right]_{_{1 \times \tilde n}}}^T\left[ {\begin{array}{ccccccccccccccc} {\underline F _E^f} \\ \hline {\underline F _h^f} \\ {\underline F _H^f} \\ {\underline F _R^f} \end{array}} \right] + {\left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right]_{_{1 \times \tilde n}}}^T\left[ {\begin{array}{ccccccccccccccc} {} \\ \hline {\underline F _h^h} \\ {} \\  {} \end{array}} \right] + {\left[ {\begin{array}{ccccccccccccccc} \\ \hline \\   \\ \end{array}} \right]_{_{1 \times \tilde n}}}^T\left[ {\begin{array}{ccccccccccccccc} {} \\ \hline {} \\  {\underline F _H^H} \\ {} \end{array}} \right] $$     (7.4.31)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \begin{matrix} d & Matrix \end{matrix} $$
 * style="width:95%" |
 * style="width:95%" |
 * }




 * {| style="width:100%" border="0"

$$  \displaystyle \begin{matrix} Temperature & Contours \end{matrix} $$
 * style="width:95%" |
 * style="width:95%" |
 * }



=Problem 7.1: Two Dimensional Lagrange Interpolation Basis Function Problem=

Given: The Following 2D Data Set
Given the data set provided below.

Domain: Bi-Unit Square
1) The following domain information $$ \Omega = \bar \omega  = \square $$ which is for a bi-unit square

Equation: PDE, K, f, and Initial Condition
2) The partial differential equation of the form $$ \displaystyle \operatorname{div} \left ( K  \cdot \nabla{u} \right ) + f = \rho c\frac $$ 2.a) $$  {K}= {I}=I_n = \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{bmatrix} $$

Find: 2-D Lagrange Interpolation Basis Functions (LIBF), Linear Lagrange Interpolation Basis Functions(LLEBF) and Solve the PDE for $$ m = n = 2,4,6,8 $$
Use 2-dimensional Lagrange Interpolation Basis Functions (LIBF) and Linear Lagrange Interpolation Basis Functions(LLEBF) with $$ \displaystyle m = n = 2,4,6,8 $$ nodes per element to solve the data set above. Ensure the accuracy of the approximate solution $$ \displaystyle u^h(x = 0, y = 0) = 10^{-6} $$ at the center of the element $$ \displaystyle (x,y) = (0,0) $$

1. Static case (steady state) $$f\left(\boldsymbol{x} \right)=1$$ in $$\Omega =\square $$

1.(a) using 2D LIBF.

1(b). 2D LLEBF

1b1). uniform mesh

1b2). non-uniform mesh

2. Dynamic Case(Transient)

$$\rho c=3$$

initial condition: $$u\left( x,t=0 \right)=xy$$, $$\forall x\in \Omega $$

2(a). using 2D LIBF.

$$f\left(\boldsymbol{x},t \right)=0$$, $$\forall \boldsymbol{x}\in \Omega $$, $$\forall t>0$$

$$g\left( \boldsymbol{x},t \right)=2$$ on $${{\Gamma }_{g}}=\partial \Omega $$

2(b).$$f\left( \boldsymbol{x},t \right)=1$$, $$\forall \boldsymbol{x}\in \Omega $$, $$\forall t>0$$

$$g\left( \boldsymbol{x},t \right)=2$$ on $${{\Gamma }_{g}}=\partial \Omega $$

2b1) 2D LIBF

2b2) 2D LLEBF

2b2a) uniform mesh

2b2a) non uniform mesh

Solution
The 2-D LIBF can be defined as in (6.5.1)

Where $$ \displaystyle L_{i,m}(x) $$ and  $$ \displaystyle L_{j,n}(y) $$ represent Lagrange Interpolation Basis Functions

For LLEBF we will have only four basis function for each element, which can be constructed from the coordinates of that particular element in the same way as LIBF are constructed.