In[]:=
Needs["NDSolve`FEM`"]
electrodePotential=200;(*Voltage*)electrodeLength=1.8*10^-3;electrodeWidth=0.65*10^-3;electrodeHeight=0.1*10^-3;(*Groundplanedimensionsinmeters*)groundLength=0.2;groundWidth=0.1;groundHeight=2*10^-3;(*Distancetogroundplaneinmeters*)distanceToGround=.3535;
In[]:=
electrodeLowerLeftCornerPosition={(groundLength/2)-(electrodeLength/2),(groundWidth/2)-(electrodeWidth/2),distanceToGround};electrodeUpperRightCornerPosition={(groundLength/2)-(electrodeLength/2)+electrodeLength,(groundWidth/2)-(electrodeWidth/2)+electrodeWidth,distanceToGround};
electrodeCuboid=Cuboid[electrodeLowerLeftCornerPosition,electrodeUpperRightCornerPosition];groundPlaneCuboid=Cuboid[{0.0,0.0,0.0},{groundLength,groundWidth,0}];Graphics3D[{Yellow,electrodeCuboid,Blue,groundPlaneCuboid},PlotLabel->"Electrode centered above ground"]
Out[]=
domain=RegionUnion[groundPlaneCuboid,electrodeCuboid];conductivityFunction[z_]:=1/Abs[z-electrodeHeight];(*PDEusingPoisson'sequationfortheelectricpotentialV*)pde=-Div[conductivityFunction[z]*Grad[V[x,y,z],{x,y,z}],{x,y,z}]==0;
In[]:=
boundaryConditions={DirichletCondition[V[x,y,z]==electrodePotential,electrodeCuboid[[1]][[1]]<=x<=electrodeCuboid[[2]][[1]]&&electrodeCuboid[[1]][[2]]<=y<=electrodeCuboid[[2]][[2]]&&electrodeCuboid[[1]][[3]]<=z<=electrodeCuboid[[2]][[3]]],DirichletCondition[V[x,y,z]==0,electrodeCuboid[[1]][[1]]<=x<=electrodeCuboid[[2]][[1]]&&electrodeCuboid[[1]][[2]]<=y<=electrodeCuboid[[2]][[2]]&&electrodeCuboid[[1]][[3]]<=z<=electrodeCuboid[[2]][[3]]]};
In[]:=
solution=NDSolveValue[pde,boundaryConditions,V,{x,0,groundLength},{y,0,groundWidth},{z,0,distanceToGround+0.001}];
In[]:=
(*Computetheelectricfield*)electricField=-Grad[solution[x,y,z],{x,y,z}];
VectorPlot3D[Evaluate[electricField],{x,0,groundLength},{y,0,groundWidth},{z,0,distanceToGround+.1},StreamPoints->Fine,VectorScale->{Tiny,Scaled[0.02],None},VectorStyle->Arrowheads[0.02]]
