|
[Sponsors] |
Summation of pressure over faces to obtain force |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 21, 2011, 12:53 |
Summation of pressure over faces to obtain force
|
#1 |
New Member
Robert
Join Date: Apr 2011
Posts: 7
Rep Power: 15 |
Hello,
I am trying to built a UDF that sums up the pressure at each face of a surface of a 3-D body. The code looks like: /************************************************** *****************/ /* UDF to calculate pressure force and output to console */ /************************************************** *****************/ #include "udf.h" #include "stdio.h" #define forebody_tid 25 /* Zone ID of forebody*/ #define domain_zone 1 real Fpx; real Fpy; real NV_VEC(A); real P_i; Domain *domain; face_t f; /*body surface */ Thread *t; /*body thread */ DEFINE_ADJUST(forces,domain) { domain = Get_Domain(domain_zone); if (NULL == domain) Message("Something wrong with your domain id!\n"); t= Lookup_Thread(domain,forebody_tid); if (NULL == t || !BOUNDARY_FACE_THREAD_P(t)) Message("Something wrong with your face id!\n"); Fpx=0; Fpy=0; begin_f_loop(f,t) { F_AREA(A,f,t); P_i = F_P(f,t); Fpx+= P_i*A[0]; Fpy+= P_i*A[1]; } end_f_loop(f,t) Message("forces are: %f\n %f\n", Fpx, Fpy); } However, I get the following error: Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () The UDF works if I chose the e.g. the inlet or outlet zone for forebody_tid, but as soon as I choose a wall zone, the error occurs. The line: P_i = F_P(f,t); is where the error occurs. Has anyone an idea? I would really appreciate your help. Thanks, Robert |
|
July 24, 2011, 13:42 |
|
#2 |
Senior Member
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18 |
Did you verify that the wall is exposed to fluid? I mean, may be you pick the shadow side exposed to solid? Your code looks fine to me. Why did you include stdio.h? It is already include by udf.h.
|
|
July 26, 2011, 05:25 |
|
#3 |
New Member
Robert
Join Date: Apr 2011
Posts: 7
Rep Power: 15 |
Dear Micael,
thanks for your reply. Running the domain analysis, FLUENT shows: Zone sizes on domain 1: 264640 hexahedral cells, zone 20. 784032 quadrilateral interior faces, zone 21. 6016 quadrilateral wall faces, zone 24. 768 quadrilateral wall faces, zone 25. 2752 quadrilateral pressure-outlet faces, zone 23. 10240 quadrilateral pressure-far-field faces, zone 22. 274565 nodes. How do I figure out whether I am choosing the wetted side or the (shadow) side facing the solid? If I display the surface pressure contours in the FLUENT interface, it works fine. However, I found that TECPLOT has some troubles displaying surface pressure from .cas and .dat files created by FLUENT 6.3. Maybe this problem is related to the error message that occurs when executing the UDF code? |
|
July 26, 2011, 13:58 |
|
#4 |
Senior Member
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18 |
Is the wall separating two zones? If no, there is no shadow side. If yes, there is one and you should see it (and its ID) in the boundary conditions panel.
|
|
August 11, 2011, 16:24 |
|
#5 |
Member
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 17 |
Do a domain = Get_Domain(1) in your udf. This will give you the fluid domain. Maybe this helps.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SnappyHexMesh for internal Flow | vishwa | OpenFOAM Meshing & Mesh Conversion | 24 | June 27, 2016 09:54 |
Calculation of the Governing Equations | Mihail | CFX | 7 | September 7, 2014 07:27 |
Pulsatile pressure inlet with pressure outlet | a.lynchy | FLUENT | 3 | March 23, 2012 14:45 |
how does Fluent calculate the pressure and viscous force vector? | Ralf Schmidt | FLUENT | 2 | May 17, 2010 16:49 |
what the result is negatif pressure at inlet | chong chee nan | FLUENT | 0 | December 29, 2001 06:13 |