-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwire_dc.mac
More file actions
174 lines (131 loc) · 5.09 KB
/
Copy pathwire_dc.mac
File metadata and controls
174 lines (131 loc) · 5.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx!
!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx!
!
! Filename: wire_dc.mac, ANSYS APDL script
! by Kolchuzhin V., TU Chemnitz, MMT
! <vladimir.kolchuzhin@etit.tu-chemnitz.de>
!
! Issue: 1. Geometric and FE modeling:
! 3D FE-mesh -> *.db
! 2. Steady-state current conduction analysis:
! determines the current density and electric potential distribution
! caused by direct current (DC) or potential drop: V(x,y,z)
! 3. R=Vs*Vs/P or R=P/Is/Is
!
! Rev.: 18. Oktober 2015
!
! Ref.: 12.4. Steady-State Current Conduction Analysis
!==========================================================================!
!
! y
!
! ^
! cond1 | cond2
! | h_wire
! >o------------o------------o< o---o
! >| | |< | |
! 0V >| | |< Vs/Is | |
! >| *------------------> x | | w_wire
! >| | |< | |
! >| | |< | |
! >o------------o------------o< o---o
!
! l_wire
! ASCII-Schematic of the problem
!==========================================================================!
!
!
!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx!
!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx!
FINISH $/CLEAR $/CONTOUR,1,128
/VUP,,Z
!/PLOPTS,VERS,0 $/PLOPTS,DATE,0 $/PLOPTS,TITLE,0 $/PLOPTS,Logo,off
/TITLE, Steady-state current conduction analysis
project_name='rectangular_wire'
!--------------------------------------------------------------------------!
/PREP7
mm=1e-3 !
!-------------------------! geometry parametrs !---------------------------!
l_wire=10.0*mm
h_wire= 0.5*mm
w_wire= 4.0*mm
! mesh quality
el_size=0.25*mm
Vs= 1 ! V
Is= 1 ! A
!--------------------------------------------------------------------------!
!----------------------! Defines elements types !--------------------------!
!--------------------------------------------------------------------------!
ET,1,SOLID5,9 ! 8-Node 3D Coupled-Field Solid
!--------------------------------------------------------------------------!
!-------------------! Defines material properties !------------------------!
!--------------------------------------------------------------------------!
EMUNIT,MKS !
! electrical material properties:
! resistivity, Ohm*m at 20 C:
rsvx_Ag=1.59e-08
rsvx_Cu=1.68e-08
rsvx_Al=2.65e-08
mp,rsvx,1,rsvx_Cu !
!--------------------------------------------------------------------------!
!-------------------------------! Geometry !-------------------------------!
!--------------------------------------------------------------------------!
!BLOCK, X1, X2, Y1, Y2, Z1, Z2 ! creates a block volume based
BLOCK,-l_wire/2,+l_wire/2,-w_wire/2,+w_wire/2,-h_wire/2,+h_wire/2
!--------------------------------------------------------------------------!
! mesh
! options for mesh
!SMRTSIZE,3 ! set smart size meshing level 4 (fine)
!MSHAPE,0,3D ! quadrilateral-shaped elements
!MSHAPE,1,3D ! triangle-shaped elements
!MSHKEY,0 ! 0 - free meshing / 1 - mapped meshing
MSHAPE,0,3D $MSHKEY,1 $ESIZE,el_size
MAT,1 $TYPE,1
VMESH,1
!--------------------------------------------------------------------------!
!--------------------! Defines components for BCs !------------------------!
!--------------------------------------------------------------------------!
nsel,s,loc,x,-l_wire/2 ! first/left electrode
cm,nodes_cond1,node
nsel,s,loc,x,+l_wire/2 ! second/right electrode
cm,nodes_cond2,node
cmsel,all $allsel
eplot
!==========================================================================!
!save,project_name,db,,all
!==========================================================================!
! apply load and BCs
!-------------------
cmsel,s,nodes_cond1,node
d,all,volt,0.0
cmsel,s,nodes_cond2,node
!d,all,volt,Vs
f,all,amps,Is
cmsel,all $allsel
/PNUM,MAT,0 $/NUMBER,0 $EPLOT
!==========================================================================!
/solu
antype,static ! steady state analysis
solve
!==========================================================================!
/post1
allsel
plnsol,volt
!ples,js,sum ! current density
!ples,amps
!ples,jheat
!--------------------------------------------------------------------------!
POWERH ! Time average power loss (PAVG), Watts
*STATUS,PAVG ! Parameter defined for power loss (avr), Watts
! PLOSSD ! Element table item for power loss density
!cmsel,all $allsel
!etable,energie,sene $ssum $*get,Wsene,ssum,,item,energie
!R=Vs*Vs/PAVG
R=PAVG/Is/Is
*status,R
/head,off,off,off,off,off,off
/output,%project_name%_R,dat,,append
*VWRITE,R
(1E20.12)
/output
!==========================================================================!