-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMAC.py
More file actions
31 lines (28 loc) · 710 Bytes
/
MAC.py
File metadata and controls
31 lines (28 loc) · 710 Bytes
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
# 2D Marker and Cell Method for Solving Incompressible Flow
from pylab import *
#import matplotlib.pyplot as plt
#from scipy.optimize import fsolve
import math
def GridGeneration(xlength, yhight):
global node_x, node_y
#print("This function generate the MAC grid")
#Horizontal Length of domain in meters
#length = 0.2
#Vertical hight of domain in meters
#hight = 0.1
#grid size in x direction
dx = 0.01
#grid size in y direction
dy = 0.002
node_x = arange (0, xlength, dx)
node_y = arange (0, yhight, dy)
def main():
x = 0.2
y = 0.1
GridGeneration(x, y)
print node_x
funcz=node_x**2+1
#plt.plot(funcz)
print("The Mac grid has been generated")
if __name__ == '__main__':
main()