Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jigyasa Watwani
/
growth-pattern-control
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4bb764e5
authored
Aug 24, 2022
by
Jigyasa Watwani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
need to fix bug
parent
a9ae2bdb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
euler_error/euler_error_moving_domain_diffusion_advection.py
euler_error/euler_error_moving_domain_diffusion_advection.py
View file @
4bb764e5
# moving domain diffusion advection equation
# moving domain diffusion advection equation
# boundary condition: diffusive flux at the boundaries [0,1] is zero
# boundary condition: diffusive flux at the boundaries [0,1] is zero
# initial condition c(x,0) = 1 + 0.2*cos(pi x) ; satisfies the boundary condition
# initial condition c(x,0) = 1 + 0.2*cos(pi x) ; satisfies the boundary condition
# exact solution at steady state: c(x) = c(0) e^(vx/D)
import
numpy
as
np
import
numpy
as
np
import
dolfin
as
df
import
dolfin
as
df
...
@@ -35,9 +34,10 @@ def advection_diffusion(Nx, L, Nt, tmax, v, D):
...
@@ -35,9 +34,10 @@ def advection_diffusion(Nx, L, Nt, tmax, v, D):
return
[
c
.
compute_vertex_values
(
mesh
),
x
]
return
[
c
.
compute_vertex_values
(
mesh
),
x
]
Nx
,
L
,
tmax
,
D
,
k
=
2000
,
1
,
5
,
1
,
1
Nx
,
L
,
tmax
,
D
,
k
=
2000
,
1
,
1
,
1
,
1
v
=
df
.
Expression
(
'k*x[0]'
,
k
=
k
,
degree
=
1
)
v
=
df
.
Expression
(
'k*x[0]'
,
k
=
k
,
degree
=
1
)
nt_array
=
np
.
array
([
50
,
100
,
200
,
400
,
800
,
1600
,
3200
,
6400
,
12800
])
nt_array
=
np
.
array
([
50
,
100
,
200
,
400
,
800
])
# , 1600, 3200, 6400, 12800])
dt_array
=
tmax
/
(
nt_array
-
1
)
dt_array
=
tmax
/
(
nt_array
-
1
)
error_in_c
=
np
.
zeros
(
len
(
nt_array
))
error_in_c
=
np
.
zeros
(
len
(
nt_array
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment