|
[Sponsors] | |||||
|
|
|
#21 | |
|
New Member
samrat himvanth nanduri
Join Date: May 2012
Posts: 21
Rep Power: 3 ![]() |
Dear Ajay,
I'm writing a C program for Flapping of a 3D wing. I'm unable to compile it in TURBO C. I' attaching the program along with the errors that r generated. kindly have a look and help me debug it. # include <math.h> # include "udf.h" # include "dynamesh_tools.h" # define DEFINE_CG_MOTION(wing,dt,vel,omega,time,dtime) {\ double Freq, pi, w, degree, phimax, thmax, phi, dphi, dtheta;\ degree = 20; /*degree step set by journal file*/ \ Freq=1.0/(dtime*degree); /*dtime is the physical time step defined in the journal file*/ \ pi = 3.141592654;\ w=2*pi*Freq; /*Omega (radians)*/\ phimax = 30.0*pi/180; /*flapping amplitude set by journal file*/\ thmax = 30.0*pi/180; /*feathering amplitude set by journal file*/\ phi = -phimax*sin(w*time); /*flapping angle*/\ dphi = -phimax*w*cos(w*time); /*flapping speed*/\ dtheta = thmax*w*sin(w*time); /*feathering speed*/\ vel[0] = 0;\ vel[1] = 0;\ vel[2] = 0;\ omega[0] = dphi;\ omega[1] = dtheta*cos(phi);\ omega[2] = dtheta*sin(phi);\ } The errors are as follows Error C:\ TC\ Airfoil 1.c : unable to open include file ' DYNAMESH_TOOLS.H' Error C:\ TC\ include\udf.h : unexpected end of file in conditional started on line 0 Quote:
|
||
|
|
|
||
|
|
|
#22 |
|
New Member
prishor p k
Join Date: Jul 2012
Posts: 29
Rep Power: 2 ![]() |
hi ajay,
in your post you have mentioned to make directory for compiled UDF in x86 system. i am using x64 system. how can i make the directory and compile the UDF in x64 system. whether i have to install visual c++ or visual studio prior. please help me thanks and regards, prishor |
|
|
|
|
|
|
|
|
#23 |
|
New Member
Mohamed Ashar
Join Date: Feb 2011
Posts: 9
Rep Power: 4 ![]() |
Hi there fellow fluent users....this is the first time I've been using UDF's.I get an error message when trying to interpret the UDF in Fluent. The following message appears: line 2 parse error
My code is the following: #include*"udf.h" * *static*const*real*Arrhenius*=*1.e15; *static*const*real*E_Activation*=*1.e6; *#define*SMALL_S*1.e-29 * *DEFINE_HET_RXN_RATE(arrh,c,t,hr,mw,yi,rr,rr_t) *{ Domain***domain_reactant*=*hr-domain_reactant; real**stoich_reactant*=*hr-stoich_reactant; int**reactant*=*hr-reactant; int*i; int*sp_id; int*dindex; Thread**t_reactant; real*ci; real*T*=*1200.;*/**should*obtain*from*cell**/ /**instead*of*compute*rr*directly,*compute*log(rr)* and*then*take*exp**/ *rr*=*0; for*(i=0;*i hr-n_reactants;*i++) { sp_id*=*reactant[i];*/**species*ID*to*access*mw*and*yi**/ if*(sp_id*==*-1)*sp_id*=*0;*/**if*phase*does*not*have*species, *mw,*etc.*will*be*stored*at*index*0**/ dindex*=*DOMAIN_INDEX(domain_reactant[i]); */**domain*index*to*access*mw*&*yi**/ t_reactant*=*THREAD_SUB_THREAD(t,dindex); */**get*conc.**/ ci*=*yi[dindex][sp_id]*C_R(c,t_reactant)/mw[dindex][sp_id]; ci*=*MAX(ci,SMALL_S); *rr*+=*stoich_reactant[i]*log(ci); } *rr*+=*log(Arrhenius*+*SMALL_S)*- *E_Activation/(UNIVERSAL_GAS_CONSTANT*T); /**1.e-40 rr 1.e40**/ *rr*=*MAX(*rr,-40); *rr*=*MIN(*rr,40); *rr*=*exp(*rr); *}* Thanks Ashar |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM | 284 | April 8, 2013 09:19 |
| How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 18:44 |
| CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 06:25 |
| UDF parse error at profile function line | Wiggy | Fluent UDF and Scheme Programming | 1 | July 27, 2009 15:59 |
| Problems of Duns Codes! | Martin J | Main CFD Forum | 8 | August 14, 2003 23:19 |