CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   UDF for time-dependent flow ( May 28, 2013 08:35

UDF for time-dependent flow
Hi all ,Iím new in fluent and particularly UDF, I want to model a system that a gas is inlet and it flows for 3s and doesnít flow for 3s alternatively and continuously. In fact itís our respiration flow and the model is a respiratory mask.
How should I write UDF file? Probably CURRENT_TIMESTEP Macro should be used, Is it right?
Would you tell me please how should I write the UDF? This is very important for me.
Thank you very very much in advance.

blackmask May 29, 2013 04:50

Something looks like

#include "udf.h"

DEFINE_PROFILE(vel_in, thread, i)  {
    real y;
    face_t f;
    real t = CURRENT_TIME;
    int off = (int) (t/0.03+0.5) %2;
        if (!off)
            F_PROFILE(f,thread,i) = 1.0;

Modify it to suit your needs. May 30, 2013 02:59

thank you very much for your quick reply


All times are GMT -4. The time now is 22:12.