CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF Profile Update once in one time step (https://www.cfd-online.com/Forums/fluent-udf/129751-udf-profile-update-once-one-time-step.html)

LYP February 12, 2014 00:21

UDF Profile Update once in one time step
 
Hi Everyone,

I am working on a transient case and using a UDF with DEFINE_Adjust macro..
I want to use a udf controlling a boundary only updated once within one time step.The udf like this:
#include "udf.h"
#define Vg 1.0e-05
#define H 0.02
#define Rg 0.01
real current=0.0;
real profile=-0.01;
DEFINE_ADJUST(name,domain)
{
current = RP_Get_Real("flow-time");
}
DEFINE_PROFILE(density,thread,position)
{
real k,t;

face_t f;

if(profile !=current)
{
begin_f_loop(f,thread)
{
t=RP_Get_Real("physical-time-step");
k=Vg*t/(H-Vg*t);
F_PROFILE(f,thread,position)=F_UDSI(f,thread,0)+F_ UDSI(f,thread,0)*(1-Rg)*k;

}
end_f_loop(f,thread)
}
profile=current;
}

I found that can't achieve my goal.Can anyone here help?

Thank you.

Radit

pakk February 12, 2014 06:30

Quote:

I found that can't achieve my goal.
Be more precise... What is the problem? Problems with compiling? Crashing when running? You don't know how to hook it to the simulation? The udf works, but does something else than you expected? In that case, what does it do?
If you give detailed information about your problem, it is much easier to find the solution.


All times are GMT -4. The time now is 16:08.