Repulsive potential between two groups

GROMACS version:2022.1
GROMACS modification: Yes/No

Dear all,
I am working on the influence of a substrate over a region of a bigger protein. In a previous simulation, the simulated protein region “flew” out of the substrate to stick on the upper substrate (due to periodic boundaries in z) in some of the replicas, which is unphysical since the top of the protein is in contact with the remaining region of the big protein. Due to this matter, I would like to impose a repulsive potential to the substrate over the top molecules of the protein so it remains close to the lower substrate. Is there any way to put a repulsive potential to the substrate over the protein?
I would appreciate any help you can provide.
Thankful in advance,

I think the simplest and most efficient way might be to restrict the motion of all (or c-alpha) atoms of the protein along z using flat-bottomed position restraints.

Here is a minor update on my post:
Having a conversation with my peers, I realized that I’m interested in putting a repulsive wall to avoid the interactions of the top of the lipid with the protein to guarantee that the protein solely interacts with the bottom substrate. I read there are ways of adding the wall in the MDP files. But don’t really understand yet what wall-atomtype parameters I should use.
If the is any insight I would really appreciate it.

Hi Hess!

I have updated some aspects of my post as a reply to it. It seems putting restraints would not work since we are doing density profiles in the analysis, which would give artificial results.

Thankful for your response! It led the discussion to understand my issue further.