Not sure I understand exactly, but perhaps this might give some ideas. Use implicit dynamics, with an enforced displacement on the moving part and a sinusoidal time varying force/pressure. These two should ideally be applied at different locations, so they do not cancel each other out. Finally a contact can be used between the moving part and the second part in case they will start touching at some point
.