Do you get a status for the drain valve? If not you could just start calculating flow when the tank volume changes by a certain amount.
If you get feedback from both valves I would just do something like record the time it takes for each 1% level change when a valve is open. You can then just do:
flowrate = (1% tank_volume)/(delta_time)
I guess it mostly depends on what you want to use the measurement for. It also sounds like it's either only filling or draining. If both the fill and drain valve can be open at the same time you could have a situation where you're filling at 4 GPM and draining at 4 GPM and calculate a flow rate of 0 GPM.