summaryrefslogtreecommitdiff
path: root/tutorials/module_3/6_pde.md
blob: 95d63c4c615c6aa7fade9fab4689d917b547c8ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Partial Differential Equation
Partial differential equations are defines when two or more partial derivatives are present in an equation. Due to the widespread application in engineering, we will be looking at **second-order equations** which can be expressed in the following general form:
$$
A\frac{\partial^2u}{\partial x^2} + 
B\frac{\partial^2u}{\partial x \partial y} +
C\frac{\partial^2u}{\partial y^2} +
D 
= 0
$$

where $A$, $B$ and $C$ are functions of both $x$ and $y$. $D$ is a a function of $x$, $y$, $u$, $\partial u / \partial x$, and $\partial u / \partial y$. Similar to our beloved quadratic formula, we can take the discriminant of the equation
$$
\Delta = B^2 - 4 AC
$$
Based on the discriminant we can categorize the equations into the following three categories:

| $\Delta$ | Category   | Example                  |
| -------- | ---------- | ------------------------ |
| -        | Elliptical | Laplace equation         |
| 0        | Parabolic  | Heat Conduction equation |
| +        | Hyperbolic | Wave equation            |
## Finite Difference Methods
### Elliptic Equations
- Used for steady-state, boundary value problems
- Examples where fields where these equations are used are: steady-state heat conduction, electrostatics and potential flow


Description of how the Laplace equations works
$$
\frac{\partial^2T}{\partial x^2}+\frac{\partial^2T}{\partial y^2}=0
$$

Finite-different solutions
- Laplacian Difference equations in dimension $x$ and $y$:
$$
\frac{\partial^2T}{\partial x^2}= \frac{T_{i+1,j}-2T_{i,j}+T_{i-1,j}}{\Delta x^2}
$$
$$
\frac{\partial^2T}{\partial y^2}= \frac{T_{i+1,j}-2T_{i,j}+T_{i-1,j}}{\Delta y^2}
$$

Boundary Conditions


Control-Volume approach
<img 
    style="display: block; 
           margin-left: auto;
           margin-right: auto;
           width: 50%;"
    src="control_volume_approach.png" 
    alt="Two Different perspsectives for developing approximate solutions of PDE: (a) finite-difference or node and (b) control-volume based">
Computer Algorithms

### Parabolic Equations
- Used for unstead-state, initial + boundary conditions problems
For parabolic PDE equations we also consider the change in time as well as space.

Heat-conduction equation
Explanation of heat equation
$$
k\frac{\partial^2T}{\partial x^2}=\frac{\partial T}{\partial t}
$$

Explicit methods

Forward-time central-space
	based on forward euler method and central difference in space. 
	
Simple Implicit methods
Crank-Nicolson
ADI


### Hyperbolic Equations
MacCormack Method
In computational fluid dynamics (CFD), the governing equations are the Navier-Stokes equations. For inviscid (no viscosity) compressible flow, these reduce to the Euler equations:
$$
\frac{\partial u}{\partial t}+\frac{\partial f(u)}{\partial x} = 0
$$
where, $U$ is conserved variables. This equation is a hyperbolic PDE.

Discretize domain: space and time



Write fluxes: 


MacCormack Algorithm
- Predictor
$$
u^p_i = u^n_i - \frac{\Delta t}{\Delta x}(f^n_{i+1}-f^n_i)
$$
- Corrector
$$
u^{p+1}_i = \frac{1}{2}(u^n_i+u^p_i) - \frac{\Delta t}{2\Delta x}(f^p_{i}-f^n_{i-1})
$$

Method of characteristics

## Finite-Element Method
General Approach

1. Discretization
2. Element Equations
3. Assembly
4. Boundary Conditions
5. Solutions
6. Postprocessing
### One-dimensional analysis

### Two-dimensional Analysis

















# Problem 1: Finite-Element Solution of a Series of Springs

Problem 32.4 from Numerical Methods for Engineers 7th Edition Steven C. Chapra and Raymond P. Canale

A series of interconnected strings are connected to a fixed wall where the other is subject to a constant force F. Using the step-by-step procedure from above, determine the displacement of the springs.






## Problem 2: Finite 

Solve the non-dimensional transient heat conduction equation in two dimensions, which represents the transient temperature distribution in an insulated plate