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

UDF to monitor minimum pressure on the wall

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2007, 11:53
Default UDF to monitor minimum pressure on the wall
  #1
Arvind Jayaprakash
Guest
 
Posts: n/a
Hello World!

Can any of you help me debug the UDF appended below. I am trying to identify the minimum pressure on the wall at the end of each time step. It is a 2D flow over a airfoil problem.

Thanks.

/************************************************** *********************************************** -----USER DEFINED FUNCTION HOOKS Fluent V6.3---------------------

UDF to identify the lowest pressure on the wall at the end of each time step ************************************************** ************************************************/

#include "udf.h" #include "stdio.h" #include "mem.h " #include "threads.h"

DEFINE_EXECUTE_AT_END(vapor) {

real pmin =0.;

real pre;

real flow_time = RP_Get_Real("flow-time");

int ID = 7; /* Enter the zone ID of Wall from the Boundary Conditions Panel*/

/* Get the domain using Fluent utility */

Domain *d;

d = Get_Domain(1);

/* Get the thread ID */

Thread *t = Lookup_Thread(d, ID);

face_t f;

if (BOUNDARY_FACE_THREAD_P(t)) /* Check the for boundary face thread */

{

FILE *fp = NULL;

char filename[ ]="wall-minimum-pressure.txt";

fp = fopen(filename, "w");

/* Loop over all faces in the wall face-thread */

begin_f_loop(f, t)

{

pre = F_P(f,t); /* get face pressure */

if (pre < pmin) pmin = pre; /* Compute minimum face pressure */

}

end_f_loop(f,t)

Message("\nWriting the lowest pressure on the wall to %s...",filename);

fprintf(fp,"%g %f \n",pmin,flow_time);

fclose(fp);

}

else

{

Error("Please enter the correct Zone ID from the Boundary Conditions Panel");

}

}
  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
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 00:04
vaporization pressure UDF Komon Fluent UDF and Scheme Programming 0 September 20, 2011 19:33
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 12:03
UDF to define or adjust pressure??? engahmed FLUENT 0 July 6, 2010 17:19
udf: dimensionless wall coordinate Chris FLUENT 0 June 22, 2004 06:10


All times are GMT -4. The time now is 13:19.