compute the current for 2D Poisson equation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

compute the current for 2D Poisson equation

James
Could you let me know how to compute the current by integrating current density over the bottom boundary (representing a working electrode surface area) for a simple 2D Poisson equation (below)? Thanks

% Initialize 2D FEATool model
fea.sdim = {'x', 'y'};
fea.geom.objects = { gobj_rectangle(0, 3, 0, 1) };  % 3 mm x 1 mm domain

% Add Poisson equation physics mode
fea = addphys(fea, @poisson);  % electrostatics / potential
fea.phys.poi.eqn.coef{2,end}{1} = '0.0268';  % conductivity [S/mm]

% Set boundary conditions
% Bottom (boundary 1): potential u = -0.4 V
% Top (boundary 3): potential u = 0 V
fea.phys.poi.bdr.sel = [1 2 1 2];  % Dirichlet-Neumann alternation
fea.phys.poi.bdr.coef{1,end} = {'-0.4', '', '0', ''};

% Generate mesh
fea.grid = gridgen(fea, 'hmax', 0.1);

% Parse and solve
fea = parsephys(fea);
fea = parseprob(fea);
fea.sol.u = solvestat(fea);