How big is the submarine?
The size matters lots because you need the Reynolds number (Re) as it will almost certainly go through a transition as it gets faster on the way down and it may not be a steady terminal velocity.
Calculate the the section weight (function of air/water in buoyancy tanks), the section buoyancy (Area * density of water), and drag opposing motion (1/2 rho Cd speed^2 * diameter) to estimate the acceleration,
You could assume it's significantly longer than wide, so dominated by flow like a long cylinder. Figure 2 on this page is useful:
https://www.princeton.edu/~asmits/Bicycle_web/blunt.html If your submarine is relatively short then choose something between cylinder and sphere.
Then do a Runge-Kutta time stepping simulation using Newton's second law - integrate to get speed, and depth - all could change with hydrostatic pressure and temperature if you're going deep!
I reckon a spreadsheet (Libre Office Calc for example) is good enough for that - that was true for my 1989 course in numerical simulation.
Good luck
I like sailing - above water - so I may have little idea of what happens below