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

udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2011, 08:38
Default udf
  #1
Senior Member
 
hamid
Join Date: Nov 2010
Posts: 185
Rep Power: 15
hamid1 is on a distinguished road
Hi all

about UDF, when do need to use C_P(c,t) and when F_P(c,t), also the other parameters like U_P(c,t) and F_P(c,t) and so on....
hamid1 is offline   Reply With Quote

Old   December 16, 2011, 07:42
Default
  #2
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
C_P(t,c) gives the pressure value in the centroid of the cell.
F_P(t,f) gives the pressure value in the centroid of the face.
I would recommend to read the manual regarding these macros. The face values are not available in the entire domain for all variables!
dmoroian is offline   Reply With Quote

Old   December 16, 2011, 08:19
Default
  #3
Senior Member
 
hamid
Join Date: Nov 2010
Posts: 185
Rep Power: 15
hamid1 is on a distinguished road
thanks for the reply, iv actually read already but get confused a bit,
im wondering if the following is correct for calculating pressure at outlet:


DEFINE_EXECUTE_AT_END(network_calculation)
{

FILE *flow_rate,*update,*velocity;


Domain *d;

real force=0.;
real NV_VEC(A);
face_t f;
Thread *t;
d = Get_Domain(1);
t = Lookup_Thread(d,2);

PF = 0.0;
area = 0.0;
force = 0.0;

begin_f_loop(f,t)
{
F_AREA (A,f,t);
force+=F_P(f,t)*NV_MAG(A);
area +=NV_MAG(A);
PF= force/area;
}
end_f_loop(f,t)
}

thank you
hamid1 is offline   Reply With Quote

Old   December 16, 2011, 09:07
Default
  #4
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
It looks ok if the outlet zone id is 2.
dmoroian is offline   Reply With Quote

Old   December 17, 2011, 04:37
Default
  #5
Senior Member
 
hamid
Join Date: Nov 2010
Posts: 185
Rep Power: 15
hamid1 is on a distinguished road
thanks for reply,
but the point is, for example when i measure the area in solid work it is a bit different from the area+=NV_MAG(A) computed through this code in fluent,
that is why it makes me feel doubt about how correct the code i use is..
please let me know
thanks so much again...
hamid1 is offline   Reply With Quote

Old   December 17, 2011, 09:42
Default
  #6
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
That's easy: Solid Works or any other CAD software keeps the surface as a parametric object (meaning there is an equation describing the surface), whereas fluent keeps the same surface as a triangular surface (meaning a discrete form). The discrete form will always include a discretization error based on the size of the discretization, so there is no surprise that you get a difference. This difference, between the CAD and CFD software should decrease if you have a finer mesh.
dmoroian 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 04:55.