summaryrefslogtreecommitdiff
path: root/src/simple.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/simple.py')
-rw-r--r--src/simple.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/simple.py b/src/simple.py
index d524659..9a3aa31 100644
--- a/src/simple.py
+++ b/src/simple.py
@@ -115,8 +115,8 @@ class SIMPLE:
self.v_star[0][j] = 0
self.u_star[0][j] = 0
- self.u_star[self.shape[0] - 1][j] = 0
self.v_star[self.shape[0] - 1][j] = 0
+ self.u_star[self.shape[0] - 1][j] = 0
def apply_bfs_boundary(self):
'''Apply Backwards Facing Step boundary conditions'''
@@ -157,25 +157,22 @@ class SIMPLE:
self.u[i][j] = self.u_star[i][j] + self.d_e[i][j] * (self.p_prime[i][j + 1] - self.p_prime[i][j])
self.v[i][j] = self.v_star[i][j] + self.d_n[i][j] * (self.p_prime[i][j] - self.p_prime[i + 1][j])
- def apply_outflow_boundary(self):
- for i in range(self.shape[0]):
- self.u[i][self.shape[1] - 1] = self.u[i][self.shape[1] - 2]
- self.v[i][self.shape[1] - 1] = self.v[i][self.shape[1] - 2]
-
def iterate(self):
+ self.apply_sides_boundary()
self.apply_inflow_boundary()
+ self.apply_bfs_boundary()
self.solve_momentum_equations()
self.apply_sides_boundary()
+ self.apply_inflow_boundary()
self.apply_bfs_boundary()
self.correct_pressure()
self.correct_velocities()
- # self.apply_outflow_boundary()
-
- self.apply_bfs_boundary() # Is it needed?
+ def avg_error(self):
+ return np.absolute(self.b).sum()
def plot(self, normalize=False, density=1):
if self.patch: