Hello
After reading of your query , may be due to these possibilities , these include:
1 Hyper acidity as this may be the reason of such pain in abdomen .Try raising the head of your bed about 4 inches with block. It might also help to avoid eating or drinking for 2-3 hours before you lie down. To control stomach acid one should not eat oily , greasy , spicy foods , also avoid pizza , burger .
Also take some
antacid ( if it contains oxetaciane it will be better). But if you feel excruciating pain ( as you are having ) , take pantaprazole-D two times in day ( normal dose is one tablet in 24 hours).
2 Ovarian swelling may be due to infection or
PCOD ( poly cystic
ovarian disease i.e most common in this age group).
3
Urinary tract infection as you mentioned is one such cause .
However there are so many reasons of such symptoms but consult a physician and get his opinion as physical examination , clinical history ,
ultrasound and blood examination are important .
So consult another doctor and get his opinion.
Good luck.