CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF 3D mesh two movements example (https://www.cfd-online.com/Forums/fluent-udf/244448-udf-3d-mesh-two-movements-example.html)

JuanReyes August 8, 2022 21:58

UDF 3D mesh two movements example
 
Greetings everyone I´m trying to make a simple exmaple of UDF with a 3D volume, The exmaple basically consist in an sphere that follows an sinusoidal function on the Y axes and spining on its own axes with determinate angular speed, what I tried was to put a UDF function on the wall of the object and its surrounding mesh, enable dynamic mesh for the control volume and a spining rotation for the surroundings of the sphere, obviously when I ran it failed , this is the code that I tried to run:

/* Moving grid problem -CG movement of a box*/

#include "udf.h"

static real velx = 0.0;
DEFINE_CG_MOTION(box, dt, vel, omega, time, dtime)
{
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

velx = 0.05 * sin(3.1415927 * time / 10.);
vel[1] = velx;
Message("Time=%f, vel[1]=%f/n", time, vel[1]);
}

Somtimes it shows that the dynamic mesh produces a zero-volume, other times it generates other errors and sometimes it moves all the domain

I will really appreciate your help guys


All times are GMT -4. The time now is 06:36.