CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   pressure boundary condition (https://www.cfd-online.com/Forums/fluent/33072-pressure-boundary-condition.html)

wim vos February 20, 2004 07:11

pressure boundary condition
 
hello, i'm using a 3D model of a nose and i want a time dependent pressure in my troath (constant over all the surface but changing in time). i tried to wright a c-file for a user-defined function but when i compile it i get this error message :

************************************************** *

cpp -IC:\FLUENT.INC\fluent6.1.22/src -IC:\FLUENT.INC\fluent6.1.22/cortex/src -IC:\FLUENT.INC\fluent6.1.22/client/src -IC:\FLUENT.INC\fluent6.1.22/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" C:\wim\unsteady\sniffing1.c Error: C:\FLUENT.INC\fluent6.1.22/src/dpm.h: line 855: parse error.

************************************************** *

i hope someone could give me an advise for this thanks WIm

i include my c-file too

************************************************** *

#include "udf.h"

DEFINE_PROFIL(outlet_snif, thread, nv)

face_t f; real t = RP_Get_Real("flow-time");

begin_f_loop (f,thread) {

F_PROFILE(f,thread,nv) = 61.03 * t^5 - 106.7 * t^4 + 67.71 * t^3 - 19.72 * t^2 + 2.673 * t - 0.1366 ; } end_f_loop (f,thread) } ************************************************** *

thomas February 20, 2004 07:34

Re: pressure boundary condition
 
Hi, I do not know if it is an error when you copy/past your c-file in the window but you have a parse error due to your brackets {}. You forgot to open the brackets ' { ' after your DEFINE_PROFIL(outlet_snif, thread, nv) declaration. Here is the correction

#include "udf.h"

DEFINE_PROFIL(outlet_snif, thread, nv) { face_t f; real t = RP_Get_Real("flow-time");

begin_f_loop (f,thread) {

F_PROFILE(f,thread,nv) = 61.03 * t^5 - 106.7 * t^4 + 67.71 * t^3 - 19.72 * t^2 + 2.673 * t - 0.1366 ; } end_f_loop (f,thread) } ************************************************** *

Hope it is that you were looking for. Cheers thomas


Anon February 20, 2004 08:23

Re: pressure boundary condition
 
You missing an 'E' from your macro definition below,

DEFINE_PROFIL(outlet_snif, thread, nv)

^ It should read

DEFINE_PROFILE(outlet_snif, thread, nv)

wim vos February 20, 2004 08:23

Re: pressure boundary condition
 
no, that was not the problem, the bracker disappeared while copy-pasting. somebody else has an idea? thanks anyway wim

Doctor Love February 20, 2004 08:52

Re: pressure boundary condition
 
Hello, The command t^n does not exist in C Language. try pow(t,n). Also if you had compiled your c file instead of interpreting you would have seen the error message referring to t^n. The Doc

wim vos February 20, 2004 09:14

Re: pressure boundary condition
 
thanks again for the advise, but i still get the same error message. wim

Doctor Love February 20, 2004 09:56

Re: pressure boundary condition
 
Okay i do not what you do or if you gave us the right part of your UDF but I sucessfuly interpret or compile your UDF.

Interprete: cpp -I/usr/local/Fluent.Inc/release/fluent6.1.22/src -I/usr/local/Fluent.Inc/release/fluent6.1.22/cortex/src -I/usr/local/Fluent.Inc/release/fluent6.1.22/client/src -I/usr/local/Fluent.Inc/release/fluent6.1.22/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" /.automount/portos/root/home/stag3/test.c

************************************************** *** #include "udf.h"

DEFINE_PROFILE(outlet_snif, thread, nv) { face_t f; real t = RP_Get_Real("flow-time");

begin_f_loop (f,thread) {

F_PROFILE(f,thread,nv) = 61.03 * pow(t,5) - 106.7 * pow(t,4) + 67.71 * pow(t,3) - 19.72 * pow(t,2) + 2.673 * t - 0.1366 ; } end_f_loop (f,thread) } ************************************************** ***

:)

ccc February 22, 2004 12:12

Re: pressure boundary condition
 
hi wim vos,

Doctor Love is right. I also have compiled and interpreted your udf and both worked well. Maybe you should reinstall fluent to fix the problem.

good luck.

wim vos February 23, 2004 05:24

Re: pressure boundary condition
 
thank u all guys, today it is working, strange things those pc's wim


All times are GMT -4. The time now is 01:36.