Hello dear
Warm  welcome to Healthcaremagic.com
I have evaluated your query in details  .
*  The sex is not the reason for stomach pain .
*  It has various issues which may be 
gastritis , 
stomach ulcer or else .
*  Primary guidelines for better outcome 
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 .
Wishing you fine recovery .
Feel free to ask any further  queries .
Regards  .