Skip to content

Commit

Permalink
implemented all the functions in the simulation.py class except the f…
Browse files Browse the repository at this point in the history
…unction to solve the transport equations.
  • Loading branch information
bhargavakula01 committed Oct 28, 2024
1 parent 8f383ba commit a139a8c
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 312 deletions.
76 changes: 0 additions & 76 deletions lib/KKdef.py

This file was deleted.

135 changes: 0 additions & 135 deletions lib/compvis.py

This file was deleted.

44 changes: 0 additions & 44 deletions lib/get_phi_test.py

This file was deleted.

37 changes: 35 additions & 2 deletions lib/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,43 @@ def setB(self, grid, rh):
return B

def transport_solver(self):
"""
-- Solving Saturation Equations --
code to compute solution of saturation,concentration and
surfactant equations by Modified Method of Characteristics
using explicit formulation (Yuan Yi-Rang 1993) and implicit finite
difference method
"""

pass

def get_gradient(self):
pass
def get_gradient(self, vn):
m = self.mesh.m
n = self.mesh.n

dx = self.mesh.dx
dy = self.mesh.dy

px = np.zeros((n+1, m+1))
py = px

for i in range(m + 2):
for j in range(n + 2):
if i != 0:
px[j, i] = (vn[j, i] - vn[j, i - 1]) / dx
if i != m:
px[j, i] = (vn[j, i + 1] - vn[j, i]) / dx
if i != 0 and i != m:
px[j, i] = (vn[j, i + 1] - vn[j, i - 1]) / (2 * dx)
if j != 0:
py[j, i] = (vn[j, i] - vn[j - 1, i]) / dy
if j != n:
py[j, i] = (vn[j + 1, i] - vn[j, i]) / dy
if j != 0 and j != n:
py[j, i] = (vn[j + 1, i] - vn[j - 1, i]) / (2 * dy)
return [px, py]



def divergence(self,F1, F2):
"""
Expand Down
25 changes: 0 additions & 25 deletions lib/surfactant_polymer_conc_initial.py

This file was deleted.

30 changes: 0 additions & 30 deletions lib/z_func_test.py

This file was deleted.

0 comments on commit a139a8c

Please sign in to comment.