Skip to content

Commit

Permalink
update permeation test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhdark committed Oct 17, 2023
1 parent 16d7ac0 commit b0901a0
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions test/test_permeation_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
dirichletbc,
locate_dofs_topological,
)
from ufl import exp, FacetNormal
from ufl import exp
import numpy as np


Expand Down Expand Up @@ -44,11 +44,10 @@ def siverts_law(T, S_0, E_S, pressure):
S = S_0 * exp(-E_S / F.k_B / T)
return S * pressure**0.5

fdim = my_mesh.mesh.topology.dim - 1
left_facets = my_model.facet_meshtags.find(1)
left_dofs = locate_dofs_topological(V, fdim, left_facets)
left_dofs = locate_dofs_topological(V, my_mesh.fdim, left_facets)
right_facets = my_model.facet_meshtags.find(2)
right_dofs = locate_dofs_topological(V, fdim, right_facets)
right_dofs = locate_dofs_topological(V, my_mesh.fdim, right_facets)

S_0 = 4.02e21
E_S = 1.04
Expand Down Expand Up @@ -143,20 +142,15 @@ def test_permeation_problem_multi_volume():
D = my_mat.get_diffusion_coefficient(my_mesh.mesh, temperature)

V = my_model.function_space
u = mobile_H.solution

# TODO this should be a property of Mesh
n = FacetNormal(my_mesh.mesh)

def siverts_law(T, S_0, E_S, pressure):
S = S_0 * exp(-E_S / F.k_B / T)
return S * pressure**0.5

fdim = my_mesh.mesh.topology.dim - 1
left_facets = my_model.facet_meshtags.find(1)
left_dofs = locate_dofs_topological(V, fdim, left_facets)
left_dofs = locate_dofs_topological(V, my_mesh.fdim, left_facets)
right_facets = my_model.facet_meshtags.find(2)
right_dofs = locate_dofs_topological(V, fdim, right_facets)
right_dofs = locate_dofs_topological(V, my_mesh.fdim, right_facets)

S_0 = 4.02e21
E_S = 1.04
Expand Down

0 comments on commit b0901a0

Please sign in to comment.