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 coding for dynamic mesh Needle valve lifting (https://www.cfd-online.com/Forums/fluent-udf/219167-udf-coding-dynamic-mesh-needle-valve-lifting.html)

Jiwon Y July 18, 2019 02:52

UDF coding for dynamic mesh Needle valve lifting
 
Hello

I'm having trouble coding a needle valve lift for a fuel injectior.

I have set my geometry and mesh but the udf code for dynamic mesh is harsh. :(

Please help me out with coding of UDF or indications would also be very helpful.

the maximum lifting length for the needle valve is 0.8(mm) and power stroke time length is 0.000232(sec)

Светлана July 29, 2019 02:48

What should the UDF do?

Jiwon Y August 19, 2019 06:20

dear Светлана
 
Trying to make a up and down movement(Y-axis movement) of 0.8mm with my geometry model.

upward movement should take place with velocity of 0.65m/s during time 0~0.0014 sec.

downward movement should take place with velocity of 0.43m/s during 0.0014~0.0033 sec.

down below is my UDF but it does not compile properly :(

#include "udf.h"
#include "dynamesh_tools.h"
DEFINE_CG_MOTION(nozzle, dt, cg_vel, cg_omega, time, dtime)
{
/* reset velocities */
NV_S (cg_vel, =, 0.0);
NV_S (cg_omega, =, 0.0);
/* compute velocity formula */

if (time <= 0.0014)
{
cg_vel[1] = 0.65;
}

else if (0.0014 < time < 0.0033)
{
cg_vel[1] = -0.43;
}
else
{
NV_S (cg_vel, =, 0.0);
NV_S (cg_omega, =, 0.0);
}
message("\n");
message("\n y_velocity = %g \n",cg_vel[1]);
}

any corrections to UDF or suggestions would be VERY helpful :)


All times are GMT -4. The time now is 01:28.