-
Notifications
You must be signed in to change notification settings - Fork 5
/
fluid_constants.py~
37 lines (31 loc) · 1017 Bytes
/
fluid_constants.py~
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
##########################################################
#Store fluid variables used in all the definitions
#########################################################
import numpy as np
#def fluid_constants():
#spatial grid size
#For this version of the code, M should equal N, and length should equal
#width
N = 16
M = 16
Q = M
#Mechanical variables
mu = 3.0 #dynamic viscosity
p= 2.0 #density
nu = mu/p #kinematic viscosity
stiff = 3.0 #stiffness of springs between boundary points
#Spatial variables
length = 0.4 #length of domain
width = 0.4 #width of domain
dx = length/N #absolute length of grid cell
ds = length/(2*N) #boundary step
dt = dx*dx/nu #time step
#new timing parameter values
time_final = 2.0 #total time
L = 20.0 #number of times to graph velocity and pressure
graphtime = time_final/L #graphs every dptime
vel_time = time_final/(100*20) #output forces?
time = 0
T = np.ceil(time_final/dt)
ptime = 0 #printing time
#k = 1 #keep track of frame number