Commit dfb70390 authored by Lloyd Connellan's avatar Lloyd Connellan
Browse files

add mixed bcs

parent 889e83cd
......@@ -99,6 +99,7 @@
"import dune.fem\n",
"\n",
"import dune.create as create\n",
"from dune.ufl import DirichletBC\n",
"from dune.fem.view import filteredGridView"
]
},
......@@ -200,10 +201,8 @@
" - exp(uSolid[1] - uElec[1]))\n",
"\n",
"# define dirichlet conditions on the left and right boundaries\n",
"tmp_a = 0.000951 # these should be removed \n",
"tmp_c = 0.018454 #\n",
"diric_a = as_vector([tmp_a, 2.5e-8])\n",
"diric_c = as_vector([tmp_c, 1.9e-2])"
"diric_a = [None, 2.5e-8]\n",
"diric_c = [None, 1.9e-2]"
]
},
{
......@@ -337,7 +336,7 @@
"# omega_a\n",
"print('constructing models and schemes')\n",
"model_a = create.model(\"split\", anode, a_ex == a_im, \n",
" dirichlet={6: diric_a}, coefficients={u_e: solution_e_n, un: solution_a_n})\n",
" DirichletBC(uflSpace, diric_a, 6), coefficients={u_e: solution_e_n, un: solution_a_n})\n",
"model_a.setConstant(dt, timeStep)\n",
"scheme_a = create.scheme(\"h1\", space_a, model_a)\n",
"\n",
......@@ -349,7 +348,7 @@
"\n",
"# omega_c\n",
"model_c = create.model(\"split\", cathode, c_ex == c_im,\n",
" dirichlet={7: diric_c}, coefficients={u_e: solution_e_n, un: solution_c_n})\n",
" DirichletBC(uflSpace, diric_c, 7), coefficients={u_e: solution_e_n, un: solution_c_n})\n",
"model_c.setConstant(dt, timeStep)\n",
"scheme_c = create.scheme(\"h1\", space_c, model_c)"
]
......
......@@ -84,6 +84,7 @@ import dune.ufl
import dune.fem
import dune.create as create
from dune.ufl import DirichletBC
from dune.fem.view import filteredGridView
......@@ -151,10 +152,8 @@ def J(uElec, uSolid):
return (uElec[0])**0.5*(uSolid[0])**0.5 *(exp(uElec[1] - uSolid[1]) - exp(uSolid[1] - uElec[1]))
# define dirichlet conditions on the left and right boundaries
tmp_a = 0.000951 # these should be removed
tmp_c = 0.018454 #
diric_a = as_vector([tmp_a, 2.5e-8])
diric_c = as_vector([tmp_c, 1.9e-2])
diric_a = [None, 2.5e-8]
diric_c = [None, 1.9e-2]
# We continue defining the PDE and boundary conditions (this part should remain the same).
......@@ -244,7 +243,7 @@ solution_c_n.assign( solution_c )
# omega_a
print('constructing models and schemes')
model_a = create.model("split", anode, a_ex == a_im,
dirichlet={6: diric_a}, coefficients={u_e: solution_e_n, un: solution_a_n})
DirichletBC(uflSpace, diric_a, 6), coefficients={u_e: solution_e_n, un: solution_a_n})
model_a.setConstant(dt, timeStep)
scheme_a = create.scheme("h1", space_a, model_a)
......@@ -256,7 +255,7 @@ scheme_e = create.scheme("h1", space_e, model_e)
# omega_c
model_c = create.model("split", cathode, c_ex == c_im,
dirichlet={7: diric_c}, coefficients={u_e: solution_e_n, un: solution_c_n})
DirichletBC(uflSpace, diric_c, 7), coefficients={u_e: solution_e_n, un: solution_c_n})
model_c.setConstant(dt, timeStep)
scheme_c = create.scheme("h1", space_c, model_c)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment