I looked up possible causes of this can came across the following from here.
I often get leg cramps in my calves toward the end of my swims. How can I avoid this?
Triguy - firstly let me say that you are not alone, lots of athletes and especially triathletes suffer from calf & foot cramps while swimming. Here are some things you can do to help solve that problem:
1) Go into your swims well hydrated. This means water of course but not water alone - also include an electrolyte drink. A muscle is far more apt to cramp when dehydrated so keep yourself topped off.
2) Include ankle stretching in your body maintenance routine. Running often stiffens the ankles making it harder to point your toes very far. Swimming requires a more flexible ankle so that the foot becomes a long, smooth extension of the leg rather than a flat surface plowing through the water. One approach would be to simply kneel down on a soft surface, point your toes so the tops of your feet are on the ground, then sit back on you heels for a few minutes. This will stretch your ankles and improve you flexibility. This must be progressed into gradually!
3) Relax while swimming. Too much leg tension will over stress the calfs and all that does is elevate your heart rate without any benefit from propulsion. Keep your legs relaxed and your kick small and easy.
All the best, Ian
I'm not real worried about this upcoming 1/2 ironman but foot and leg flexibility will definitely be in my training regime prior to IM-KY!