Hello dear
Warm  welcome to Healthcaremagic.com
I have evaluated your query in details  .
*  Digestive upset is from various issues as 
    - gastritis or 
duodenitis - ulcer stomach or duodenum - food intake 
    related - weight gain - lack of physical activity - hormone imbalance
    - 
digestive enzyme issues - gut flora alterations - others .
*  Primary guidelines for this are as
Prefer soft , light , bland , vegan diet till possible .
Consume more of whole grains , cereals , pulses , legumes , organic fresh fruits .
Avoid  all oily , spicy , non veg , hot beverages , junk foods , carbonated drinks .
Avoid over eating , prolong fasting .
Avoid resting upto 2 hours after meals .
Fix your timing of breakfast , lunch , dinner  till possible .
Avoid late night parties , dinners .
Keep the head end of the bed elevated for 30 degrees  when  resting .
Have  regular walking in fresh air , exercises , YOGA .
Avoid smoking , alcohol if consuming .
Avoid stress , anxiety .
Manage  to have regular sound sleep of 8 hours .
Intake  of  
Proton pump inhibitors as 
omeprazole or 
pantoprazole on empty
stomach  1 hour prior to lunch  ;  antacid  syrups  as  mylanta or others according to the  advise of your doctor  helps .
Keep your  BP , blood sugar , 
cholesterol , body  weight  under  control .
Later on may need  ultrasound  or  upper  GI  endoscopy according to the progress .
*  The 
pain during intercourse is pelvic inflammation related , needs in
    person check up with your OBGY doctor .
Hope this  will help  to clear your doubt   .
Wishing you fine recovery .
Always welcome for any further assistance anytime .
Regards  .