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

UDF for time-dependent flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2013, 09:35
Default UDF for time-dependent flow
  #1
Member
 
soodabe
Join Date: Apr 2013
Posts: 40
Rep Power: 13
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, 05:50
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
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, 03:59
Default
  #3
Member
 
soodabe
Join Date: Apr 2013
Posts: 40
Rep Power: 13
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


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 Off
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 31 October 4, 2018 15:10
Periodic channel flow with time dependent mass flow rate QBeast FLUENT 3 May 10, 2013 14:14
Density UDF for supersonic flow David Christopher Fluent UDF and Scheme Programming 0 April 18, 2013 06:48
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat kokoory FLUENT 0 August 17, 2011 03:07
UDF for multiphase flow ROOZBEH FLUENT 3 April 7, 2004 18:54


All times are GMT -4. The time now is 18:57.