Commit 7deb5e7338983d1488f1e7c02159a34465d167b3

Authored by Chris Smartt
1 parent 0cd31073
Exists in nested_overshields

Initial updates to create_global_domain_structure.F90 for nested overshields

DOCUMENTATION/USER_GUIDE/Imgs/edge_coupled_stripline-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_bundle_form_01-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_bundle_form_01a-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_bundle_form_01b-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_bundle_form_02-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_bundle_form_02a-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_bundle_form_02b-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_cable_form_01-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_cable_form_02-eps-converted-to.pdf deleted
No preview for this file type
DOCUMENTATION/USER_GUIDE/Imgs/flex_cable_form_03-eps-converted-to.pdf deleted
No preview for this file type
SRC/BUNDLE_DOMAIN_CREATION/create_global_domain_structure.F90
... ... @@ -73,8 +73,10 @@
73 73 ! so that we can work out the is_shield flag properly in all circumstances.
74 74 ! 18/10/2017 CJS: include 8b. Copy the cable based conductor labels to the bundle structure
75 75 ! 16/11/2017 CJS Include network synthesis process to replace s-domain transfer functions
76   -! 16/3/2018 CJS add y offset for ML_flex_cable
  76 +! 16/3/2018 CJS add y offset for ML_flex_cable
77 77 ! 22/10/2019 CJS Fix bug with numbering here: overshields were numbered using terminal conductor number not global domain number
  78 +! 24/10/2019 CJS Allow mutliple layers of overshields (previously overshields could not be 'nested'
  79 +! (though they could cover shielded cables).
78 80 !
79 81  
80 82 SUBROUTINE create_global_domain_structure(bundle)
... ... @@ -97,7 +99,7 @@ USE maths
97 99 ! local variables
98 100  
99 101 ! global cable, conductor and domain numbers and loop variables
100   - integer :: cable
  102 + integer :: cable,cable_t
101 103 integer :: tot_n_cables
102 104 integer :: tot_n_cables_without_ground_plane
103 105  
... ... @@ -115,7 +117,9 @@ USE maths
115 117 integer :: first_external_conductor
116 118  
117 119 ! variables for looking at overshields and determining which domain cables are in
118   - integer :: tot_n_overshields,n_overshield_domains,overshield
  120 + integer :: tot_n_overshields,n_overshield_domains,overshield,reference_overshield
  121 + real(dp)::radius_reference_overshield
  122 +
119 123 integer,allocatable :: overshield_shape(:)
120 124 real(dp),allocatable :: overshield_x(:)
121 125 real(dp),allocatable :: overshield_y(:)
... ... @@ -125,11 +129,12 @@ USE maths
125 129 real(dp),allocatable :: overshield_h(:)
126 130 integer,allocatable :: overshield_domain(:)
127 131 integer,allocatable :: overshield_reference_terminal_conductor(:)
  132 + integer,allocatable :: overshield_to_cable_number(:)
128 133  
129 134 integer,allocatable :: overshield_n_conductors(:)
130 135 integer,allocatable :: overshield_terminal_conductor(:,:)
131 136  
132   - real(dp) :: cable_x,cable_y,dist_cable_to_overshield_centre
  137 + real(dp) :: cable_x,cable_y,dist_cable_to_overshield_centre,cable_r
133 138 logical :: is_overshield_domain
134 139  
135 140 ! referencing arrays
... ... @@ -160,7 +165,7 @@ USE maths
160 165 integer :: dim
161 166 integer :: row,col
162 167 integer :: row_l,col_l
163   - integer :: row_g,col_g
  168 + integer :: row_g,col_g,row_g_ref
164 169  
165 170 character(LEN=3) :: conductor_string ! used to generate the conductor labels in the bundle
166 171  
... ... @@ -291,12 +296,14 @@ USE maths
291 296 ALLOCATE( overshield_w2(1:tot_n_overshields) )
292 297 ALLOCATE( overshield_h(1:tot_n_overshields) )
293 298 ALLOCATE( overshield_reference_terminal_conductor(1:tot_n_overshields) )
  299 + ALLOCATE( overshield_to_cable_number(1:tot_n_overshields) )
294 300  
295 301 overshield=0
296 302 conductor_count=0
297 303 do cable=1,tot_n_cables
298 304 if (bundle%cable(cable)%cable_type.EQ.cable_geometry_type_overshield) then
299 305 overshield=overshield+1
  306 + overshield_to_cable_number(overshield)=cable
300 307 overshield_shape(overshield)=circle
301 308 overshield_x(overshield)=bundle%cable_x_offset(cable)
302 309 overshield_y(overshield)=bundle%cable_y_offset(cable)
... ... @@ -305,6 +312,20 @@ USE maths
305 312 overshield_w2(overshield)=0d0
306 313 overshield_h(overshield)=0d0
307 314 overshield_reference_terminal_conductor(overshield)=conductor_count+1
  315 +
  316 + else
  317 +
  318 +! This is not an overshield
  319 +
  320 + if ( (bundle%cable(cable)%cable_type.NE.cable_geometry_type_ground_plane) .AND. (overshield.NE.0) ) then
  321 +
  322 +! check that oveshields are the last conductors defined in the bundle_spec file
  323 + run_status='ERROR, Overshields should be the last cables defined in the bundle specification'
  324 + CALL write_program_status()
  325 + STOP 1
  326 +
  327 + end if
  328 +
308 329 end if
309 330 conductor_count=conductor_count+bundle%cable(cable)%tot_n_conductors
310 331 end do
... ... @@ -330,47 +351,175 @@ USE maths
330 351 cable_reference_conductor(1:bundle%n_cables)=0
331 352 n_overshield_domains=0 ! counter for overshield domains
332 353  
  354 + write(*,*)'**********************************************************************'
  355 +
333 356 do cable=1,tot_n_cables
334 357  
  358 + write(*,*)
  359 + write(*,*)'Checking cable number',cable
  360 +
335 361 if (bundle%cable(cable)%cable_type.NE.cable_geometry_type_overshield) then
336   -! if this cable is not an overshield then see whether it is WITHIN an overshield
  362 +
  363 +! IF THIS CABLE IS NOT AN OVERSHIELD THEN SEE WHETHER IT IS WITHIN AN OVERSHIELD
  364 +
  365 + write(*,*)'THIS CABLE IS NOT AN OVERSHIELD'
337 366  
338 367 cable_x=bundle%cable_x_offset(cable)
339 368 cable_y=bundle%cable_y_offset(cable)
  369 +
  370 +! find the smallest overshield enclosing this cable
  371 +
  372 + reference_overshield=0
  373 + radius_reference_overshield=1d30
340 374  
341 375 do overshield=1,tot_n_overshields
342   -
  376 +
343 377 dist_cable_to_overshield_centre=sqrt( (cable_x-overshield_x(overshield))**2+ &
344   - (cable_y-overshield_y(overshield))**2 )
  378 + (cable_y-overshield_y(overshield))**2 )
  379 +
