The MetalIonDiffusionEquation solves the diffusion of the metal species with a source term at the electrolyte interface. The governing equation is given by,

where,

The velocity of the interface generally has a linear dependence on ion concentration. The following boundary condition applies at the zero level set,

where

The test case below is for a 1D steady state problem. The solution is given by:

This is the test case,
>>> from fipy.meshes import Grid1D
>>> nx = 11
>>> dx = 1.
>>> from fipy.tools import serial
>>> mesh = Grid1D(nx = nx, dx = dx, communicator=serial)
>>> x, = mesh.cellCenters
>>> from fipy.variables.cellVariable import CellVariable
>>> ionVar = CellVariable(mesh = mesh, value = 1.)
>>> from fipy.models.levelSet.distanceFunction.distanceVariable \
... import DistanceVariable
>>> disVar = DistanceVariable(mesh = mesh,
... value = (x - 0.5) - 0.99,
... hasOld = 1)
>>> v = 1.
>>> diffusion = 1.
>>> omega = 1.
>>> cinf = 1.
>>> eqn = buildMetalIonDiffusionEquation(ionVar = ionVar,
... distanceVar = disVar,
... depositionRate = v * ionVar,
... diffusionCoeff = diffusion,
... metalIonMolarVolume = omega)
>>> ionVar.constrain(cinf, mesh.facesRight)
>>> for i in range(10):
... eqn.solve(ionVar, dt = 1000)
>>> L = (nx - 1) * dx - dx / 2
>>> gradient = cinf / (omega * diffusion / v + L)
>>> answer = gradient * (x - L - dx * 3 / 2) + cinf
>>> answer[x < dx] = 1
>>> print ionVar.allclose(answer)
1
| Parameters : |
|
|---|
Bases: fipy.models.levelSet.electroChem.gapFillMesh.GapFillMesh
The trench mesh takes the parameters generally used to define a trench region and recasts then for the general GapFillMesh.
The following test case tests for diffusion across the domain.
>>> cellSize = 0.05e-6
>>> trenchDepth = 0.5e-6
>>> boundaryLayerDepth = 50e-6
>>> domainHeight = 10 * cellSize + trenchDepth + boundaryLayerDepth
>>> mesh = TrenchMesh(trenchSpacing = 1e-6,
... cellSize = cellSize,
... trenchDepth = trenchDepth,
... boundaryLayerDepth = boundaryLayerDepth,
... aspectRatio = 1.)
>>> import fipy.tools.dump as dump
>>> (f, filename) = dump.write(mesh)
>>> mesh = dump.read(filename, f)
>>> mesh.numberOfCells - len(numerix.nonzero(mesh.electrolyteMask)[0])
150
>>> from fipy.variables.cellVariable import CellVariable
>>> var = CellVariable(mesh = mesh, value = 0.)
>>> from fipy.terms.diffusionTerm import DiffusionTerm
>>> eq = DiffusionTerm()
>>> var.constrain(0., mesh.facesBottom)
>>> var.constrain(domainHeight, mesh.facesTop)
>>> eq.solve(var)
Evaluate the result:
>>> centers = mesh.cellCenters[1].copy()
Note
the copy makes the array contiguous for inlining
>>> localErrors = (centers - var)**2 / centers**2
>>> globalError = numerix.sqrt(numerix.sum(localErrors) / mesh.numberOfCells)
>>> argmax = numerix.argmax(localErrors)
>>> print numerix.sqrt(localErrors[argmax]) < 0.051
1
>>> print globalError < 0.02
1
trenchDepth - Depth of the trench.
trenchSpacing - The distance between the trenches.
boundaryLayerDepth - The depth of the hydrodynamic boundary layer.
cellSize - The cell Size.
aspectRatio - trenchDepth / trenchWidth
angle - The angle for the taper of the trench.
bowWidth - The maximum displacement for any bow in the trench shape.
overBumpWidth - The width of the over bump.
overBumpRadius - The radius of the over bump.
Deprecated since version 3.0: use the electrolyteMask property instead
The GapFillMesh object glues 3 meshes together to form a composite mesh. The first mesh is a Grid2D object that is fine and deals with the area around the trench or via. The second mesh is a Gmsh2D object that forms a transition mesh from a fine to a course region. The third mesh is another Grid2D object that forms the boundary layer. This region consists of very large elements and is only used for the diffusion in the boundary layer.
Bases: fipy.models.levelSet.electroChem.gapFillMesh.GapFillMesh
The trench mesh takes the parameters generally used to define a trench region and recasts then for the general GapFillMesh.
The following test case tests for diffusion across the domain.
>>> cellSize = 0.05e-6
>>> trenchDepth = 0.5e-6
>>> boundaryLayerDepth = 50e-6
>>> domainHeight = 10 * cellSize + trenchDepth + boundaryLayerDepth
>>> mesh = TrenchMesh(trenchSpacing = 1e-6,
... cellSize = cellSize,
... trenchDepth = trenchDepth,
... boundaryLayerDepth = boundaryLayerDepth,
... aspectRatio = 1.)
>>> import fipy.tools.dump as dump
>>> (f, filename) = dump.write(mesh)
>>> mesh = dump.read(filename, f)
>>> mesh.numberOfCells - len(numerix.nonzero(mesh.electrolyteMask)[0])
150
>>> from fipy.variables.cellVariable import CellVariable
>>> var = CellVariable(mesh = mesh, value = 0.)
>>> from fipy.terms.diffusionTerm import DiffusionTerm
>>> eq = DiffusionTerm()
>>> var.constrain(0., mesh.facesBottom)
>>> var.constrain(domainHeight, mesh.facesTop)
>>> eq.solve(var)
Evaluate the result:
>>> centers = mesh.cellCenters[1].copy()
Note
the copy makes the array contiguous for inlining
>>> localErrors = (centers - var)**2 / centers**2
>>> globalError = numerix.sqrt(numerix.sum(localErrors) / mesh.numberOfCells)
>>> argmax = numerix.argmax(localErrors)
>>> print numerix.sqrt(localErrors[argmax]) < 0.051
1
>>> print globalError < 0.02
1
trenchDepth - Depth of the trench.
trenchSpacing - The distance between the trenches.
boundaryLayerDepth - The depth of the hydrodynamic boundary layer.
cellSize - The cell Size.
aspectRatio - trenchDepth / trenchWidth
angle - The angle for the taper of the trench.
bowWidth - The maximum displacement for any bow in the trench shape.
overBumpWidth - The width of the over bump.
overBumpRadius - The radius of the over bump.
Deprecated since version 3.0: use the electrolyteMask property instead
The MetalIonDiffusionEquation solves the diffusion of the metal species with a source term at the electrolyte interface. The governing equation is given by,

