Let me explain. The first source suggested the use of several functions, which may be useful. For instance, if it is possible, you may try the Terrain:FillBlock() function, which supposedly uses parts to create terrain. You could place a series of large, transparent blocks in your submarine, and find a means of welding them all there.
Next, you need a while loop that constantly uses the Terrain:FillBlock() function. Now, what I think is if you either try to fill it with nothing, or perhaps there is an “air” option, you could pull it off. Then, all you need is a block surrounding your vessel, which is also welded, to run a similar while loop, which can fill the surrounding area with water.
You may also need the Terrain:FillWedge() function, and others.
Additionally, I added the second source as a reference for working with terrain, be it in this way or any other.
Note: I have not tested anything written above, so it’s all just in theory.