345 380 if ( dist_cable_to_overshield_centre.LT.overshield_r(overshield) ) then
346   -! we conclude that this cable is with the overshield
  381 +! we conclude that this cable is within the overshield
  382 +
  383 + write(*,*)'This cable is inside overshield number',overshield
347 384  
348   - if (overshield_domain(overshield).EQ.0) then
  385 + if (radius_reference_overshield.GT.overshield_r(overshield)) then
  386 +! this overshield is smaller than the current reference overshield so this becomes the new reference overshield
  387 +
  388 + reference_overshield=overshield
  389 + radius_reference_overshield=overshield_r(overshield)
  390 +
  391 + write(*,*)'This cable reference overshield has been updated to',reference_overshield
  392 +
  393 + end if ! is this the smallest overshield?
  394 +
  395 + end if ! is cable within this overshield?
  396 +
  397 + end do
  398 +
  399 + if (reference_overshield.NE.0) then
  400 +! this cable has been identified as being within an overshield
  401 +
  402 + if (overshield_domain(reference_overshield).EQ.0) then
349 403  
350 404 ! this overshield domain is unallocated so create a new domain
351 405  
352   - tot_n_domains=tot_n_domains+1
353   - n_overshield_domains=n_overshield_domains+1
354   - if(verbose) write(*,*)'Creating overshield domain=',tot_n_domains
355   - overshield_domain(overshield)=tot_n_domains
  406 + tot_n_domains=tot_n_domains+1
  407 + n_overshield_domains=n_overshield_domains+1
  408 + if(verbose) write(*,*)'Creating overshield domain=',tot_n_domains
  409 + overshield_domain(reference_overshield)=tot_n_domains
  410 +
  411 + global_domain_reference_conductor(tot_n_domains)=overshield_reference_terminal_conductor(reference_overshield)
