## General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

#### About electrostatic field analysis in MAPDL

• Yuuhi Takabayashi
Subscriber

Dear everyone,

Maxwell cannot be used due to licensing issues.
I created the program below to simulate the effect of fringe electric fields on parallel plate capacitors in MAPDL, but the simulation does not work well.

/CLEAR
/PREP7

! プレートの寸法（μm単位をmm単位に変換）
width = 0.1
height = 0.02
thickness = 0.003
separation = 0.01

! 3D 8ノード要素の静電解析用に設定
ET,1,SOLID122

! 無限要素を定義
ET,2,111,2,1

! 材料特性（真空の相対誘電率）
MP,PERX,1,8.854e-12

! 最初のプレートを作成
BLOCK,0,width,0,height,0,thickness

! 二番目のプレートを作成
BLOCK,0,width,0,height,separation,separation+thickness

! メッシュ設定
ESIZE,0.005   ! 要素サイズを設定

! すべてのボリュームにメッシュを適用
ALLSEL,ALL
VMESH,ALL

/SOLU

! 静電解析を指定
ANTYPE,STAT

! 境界条件
ALLSEL
CSYS,0

! 最初のプレートの上面に0Vを適用
ASEL,S,LOC,Z,thickness
NSLA,S,1
D,ALL,VOLT,0

! 二番目のプレートの下面に1Vを適用
ALLSEL
ASEL,S,LOC,Z,separation
NSLA,S,1
D,ALL,VOLT,1

! 解を求める
SOLVE
FINISH

/POST1
PLNSOL,VOLT  ! ノード解（電圧）をプロット

! 電場エネルギーを抽出して容量を計算
/OUT, CAPACITANCE_CALCULATION, , TXT
*GET, W, ENER, , STAT, ENE
V = 1
C = 2*W/(V**2)
*STATUS, C
/OUT

Please tell me what needs to be improved.

thank you
• Ashish Kumar
Forum Moderator

Translated:

```Dear everyone,

Maxwell cannot be used due to licensing issues.
I created the program below to simulate the effect of fringe electric fields on parallel plate capacitors in MAPDL, but the simulation does not work well.

/CLEAR
/PREP7

! Plate dimensions (convert from μm to mm)
width = 0.1
height = 0.02
thickness = 0.003
separation = 0.01

! Configured for electrostatic analysis of 3D 8-node elements
ET,1,SOLID122

! Define infinite element
ET,2,111,2,1

! Material properties (relative dielectric constant in vacuum)
MP,PERX,1,8.854e-12

BLOCK,0,width,0,height,0,thickness

!Create second plate
BLOCK,0,width,0,height,separation,separation+thickness

! Mesh settings
ESIZE,0.005 ! Set element size

!Apply mesh to all volumes
ALLSEL,ALL
VMESH,ALL

/SOLU

! Specify electrostatic analysis
ANTYPE,STAT

! boundary condition
ALLSEL
CSYS,0

!Apply 0V to the top of the first plate
ASEL,S,LOC,Z,thickness
NSLA,S,1
D,ALL,VOLT,0

!Apply 1V to the bottom of the second plate
ALLSEL
ASEL,S,LOC,Z,separation
NSLA,S,1
D,ALL,VOLT,1

! Find the solution
SOLVE
FINISH

/POST1
PLNSOL,VOLT ! Plot node solution (voltage)

! Calculate capacity by extracting electric field energy
/OUT, CAPACITANCE_CALCULATION, , TXT
*GET, W, ENER, , STAT, ENE
V = 1
C = 2*W/(V**2)
*STATUS, C
/OUT

Please tell me what needs to be improved.

thank you```
• Bill Bulat
Ansys Employee

Please try the listing below. In electrostatic analyses, one models/meshes the domain enclosing the electrodes (not the electrodes themselves). The electrodes are usually represented by voids in a mesh of the domain that encloses them. I didn't bother to add the INFIN111 elements (it's a little tedious - pardon me for getting cheap on you). You can increase the value of parameter d_dmn in successive runs until the value of the calculated capacitance stops changing significantly.

