We would like to do in ansys fluent with moving mesh along with piston and inlet  pressure. What is the correct methodology ? Since the compression zone is compressing, in the current simulation I have given an UDF to the Compressing wall. As per your suggestion, how should we modify the UDF ?

If we just give inlet pressure, then we do not know at what speed the piston moves. So we do not know at what rate the compression zone is compressing or the expanding zone is expanding. If we want moving mesh how do we specify the velocity for the compression wall compression, expanding wall expansion and piston ? movement