|
[Sponsors] |
Get different value from FLUENT static pressure integration. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 22, 2016, 09:29 |
Get different value from FLUENT static pressure integration.
|
#1 |
Member
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
I wrote following UDF to acquire pressure integration value of one flat boundary. However, the pressure integration function build in FLUENT gives me a totally different answer. Are there any problem in my code?
#include "udf.h" #define rvol1_ID 22 DEFINE_EXECUTE_AT_END(pressureudf) { FILE *fp1; real time1=CURRENT_TIME; Domain *d; Thread *thread; face_t f; double A[ND_ND]; double pressure=0.; d= Get_Domain(1); thread=Lookup_Thread(d, rvol1_ID); begin_f_loop(f,thread) { F_AREA(A,f,thread); pressure+=F_P(f,thread)*NV_MAG(A); } end_f_loop(f,thread) fp1=fopen("pressure223.txt","a"); fprintf(fp1,"%g %g\n",time1,pressure); fclose(fp1); } |
|
March 22, 2016, 16:58 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The units of your variable 'pressure' is N (a force). Ensure your units are what you expect and whether or not gauge/dynamic/static pressure is used. For details on how Fluent treats pressure, have a read of this post.
|
|
March 23, 2016, 23:48 |
|
#3 |
Member
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
It is very weird that the problem is at fprintf(fp1,"%g %g\n",time1,pressure); which cannot show a correct answer. When I adjust the distance between time1 and pressure, it works and gives the same answer as FLUENT integral function.
|
|
Tags |
fluent, fluent - udf, integrate variables, udf, udf and programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind tunnel Boundary Conditions in Fluent | metmet | FLUENT | 6 | October 30, 2019 13:23 |
static vs. total pressure | auf dem feld | FLUENT | 17 | February 26, 2016 14:04 |
Assign static pressure at inlet | Tanjina | FLUENT | 0 | November 3, 2013 12:34 |
Fluent natural ventilation pressure boundary condition | pierresandre | FLUENT | 24 | November 8, 2011 15:32 |
defining a term for a domain using DEFINE_ADJUST | MASOUD | Fluent UDF and Scheme Programming | 1 | September 24, 2010 06:08 |