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

Can any tell me which is right for the below codes?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 23, 2020, 21:35
Default Can any tell me which is right for the below codes?
  #1
Senior Member
 
Join Date: Dec 2017
Posts: 387
Rep Power: 9
hitzhwan is on a distinguished road
Can any tell me which is right for the below codes?

The first one:


#include "udf.h"



DEFINE_PROFILE(hf_change,thread,position)
{
face_t f;
real time,heat_flux1,heat_flux2;
heat_flux1 = 0;
heat_flux2 = 500;
time=CURRENT_TIME;
begin_f_loop(f,thread)
{

if (time<0.0001)
{
F_PROFILE(f,thread,position)=heat_flux1;
}

else if (time>=0.0001)
{
F_PROFILE(f,thread,position)=heat_flux2;
}

}
end_f_loop(f,thread)
}



The second one:

#include "udf.h"



DEFINE_PROFILE(hf_change,thread,position)
{
face_t f;
real time,heat_flux1,heat_flux2;
heat_flux1 = 0;
heat_flux2 = 500;

begin_f_loop(f,thread)
{
time=CURRENT_TIME;
if (time<0.0001)
{
F_PROFILE(f,thread,position)=heat_flux1;
}

else if (time>=0.0001)
{
F_PROFILE(f,thread,position)=heat_flux2;
}

}
end_f_loop(f,thread)
}
hitzhwan is offline   Reply With Quote

 

Tags
udf


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



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