If memory serves, INFIN111 will not account for additional electrostatic energy of the infinite domain that extends beyond the boundaries of the SOLID122/123 mesh. So if you do use them, my second approach for assessing the capacitance would be, I believe, the more accurate way (divide the charge reaction on one of the electrodes by the applied voltage difference).

Cheers,

Bill

fini
/cle

/vie,1,1,1,1
/sys,del file*.png

/PREP7

C*** Plate dimensions (we'll assume this is in meters)
eps0=8.854e-12 ! FREE SPACE PERMITTIVITY

width = 0.1
height = 0.02
thickness = 0.003
separation = 0.002 !0.010

d_dmn = 0.010 ! DEPTH SURROUNDING DOMAIN EXTENDS BEYOND ELECTRODES
d_inf = 0.005 ! DEPTH OF INFINITE BOUNDARY ELEMENT MESH

esz = 0.003 ! MESH SIZE

V = 1 ! APPLIED VOLTAGE

C*** Configured for electrostatic analysis of 3D 8-node elements
ET,1,SOLID123

C*** Define infinite element
ET,2,111,2,1

C*** Material properties (relative dielectric constant in vacuum)
!MP,PERX,1,8.854e-12 ! THIS IS ABSOLUTE PERMITTIVITY IN MKS, WHICH WORKS OK, BUT...
MP,PERX,1,1 ! WE GENERALLY USE RELATIVE PERMITTIVITY INSTEAD

BLOCK,0,width,0,height,0,-thickness
cm,electrode1_a,area

C*** Create second plate
asel,none
BLOCK,0,width,0,height,separation,separation+thickness
cm,electrode2_a,area

C*** SURROUNDING DOMAIN
alls
cm,scrap1_v,volu
*get,xmin,kp,,mnloc,x
*get,xmax,kp,,mxloc,x
*get,ymin,kp,,mnloc,y
*get,ymax,kp,,mxloc,y
*get,zmin,kp,,mnloc,z
*get,zmax,kp,,mxloc,z
vsel,none
bloc,xmin-d_dmn,xmax+d_dmn,ymin-d_dmn,ymax+d_dmn,zmin-d_dmn,zmax+d_dmn
cm,scrap2_v,volu
alls
vsbv,scrap2_v,scrap1_v

C*** MESH
esiz,esz
vmes,all

C*** ELECTRODE VOLTAGE
da,electrode1_a,volt
da,electrode2_a,volt,V

fini

C*** SOLVE
/solu
alls
save
solv
fini

C*** POST PROCESS
/post1

etab,w,sene ! BASED ON ENERGY
ssum
*get,Wnet,ssum,,item,w
C1 = 2*Wnet/(V**2)

nsel,s,d,volt ! BASED ON CHARGE & VOLTAGE
fsum
*get,q,fsum,,item,chrg
c2 = q/v

C_nominal=eps0*(height*width)/separation ! NOMINAL FRINGE FREE VALUE

/tla,-0.35,0.90,Capacitance (ANSYS, energy) = %C1% Fd ! ANNOTATION
/tla,-0.35,0.85,Capacitance (ANSYS, Q/V) = %C2% Fd
/tla,-0.35,0.80,Capacitance (nominal fringe-free) = %C_nominal% Fd

alls ! CAPPED SECTION PLOTS
wpro,,,90
wpof,,,width/2
/type,1,7
/cpl,1

plns,volt
/sho,png \$plns,volt \$/sho,close \$/wait,2
plve,ef,,,,vect,,on
/sho,png \$plve,ef,,,,vect,,on \$/sho,close \$/wait,2

/eof

• Yuuhi Takabayashi
Subscriber

dear Bill

I tried it right away and was able to successfully analyze it. It never occurred to me to mesh the area instead of the electrode.
I have an additional question: What kind of command operation should I use to extract the electric field leaking from the electrode?

Where is the capacitance worth when there is a fringe?

Thanks

• Yuuhi Takabayashi
Subscriber

misstake　post

• Yuuhi Takabayashi
Subscriber

postscript
Where is the capacitance worth when there is a fringe?