You'll need two DEFINE_whatever-motion sections but they can be defined in one UDF file. For a sealed system (no inlet or outlet) you will need to carefully initialise the temperature & pressure in each fluid volume. That defines the mass of fluid in the domain.https://forum.ansys.com/discussion/comment/101558#Comment_101558

Hi Rob, thank you very much for your answer, it really helped me but I'm having problems with the motion. I interpreted the UDF file and it went good, but when I create the dynamic mesh zone for the piston inside (rigid body, and cg macro in the Motion UDF/Profile) I get this warning:nWarning: incorrect cg motion UDF desplazador400_prueba1 on zone 6 (assuming no motion)nAnd when I run the simulation the piston doesn't move, nothing moves.nIs this and error of my udf or and error with the boundary conditions and dynamic mesh?nHere I leave you the code if anyone see any error:n#include 'udf.h'n#include 'dynamesh_tools.h'n#include 'unsteady.h'nDEFINE_CG_MOTION(desplazador400_prueba1, dt, vel, omega, time, dtime)n{ntreal A= 0.013; ntreal H= 6.666667; ntreal angular= 2. * 3.14159265 * H; ntreal v;tNV_S (vel, =, 0.0);ntNV_S (omega, =, 0.0);ntntv = -1*A*angular*sin(angular*time);ntvel[0]= v;n} nThanks for your attention.n