Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions fvm_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def alpha_matrix(self):
conditions. Otherwise for a fully Neumann (or Robin) system it is equal to
the identity matrix."""
a1 = 0 if self.left_flux is None else 1
aJ = 0 if self.left_flux is None else 1
aJ = 0 if self.right_flux is None else 1
diagonals = np.ones(self.mesh.J)
diagonals[0] = a1
diagonals[-1] = aJ
Expand Down Expand Up @@ -374,7 +374,6 @@ def geo_series(n, r, min_spacing=0.01):

# Construct linear system from discretised matrices, A.x = d
A = I - k*theta*alpha*M
d = (I + k*(1-theta)*alpha*M)*w_init + beta

print "Peclet number", np.min(model.peclet_number()), np.max(model.peclet_number())
print "CFL condition", np.min(model.CFL_condition()), np.max(model.CFL_condition())
Expand Down Expand Up @@ -407,7 +406,7 @@ def geo_series(n, r, min_spacing=0.01):

for i in range(201):
#w = linalg.spsolve(A.tocsc(), M * w + s)
d = (I + k*(1-theta)*alpha*M)*w + beta
d = (I + k*(1-theta)*alpha*M)*w + beta * k
w = linalg.spsolve(A, d)

if i == 0:
Expand All @@ -423,4 +422,4 @@ def geo_series(n, r, min_spacing=0.01):