Closed cell spray foam will work in above grade, below grade and higher moisture areas. It is a hard, dense spray foam. It will have R-values from 5 to 7 per inch.
It is a good fit in agricultural buildings, truck washes and in wet locations and is specified in most commercial projects. Most closed cell foams will provide a vapor barrier as low as 1.5 inches.
Sprayed into place it will expand about 30 or 40 times itself, filling cracks and crevices, providing an air barrier. Although closed cell is generally water resistant, it is not designed to be used as water proofer.
In just as little as 2 inches, closed cell will stop over 94% of the conductive heat loss in a building. Because closed cell is a denser product, it takes more product make it, thus making closed cell more expensive to install. And it is not as good for sound control as open cell spray foam.