Term: comfort sex
Example: when you fuck your ex, it's comfort sex
Definition: a sexual encounter between two people who used to be intimate