|
[Sponsors] |
April 12, 2021, 03:09 |
Related to UDF
|
#1 |
Member
Heer
Join Date: Oct 2020
Posts: 44
Rep Power: 5 |
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! |
|
Tags |
average outlet pressure, udf |
|
|
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 |