13 April 2024 0 6K Report

Hi, I am working on a simulation that contains the motion of a rigid wall zone defined by a profile.

The motion is divided into 3 phases:

1. Translation from A to B

2. Certain time span (1.5 secs) without motion

3. Translation from B back to A

My current UDF

#include "udf.h"

DEFINE_CG_MOTION(moving_wall, dt, vel, omega, time, dtime) {

real t = CURRENT_TIME;

NV_S(vel, =, 0.0);

vel[0] = 0.00016 * 3.1415 * 20 * cos(10*3.1415 * t + 3.1415/2);

}

Currently my UDF only oscillates (that's what I want too), but I want to add a rest time between phases.

Thanks a lot!

Similar questions and discussions