Commit 0a0c349e34e9cb5f4ddc9556af3fb867ac41aff5

Authored by Chris Smartt
1 parent 7deb5e73
Exists in nested_overshields

Add nested overshield checks on MI and MV matrices

SRC/BUNDLE_DOMAIN_CREATION/create_global_domain_structure.F90
@@ -168,7 +168,12 @@ USE maths @@ -168,7 +168,12 @@ USE maths
168 integer :: row_g,col_g,row_g_ref 168 integer :: row_g,col_g,row_g_ref
169 169
170 character(LEN=3) :: conductor_string ! used to generate the conductor labels in the bundle 170 character(LEN=3) :: conductor_string ! used to generate the conductor labels in the bundle
171 - 171 +
  172 + real(dp),allocatable :: M1(:,:),M1I(:,:),M2(:,:)
  173 + integer :: Mdim
  174 + integer :: ierr
  175 + real(dp) :: Mdiff
  176 +
172 ! START 177 ! START
173 178
174 if(verbose) write(*,*)'CALLED: create_global_domain_structure' 179 if(verbose) write(*,*)'CALLED: create_global_domain_structure'
@@ -1050,8 +1055,8 @@ USE maths @@ -1050,8 +1055,8 @@ USE maths
1050 ! if (verbose) write(*,*)'Copy MV element',row_g,col_g,bundle%global_MV%mat(row_g,col_g) 1055 ! if (verbose) write(*,*)'Copy MV element',row_g,col_g,bundle%global_MV%mat(row_g,col_g)
1051 1056
1052 if (verbose) then 1057 if (verbose) then
1053 - write(*,*)'Copy MI element',' row_g=',row_g,' col_g=',col_g, &  
1054 - ' row_l=',row_l,' col_l=',col_l,bundle%cable(cable)%MI%mat(row_l,col_l) 1058 + write(*,'(A,A,I3,A,I3,A,I3,A,I3,F5.2,F5.2)')'Copy MI element',' row_g=',row_g,' col_g=',col_g, &
  1059 + ' row_l=',row_l,' col_l=',col_l,bundle%cable(cable)%MI%mat(row_l,col_l),bundle%cable(cable)%MV%mat(row_l,col_l)
1055 end if 1060 end if
1056 1061
1057 end do ! next col 1062 end do ! next col
@@ -1180,7 +1185,68 @@ USE maths @@ -1180,7 +1185,68 @@ USE maths
1180 end do ! next local domain 1185 end do ! next local domain
1181 1186
1182 end do ! next cable 1187 end do ! next cable
  1188 +
  1189 +! if (verbose) then
  1190 +
  1191 + write(*,*)''
  1192 + write(*,*)'CHECK CONSISTENCY OF MI, MV matrices, (MV)T=(MI^-1)'
  1193 + write(*,*)''
  1194 +
  1195 + Mdim=bundle%global_MI%dim
1183 1196
  1197 +! This is the matrix dimensions however if there is no ground plane then the last conductor is
  1198 +! the reference and hence the matrix dimension is reduced by one
  1199 +
  1200 + if (.NOT.bundle%ground_plane_present) then
  1201 + Mdim=Mdim-1
  1202 + end if
  1203 +
  1204 + ALLOCATE( M1(1:Mdim,1:Mdim) )
  1205 + ALLOCATE( M2(1:Mdim,1:Mdim) )
  1206 + ALLOCATE( M1I(1:Mdim,1:Mdim) )
  1207 +
  1208 + M1(1:Mdim,1:Mdim)=bundle%global_MI%mat(1:Mdim,1:Mdim)
  1209 +
  1210 + do row_l=1,Mdim
  1211 + do col_l=1,Mdim
  1212 + M2(row_l,col_l)=bundle%global_MV%mat(col_l,row_l)
  1213 + end do
  1214 + end do
  1215 +
  1216 + CALL dinvert_Gauss_Jordan(M1,Mdim,M1I,Mdim,ierr)
  1217 +
  1218 + Mdiff=0d0
  1219 + do row_l=1,Mdim
  1220 + do col_l=1,Mdim
  1221 + Mdiff=Mdiff+abs( M1I(row_l,col_l)-M2(row_l,col_l) )
  1222 + end do
  1223 + end do
  1224 +
  1225 + write(*,*)'MI='
  1226 + CALL dwrite_matrix(M1,Mdim,Mdim,Mdim,0)
  1227 + write(*,*)''
  1228 + write(*,*)'(MI)^-1^='
  1229 + CALL dwrite_matrix(M1I,Mdim,Mdim,Mdim,0)
  1230 + write(*,*)''
  1231 + write(*,*)'(MV)T='
  1232 + CALL dwrite_matrix(M2,Mdim,Mdim,Mdim,0)
  1233 +
  1234 + write(*,*)''
  1235 + write(*,*)'Matrix difference=',Mdiff
  1236 + write(*,*)''
  1237 +
  1238 + DEALLOCATE( M1 )
  1239 + DEALLOCATE( M2 )
  1240 + DEALLOCATE( M1I )
  1241 +
  1242 + if (Mdiff.GT.0.001) then
  1243 + write(*,*)'ERROR in create_global_domain_structure'
  1244 + write(*,*)'(MV)T .NE. (MI)^-1'
  1245 + STOP
  1246 + end if
  1247 +
  1248 +! end if
  1249 +
