devsim 2.10.0__cp39-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- devsim/__init__.py +17 -0
- devsim/devsim_py3.pyd +0 -0
- devsim/python_packages/Klaassen.py +336 -0
- devsim/python_packages/__init__.py +0 -0
- devsim/python_packages/fermi_physics.py +31 -0
- devsim/python_packages/model_create.py +262 -0
- devsim/python_packages/mos_physics.py +170 -0
- devsim/python_packages/pythonmesh.py +131 -0
- devsim/python_packages/ramp.py +101 -0
- devsim/python_packages/simple_dd.py +75 -0
- devsim/python_packages/simple_physics.py +463 -0
- devsim/umfpack/umfpack_lgpl.dll +0 -0
- devsim/umfpack/umfpack_loader.py +517 -0
- devsim/umfpack/umfshim.py +116 -0
- devsim-2.10.0.data/data/devsim_data/BUILD.md +94 -0
- devsim-2.10.0.data/data/devsim_data/CHANGES.md +773 -0
- devsim-2.10.0.data/data/devsim_data/CITATION.md +23 -0
- devsim-2.10.0.data/data/devsim_data/CODE_OF_CONDUCT.md +74 -0
- devsim-2.10.0.data/data/devsim_data/CONTRIBUTING.md +43 -0
- devsim-2.10.0.data/data/devsim_data/HOWTO.md +27 -0
- devsim-2.10.0.data/data/devsim_data/INSTALL.md +65 -0
- devsim-2.10.0.data/data/devsim_data/README.md +97 -0
- devsim-2.10.0.data/data/devsim_data/TEST.md +13 -0
- devsim-2.10.0.data/data/devsim_data/doc/devsim.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/doc/symdiff.pdf +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve0_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/Ve7_3d.jpg +0 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_2d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_3d.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/bioapp1_common.py +399 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.geo +62 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_2d.msh +65606 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.geo +183 -0
- devsim-2.10.0.data/data/devsim_data/examples/bioapp1/disk_3d.msh +25808 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap.lay +1587 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap1d.py +155 -0
- devsim-2.10.0.data/data/devsim_data/examples/capacitance/cap2d.py +200 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/3dblock.geo +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d.py +94 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_1d_custom.py +159 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_2d.py +68 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_common.py +253 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_current.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_density.lay +3271 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/diode_potential.lay +3272 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.msh +1477 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode2d.py +55 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.msh +8557 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d.py +74 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_equil.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/gmsh_diode3d_float128.py +85 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux2d.py +43 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux3d.py +54 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/laux_common.py +503 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/pythonmesh3d.py +61 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/ssac_diode.py +57 -0
- devsim-2.10.0.data/data/devsim_data/examples/diode/tran_diode.py +63 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.geo +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.msh +8599 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d.py +96 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_create.py +174 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/gmsh_mos2d_kla.py +162 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/logElectrons.lay +1327 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/pythonmesh2d.py +100 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/test.lay +3385 -0
- devsim-2.10.0.data/data/devsim_data/examples/mobility/times.txt +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/plotting/visualization.ipynb +160 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/arrhenius.py +24 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/deftest.py +48 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/modellist1.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/models1.py +41 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/ordered.py +9 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/parsetest.py +107 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/remove1.py +8 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/subexpression1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/table.py +7 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/undefined1.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/symdiff/utf8.py +10 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.geo +34 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.lay +1469 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.msh +13596 -0
- devsim-2.10.0.data/data/devsim_data/examples/vectorpotential/twowire.py +177 -0
- devsim-2.10.0.data/data/devsim_data/setup.cfg +23 -0
- devsim-2.10.0.data/data/devsim_data/setup.py +58 -0
- devsim-2.10.0.data/data/devsim_data/testing/3dtetmesh.msh +281 -0
- devsim-2.10.0.data/data/devsim_data/testing/CMakeLists.txt +175 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/Fermi1_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi.py +38 -0
- devsim-2.10.0.data/data/devsim_data/testing/GaussFermi_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap2.py +439 -0
- devsim-2.10.0.data/data/devsim_data/testing/cap_mesh.py +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ1.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ2.py +79 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ3.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/circ4.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_2d.py +136 -0
- devsim-2.10.0.data/data/devsim_data/testing/dio2_element_physics.py +302 -0
- devsim-2.10.0.data/data/devsim_data/testing/equation1.py +68 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf1.py +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/erf2.py +34 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest1.py +21 -0
- devsim-2.10.0.data/data/devsim_data/testing/fpetest2.py +25 -0
- devsim-2.10.0.data/data/devsim_data/testing/gmsh_mos3d.geo +272 -0
- devsim-2.10.0.data/data/devsim_data/testing/info.py +11 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/kahan_float128.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/laux1.py +232 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest.mc +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/mctest_user.mc +33 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.msh +52 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh1.py +121 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.msh +70 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2.py +210 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh2d.py +105 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh3.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mesh4.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d.py +111 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_create.py +207 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart.py +69 -0
- devsim-2.10.0.data/data/devsim_data/testing/mos_2d_restart2.py +24 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res.py +51 -0
- devsim-2.10.0.data/data/devsim_data/testing/noise_res_2d.py +101 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest1.py +53 -0
- devsim-2.10.0.data/data/devsim_data/testing/ptest2.py +110 -0
- devsim-2.10.0.data/data/devsim_data/testing/pythonmesh1d.py +202 -0
- devsim-2.10.0.data/data/devsim_data/testing/res1.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res2.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/res3.py +59 -0
- devsim-2.10.0.data/data/devsim_data/testing/rundifftest.py +62 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap.py +145 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_edge.py +199 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_2d_element.py +214 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_edge.py +148 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_cap_3d_element.py +167 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_circ.py +18 -0
- devsim-2.10.0.data/data/devsim_data/testing/ssac_res.py +30 -0
- devsim-2.10.0.data/data/devsim_data/testing/symdiff1.py +54 -0
- devsim-2.10.0.data/data/devsim_data/testing/test_common.py +435 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc.py +65 -0
- devsim-2.10.0.data/data/devsim_data/testing/testfunc_extended.py +8 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ2.py +67 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_circ3.py +125 -0
- devsim-2.10.0.data/data/devsim_data/testing/transient_rc.py +157 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.msh +47 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh1.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/trimesh2.py +114 -0
- devsim-2.10.0.data/data/devsim_data/testing/utf8_2.py +126 -0
- devsim-2.10.0.dist-info/METADATA +121 -0
- devsim-2.10.0.dist-info/RECORD +157 -0
- devsim-2.10.0.dist-info/WHEEL +5 -0
- devsim-2.10.0.dist-info/licenses/LICENSE +202 -0
- devsim-2.10.0.dist-info/licenses/NOTICE +241 -0
- devsim-2.10.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
# Copyright 2013 DEVSIM LLC
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
from devsim import (
|
|
6
|
+
contact_equation,
|
|
7
|
+
contact_node_model,
|
|
8
|
+
cylindrical_edge_couple,
|
|
9
|
+
cylindrical_node_volume,
|
|
10
|
+
edge_from_node_model,
|
|
11
|
+
edge_model,
|
|
12
|
+
element_from_edge_model,
|
|
13
|
+
equation,
|
|
14
|
+
get_dimension,
|
|
15
|
+
get_material,
|
|
16
|
+
get_node_model_values,
|
|
17
|
+
get_region_list,
|
|
18
|
+
interface_equation,
|
|
19
|
+
interface_model,
|
|
20
|
+
node_model,
|
|
21
|
+
node_solution,
|
|
22
|
+
set_node_values,
|
|
23
|
+
set_parameter,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
#### molarity 0.001 mole / Liter * 1 L / (1e3 cm^3) * 6.02e23 / mole = 6.02e17 /cm^3
|
|
27
|
+
set_parameter(device="disk", region="solution", name="n_bound", value=6.02e17)
|
|
28
|
+
#### 2q/nm^3 --> 2/nm^3 * (1 nm^3/(1e-7 cm)^3)
|
|
29
|
+
# set_parameter device="disk", region="dna", name="charge_density", value=0,
|
|
30
|
+
set_parameter(device="disk", region="dna", name="charge_density", value=2e21)
|
|
31
|
+
set_parameter(device="disk", region="dielectric", name="charge_density", value=0)
|
|
32
|
+
|
|
33
|
+
dimension = get_dimension(device="disk")
|
|
34
|
+
|
|
35
|
+
material_parameter_table = (
|
|
36
|
+
{
|
|
37
|
+
"material": "global",
|
|
38
|
+
"parameter": "q",
|
|
39
|
+
"value": 1.6e-19,
|
|
40
|
+
"unit": "coul",
|
|
41
|
+
"description": "Charge of an electron",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"material": "ionic_solution",
|
|
45
|
+
"parameter": "mu_c",
|
|
46
|
+
"value": 7.62e-4,
|
|
47
|
+
"unit": "cm^2/(V*sec)",
|
|
48
|
+
"description": "mobility of cations (K+)",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"material": "ionic_solution",
|
|
52
|
+
"parameter": "mu_a",
|
|
53
|
+
"value": 7.98e-4,
|
|
54
|
+
"unit": "cm^2/(V*sec)",
|
|
55
|
+
"description": "mobility of anions (Cl-)",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"material": "ionic_solution",
|
|
59
|
+
"parameter": "Permittivity",
|
|
60
|
+
"value": 80 * 8.85e-14,
|
|
61
|
+
"unit": "F/cm",
|
|
62
|
+
"description": "",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"material": "dielectric",
|
|
66
|
+
"parameter": "Permittivity",
|
|
67
|
+
"value": 3 * 8.85e-14,
|
|
68
|
+
"unit": "F/cm",
|
|
69
|
+
"description": "",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"material": "dna",
|
|
73
|
+
"parameter": "Permittivity",
|
|
74
|
+
"value": 4 * 8.85e-14,
|
|
75
|
+
"unit": "F/cm",
|
|
76
|
+
"description": "",
|
|
77
|
+
},
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
material_parameters = {}
|
|
81
|
+
|
|
82
|
+
for m in material_parameter_table:
|
|
83
|
+
material_parameters[m["material"]] = {}
|
|
84
|
+
for m in material_parameter_table:
|
|
85
|
+
material_parameters[m["material"]][m["parameter"]] = m["value"]
|
|
86
|
+
|
|
87
|
+
for k, v in material_parameters["global"].items():
|
|
88
|
+
set_parameter(device="disk", name=k, value=v)
|
|
89
|
+
|
|
90
|
+
for r in get_region_list(device="disk"):
|
|
91
|
+
m = get_material(device="disk", region=r)
|
|
92
|
+
for k, v in material_parameters[m].items():
|
|
93
|
+
set_parameter(device="disk", region=r, name=k, value=v)
|
|
94
|
+
|
|
95
|
+
set_parameter(device="disk", region="solution", name="V_t", value=0.0238)
|
|
96
|
+
|
|
97
|
+
for region in ("dna", "dielectric", "solution"):
|
|
98
|
+
node_solution(device="disk", region=region, name="Potential")
|
|
99
|
+
edge_from_node_model(device="disk", region=region, node_model="Potential")
|
|
100
|
+
|
|
101
|
+
if dimension == 2:
|
|
102
|
+
set_parameter(device="disk", name="raxis_variable", value="x")
|
|
103
|
+
set_parameter(device="disk", name="raxis_zero", value=0)
|
|
104
|
+
cylindrical_node_volume(device="disk", region=region)
|
|
105
|
+
cylindrical_edge_couple(device="disk", region=region)
|
|
106
|
+
|
|
107
|
+
set_parameter(name="node_volume_model", value="CylindricalNodeVolume")
|
|
108
|
+
set_parameter(name="edge_couple_model", value="CylindricalEdgeCouple")
|
|
109
|
+
set_parameter(
|
|
110
|
+
name="element_edge_couple_model", value="ElementCylindricalEdgeCouple"
|
|
111
|
+
)
|
|
112
|
+
set_parameter(
|
|
113
|
+
name="element_node0_volume_model", value="ElementCylindricalNodeVolume@en0"
|
|
114
|
+
)
|
|
115
|
+
set_parameter(
|
|
116
|
+
name="element_node1_volume_model", value="ElementCylindricalNodeVolume@en1"
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
x = sum(
|
|
120
|
+
get_node_model_values(
|
|
121
|
+
device="disk", region=region, name="CylindricalNodeVolume"
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
y = sum(get_node_model_values(device="disk", region=region, name="NodeVolume"))
|
|
125
|
+
print("Volume {0} {1} {2}".format(region, x, y))
|
|
126
|
+
else:
|
|
127
|
+
y = sum(get_node_model_values(device="disk", region=region, name="NodeVolume"))
|
|
128
|
+
print("Volume {0} {1}".format(region, y))
|
|
129
|
+
|
|
130
|
+
# Electric Field Edge Model
|
|
131
|
+
edge_model(
|
|
132
|
+
device="disk",
|
|
133
|
+
region=region,
|
|
134
|
+
name="EField",
|
|
135
|
+
equation="(Potential@n0 - Potential@n1)*EdgeInverseLength",
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
edge_model(
|
|
139
|
+
device="disk",
|
|
140
|
+
region=region,
|
|
141
|
+
name="EField:Potential@n0",
|
|
142
|
+
equation="EdgeInverseLength",
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
edge_model(
|
|
146
|
+
device="disk",
|
|
147
|
+
region=region,
|
|
148
|
+
name="EField:Potential@n1",
|
|
149
|
+
equation="-EdgeInverseLength",
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
edge_model(
|
|
153
|
+
device="disk", region=region, name="DField", equation="Permittivity*EField"
|
|
154
|
+
)
|
|
155
|
+
edge_model(
|
|
156
|
+
device="disk",
|
|
157
|
+
region=region,
|
|
158
|
+
name="DField:Potential@n0",
|
|
159
|
+
equation="Permittivity*EField:Potential@n0",
|
|
160
|
+
)
|
|
161
|
+
edge_model(
|
|
162
|
+
device="disk",
|
|
163
|
+
region=region,
|
|
164
|
+
name="DField:Potential@n1",
|
|
165
|
+
equation="Permittivity*EField:Potential@n1",
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
# create anions and cations solution variable in solution (positive only applied in equation)
|
|
169
|
+
node_solution(device="disk", region="solution", name="cations")
|
|
170
|
+
edge_from_node_model(device="disk", region="solution", node_model="cations")
|
|
171
|
+
node_solution(device="disk", region="solution", name="anions")
|
|
172
|
+
edge_from_node_model(device="disk", region="solution", node_model="anions")
|
|
173
|
+
node_model(device="disk", region="solution", name="small_value", equation="n_bound")
|
|
174
|
+
set_node_values(
|
|
175
|
+
device="disk", region="solution", name="cations", init_from="small_value"
|
|
176
|
+
)
|
|
177
|
+
set_node_values(
|
|
178
|
+
device="disk", region="solution", name="anions", init_from="small_value"
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
# create Poisson equation in each region
|
|
182
|
+
# sign is negative since poisson equation all on lhs
|
|
183
|
+
node_model(
|
|
184
|
+
device="disk", region="solution", name="NetCharge", equation="q*(anions - cations)"
|
|
185
|
+
)
|
|
186
|
+
node_model(device="disk", region="solution", name="NetCharge:anions", equation="q")
|
|
187
|
+
node_model(device="disk", region="solution", name="NetCharge:cations", equation="-q")
|
|
188
|
+
|
|
189
|
+
equation(
|
|
190
|
+
device="disk",
|
|
191
|
+
region="solution",
|
|
192
|
+
name="PotentialEquation",
|
|
193
|
+
variable_name="Potential",
|
|
194
|
+
node_model="NetCharge",
|
|
195
|
+
edge_model="DField",
|
|
196
|
+
variable_update="default",
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
for region in ("dna", "dielectric"):
|
|
201
|
+
node_model(
|
|
202
|
+
device="disk", region=region, name="NetCharge", equation="-q*charge_density"
|
|
203
|
+
)
|
|
204
|
+
equation(
|
|
205
|
+
device="disk",
|
|
206
|
+
region=region,
|
|
207
|
+
name="PotentialEquation",
|
|
208
|
+
variable_name="Potential",
|
|
209
|
+
node_model="NetCharge",
|
|
210
|
+
edge_model="DField",
|
|
211
|
+
variable_update="default",
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
# create fluxes in solution
|
|
215
|
+
# This is complicated, but the Bernoulli functions are a representation of Sharfetter Gummel
|
|
216
|
+
vdiffstr = "(Potential@n0 - Potential@n1)/V_t"
|
|
217
|
+
edge_model(device="disk", region="solution", name="vdiff", equation=vdiffstr)
|
|
218
|
+
# #assuming that Potential is based on a solution, and not a model
|
|
219
|
+
edge_model(
|
|
220
|
+
device="disk", region="solution", name="vdiff:Potential@n0", equation="V_t^(-1)"
|
|
221
|
+
)
|
|
222
|
+
edge_model(
|
|
223
|
+
device="disk", region="solution", name="vdiff:Potential@n1", equation="-V_t^(-1)"
|
|
224
|
+
)
|
|
225
|
+
#
|
|
226
|
+
edge_model(device="disk", region="solution", name="Bern01", equation="B(vdiff)")
|
|
227
|
+
edge_model(
|
|
228
|
+
device="disk",
|
|
229
|
+
region="solution",
|
|
230
|
+
name="Bern01:Potential@n0",
|
|
231
|
+
equation="dBdx(vdiff) * vdiff:Potential@n0",
|
|
232
|
+
)
|
|
233
|
+
edge_model(
|
|
234
|
+
device="disk",
|
|
235
|
+
region="solution",
|
|
236
|
+
name="Bern01:Potential@n1",
|
|
237
|
+
equation="-Bern01:Potential@n0",
|
|
238
|
+
)
|
|
239
|
+
# #identity of Bernoulli functions
|
|
240
|
+
edge_model(device="disk", region="solution", name="Bern10", equation="Bern01 + vdiff")
|
|
241
|
+
edge_model(
|
|
242
|
+
device="disk",
|
|
243
|
+
region="solution",
|
|
244
|
+
name="Bern10:Potential@n0",
|
|
245
|
+
equation="Bern01:Potential@n0 + vdiff:Potential@n0",
|
|
246
|
+
)
|
|
247
|
+
edge_model(
|
|
248
|
+
device="disk",
|
|
249
|
+
region="solution",
|
|
250
|
+
name="Bern10:Potential@n1",
|
|
251
|
+
equation="Bern01:Potential@n1 + vdiff:Potential@n1",
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
Ja = " q*mu_a*EdgeInverseLength*V_t*(anions@n1*Bern10 - anions@n0*Bern01)"
|
|
255
|
+
edge_model(
|
|
256
|
+
device="disk", region="solution", name="AnionFlux", equation="{0}".format(Ja)
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
Jc = "-q*mu_c*EdgeInverseLength*V_t*(cations@n1*Bern01 - cations@n0*Bern10)"
|
|
260
|
+
edge_model(
|
|
261
|
+
device="disk", region="solution", name="CationFlux", equation="{0}".format(Jc)
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
# derivatives w.r.t. the solution variables
|
|
265
|
+
for v in (
|
|
266
|
+
"Potential@n0",
|
|
267
|
+
"Potential@n1",
|
|
268
|
+
"anions@n0",
|
|
269
|
+
"anions@n1",
|
|
270
|
+
"cations@n0",
|
|
271
|
+
"cations@n1",
|
|
272
|
+
):
|
|
273
|
+
edge_model(
|
|
274
|
+
device="disk",
|
|
275
|
+
region="solution",
|
|
276
|
+
name="AnionFlux:{0}".format(v),
|
|
277
|
+
equation="simplify(diff({0},{1}))".format(Ja, v),
|
|
278
|
+
)
|
|
279
|
+
edge_model(
|
|
280
|
+
device="disk",
|
|
281
|
+
region="solution",
|
|
282
|
+
name="CationFlux:{0}".format(v),
|
|
283
|
+
equation="simplify(diff({0},{1}))".format(Jc, v),
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
# create continuity equations in solution
|
|
287
|
+
equation(
|
|
288
|
+
device="disk",
|
|
289
|
+
region="solution",
|
|
290
|
+
name="AnionContinuityEquation",
|
|
291
|
+
variable_name="anions",
|
|
292
|
+
edge_model="AnionFlux",
|
|
293
|
+
variable_update="positive",
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
equation(
|
|
297
|
+
device="disk",
|
|
298
|
+
region="solution",
|
|
299
|
+
name="CationContinuityEquation",
|
|
300
|
+
variable_name="cations",
|
|
301
|
+
edge_model="CationFlux",
|
|
302
|
+
variable_update="positive",
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
# create n0, and potential boundary condition at contact
|
|
306
|
+
for contact in ("top", "bot"):
|
|
307
|
+
node_model(
|
|
308
|
+
device="disk",
|
|
309
|
+
region="solution",
|
|
310
|
+
name="{0}_potential".format(contact),
|
|
311
|
+
equation="Potential - {0}_bias".format(contact),
|
|
312
|
+
)
|
|
313
|
+
node_model(
|
|
314
|
+
device="disk",
|
|
315
|
+
region="solution",
|
|
316
|
+
name="{0}_potential:Potential".format(contact),
|
|
317
|
+
equation="1",
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
contact_equation(
|
|
321
|
+
device="disk",
|
|
322
|
+
contact=contact,
|
|
323
|
+
name="PotentialEquation",
|
|
324
|
+
node_model="{0}_potential".format(contact),
|
|
325
|
+
edge_charge_model="DField",
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
contact_node_model(
|
|
329
|
+
device="disk",
|
|
330
|
+
contact=contact,
|
|
331
|
+
name="{0}_anion".format(contact),
|
|
332
|
+
equation="anions - n_bound",
|
|
333
|
+
)
|
|
334
|
+
contact_node_model(
|
|
335
|
+
device="disk",
|
|
336
|
+
contact=contact,
|
|
337
|
+
name="{0}_anion:anions".format(contact),
|
|
338
|
+
equation="1",
|
|
339
|
+
)
|
|
340
|
+
contact_equation(
|
|
341
|
+
device="disk",
|
|
342
|
+
contact=contact,
|
|
343
|
+
name="AnionContinuityEquation",
|
|
344
|
+
node_model="{0}_anion".format(contact),
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
contact_node_model(
|
|
348
|
+
device="disk",
|
|
349
|
+
contact=contact,
|
|
350
|
+
name="{0}_cation".format(contact),
|
|
351
|
+
equation="cations - n_bound",
|
|
352
|
+
)
|
|
353
|
+
contact_node_model(
|
|
354
|
+
device="disk",
|
|
355
|
+
contact=contact,
|
|
356
|
+
name="{0}_cation:cations".format(contact),
|
|
357
|
+
equation="1",
|
|
358
|
+
)
|
|
359
|
+
contact_equation(
|
|
360
|
+
device="disk",
|
|
361
|
+
contact=contact,
|
|
362
|
+
name="CationContinuityEquation",
|
|
363
|
+
node_model="{0}_cation".format(contact),
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
# create potential continuity at interfaces
|
|
368
|
+
for interface in ("dna_solution", "dielectric_solution"):
|
|
369
|
+
interface_model(
|
|
370
|
+
device="disk",
|
|
371
|
+
interface=interface,
|
|
372
|
+
name="continuousPotential",
|
|
373
|
+
equation="Potential@r0-Potential@r1",
|
|
374
|
+
)
|
|
375
|
+
interface_model(
|
|
376
|
+
device="disk",
|
|
377
|
+
interface=interface,
|
|
378
|
+
name="continuousPotential:Potential@r0",
|
|
379
|
+
equation="1",
|
|
380
|
+
)
|
|
381
|
+
interface_model(
|
|
382
|
+
device="disk",
|
|
383
|
+
interface=interface,
|
|
384
|
+
name="continuousPotential:Potential@r1",
|
|
385
|
+
equation="-1",
|
|
386
|
+
)
|
|
387
|
+
interface_equation(
|
|
388
|
+
device="disk",
|
|
389
|
+
interface=interface,
|
|
390
|
+
name="PotentialEquation",
|
|
391
|
+
interface_model="continuousPotential",
|
|
392
|
+
type="continuous",
|
|
393
|
+
)
|
|
394
|
+
|
|
395
|
+
# For visualization
|
|
396
|
+
for region in ("dna", "dielectric", "solution"):
|
|
397
|
+
element_from_edge_model(edge_model="EField", device="disk", region=region)
|
|
398
|
+
element_from_edge_model(edge_model="AnionFlux", device="disk", region="solution")
|
|
399
|
+
element_from_edge_model(edge_model="CationFlux", device="disk", region="solution")
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
dna_t = 0.02e-4;
|
|
3
|
+
dna_r = 0.001e-4;
|
|
4
|
+
dna_lc = dna_r / 20;
|
|
5
|
+
Point(0) = { 0, -dna_t/2, 0, dna_lc};
|
|
6
|
+
Point(1) = { 0, +dna_t/2, 0, dna_lc};
|
|
7
|
+
Point(2) = { dna_r, -dna_t/2, 0, dna_lc};
|
|
8
|
+
Point(3) = { dna_r, +dna_t/2, 0, dna_lc};
|
|
9
|
+
|
|
10
|
+
disk_t = 0.5e-4;
|
|
11
|
+
disk_r = 0.3e-4;
|
|
12
|
+
disk_w = 2.2e-4;
|
|
13
|
+
disk_r2 = disk_r + disk_w;
|
|
14
|
+
disk_lc = disk_t/25;
|
|
15
|
+
disk_lc2 = disk_w/25;
|
|
16
|
+
|
|
17
|
+
Point(4) = { 0, -disk_t/2, 0, disk_lc};
|
|
18
|
+
Point(5) = { 0, +disk_t/2, 0, disk_lc};
|
|
19
|
+
Point(6) = { disk_r, -disk_t/2, 0, disk_lc};
|
|
20
|
+
Point(7) = { disk_r, +disk_t/2, 0, disk_lc};
|
|
21
|
+
Point(8) = { disk_r2, -disk_t/2, 0, disk_lc2};
|
|
22
|
+
Point(9) = { disk_r2, +disk_t/2, 0, disk_lc2};
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
who_t = 2.5e-4;
|
|
26
|
+
who_r = disk_r2;
|
|
27
|
+
who_lc = who_t/25;
|
|
28
|
+
|
|
29
|
+
Point(10) = { 0, -who_t/2, 0, who_lc};
|
|
30
|
+
Point(11) = { 0, +who_t/2, 0, who_lc};
|
|
31
|
+
Point(12) = { who_r, -who_t/2, 0, who_lc};
|
|
32
|
+
Point(13) = { who_r, +who_t/2, 0, who_lc};
|
|
33
|
+
Line(1) = {0, 1};
|
|
34
|
+
Line(2) = {1, 3};
|
|
35
|
+
Line(3) = {3, 2};
|
|
36
|
+
Line(4) = {0, 2};
|
|
37
|
+
Line(6) = {7, 6};
|
|
38
|
+
Line(8) = {1, 5};
|
|
39
|
+
Line(9) = {4, 0};
|
|
40
|
+
Line(10) = {4, 10};
|
|
41
|
+
Line(11) = {10, 12};
|
|
42
|
+
Line(12) = {12, 8};
|
|
43
|
+
Line(13) = {8, 9};
|
|
44
|
+
Line(14) = {9, 13};
|
|
45
|
+
Line(15) = {13, 11};
|
|
46
|
+
Line(16) = {11, 5};
|
|
47
|
+
Line(17) = {7, 9};
|
|
48
|
+
Line(18) = {6, 8};
|
|
49
|
+
Line Loop(19) = {1, 2, 3, -4};
|
|
50
|
+
Plane Surface(20) = {19};
|
|
51
|
+
Line Loop(21) = {8, -16, -15, -14, -17, 6, 18, -12, -11, -10, 9, 4, -3, -2};
|
|
52
|
+
Plane Surface(22) = {21};
|
|
53
|
+
Line Loop(23) = {17, -13, -18, -6};
|
|
54
|
+
Plane Surface(24) = {23};
|
|
55
|
+
|
|
56
|
+
Physical Line("top") = {15};
|
|
57
|
+
Physical Line("bot") = {11};
|
|
58
|
+
Physical Line("dielectric_solution") = {17, 6, 18};
|
|
59
|
+
Physical Line("dna_solution") = {2, 3, 4};
|
|
60
|
+
Physical Surface("solution") = {22};
|
|
61
|
+
Physical Surface("dielectric") = {24};
|
|
62
|
+
Physical Surface("dna") = {20};
|