356 412  
357   - global_domain_reference_conductor(tot_n_domains)=overshield_reference_terminal_conductor(overshield)
  413 + write(*,*)'This overshield domain is unallocated so create a new domain, domain=',tot_n_domains
358 414  
359   - end if ! this overshield domain is unallocated
  415 + end if ! this overshield domain is unallocated
  416 +
  417 + cable_reference_domain(cable)=overshield_domain(reference_overshield)
360 418  
361   - cable_reference_domain(cable)=overshield_domain(overshield)
  419 + write(*,*)'Setting the cable reference domain to',overshield_domain(reference_overshield)
362 420  
363   - end if ! this cable is with the overshield
  421 + end if ! this cable is within the overshield
  422 +
  423 + terminal_conductor=terminal_conductor+bundle%cable(cable)%tot_n_conductors ! update the terminal conductor count
364 424  
365   - end do ! next overshield to check
  425 + else ! THIS CABLE IS AN OVERSHIELD SO WE NEED TO CHECK WHETHER IT IS INSIDE ANY OTHER OVERSHIELDS
  426 +
  427 + write(*,*)'THIS CABLE IS AN OVERSHIELD'
  428 +
  429 + cable_x=bundle%cable_x_offset(cable)
  430 + cable_y=bundle%cable_y_offset(cable)
  431 + cable_r=bundle%cable(cable)%parameters(1) ! overshield radius
366 432  
367   - terminal_conductor=terminal_conductor+bundle%cable(cable)%tot_n_conductors ! update the terminal conductor count
  433 +! find the smallest overshield enclosing this overshield if there is one
  434 +
  435 + reference_overshield=0
  436 + radius_reference_overshield=1d30
  437 +
  438 + do overshield=1,tot_n_overshields
  439 +
  440 + cable_t=overshield_to_cable_number(overshield)
  441 + if (cable_t.NE.cable) then ! don't check an overshield against itself
  442 +
  443 + dist_cable_to_overshield_centre=sqrt( (cable_x-overshield_x(overshield))**2+ &
  444 + (cable_y-overshield_y(overshield))**2 )
  445 +
  446 + if ( dist_cable_to_overshield_centre.LT.overshield_r(overshield) ) then
  447 +! we conclude that this cable is within the overshield
  448 +
  449 + write(*,*)'This overshield centre is inside overshield number',overshield
  450 +
  451 +!! Check that can be removed when we are happy with nexted overshields code
  452 +! run_status='ERROR, Nested overshields cannot be used in SACAMOS at the moment'
  453 +! CALL write_program_status()
  454 +! STOP 1
  455 +
  456 + if (radius_reference_overshield.GT.overshield_r(overshield)) then
  457 +! this overshield is smaller than the current reference overshield so this becomes the new reference overshield
  458 +
  459 + if (overshield_r(overshield).GT.cable_r) then
  460 +! the cable is smaller than the overshield and hence is inside it
  461 +
  462 +! Check that the lowest number overshield is the smaller. Overshields should be numbered inside to out
  463 +
  464 + if (cable_t.LT.cable) then
  465 +
  466 + run_status='ERROR, Nested overshields should be numbered in the order inside to out'
  467 + CALL write_program_status()
  468 + STOP 1
  469 +
  470 + end if
  471 +
  472 + write(*,*)'This overshield is smaller than the reference overshield and is therefore inside it'
  473 +
  474 + reference_overshield=overshield
  475 + radius_reference_overshield=overshield_r(overshield)
  476 +
  477 + write(*,*)'This cable reference overshield has been updated to',reference_overshield
  478 +
  479 + end if ! This overshield is smaller than the reference overshield and is therefore inside it
  480 +
  481 + end if ! is this the smallest overshield?
  482 +
  483 + end if ! is cable centre within this overshield?
  484 +
  485 + end if ! don't check an overshield against itself
  486 +
  487 + end do
