Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | You are right, there is a bug in NEC-2 when the extended thin-wire |
2 | kernel is used with wires connected to patches. This has escaped |
||
3 | detection for over 20 years. I did not catch it yesterday, because I |
||
4 | had MAXSEG=10000, and ICON1 and ICON2 are dimensioned to 2*MAXSEG, so |
||
5 | 10000 did not exceed the bound. |
||
6 | |||
7 | The problem can be fixed as shown below. In addition to subroutine |
||
8 | CMWW, where you encountered the problem, the same changes need to be |
||
9 | made in subroutines NEFLD and QDSRC. With this change the extended |
||
10 | kernel is not used at a wire end connected to a patch surface, but |
||
11 | would be used on the rest of the wire if it is straight . |
||
12 | |||
13 | The extended thin-wire kernel is only used on thick, straight wires, |
||
14 | so is not very useful. The code turns it off at junctions, bends and |
||
15 | changes in radius. Also, the connection of a wire to a patch surface |
||
16 | is not good in NEC-2 or 4. It works fairly well for something like a |
||
17 | monopole on a surface, but not for a half loop connected to the |
||
18 | surface. A wire grid surface provides a better connection for a wire |
||
19 | antenna. |
||
20 | |||
21 | NEC-4 does not have the extended kernel, but instead puts the current |
||
22 | on the wire surface with match points on the axis, and has an |
||
23 | approximation for wire end caps that reduces the instability when the |
||
24 | segment length to radius ratio is small. So NEC-4 would not have |
||
25 | this problem. |
||
26 | |||
27 | Thanks for finding this bug. |
||
28 | |||
29 | Jerry Burke |
||
30 | LLNL |
||
31 | |||
32 | |||
33 | |||
34 | |||
35 | To fix the extended thin-wire kernel with patches in NEC-2: |
||
36 | |||
37 | SUBROUTINE CMWW (J,I1,I2,CM,NR,CW,NW,ITRP) |
||
38 | . |
||
39 | . |
||
40 | C DECIDE WETHER EXT. T.W. APPROX. CAN BE USED |
||
41 | IPR=ICON1(J) |
||
42 | IF(IPR.GT.10000)GO TO 5 !<---NEW |
||
43 | IF (IPR) 1,6,2 |
||
44 | 1 IPR=-IPR |
||
45 | IF (-ICON1(IPR).NE.J) GO TO 7 |
||
46 | GO TO 4 |
||
47 | 2 IF (IPR.NE.J) GO TO 3 |
||
48 | IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 7 |
||
49 | GO TO 5 |
||
50 | 3 IF (ICON2(IPR).NE.J) GO TO 7 |
||
51 | 4 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) |
||
52 | IF (XI.LT.0.999999D+0) GO TO 7 |
||
53 | IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 7 |
||
54 | 5 IND1=0 |
||
55 | GO TO 8 |
||
56 | 6 IND1=1 |
||
57 | GO TO 8 |
||
58 | 7 IND1=2 |
||
59 | 8 IPR=ICON2(J) |
||
60 | IF(IPR.GT.10000)GO TO 15 !<---NEW |
||
61 | IF (IPR) 9,14,10 |
||
62 | |||
63 | |||
64 | SUBROUTINE NEFLD (XOB,YOB,ZOB,EX,EY,EZ) |
||
65 | . |
||
66 | . |
||
67 | IPR=ICON1(I) |
||
68 | IF(IPR.GT.10000)GO TO 9 !<---NEW |
||
69 | IF (IPR) 3,8,4 |
||
70 | 3 IPR=-IPR |
||
71 | IF (-ICON1(IPR).NE.I) GO TO 9 |
||
72 | GO TO 6 |
||
73 | 4 IF (IPR.NE.I) GO TO 5 |
||
74 | IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 9 |
||
75 | GO TO 7 |
||
76 | 5 IF (ICON2(IPR).NE.I) GO TO 9 |
||
77 | 6 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) |
||
78 | IF (XI.LT.0.999999D+0) GO TO 9 |
||
79 | IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 9 |
||
80 | 7 IND1=0 |
||
81 | GO TO 10 |
||
82 | 8 IND1=1 |
||
83 | GO TO 10 |
||
84 | 9 IND1=2 |
||
85 | 10 IPR=ICON2(I) |
||
86 | IF(IPR.GT.10000)GO TO 17 !<---NEW |
||
87 | IF (IPR) 11,16,12 |
||
88 | |||
89 | |||
90 | SUBROUTINE QDSRC (IS,V,E) |
||
91 | . |
||
92 | . |
||
93 | IPR=ICON1(J) |
||
94 | IF(IPR.GT.10000)GO TO 7 !<---NEW |
||
95 | IF (IPR) 1,6,2 |
||
96 | 1 IPR=-IPR |
||
97 | IF (-ICON1(IPR).NE.J) GO TO 7 |
||
98 | GO TO 4 |
||
99 | 2 IF (IPR.NE.J) GO TO 3 |
||
100 | IF (CABJ*CABJ+SABJ*SABJ.GT.1.D-8) GO TO 7 |
||
101 | GO TO 5 |
||
102 | 3 IF (ICON2(IPR).NE.J) GO TO 7 |
||
103 | 4 XI=ABS(CABJ*CAB(IPR)+SABJ*SAB(IPR)+SALPJ*SALP(IPR)) |
||
104 | IF (XI.LT.0.999999D+0) GO TO 7 |
||
105 | IF (ABS(BI(IPR)/B-1.).GT.1.D-6) GO TO 7 |
||
106 | 5 IND1=0 |
||
107 | GO TO 8 |
||
108 | 6 IND1=1 |
||
109 | GO TO 8 |
||
110 | 7 IND1=2 |
||
111 | 8 IPR=ICON2(J) |
||
112 | IF(IPR.GT.10000)GO TO 15 !<---NEW |
||
113 | IF (IPR) 9,14,10 |
||
114 |