1184 ! 7. Calculate the inductance and capacitance matrices for the external domains (domains within overshields and the external domain) 1250 ! 7. Calculate the inductance and capacitance matrices for the external domains (domains within overshields and the external domain)
1185 1251
1186 if(verbose) write(*,*)'first external domain:',first_external_domain 1252 if(verbose) write(*,*)'first external domain:',first_external_domain
TEST_CASES/COAX_FREE_SPACE/coax.bundle_spec
@@ -6,4 +6,5 @@ @@ -6,4 +6,5 @@
6 coax_free_space 6 coax_free_space
7 0.0 0.0 ! x and y coordinates of the cable centre 7 0.0 0.0 ! x and y coordinates of the cable centre
8 no_ground_plane 8 no_ground_plane
  9 +verbose
9 10
TEST_CASES/COMPLEX_BUNDLE/complex_bundle.bundle_spec
@@ -3,8 +3,6 @@ @@ -3,8 +3,6 @@
3 #MOD_bundle_lib_dir 3 #MOD_bundle_lib_dir
4 ./ 4 ./
5 9 # number of cables (including overshields) followed by a list of the cables 5 9 # number of cables (including overshields) followed by a list of the cables
6 -10mm_radius_overshield  
7 -0.0 0.030 0.0 ! x and y coordinates of the overshield centre and rotation angle, theta  
8 0.1mm_radius_single_wire 6 0.1mm_radius_single_wire
9 -0.005 0.030 0.0 ! x and y coordinates of the cable centre and rotation angle, theta 7 -0.005 0.030 0.0 ! x and y coordinates of the cable centre and rotation angle, theta
10 rg58 8 rg58
@@ -21,5 +19,7 @@ shielded_twisted_pair @@ -21,5 +19,7 @@ shielded_twisted_pair
21 0.00 0.025 0.0 ! x and y coordinates of the cable centre and rotation angle, theta 19 0.00 0.025 0.0 ! x and y coordinates of the cable centre and rotation angle, theta
22 spacewire 20 spacewire
23 0.02 0.02 0.0 ! x and y coordinates of the cable centre and rotation angle, theta 21 0.02 0.02 0.0 ! x and y coordinates of the cable centre and rotation angle, theta
  22 +10mm_radius_overshield
  23 +0.0 0.030 0.0 ! x and y coordinates of the overshield centre and rotation angle, theta
24 ground_plane 24 ground_plane
25 25
TEST_CASES/COMPLEX_BUNDLE/complex_bundle.spice_model_spec
@@ -16,9 +16,9 @@ complex_bundle @@ -16,9 +16,9 @@ complex_bundle
16 -1.0 0.0 Etheta Ephi 16 -1.0 0.0 Etheta Ephi
17 #Transfer impedance terms 17 #Transfer impedance terms
18 1 # number of transfer impedances to include in the model 18 1 # number of transfer impedances to include in the model
19 -7 -1 # conductor number and coupling direction for transfer impedance model 1 + is inside to out 19 +6 -1 # conductor number and coupling direction for transfer impedance model 1 + is inside to out
20 # End 1 termination model 20 # End 1 termination model
21 -1.0 End 1 voltage source list 21 +0.0 End 1 voltage source list
22 0.0 22 0.0
23 0.0 23 0.0
24 0.0 24 0.0
@@ -46,9 +46,8 @@ complex_bundle @@ -46,9 +46,8 @@ complex_bundle
46 0.0 46 0.0
47 0.0 47 0.0
48 0.0 48 0.0
49 -0.0  
50 -50.0 End 1 impedance list  
51 -25.0 49 +1.0
  50 +25.0 End 1 impedance list
52 0.0 51 0.0
53 0.0 52 0.0
54 0.0 53 0.0
@@ -76,6 +75,7 @@ complex_bundle @@ -76,6 +75,7 @@ complex_bundle
76 0.0 75 0.0
77 0.0 76 0.0
78 0.0 77 0.0
  78 +50.0
79 # End 2 termination model 79 # End 2 termination model
80 0.0 End 2 voltage source list 80 0.0 End 2 voltage source list
81 0.0 81 0.0
@@ -106,8 +106,7 @@ complex_bundle @@ -106,8 +106,7 @@ complex_bundle
106 0.0 106 0.0
107 0.0 107 0.0
108 0.0 108 0.0
109 -5.0 End 2 impedance list  
110 -1000.0 109 +1000.0 End 2 impedance list
111 0.0 110 0.0
112 0.0 111 0.0
113 0.0 112 0.0
@@ -135,12 +134,13 @@ complex_bundle @@ -135,12 +134,13 @@ complex_bundle
135 0.0 134 0.0
136 0.0 135 0.0
137 0.0 136 0.0
  137 +5.0 End 2 impedance list
138 # Type of analysis 138 # Type of analysis
139 AC 139 AC
140 log # frequency scale (log or lin) 140 log # frequency scale (log or lin)
141 1e5 1e9 1000 # fmin fmax number_of_frequencies 141 1e5 1e9 1000 # fmin fmax number_of_frequencies
142 # Output conductor number and end number 142 # Output conductor number and end number
143 -6 2 143 +5 28 2
144 lin # output type (lin or dB) 144 lin # output type (lin or dB)
145 0 # order for vector fit model 145 0 # order for vector fit model
146 log # frequency scale (log or lin) 146 log # frequency scale (log or lin)