Udf help
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:
|
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 |
Help with the UDF
Hi there fellow fluent users.I get an error message when trying to interpret the UDF in Fluent see below
|
Help with the error in UDF
Hi fluent users,
I get an error message when trying to interpret the UDF in Fluent. The following message appears: line 124: parse error. I even tried c:\fluent.inc\ntbin\ntx86 folder ... as suggested by Ajay. Also if there is any correction in the UDF it could be suggested #include "udf.h" /* must be the bginning of every UDF you write */ #include "sg_pb.h" #include "sg_mphase.h" DEFINE_PB_Nucleation_Rate(nuc_rate,cell,thread) { real J,S; real Kn=1.0e36; /* Nucleation rate constant */ real Nn=2686.; /* Nucleation law power index */ real T,solute_mass_fract,solvent_mass_frac,solute_mol_f rac,solubility; real solute_mol_wt, solvent_mol_wt; Thread *tc=THREAD_SUPER_THREAD(thread); /* obtain mixture thread */ Thread **pt=THREAD_SUB_THREADS(tc); /* pointer to sub_threads thread */ Thread **tp=pt[P_PHASE]; /* primary phase thread */ solute_mol_wt=224.00; /* molecular weight of barium sulphate */ solvent_mol_wt=18.; /* molecular weight of water */ solute_mass_frac=C_YI(cell,tp,o); /* mass fraction of solute in primary phase (solvent)*/ solvent_mass_frac=1.0-solute_mass_frac; solute_mass_frac=(solute_mass_frac/solute_mol_wt)/ ((solute_mass_frac/solute_mol_wt)+(solvent_mass_frac/solvent_mol_wt)); T=C_T(cell,tp); /* Temperature of primary phase in kelvin */ solubility=0.0005*T-0.0794; /* Solubility Law relating equilibrium solute mole fraction to Temperature */ s=solute_mol_frac/solubilty; /* Definition of Supersaturation */ if (S=1.) { J=0.; } else { J=Kn*exp-((Nn)/(pow((lnS),2.0))); } return J; } the equation is J=Kn exp (-Nn/(lnS)^2) Hi guys any help or guidance will be appreciated |
Hi, ashar
Did you solve this error?? If you are, can you explain how to solve the error?? |
All times are GMT -4. The time now is 00:38. |