|
[Sponsors] |
February 4, 2010, 07:13 |
surface integral at the interior surface!!
|
#1 |
New Member
Join Date: Feb 2010
Posts: 3
Rep Power: 16 |
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!!! |
|
October 30, 2012, 21:52 |
surface integral help
|
#2 |
New Member
Praneetha
Join Date: Dec 2009
Posts: 7
Rep Power: 16 |
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; } |
|
October 30, 2012, 22:14 |
DEFINE_EXECUTE_AT_END is a void function
|
#3 |
New Member
Praneetha
Join Date: Dec 2009
Posts: 7
Rep Power: 16 |
Your are trying to return a value from void function i think tht is causing the issue
|
|
August 19, 2013, 16:34 |
|
#4 |
New Member
Join Date: Feb 2010
Posts: 3
Rep Power: 16 |
#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 |
|
August 20, 2013, 02:13 |
|
#5 |
New Member
saurabh mangal
Join Date: Aug 2013
Posts: 1
Rep Power: 0 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible | velan | OpenFOAM Meshing & Mesh Conversion | 3 | October 22, 2015 11:05 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 02:09 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 12:43 |
monitor surface integral & report surface integral | Ning | FLUENT | 0 | March 18, 2007 12:51 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 12, 2001 23:19 |