CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Language for Fluent 6.3.26 UDF Compiler ?? (https://www.cfd-online.com/Forums/fluent-udf/108709-language-fluent-6-3-26-udf-compiler.html)

Abhya October 31, 2012 00:12

Language for Fluent 6.3.26 UDF Compiler ??
 
HI there :D:D:D:cool::cool::cool:

I'm v v new to fluent...so plz help me folks!

Plz let me know which prg language and compiler (On win 7) I need to learn for writing an udf in Fluent version 6.3.26 and Ansys-Fluent 13 ..I have access to both of these versions.
I Googled for the same and I found out that its Visual C++ language and Microsoft Visual C++ compiler (on windows) that I need.
However when I checked out Ansys-Fluent 13.0 udf tuts I suspect the tuts code is in C (not in visual C++) ..
here is the CODE from the tut file on porous media:

Code:

/*******************************************************************/
/*                                                                */
/* Position-Dependent Porous Media                                */
/*                                                                */
/*******************************************************************/

#include "udf.h"

DEFINE_SOURCE(xmom_source, cell, thread, dS, eqn)
{
const real c2=100.0;
real x[ND_ND];
real con, source;

C_CENTROID(x, cell, thread);
con = c2*0.5*C_R(cell, thread)*x[1];
source = - con*fabs(C_U(cell, thread))*C_U(cell, thread);
dS[eqn] = - 2.*con*fabs(C_U(cell, thread));
 
return source;
}

plz anyone who knows about this well help me out ..
I don't know much abt C and almost nothing abt visual c++

Any help is appreciated!! :D:D:D

BehzadNJ October 31, 2012 01:30

Quote:

Originally Posted by Abhya (Post 389388)
HI there :D:D:D:cool::cool::cool:

I'm v v new to fluent...so plz help me folks!

Plz let me know which prg language and compiler (On win 7) I need to learn for writing an udf in Fluent version 6.3.26 and Ansys-Fluent 13 ..I have access to both of these versions.
I Googled for the same and I found out that its Visual C++ language and Microsoft Visual C++ compiler (on windows) that I need.
However when I checked out Ansys-Fluent 13.0 udf tuts I suspect the tuts code is in C (not in visual C++) ..
here is the CODE from the tut file on porous media:

Code:

/*******************************************************************/
/*                                                                */
/* Position-Dependent Porous Media                                */
/*                                                                */
/*******************************************************************/

#include "udf.h"

DEFINE_SOURCE(xmom_source, cell, thread, dS, eqn)
{
const real c2=100.0;
real x[ND_ND];
real con, source;

C_CENTROID(x, cell, thread);
con = c2*0.5*C_R(cell, thread)*x[1];
source = - con*fabs(C_U(cell, thread))*C_U(cell, thread);
dS[eqn] = - 2.*con*fabs(C_U(cell, thread));
 
return source;
}

plz anyone who knows about this well help me out ..
I don't know much abt C and almost nothing abt visual c++

Any help is appreciated!! :D:D:D

There isn't much difference between C and C++ , you can start learning one of them and then you can code in the other one too, and compiler doesn't matter , you can even compile with borland C++ or RAD Studio , the important thing is to have a good and working compiled files. that's all :)

Best Regards


All times are GMT -4. The time now is 00:10.