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

Need help on DEFINE_PROFILE and EXECUTE_AT_END

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 4, 2017, 02:37
Default Need help on DEFINE_PROFILE and EXECUTE_AT_END
  #1
New Member
 
Gene
Join Date: Mar 2017
Posts: 13
Rep Power: 9
gzsakuraz is on a distinguished road
I have the question, will define_profile value in UDMI will change when UDMI in Execute at end change?
Because I want heatflux to be updated in every time step
*the red

please help me

DEFINE_EXECUTE_AT_END(execute_at_end)
{
Domain *d;
face_t f;
Thread *t, *t1;
int Zone_ID = 62; /* Zone Id can be seen in the Boundary Conditions Panel, ice outer = 42 */
d = Get_Domain(1);
cell_t c;
int x =0;
real A[ND_ND]; real area; real totalarea=0;
t = Lookup_Thread(d, Zone_ID);
real v=15.0; /*input wind speed*/
real temp=273.15-273.15; /*ambient temp - zero celsius*/
real humid=0.0;/*input humidity*/
real p1 = (6.11176750+0.443986062*pow(temp,1)+0.143053301*po w(10,-1)*pow(temp,2)
+0.265027242*pow(10,-3)*pow(temp,3)+0.302246994*pow(10,-5)*pow(temp,4)
+0.203886313*pow(10,-7)*pow(temp,5)+0.638780966*pow(10,-10)*pow(temp,6))*100;/*put to the power function*/
real evaporate = ((0.089+0.0782*v)*(p1-humid*p1)/(2450000)); /*kg per area per second*/
real heat = 2450000*evaporate;
real current_time;
current_time = CURRENT_TIMESTEP;
int z=0; int y=0; int p=0; int ab=0; real limitmass=0;
real totalmass =0;
begin_f_loop(f,t){
t1 = THREAD_T0(t);
int ttt=THREAD_ID(t1);
c=F_C0(f, t);
if(ttt==40){
if(C_LIQF(c,t1)>=1.0){
x=x+1;
F_AREA(A,f,t);/*area vector on the surface*/
area = NV_MAG(A);
if(C_UDMI(c,t1,1)<area*1.5*0.001*C_R(c,t1)){ /* check if it is above the limit of evaporation*/
F_AREA(A,f,t);/*area vector on the surface*/
area = NV_MAG(A);
real areaabs=fabs(area);
real mass = evaporate*areaabs*0.5; /*in kg*/
totalmass=mass+totalmass;
C_UDMI(c,t1,1)=C_UDMI(c,t1,1)+mass; /*collect cumulative mass*/
F_UDMI(f,t,2)=-heat; /*collect the position where heat flux must be applied*/
/*make sure sum not exceed*/


}
else{y=y+1; F_UDMI(f,t,2)=0;} /*no evaporative heat flux applied*/
}
}

} end_f_loop(f,t)


}

DEFINE_PROFILE(heatfluxkrub,thread,i)
{

face_t f;
begin_f_loop(f,thread){
F_PROFILE(f,thread,i) = F_UDMI(f,thread,2);
end_f_loop(f,thread)
}
}
gzsakuraz 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



All times are GMT -4. The time now is 14:54.