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

Related to UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 12, 2021, 03:09
Default Related to UDF
  #1
msd
Member
 
Heer
Join Date: Oct 2020
Posts: 44
Rep Power: 5
msd is on a distinguished road
Hello All,

I am trying to write a UDF for the pressure outlet boundary condition and the underlying condition is,
P = R*Q.
P = Mean pressure at the outlet (i.e. it remains constant at the whole face)
R = constant taken from literature
Q = flow rate
At the inlet, the pressure boundary condition is specified.

The code written goes as follows,
#include "udf.h"

#define R 12e9 /*Value taken from literature*/

#include "mem.h"
#include "metric.h"

DEFINE_PROFILE (outlet_pressure, thread, position)
{
real A[ND_ND];
face_t f;
Thread *t;
real Ar, V, Qfinal;
real Q = 0;

begin_f_loop(f, thread)
{
F_AREA(A, f, thread);
Ar = NV_MAG(A); /* Used for the computation of the magnitude of the area vector */
V = F_U(f, thread);
Q = Q + (Ar*V);
}
end_f_loop(f, thread)

Qfinal = Q;

begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = R*Qfinal;
}
end_f_loop(f, thread)
}


Can someone please tell if there is some logical error in the code because the relation P = R*Q is not getting satisfied.

Thanks in advance!
msd is offline   Reply With Quote

 

Tags
average outlet pressure, udf


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
Want help regarding the UDF that is been written in VS code related to weber number saratunni07 CFD Freelancers 0 May 20, 2017 02:30
Problem in convergence regarding constant viscosity and UDF related Viscosity. alexskerhut FLUENT 0 May 9, 2016 08:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 10:55


All times are GMT -4. The time now is 15:47.