|
[Sponsors] |
December 14, 2011, 08:38 |
udf
|
#1 |
Senior Member
hamid
Join Date: Nov 2010
Posts: 185
Rep Power: 15 |
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.... |
|
December 16, 2011, 07:42 |
|
#2 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
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! |
|
December 16, 2011, 08:19 |
|
#3 |
Senior Member
hamid
Join Date: Nov 2010
Posts: 185
Rep Power: 15 |
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 |
|
December 16, 2011, 09:07 |
|
#4 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
It looks ok if the outlet zone id is 2.
|
|
December 17, 2011, 04:37 |
|
#5 |
Senior Member
hamid
Join Date: Nov 2010
Posts: 185
Rep Power: 15 |
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... |
|
December 17, 2011, 09:42 |
|
#6 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
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.
|
|
|
|
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 |