I am not saying you have chosen a bad solution, but my experience with foam is that it should never be exposed to water.
Way back in the seventies, When I was a seascout, expanding foam was used in our 19 feet fixed keel dinghies, under the cockpitfloor, to ensure flotation, and to make the boats unsinkable. Years later we had to remove it all again, as it had started to get wet, in fact it accumulated water like a sponge. I believe it was foam of the poly urethane kind.
Expanding foam may have improved, but the same foam has been used between the tiles on my roof, and every craftsman I talk to about it, says its a bad thing to do, for the same reasons.
I hope this is not too discouraging.