368 488  
  489 + if (reference_overshield.NE.0) then
  490 +! this cable has been identified as being within an overshield
  491 +
  492 + if (overshield_domain(reference_overshield).EQ.0) then
  493 +
  494 +! this overshield domain is unallocated so create a new domain
  495 +
  496 + tot_n_domains=tot_n_domains+1
  497 + n_overshield_domains=n_overshield_domains+1
  498 + if(verbose) write(*,*)'Creating overshield domain=',tot_n_domains
  499 + overshield_domain(reference_overshield)=tot_n_domains
  500 +
  501 + global_domain_reference_conductor(tot_n_domains)=overshield_reference_terminal_conductor(reference_overshield)
  502 +
  503 + write(*,*)'This overshield domain is unallocated so create a new domain, domain=',tot_n_domains
  504 +
  505 + end if ! this overshield domain is unallocated
  506 +
  507 + cable_reference_domain(cable)=overshield_domain(reference_overshield)
  508 +
  509 + write(*,*)'Setting the cable reference domain to',overshield_domain(reference_overshield)
  510 +
  511 + end if ! this cable is within the overshield
  512 +
  513 + terminal_conductor=terminal_conductor+bundle%cable(cable)%tot_n_conductors ! update the terminal conductor count
  514 +
  515 +
369 516 end if ! not an overshield
370 517  
371 518 end do ! next cable
372 519  
373 520 if (verbose) write(*,*) 'n_overshield_domains=',n_overshield_domains
  521 +
  522 + write(*,*)'**********************************************************************'
374 523  
375 524 ! 3c part 2. loop over the overshield domains and count the number of external conductors in each one
376 525  
... ... @@ -736,6 +885,7 @@ USE maths
736 885 end do ! next local domain
737 886  
738 887 end do ! next cable
  888 +
739 889  
740 890 ! 6. Now that we have counted the number of domains we can allocate the
741 891 ! domain based number of conductors and L and C matrices plus
... ... @@ -854,6 +1004,12 @@ USE maths
854 1004 terminal_conductor=0 ! this is the external conductor number
855 1005 domain_count=0
856 1006  
  1007 + if (verbose) then
  1008 + write(*,*)''
  1009 + write(*,*)'SET MI, MV matrices'
  1010 + write(*,*)''
  1011 + end if
  1012 +
857 1013 do cable=1,tot_n_cables_without_ground_plane
858 1014  
859 1015 local_n_domains=bundle%cable(cable)%tot_n_domains
... ... @@ -864,6 +1020,7 @@ USE maths
864 1020 ! copy the cable based MI and MV matrices to the global structure. The cable based
865 1021 ! MI and MV matrices are on the basis of terminal_conductor numbering
866 1022 if (verbose) then
  1023 + write(*,*)''
867 1024 write(*,*)'Copy MI, MV, cable=',cable,' of', tot_n_cables_without_ground_plane
868 1025 write(*,*)'Matrix dimension',n_cable_conductors+1
869 1026 write(*,*)'intial terminal_conductor count=',terminal_conductor
... ... @@ -880,7 +1037,7 @@ USE maths
880 1037 else
881 1038 row_g=terminal_conductor_to_reference_global_domain_conductor(terminal_conductor+row_l-1) ! last conductor for this cable and the reference
882 1039 end if
883   -
  1040 +
884 1041 if (col_l.NE.n_cable_conductors+1) then
885 1042 col_g=terminal_conductor+col_l
886 1043 else
... ... @@ -890,12 +1047,44 @@ USE maths
890 1047 bundle%global_MI%mat(row_g,col_g)=bundle%cable(cable)%MI%mat(row_l,col_l)
891 1048 bundle%global_MV%mat(row_g,col_g)=bundle%cable(cable)%MV%mat(row_l,col_l)
892 1049  
893   - if (verbose) write(*,*)'Copy MV element',row_g,col_g,bundle%global_MV%mat(row_g,col_g)
  1050 +! if (verbose) write(*,*)'Copy MV element',row_g,col_g,bundle%global_MV%mat(row_g,col_g)
894 1051  
  1052 + 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)
  1055 + end if
  1056 +
895 1057 end do ! next col
896 1058  
897 1059 end do ! next row
898 1060  
  1061 + if (bundle%cable(cable)%cable_type.EQ.cable_geometry_type_overshield) then
  1062 +! This is an overshield so invoke the special process for overshields
  1063 +
  1064 +! Get the global domain number of the shield conductor
  1065 + row_g=terminal_conductor_to_global_domain_conductor(terminal_conductor+1)
  1066 +
  1067 +! Get the global domain number of the shield reference conductor
  1068 + row_g_ref=terminal_conductor_to_reference_global_domain_conductor(terminal_conductor+1)
  1069 +
  1070 +! Add all the non-zero elements of the MI matrix shield row to the shield reference row
  1071 +
  1072 + write(*,*)'Overshield cable',cable,' Copying row',row_g,' to row',row_g_ref
  1073 +
  1074 + do col_g=1,bundle%global_MI%dim
  1075 +
  1076 +! In the global MI, MV structure rows correspond to the global domain conductor number, cols correspond to the terminal conductor number
  1077 +
  1078 + if (bundle%global_MI%mat(row_g,col_g).NE.0d0) then
  1079 +
  1080 + bundle%global_MI%mat(row_g_ref,col_g)=bundle%global_MI%mat(row_g,col_g)
  1081 +
  1082 + end if
  1083 +
  1084 + end do ! next col
  1085 +
  1086 + end if ! overshield
  1087 +
899 1088 do local_domain=1,local_n_domains ! exclude the external domain for now
900 1089  
901 1090 if (local_domain.NE.local_n_domains) then
... ... @@ -1363,6 +1552,7 @@ write(*,*)'****************************************************************'
1363 1552 if (allocated( overshield_h )) DEALLOCATE( overshield_h)
1364 1553 if (allocated( overshield_domain )) DEALLOCATE( overshield_domain)
1365 1554 if (allocated( overshield_reference_terminal_conductor)) DEALLOCATE( overshield_reference_terminal_conductor )
  1555 + if (allocated( overshield_to_cable_number)) DEALLOCATE( overshield_to_cable_number )
1366 1556 if (allocated( global_domain_reference_conductor )) DEALLOCATE( global_domain_reference_conductor )
1367 1557 DEALLOCATE( cable_reference_conductor )
1368 1558 DEALLOCATE( cable_reference_domain )
... ...
TEST_CASES/OVERSHIELD_COAX_FREE_SPACE_OVER_GROUND_PLANE/coax_over_ground_plane.bundle_spec
... ... @@ -3,9 +3,9 @@
3 3 #MOD_bundle_lib_dir
4 4 ./
5 5 2 # Number of cables in bundle, cable list follows: name then x,y of cable
6   -overshield
7   -0.0 0.01 ! x and y coordinates of the cable centre
8 6 inner_wire
9 7 0.0 0.01 ! x and y coordinates of the cable centre
  8 +overshield
  9 +0.0 0.01 ! x and y coordinates of the cable centre
10 10 ground_plane
11 11  
... ...
TEST_CASES/OVERSHIELD_COAX_FREE_SPACE_OVER_GROUND_PLANE/coax_over_ground_plane_ac.spice_model_spec
... ... @@ -15,23 +15,23 @@ coax_over_ground_plane
15 15 90.0 0.0 ktheta kphi (degrees)
16 16 -1.0 0.0 Etheta Ephi
17 17 # End 1 termination model
18   -1.0 End 1 voltage source list
  18 +0.0 End 1 voltage source list
  19 +1.0
19 20 0.0
20   -0.0
21   -10.0 End 1 impedance list
22   -100.0
  21 +100.0 End 1 impedance list
  22 +10.0
23 23 0.0
24 24 # End 2 termination model
25 25 0.0 End 2 voltage source list
26 26 0.0
27 27 0.0
28   -20.0 End 2 impedance list
29   -25.0
  28 +25.0 End 2 impedance list
  29 +20.0
30 30 0.0
31 31 # Type of analysis
32 32 AC
33 33 log # frequency scale (log or lin)
34 34 1e3 1e8 1000 # fmin fmax number_of_frequencies
35 35 # Output conductor number and end number
36   -1 1
  36 +2 1
37 37 lin # output type (lin or dB)
... ...
TEST_CASES/generate_spice_cable_bundle_model 100644 → 100755
clean_project 100644 → 100755