Ansys Learning Forum › Forums › Discuss Simulation › Fluids › Dynamic mesh-nan in cg definition › Reply To: Dynamic mesh-nan in cg definition
November 24, 2023 at 3:59 pm
Subscriber
I always check the mesh prior to the preview of the mesh motion. Hereby my UDF. Always works for frequency 1-5 but not for larger.
Â
#include "udf.h"
Â
#define amplitude 0.01
#define frequency 10
Â
DEFINE_CG_MOTION(ymotion,dt,vel,omega,time,dtime)
{
real vmax;
real Tper;Â
Â
Tper = 1/frequency;
vmax = (amplitude * 2*M_PI) / Tper;
vel[1] = vmax*(cos(2 * M_PI * time / Tper));
}