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

Source-Code

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 10, 2006, 10:15
Default Source-Code
  #1
Peter
Guest
 
Posts: n/a
Hello,

I get some error-messages if I compile the following source-code of my udf. Perhaps some of you have an idea what's wrong. I would be glad about each help. Thanks.

Here are the error-messages: implicite declaration of function Berechnung_1 implicite declaration of function Berechnung_2 conflicting types for Berechnung_1 conflicting types for Berechnung_2

#include <udf.h> #include <unsteady.h>

DEFINE_PROFILE(inlet_x_velocity,t,i) { real x[3]; face_t f; real y;

begin_f_loop(f,t) {

F_CENTROID(x,f,t);

y=x[1];

F_PROFILE(f,t,i)=Berechnung_1(); } end_f_loop(f,f) }

real Berechnung_1()

{

static real X=0.0; /*Position des Wasserspiegels in der Kapillare*/

static real U=0.0; /*Geschwindigkeit des Wasserspiegels in der Kapillare*/

real X1,X2,X3,X4;

real U1,U2,U3,U4;

real F1,F2,F3,F4;

real Delta_t; /*Zeitschritt in Sekunden*/

Delta_t=CURRENT_TIMESTEP;

X1=X;

U1=U;

F1=Berechnung_2(X1,U1);

X2=X+(U1*Delta_t)/2;

U2=U+(F1*Delta_t)/2;

F2=Berechnung_2(X2,U2);

X3=X+(U2*Delta_t)/2;

U3=U+(F2*Delta_t)/2;

F3=Berechnung_2(X3,U3);

X4=X+U3*Delta_t;

U4=U+F3*Delta_t;

F4=Berechnung_2(X4,U4);

X=X1+(Delta_t/6)*(U1+(2*U2)+(2*U3)+U4);

U=U1+(Delta_t/6)*(F1+(2*F2)+(2*F3)+F4);

return U;

}

real Berechnung_2(real C,real D)

{

real K;

#define g 9.8 /*Erdbeschleunigung*/

#define x_0 0.02 /*Eintauchtiefe*/

#define nu 0.000000893 /*Kinematische Viskositaet*/

#define rK 0.0004 /*Radius der Kapillare*/

#define sigma 0.072 /*Oberflaechenspannung*/

#define cos_theta 1.0 /*cos des Kontaktwinkels = cos(theta*3,1416/180) */

#define rho 997.0 /*Dichte*/

K=(-((C*g)/(C+x_0)) - ((D*D)/(C+x_0))) - (((8*nu)/((rK*rK)*D)) + ((2*sigma*cos_theta)/(rho*(rK*(C+x_0)))));

return K;

}
  Reply With Quote

Old   October 10, 2006, 19:07
Default Re: Source-Code
  #2
Ahmed
Guest
 
Posts: n/a
1- Why your first line has two #include on the same line and what to include !! 2- Take all the #define to the top of the file or have them as Real e.g. real g=9.8; etc 3- Keep a C language primer handy
  Reply With Quote

Old   October 11, 2006, 06:10
Default Re: Source-Code
  #3
Peter
Guest
 
Posts: n/a
Ive done what you've said and it works. Thx for your help.
  Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Discontinuous Galerkin schemes -- fortran source code diedro Main CFD Forum 3 March 12, 2011 11:20
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
Fast Polygon Triangulation with source code. Liang, Wu Main CFD Forum 0 November 2, 2005 20:42
Pre & Post-Processor source code !! C. Beghein Main CFD Forum 1 January 30, 2002 09:35
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56


All times are GMT -4. The time now is 21:18.