CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

surface integral at the interior surface!!

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 4, 2010, 08:13
Default surface integral at the interior surface!!
  #1
New Member
 
Join Date: Feb 2010
Posts: 3
Rep Power: 7
rajamanimech is on a distinguished road
Is it possible to take surface integral (of temperature) from any interior surface and given it as B.C at the inlet (temperature) using DEFINE_EXECUTE_AT_END macro in fluent????
i am getting error at the end of iteration when i use the following udf,

#include "udf.h"
#include "mem.h"
face_t f;
real mass_tot,mass_temp_sum,mw_temp_outlet;
DEFINE_EXECUTE_AT_END(outlet)
{
Domain *d;
d=Get_Domain(1);
real zone_ID=5;
Thread *tf;
tf=Lookup_Thread(d,zone_ID);
mass_tot=0.0;
mass_temp_sum=0.0;
begin_f_loop(f,tf)
{
mass_tot += fabs(F_FLUX(f,tf));
mass_temp_sum += fabs(F_FLUX(f,tf)) * F_T(f,tf);
}
end_f_loop(f,tf)
mw_temp_outlet = mass_temp_sum/mass_tot;
}
DEFINE_PROFILE(inlet_temp,t,i)
{
begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = mw_temp_outlet;
}
end_f_loop(f, t)
}


ERROR I AM GETTING



================================================== ============================
Stack backtrace generated for process id 8912 on signal 1 :
Please include this information with any bug report you file on this issue!
================================================== ============================

/usr/local/Fluent.Inc/fluent6.3.26/lnamd64/3d/fluent.6.3.26[0xdd6fcb]
/usr/local/Fluent.Inc/fluent6.3.26/lnamd64/3d/fluent.6.3.26[0xdd6f21]
/lib64/libpthread.so.0[0x323fc0de80]
libudf/lnamd64/3d/libudf.so(outlet+0xa8)[0x2b740be9e5bc]

Error: fluent.6.3.26 received a fatal signal (SEGMENTATION VIOLATION).
Error Object: #f

can any one can help?

Billion thanks in advance!!!
rajamanimech is offline   Reply With Quote

Old   October 30, 2012, 22:52
Default surface integral help
  #2
New Member
 
Praneetha
Join Date: Dec 2009
Posts: 7
Rep Power: 7
Praneetha is on a distinguished road
I am trying to do something similar, I am calculating surface integral over boundary which has zone id 15 and trying to use tohis as source for domain (cell zone). the code compiles and loads without any errors. But after 1st iteration nothing happens. It just hovers over 1st iteration. looks like it is going into infinite loop. But cannot figure out how?

#include "udf.h"
#define C 1.7e-8
#define V 5.7e-4
DEFINE_SOURCE(source3, c, t, dS, i)
{
real flux=0;
real ID=15;
face_t f;
Domain *d;
d=Get_Domain(1);
t=Lookup_Thread(d, ID);
begin_f_loop(f,t)
{
flux += ((pow(F_T(f,t),4))-(pow(297,4)))*(-C)/V;
}
end_f_loop(f,t)
dS[i]=0;
return flux;
}
Praneetha is offline   Reply With Quote

Old   October 30, 2012, 23:14
Default DEFINE_EXECUTE_AT_END is a void function
  #3
New Member
 
Praneetha
Join Date: Dec 2009
Posts: 7
Rep Power: 7
Praneetha is on a distinguished road
Your are trying to return a value from void function i think tht is causing the issue
Praneetha is offline   Reply With Quote

Old   August 19, 2013, 16:34
Default
  #4
New Member
 
Join Date: Feb 2010
Posts: 3
Rep Power: 7
rajamanimech is on a distinguished road
#include "udf.h"
#include "mem.h"

real area_tot;
real area_temp_sum;
real aw_temp_outlet;
int zone_ID=3712;
DEFINE_EXECUTE_AT_END(outlet)
{

#if !RP_HOST
Domain *d;
Thread *tf;
Thread *t0 = NULL;
cell_t c0;
face_t f;
real A[ND_ND],area;
#endif

/*#if !RP_NODE

#endif */

#if !RP_HOST
d=Get_Domain(1);
tf=Lookup_Thread(d,zone_ID);
area_tot=0.0;
area_temp_sum=0.0;

begin_f_loop(f,tf)
{
F_AREA(A,f,tf);
area=NV_MAG(A);
c0 = F_C0(f,tf);
t0 = F_C0_THREAD(f,tf);
area_tot += fabs(area);
area_temp_sum += fabs(area) * C_T(c0,t0);
}
end_f_loop(f,tf)

# if RP_NODE
area_tot = PRF_GRSUM1(area_tot);
area_temp_sum = PRF_GRSUM1(area_temp_sum);
#endif
aw_temp_outlet = area_temp_sum/area_tot;
#endif
}


you can use this UDF to get the average temperature on interior boundary and it will stored in the variable aw_temp_outlet
rajamanimech is offline   Reply With Quote

Old   August 20, 2013, 02:13
Default
  #5
New Member
 
saurabh mangal
Join Date: Aug 2013
Posts: 1
Rep Power: 0
saurabhmangal350 is on a distinguished road
hey..
i want to know how to write UDF function and in which i have to write this.
my problem is like that i want to apply a continuous temperature change as a boundary condition on a building roof.
please help me i have no idea about this UDF function.

thanks in advance
saurabhmangal350 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
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 18 April 22, 2015 08:43
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43
Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 June 29, 2009 00:48
monitor surface integral & report surface integral Ning FLUENT 0 March 18, 2007 13:51
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


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