Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frap Theory
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hubatsch
Frap Theory
Commits
90c82cab
Commit
90c82cab
authored
2 years ago
by
martamestroni
Browse files
Options
Downloads
Patches
Plain Diff
calc_b working for Neumann boundary condition ("N") and experimental ("E").
parent
5d0d800c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eff_Drop.jl
+48
-16
48 additions, 16 deletions
eff_Drop.jl
with
48 additions
and
16 deletions
eff_Drop.jl
+
48
−
16
View file @
90c82cab
...
...
@@ -49,29 +49,59 @@ return Ptx
end
"""
calc_b_spherical(
c, α_i, α_o
, Nb)
calc_b_spherical(
geometry, B, c, α_i, α_o, Δxi, Δxo, x
, Nb)
Calculate b in Au=b.
# Arguments
- `u::Vec`: concentration vector
- `α::Float`: defined in solve_D
- `geometry::String`: "
1
D
" | "
3
D
"
- `B::String`: "
N
" Neumann boundaries, calc_b inside and
outside the boundary,
| "E" Experimental right boundary, calc_b from L to BP
- `c::Vec`: concentration vector
- `α_i::Float`: defined in solve_D
- `α_o::Float`: defined in solve_D
- `Δxi::Float`: x spacing inside
- `Δxo::Float`: x spacing outside
- `x::Vec`: x grid
- `Nb::Int`: index of left ghost point"""
function
calc_b
(
geometry
,
c
,
α_i
,
α_o
,
Δxi
,
Δxo
,
x
,
Nb
)
function
calc_b
(
geometry
,
B
,
c
,
α_i
,
α_o
,
Δxi
,
Δxo
,
x
,
Nb
)
b
=
zeros
(
length
(
c
))
if
geometry
==
"3D"
for
i
=
2
:
Nb
-
1
b
[
i
]
=
α_i
*
((
Δxi
/
x
[
i
]
+
1
)
*
c
[
i
+
1
]
+
(
-
Δxi
/
x
[
i
]
+
1
)
*
c
[
i
-
1
])
+
(
1
-
2
*
α_i
)
*
c
[
i
]
end
for
i
=
Nb
+
2
:
length
(
c
)
-
1
b
[
i
]
=
α_o
*
((
Δxo
/
x
[
i
]
+
1
)
*
c
[
i
+
1
]
+
(
-
Δxo
/
x
[
i
]
+
1
)
*
c
[
i
-
1
])
+
(
1
-
2
*
α_o
)
*
c
[
i
]
if
B
==
"N"
if
geometry
==
"3D"
for
i
in
length
(
b
)
if
i
>=
2
&&
i
<=
Nb
-
1
b
[
i
]
=
α_i
*
((
Δxi
/
x
[
i
]
+
1
)
*
c
[
i
+
1
]
+
(
-
Δxi
/
x
[
i
]
+
1
)
*
c
[
i
-
1
])
+
(
1
-
2
*
α_i
)
*
c
[
i
]
elseif
i
>=
Nb
+
2
&&
i
<=
length
(
x
)
-
1
b
[
i
]
=
α_o
*
((
Δxo
/
x
[
i
]
+
1
)
*
c
[
i
+
1
]
+
(
-
Δxo
/
x
[
i
]
+
1
)
*
c
[
i
-
1
])
+
(
1
-
2
*
α_o
)
*
c
[
i
]
end
end
elseif
geometry
==
"1D"
for
i
in
length
(
b
)
if
i
>=
2
&&
i
<=
Nb
-
1
b
[
i
]
=
α_i
*
(
c
[
i
+
1
]
+
c
[
i
-
1
])
+
(
1
-
2
*
α_i
)
*
c
[
i
]
elseif
i
>=
Nb
+
2
&&
i
<=
length
(
x
)
-
1
b
[
i
]
=
α_o
*
(
c
[
i
+
1
]
+
c
[
i
-
1
])
+
(
1
-
2
*
α_o
)
*
c
[
i
]
end
end
end
elseif
geometry
==
"1D"
for
i
=
2
:
Nb
-
1
b
[
i
]
=
α_i
*
(
c
[
i
+
1
]
+
c
[
i
-
1
])
+
(
1
-
2
*
α_i
)
*
c
[
i
]
end
if
B
==
"E"
if
geometry
==
"3D"
for
i
in
length
(
b
)
if
i
>=
2
&&
i
<
Nb
-
1
b
[
i
]
=
α_i
*
((
Δxi
/
x
[
i
]
+
1
)
*
c
[
i
+
1
]
+
(
-
Δxi
/
x
[
i
]
+
1
)
*
c
[
i
-
1
])
+
(
1
-
2
*
α_i
)
*
c
[
i
]
end
end
end
for
i
=
Nb
+
2
:
length
(
c
)
-
1
b
[
i
]
=
α_o
*
(
c
[
i
+
1
]
+
c
[
i
-
1
])
+
(
1
-
2
*
α_o
)
*
c
[
i
]
if
geometry
==
"1D"
for
i
in
length
(
b
)
if
i
>=
2
&&
i
<
Nb
-
1
b
[
i
]
=
α_i
*
(
c
[
i
+
1
]
+
c
[
i
-
1
])
+
(
1
-
2
*
α_i
)
*
c
[
i
]
end
end
end
b
[
Nb
-
1
]
=
1
end
return
b
...
...
@@ -89,7 +119,9 @@ end
| "E" Experimental right boundary, make_A from L to BP
- `α_i::Float`: defined in solve_D.
- `α_o::Float`: defined in solve_D.
- `Δx::Float`: x spacing
- `Δxi::Float`: x spacing inside
- `Δxo::Float`: x spacing outside
- `x::Vec`: x grid
- `D_i::Float`: diffusion coefficient inside.
- `D_o::Float`: diffusion coefficient outside.
- `N::Int`: size of matrix A.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment