Electrical currents in a submarine’s electrical equipment, especially in its batteries, can induce stray magnetic fields. Above are used batteries at main battery supplier to Collins submarines, PMB Defence. Each battery cell weighs about 3 tonnes, is about 1.5m high and a metre wide. The entire battery weight for a Collins is about 450 tons [150 cells] (Photo courtesy overclockers forum. Comment #9).---
In a Comment on 26/1/17 10:24 PM an Anonymous advised, along the lines:
Electrical currents in a submarine’s electrical equipment, especially in its batteries, can induce stray magnetic fields. Such distortions of the electro-magnetic field can lead to magnetic anomaly detection (MAD) of a submarine. MAD detectors may be frequently present in seabed arrays and on the tail booms of ASW patrol aircraft.
It is therefore important that diesel-electric submarine maintenance in port and during missions minimizes stray magnetic fields. This is partly achieved by arranging the contents of the submarine (especially batteries) for magnetic minimization. Another measure is degaussing a submarine’s iron, especially in its hull, before a mission.
A major way to minimize a stray magnetic field is be achieved by partial cancellation of magnetic field through “alternative arrangement of two battery modules with an opposite current loop. So, for the n-row by m-column array of battery modules, n and m are even numbers, and for the submarine with two battery sections, m is multiples of four.”
Existing lead-acid batteries may function by being closely packed in modules . Such an arrangement doesn’t need pedestals (which can form a rigid structural base of a battery) and this minimizes stray magnetic fields. No pedestals also have the benefit of lowering the center of gravity. The lower the center the lower the chance of battery shaking, vibration and, in extremis, falling over.
Alternatively, lead-acid battery arrangements may use pedestals because this benefits battery installation and maintenance.
But discussion of precise battery arrangements is a highly confidential area for which there is little open source information. So one cannot be sure how diesel-electric submarine building and customer countries arrange their lead-acid batteries.
 see Page 11.2 (Figure 11.01 Battery compartment – typical arrangement) and Page 11.16 (Figure 11.06 Arrangement of cell group water cooling connections) of this Canadian Forces (CF) Oberon class (“O boat”) Training Notebook (Electrical). This Notebook would have been based on UK Royal Navy and Vickers original information. Notebook is decades old now and used to be classified “RESTRICTED” http://jproc.ca/rrp/rrp2/oberon_battery_and_electrical.pdf (about 10MB)
Also see very detailed battery comments at https://en.wikipedia.org/wiki/Oberon-class_submarine#Propulsion_systems.
The Japanese Ministry of Defence Standard NDS F8016B concerns “General rules for design of equipment with small stray magnetic field”, 5.3”Arrangement of main batteries for submarine” which specifies that submarine is generally equipped with 240 directly connected cells as a group.
Flowing from NDS F8016B Japanese lead-acid battery arrangements might adhere to the following rules:
i) width of each column of cell module should be the same. (240 = 20 columns x 12 cell modules) was decided based on these rule. In this case columns of 20 satisfies rule.
ii) numbers of each column are desirably multiples of four or must be at least an odd number (20 = 4 x 5) and number (12) of cell module in a column satisfies rule
iii) desirable numbers of cell modules in a column are multiples of four. (12 = 4 x 3). Logically speaking, if the rules are satisfied, other arrangements such as three groups of 24 columns or four groups of 16 columns are possible.
iv) polarity cancellation of a pair of neighbouring columns should be conducted by cross connection of these columns, and so on.