[12] | 1 | subroutine scwall (r,z,er,ez) |
---|
| 2 | c---calculate electric field components due to image |
---|
| 3 | c---charges on wall caused by a ring of charge at z |
---|
| 4 | c---having a radius r |
---|
| 5 | c---having a radius r (only valid for r.le.0.9*rwall). |
---|
| 6 | c--------------------------------------------------------------------------- |
---|
| 7 | save |
---|
| 8 | c |
---|
| 9 | include 'constcom.h' |
---|
| 10 | include 'fldcom.h' |
---|
| 11 | include 'ucom.h' |
---|
| 12 | c |
---|
| 13 | common/splwall/ rr(10),s(8),sig(8,10),sx(8,10), |
---|
| 14 | * sy(8,10),sxy(8,10) |
---|
| 15 | r1=rp |
---|
| 16 | z1=zp |
---|
| 17 | c-------------------------------------------------------------------------- |
---|
| 18 | c* |
---|
| 19 | if (r1.lt.rwall) go to 10 |
---|
| 20 | if (r1.eq.rwall) go to 3 |
---|
| 21 | c---inside wall. set field to zero. |
---|
| 22 | er=0. |
---|
| 23 | ez=0. |
---|
| 24 | return |
---|
| 25 | c---calculate fields on wall |
---|
| 26 | 3 continue |
---|
| 27 | rx=r/rwall |
---|
| 28 | sr=abs((z1-z)/rwall) |
---|
| 29 | sg=0. |
---|
| 30 | c---calculate charge density on wall if sr.lt.4. |
---|
| 31 | if (sr.lt.4.) sg=spl2d2 (rx,sr,10,rr,8,s,sig,sx,sy,sxy,8,0,0) |
---|
| 32 | ez=0. |
---|
| 33 | er=-sg/(twopi*rwall**2) |
---|
| 34 | return |
---|
| 35 | 10 continue |
---|
| 36 | rx=r/rwall |
---|
| 37 | ersum=0. |
---|
| 38 | ezsum=0. |
---|
| 39 | do 20 n=1,7 |
---|
| 40 | c---calculate mid point between knots of spline. |
---|
| 41 | sb=.5*(s(n)+s(n+1)) |
---|
| 42 | c---calculate charge density at mid point |
---|
| 43 | sg=spl2d2(rx,sb,10,rr,8,s,sig,sx,sy,sxy,8,0,0) |
---|
| 44 | c---calculate total charge on segment |
---|
| 45 | q=sg*(s(n+1)-s(n)) |
---|
| 46 | c---calculate field components due to charged rings |
---|
| 47 | call fldring (r1,z1,rwall,z+sb*rwall,er1,ez1) |
---|
| 48 | call fldring (r1,z1,rwall,z-sb*rwall,er2,ez2) |
---|
| 49 | c---sum up fields due to all rings. |
---|
| 50 | ersum=ersum+q*(er1+er2) |
---|
| 51 | ezsum=ezsum+q*(ez1+ez2) |
---|
| 52 | 20 continue |
---|
| 53 | er=ersum |
---|
| 54 | ez=ezsum |
---|
| 55 | return |
---|
| 56 | end |
---|
| 57 | c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* |
---|