# Udf velocity inlet profile with multiphase mixture (ansys fluent)

 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 23, 2020, 19:12 Udf velocity inlet profile with multiphase mixture (ansys fluent) #1 New Member   Engineering_Student Join Date: Nov 2020 Posts: 2 Rep Power: 0 We are two undergraduate students seeking for help!!! We are trying to simulate a laminar flux through a 3D pipe (25 cm long, 2 cm of diameter) consisting of a multiphase flux (air and water). We want to implement a UDF for the velocity inlet consisting of several time-dependent square pulses. In our ideal scenario, the pipe is initially full of air and water is injected from the inlet periodically (every injection is a square pulse) and the amount of water decreases with each interval. To do so, we have written the following code, but it does not seem to work. COULD ANYONE HELP PELASE?? HOW CAN WE SOLVE IT??? THANK YOU VERY MUCH IN ADVANCE! -------------- #include "udf.h DEFINE_PROFILE(inlet_velocity, t, i) { real current_time; face_t f; current_time = CURRENT_TIME; begin_f_loop(f, t) { if ((current_time < 2) | (current_time > 9 & current_time<14) | (current_time > 21 & current_time<25) | (current_time > 32 & current_time<37) | (current_time > 44 & current_time<49)) { F_PROFILE(f, t, i)=0; } else if (current_time >= 2 & current_time<=9) { F_PROFILE(f, t, i)=1*0.08; } else if (current_time >= 14 & current_time<=21) { F_PROFILE(f, t, i)=0.75*0.08; } else if (current_time >= 25 & current_time<=32) { F_PROFILE(f, t, i)=0.5*0.08; } else if (current_time >= 37 & current_time<44) { F_PROFILE(f, t, i)=0.25*0.08; } } end_f_loop(f, t) }

 November 24, 2020, 07:48 #2 Senior Member   Gert-Jan Join Date: Oct 2012 Location: Europe Posts: 1,741 Rep Power: 25 Use CFX. No need to use Fortran. Just add a few equations to the simulations and off you go.

 December 12, 2020, 01:23 #3 Member   Dnyanesh Mirikar Join Date: Jul 2019 Posts: 35 Rep Power: 5 Try named expressions feature provided by Ansys and you may end up solving your problem. Let me know if you want any help further.

 Tags ansys fluent, multiphase mixture model, udf