/
README.txt
103 lines (80 loc) · 4.53 KB
/
README.txt
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
%*****************************************************************************%
%********************************% HOLY GRAIL %*******************************%
%*****************************************************************************%
HOLY GRAIL is a collection of various fluid solvers, with built in examples.
The codes are used mostly for educational and recreational purposes.
Author: Nicholas A. Battista
Email: nickabattista@gmail.com
Date Created: 2014
Institution: University of North Carolina at Chapel Hill
Website: http://battista.web.unc.edu
GitHub: http://www.github.com/nickabattista
%*****************************************************************************%
%******************************% FLUID SOLVERS %******************************%
%*****************************************************************************%
PROJECTION:
Solves the Navier-Stokes equations in the Velocity-Pressure formulation
using a predictor-corrector projection method approach
Equations of Motion:
Du/Dt = -Nabla(u) + nu*Laplacian(u) [Conservation of Momentum]
Nabla \cdot u = 0 [Conservation of Mass]
IDEA: for each time-step
1. Compute an intermediate velocity field explicitly,
use the momentum equation, but ignore the pressure gradient term
2. Solve the Poisson problem for the pressure, whilst enforcing
that the true velocity is divergence free.
3. Projection Step: correct the intermediate velocity field to
obtain a velocity field that satisfies momentum and
incompressiblity.
PSEUDO-SPECTRAL (FFT):
Solves the Navier-Stokes equations in the Vorticity-Stream Function
formulation using a pseudo-spectral approach w/ FFT
Equations of Motion:
D (Vorticity) /Dt = nu*Laplacian(Vorticity)
Laplacian(Psi) = - Vorticity
Real Space Variables Fourier (Frequency) Space
SteamFunction: Psi StreamFunction: Psi_hat
Velocity: u = Psi_y & v = -Psi_x Velocity: u_hat ,v_hat
Vorticity: Vort Vorticity: Vort_hat
IDEA: for each time-step
1. Solve Poisson problem for Psi (in Fourier space)
2. Compute nonlinear advection term by finding u and v in real
variables by doing an inverse-FFT, compute advection, transform
back to Fourier space
3. Time-step vort_hat in frequency space using a semi-implicit
Crank-Nicholson scheme (explicit for nonlinear adv. term, implicit
for viscous term)
LATTICE-BOLTZMANN:
D2Q9 Model:
c6 c2 c5
\ | /
c3- c9 - c1
/ | \
c7 c4 c8
f_i: the probability for site vec(x) to have a particle heading in
direction i, at time t. These f_i's are called discretized probability
distribution functions
LBM IDEA:
1. At each timestep the particle densities propogate in each
direction (1-8).
2. An equivalent "equilibrium" density is found
3. Densities relax towards that state, in proportion governed by
tau (parameter related to viscosity)
CHOICE OF SIMULATION:
-> The code is setup to run a few different geometries:
a. Flow in a channel
b. Flow around a cylinder
c. Flow around a few cylinders
d. Flow through one porous layer
e. Flow through multiple porous layers
PANEL METHOD:
Solves the incompressible potential flow equations in 2D.
Assumptions for Incompressible Potential Flow
1. Inviscid
2. Incompressible div(V) = 0
3. Irrotational curl(V) = 0
4. Steady partial(u)/partial(t) = 0
What it does:
This method finds the lift and drag coefficients around an
airfoil shape, chosen by the user. It also computes the
pressure distribution over the airfoil as well.