-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutp2.pro
145 lines (134 loc) · 3.73 KB
/
utp2.pro
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
Group {
Diel1 = Region[7];
Ground = Region[10];
Electrode1 = Region[8];
Electrode2 = Region[9];
Vol_Ele = Region[ {Diel1 } ];
Sur_Neu_Ele = Region[ {} ];
}
Function {
eps0 = 8.854187818e-12;
epsilon[Diel1] = 1* eps0;
}
Constraint {
{ Name Dirichlet_Ele; Type Assign;
Case {
{ Region Ground; Value 0.; }
{ Region Electrode1; Value 1; }
{ Region Electrode2; Value 0.; }
}
}
}
Group{
Dom_Hgrad_v_Ele = Region[ {Vol_Ele, Sur_Neu_Ele} ];
}
FunctionSpace {
{ Name Hgrad_v_Ele; Type Form0;
BasisFunction {
{ Name sn; NameOfCoef vn; Function BF_Node;
Support Dom_Hgrad_v_Ele; Entity NodesOf[ All, Not Electrode1 ]; }
{ Name sf; NameOfCoef vf; Function BF_GroupOfNodes;
Support Dom_Hgrad_v_Ele; Entity GroupsOfNodesOf[ Electrode1 ]; }
}
GlobalQuantity {
{ Name GlobalPotential; Type AliasOf; NameOfCoef vf; }
{ Name ArmatureCharge; Type AssociatedWith; NameOfCoef vf; }
}
Constraint {
{ NameOfCoef vn; EntityType NodesOf; NameOfConstraint Dirichlet_Ele; }
{ NameOfCoef GlobalPotential; EntityType GroupsOfNodesOf; NameOfConstraint Dirichlet_Ele; }
}
}
}
Jacobian {
{ Name Vol ;
Case {
{ Region All ; Jacobian Vol ; }
}
}
{ Name Sur ;
Case {
{ Region All ; Jacobian Sur ; }
}
}
}
Integration {
/* A Gauss quadrature rule with 4 points is used for all integrations below. */
{ Name Int ;
Case { { Type Gauss ;
Case { { GeoElement Line ; NumberOfPoints 4 ; }
{ GeoElement Triangle ; NumberOfPoints 4 ; }
{ GeoElement Quadrangle ; NumberOfPoints 4 ; } }
}
}
}
}
Formulation {
{ Name Electrostatics_v; Type FemEquation;
Quantity {
{ Name v; Type Local; NameOfSpace Hgrad_v_Ele; }
{ Name U; Type Global; NameOfSpace Hgrad_v_Ele [GlobalPotential]; }
{ Name Q; Type Global; NameOfSpace Hgrad_v_Ele [ArmatureCharge]; }
}
Equation {
Integral { [ epsilon[] * Dof{d v} , {d v} ];
In Vol_Ele; Jacobian Vol; Integration Int; }
GlobalTerm { [ -Dof{Q} , {U} ]; In Electrode1; }
}
}
}
Resolution {
{ Name EleSta_v;
System {
{ Name Sys_Ele; NameOfFormulation Electrostatics_v; }
}
Operation {
Generate[Sys_Ele]; Solve[Sys_Ele]; SaveSolution[Sys_Ele];
}
}
}
PostProcessing {
{ Name EleSta_v; NameOfFormulation Electrostatics_v;
Quantity {
{ Name v; Value {
Term { [ {v} ]; In Dom_Hgrad_v_Ele; Jacobian Vol; }
}
}
{ Name e; Value {
Term { [ -{d v} ]; In Dom_Hgrad_v_Ele; Jacobian Vol; }
}
}
{ Name d; Value {
Term { [ -epsilon[] * {d v} ]; In Dom_Hgrad_v_Ele; Jacobian Vol; }
}
}
{ Name Q; Value {
Term { [ {Q} ]; In Electrode1; }
}
}
{ Name U; Value {
Term { [ {U} ]; In Electrode1; }
}
}
{ Name C; Value {
Term { [ Fabs[{Q}/{U}] ]; In Electrode1; }
}
}
}
}
}
PostOperation {
{ Name Map; NameOfPostProcessing EleSta_v;
Operation {
Print[ v, OnElementsOf Dom_Hgrad_v_Ele, File "v.pos" ];
Print[ e, OnElementsOf Dom_Hgrad_v_Ele, File "e.pos" ];
Print[ d, OnElementsOf Dom_Hgrad_v_Ele, File "d.pos" ];
Echo[ "Electrode1 charge [C]:", Format Table, File > "output.txt"] ;
Print[ Q, OnRegion Electrode1, File > "output.txt", Format Table ];
Echo[ "Electrode1 potential [V]:", Format Table, File > "output.txt"] ;
Print[ U, OnRegion Electrode1, File > "output.txt", Format Table ];
Echo[ "Coaxial cable capacitance [F]:", Format Table, File > "output.txt"] ;
Print[ C, OnRegion Electrode1, File > "output.txt", Format Table ];
}
}
}