A long closely wound helical coil is called a solenoid. Fig 1 shows a section of a stretched-out solenoid.
Solenoid and its magnetic field
The magnetic field due to the solenoid is the vector sum of the magnetic fields due to current through individual turns of the solenoid.
The magnetic fields associated with every single turn are almost concentric circles and hence tend to cancel between the turns.
The field at the interior midpoint of the solenoid: At the interior midpoint, the field is strong and along the axis of the solenoid (i.e) the field is parallel to the axis.
The field outside the solenoid: For a point such as P, the field due to the turns in the upper part of the solenoid tends to cancel the field due to the lower part of the solenoid turns, acting in opposite directions. Hence the field outside the solenoid is nearly zero.
The direction of the magnetic field due to circular closed loops (solenoid) is given by the right-hand palm rule.
Right-hand palm rule
The coil is held in the right hand so that the fingers point in the direction of the current in the windings. The extended thumb points in the direction of the magnetic field.