where,

The velocity of the interface generally has a linear dependence on ion concentration. The following boundary condition applies at the zero level set,

where

The test case below is for a 1D steady state problem. The solution is given by:

This is the test case,
>>> from fipy.meshes import Grid1D
>>> nx = 11
>>> dx = 1.
>>> from fipy.tools import serial
>>> mesh = Grid1D(nx = nx, dx = dx, communicator=serial)
>>> x, = mesh.cellCenters
>>> from fipy.variables.cellVariable import CellVariable
>>> ionVar = CellVariable(mesh = mesh, value = 1.)
>>> from fipy.models.levelSet.distanceFunction.distanceVariable \
... import DistanceVariable
>>> disVar = DistanceVariable(mesh = mesh,
... value = (x - 0.5) - 0.99,
... hasOld = 1)
>>> v = 1.
>>> diffusion = 1.
>>> omega = 1.
>>> cinf = 1.
>>> eqn = buildMetalIonDiffusionEquation(ionVar = ionVar,
... distanceVar = disVar,
... depositionRate = v * ionVar,
... diffusionCoeff = diffusion,
... metalIonMolarVolume = omega)
>>> ionVar.constrain(cinf, mesh.facesRight)
>>> for i in range(10):
... eqn.solve(ionVar, dt = 1000)
>>> L = (nx - 1) * dx - dx / 2
>>> gradient = cinf / (omega * diffusion / v + L)
>>> answer = gradient * (x - L - dx * 3 / 2) + cinf
>>> answer[x < dx] = 1
>>> print ionVar.allclose(answer)
1
| Parameters : |
|
|---|