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

Get different value from FLUENT static pressure integration.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2016, 09:29
Question Get different value from FLUENT static pressure integration.
  #1
Member
 
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10
SNeCu is on a distinguished road
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);

}
SNeCu is offline   Reply With Quote

Old   March 22, 2016, 16:58
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   March 23, 2016, 23:48
Default
  #3
Member
 
Nate Lau
Join Date: Mar 2016
Posts: 33
Rep Power: 10
SNeCu is on a distinguished road
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.
SNeCu is offline   Reply With Quote

Reply

Tags
fluent, fluent - udf, integrate variables, udf, udf and programming


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
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


All times are GMT -4. The time now is 17:46.