Skip to content
Snippets Groups Projects
Commit ccabe34e authored by martamestroni's avatar martamestroni
Browse files

Working with InterfaceTry.jl. It was not k, but the adaptive time stepping...

Working with InterfaceTry.jl. It was not k, but the adaptive time stepping giving stability for D>1. For now easy fix.
parent 61184537
No related branches found
No related tags found
No related merge requests found
...@@ -225,7 +225,7 @@ function solve_D(geometry,IC,AG,B,u0E,P,D_i,D_o,Δx,Δt, ...@@ -225,7 +225,7 @@ function solve_D(geometry,IC,AG,B,u0E,P,D_i,D_o,Δx,Δt,
Nb = Int((BP-L)/Δx+3); # Position of left ghost point Nb = Int((BP-L)/Δx+3); # Position of left ghost point
elseif AG=="Y" elseif AG=="Y"
if D_i<1 if D_i<1 || B=="E"
Δxi=sqrt(D_i/2*Δt) Δxi=sqrt(D_i/2*Δt)
Δxo=sqrt(D_o/2*Δt) Δxo=sqrt(D_o/2*Δt)
Ni=Int(round((BP-L)/Δxi)) Ni=Int(round((BP-L)/Δxi))
...@@ -362,6 +362,8 @@ function solve_D(geometry,IC,AG,B,u0E,P,D_i,D_o,Δx,Δt, ...@@ -362,6 +362,8 @@ function solve_D(geometry,IC,AG,B,u0E,P,D_i,D_o,Δx,Δt,
t=2*Δt t=2*Δt
i=3 i=3
#time stepping #time stepping
while t<=T while t<=T
#b(i) and A(i) #b(i) and A(i)
...@@ -371,7 +373,6 @@ function solve_D(geometry,IC,AG,B,u0E,P,D_i,D_o,Δx,Δt, ...@@ -371,7 +373,6 @@ function solve_D(geometry,IC,AG,B,u0E,P,D_i,D_o,Δx,Δt,
A=make_A(geometry,B,α_i(D_i,Δt,Δxi), α_i(D_i,Δt,Δxo), A=make_A(geometry,B,α_i(D_i,Δt,Δxi), α_i(D_i,Δt,Δxo),
Δxi, Δxo, x, D_i, D_o, length(x), Nb, P, Δxi, Δxo, x, D_i, D_o, length(x), Nb, P,
BE_t(round(Δt*(i-1),digits=length(string(Δt))-2)), k) BE_t(round(Δt*(i-1),digits=length(string(Δt))-2)), k)
# giving problems in InterfaceTry
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment