CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF line 1 parse error

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2013, 02:05
Default Udf help
  #21
Member
 
samrat himvanth nanduri
Join Date: May 2012
Posts: 30
Rep Power: 14
samcfd is on a distinguished road
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:
Originally Posted by Ajay
;109106
Hi, The error means that you cant use Interpreted UDF you have to use compiled UDF. compiled udf are bit more difficult to set up , you need to build the libraries and then load them. You should have an external compiler , VC++ compiler, thats the way i do it. Let me know if you need more help with it. -Ajay
samcfd is offline   Reply With Quote

Old   February 28, 2013, 01:11
Default
  #22
New Member
 
prishor p k
Join Date: Jul 2012
Posts: 29
Rep Power: 14
prishor is on a distinguished road
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
prishor is offline   Reply With Quote

Old   May 21, 2013, 19:05
Default Help with the UDF
  #23
New Member
 
Mohamed Ashar
Join Date: Feb 2011
Posts: 13
Rep Power: 15
ashar_md2001 is on a distinguished road
Hi there fellow fluent users.I get an error message when trying to interpret the UDF in Fluent see below

Last edited by ashar_md2001; May 24, 2013 at 16:03. Reason: dele
ashar_md2001 is offline   Reply With Quote

Old   May 24, 2013, 15:57
Default Help with the error in UDF
  #24
New Member
 
Mohamed Ashar
Join Date: Feb 2011
Posts: 13
Rep Power: 15
ashar_md2001 is on a distinguished road
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
weilin likes this.

Last edited by ashar_md2001; May 24, 2013 at 23:13.
ashar_md2001 is offline   Reply With Quote

Old   March 18, 2015, 23:53
Default
  #25
New Member
 
hyunkwonlee
Join Date: Feb 2015
Posts: 3
Rep Power: 11
bradlee is on a distinguished road
Hi, ashar

Did you solve this error??

If you are, can you explain how to solve the error??
bradlee is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 19:00
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 19:44
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 07:25
UDF parse error at profile function line Wiggy Fluent UDF and Scheme Programming 1 July 27, 2009 16:59
Problems of Duns Codes! Martin J Main CFD Forum 8 August 15, 2003 00:19


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