CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

UDF for time-dependent flow

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 28, 2013, 08:35
Default UDF for time-dependent flow
  #1
Member
 
soodabe
Join Date: Apr 2013
Posts: 40
Rep Power: 4
borhan_sd@yahoo.com is on a distinguished road
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.
borhan_sd@yahoo.com is offline   Reply With Quote

Old   May 29, 2013, 04:50
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
Something looks like
Code:
#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;
    
    begin_f_loop(f,thread)
    {
        if (!off)
            F_PROFILE(f,thread,i) = 1.0;
    }
    end_f_loop(f,thread)
}
Modify it to suit your needs.
blackmask is offline   Reply With Quote

Old   May 30, 2013, 02:59
Default
  #3
Member
 
soodabe
Join Date: Apr 2013
Posts: 40
Rep Power: 4
borhan_sd@yahoo.com is on a distinguished road
thank you very much for your quick reply

regards
borhan_sd@yahoo.com is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 21 February 15, 2014 03:18
Periodic channel flow with time dependent mass flow rate QBeast FLUENT 3 May 10, 2013 13:14
Density UDF for supersonic flow David Christopher Fluent UDF and Scheme Programming 0 April 18, 2013 05:48
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat kokoory FLUENT 0 August 17, 2011 02:07
UDF for multiphase flow ROOZBEH FLUENT 3 April 7, 2004 17:54


All times are GMT -4. The time now is 03:53.