|
[Sponsors] |
January 27, 2011, 04:45 |
[solved]"unresolved external symbol"
|
#1 | |
New Member
Coiby Xu
Join Date: Jan 2011
Posts: 7
Rep Power: 15 |
I've fixed the problem. Thanks!
I write a proram for the purpose of user-defined initialization. But Fluent gives the error message when compiling it. Can anybody figure out the reason? Thanks! Quote:
Code:
#include<stdio.h> #include<stdlib.h> #include<time.h> #include<udf.h> #include<math.h> #define K 4 //K nucleis per cell #define mu 2.6 //expected value #define sigma 8.0 // standard deviation #define PI 3.1416926 #define maxi 10000000 float gauss(void) { float tmp; //tmp value float u; float v; //float mu; // the expected value of Gauss Distrubution tmp=0; srand((unsigned)time(NULL)); while(mu-2>tmp||tmp>mu+2){ u=ran()*1.0/RAND_MAX; v=ran()*1.0/RAND_MAX; tmp=sqrt(-2*log(u))*cos(2*PI*v)*sigma+mu; } return tmp; } DEFINE_INIT(my_init_function, domain) { cell_t c; Thread *t; int i; //loop control int j; //loop control //int cnum = domain->cell_count; // the total number of cells float *radius[maxi][K]; j=0; thread_loop_c(t,domain) { for(i=0;i<K;i++) *radius[j][i]=gauss(); j++; } } Last edited by coiby; January 27, 2011 at 06:09. Reason: problem fixed |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
External magnetic field data | Richard Lee | FLUENT | 7 | January 11, 2019 04:43 |
CGNS Compiling | Diego | Main CFD Forum | 17 | December 21, 2014 01:40 |
About External Emissivity | Cloud | FLUENT | 4 | June 27, 2013 02:16 |
Update boundary conditions calculated by an external program | CedricVH | OpenFOAM | 2 | January 15, 2010 11:55 |
Why I can't read one external file? | Lee | Siemens | 7 | April 2, 2004 12:25 |