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

Parse Error while Interpreting UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2018, 06:47
Smile Parse Error while Interpreting UDF
  #1
New Member
 
Join Date: Sep 2018
Posts: 1
Rep Power: 0
zh_cfd is on a distinguished road
Hello,

I am doing UDF for the first time. After going through the udf manual and forum posts, I have written this code that calculates effective conductivity for fluid phase and particle phase based on volume fraction of each phase in FLUENT EULERIAN MULTIPHASE model.

I tried compiling the code but it says
"'xcopy' is not recognized as an internal or external command, operable program or batch file fluent".

before this 'xcopy' error, i managed to solve the 'nmake' error problem using different Visual Studios, Setting Environment Variable (as mentioned in some forum posts).

Now, I am trying to interpret the code and getting : Parse Error & undeclared variable msg. Also, it says "WARNING: automatically switched to run in parallel -t1 mode ..." although if I am using serial solver.

Here is the error message:
.................................................. .................................................. .................................................. .................................................. ......

************************************************** **************************
************************************************** **************************
** WARNING: Automatically switched to run in parallel -t1 mode. **
** Detected non-parallelized UDF usage, enabling parallel usage. **
** If you encounter any issues, please re-run with -t0 flag. **
************************************************** **************************
************************************************** **************************
cpp -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/main" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/addon-wrapper" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/io" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/species" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/pbns" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/numerics" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/sphysics" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/storage" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/mphase" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/bc" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/models" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/material" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/amg" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/util" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/mesh" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/udf" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/ht" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/dx" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/turbulence" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/parallel" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/etc" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/ue" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/dpm" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/dbns" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/tgrid/src" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/client/src" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/multiport/src" -I. -DUSE_UDF_HOST_DUMMY -DUDFCONFIG_H="<udfconfig-host.h>" "C:/FYP ZHS/Nanofluid_Design1_files/dp0/FFF/Fluent/Nanofluid_Conductivity.c"
Error: C:/FYP ZHS/Nanofluid_Design1_files/dp0/FFF/Fluent/Nanofluid_Conductivity.c: line 11: parse error.
Error: C:/FYP ZHS/Nanofluid_Design1_files/dp0/FFF/Fluent/Nanofluid_Conductivity.c: line 12: parse error.
Error: C:/FYP ZHS/Nanofluid_Design1_files/dp0/FFF/Fluent/Nanofluid_Conductivity.c: line 13: parse error.
Error: C:/FYP ZHS/Nanofluid_Design1_files/dp0/FFF/Fluent/Nanofluid_Conductivity.c: line 14: k_f: undeclared variable

cpp -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/main" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/addon-wrapper" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/io" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/species" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/pbns" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/numerics" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/sphysics" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/storage" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/mphase" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/bc" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/models" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/material" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/amg" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/util" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/mesh" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/udf" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/ht" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/dx" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/turbulence" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/parallel" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/etc" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/ue" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/dpm" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/src/dbns" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/tgrid/src" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/client/src" -I"C:\PROGRA~1\ANSYSI~1\v182\fluent\fluent18.2.0/multiport/src" -I. -DUDFCONFIG_H="<C:/Users/Student/AppData/Local/Temp/udfconfig-5700-node0.h>" "C:/Users/Student/AppData/Local/Temp/Nanofluid_Conductivity.c.5700.0.c"
Error: C:/Users/Student/AppData/Local/Temp/Nanofluid_Conductivity.c.5700.0.c: line 11: parse error.
Error: C:/Users/Student/AppData/Local/Temp/Nanofluid_Conductivity.c.5700.0.c: line 12: parse error.
Error: C:/Users/Student/AppData/Local/Temp/Nanofluid_Conductivity.c.5700.0.c: line 13: parse error.
Error: C:/Users/Student/AppData/Local/Temp/Nanofluid_Conductivity.c.5700.0.c: line 14: k_f: undeclared variable

.................................................. .................................................. .................................................. .........................................


I think i'm missing out some basics or some steps .
I hope someone can guide me through this .

here is the code i've written:

#include"udf.h"
#define kp 3000 /**thermal conductivity for nanoparticle RGO******/
#define kl 0.6 /**thermal conductivity for fluid******/
#define omega 0.00726 /************omega***************/


DEFINE_PROPERTY(keff_fluid_Conductivity,c,t)
{
Thread *tsf;
tsf = THREAD_SUB_THREAD(t,0);
real k_f; /***thermal conductivity for fluid(water)***********/
real k_eff_l; /******effective thermal conductivity for fluid*********/
real phi_l = C_VOF(c,tsf); /****volume fraction primary phase******/
k_f=(1-sqrt(1-phi_l))*kl; /***Thermal Conductivity of water**/
k_eff_l = k_f/phi_l;
return k_eff_l;
}


DEFINE_PROPERTY(keff_particle_Conductivity,c,t)
{
Thread *tsf;
Thread *tsp;
tsf = THREAD_SUB_THREAD(t,0);
tsp = THREAD_SUB_THREAD(t,1);
real phi_l = C_VOF(c,tsf); /****volume fraction primary phase******/
real phi_p = C_VOF(c,tsp); /****volume fraction secondary phase******/
real A;
real B;
A= kp/kl;
B= 1.25*(pow(((1-phi_l)/phi_l),(10/9)));

real k_p; /******thermal conductivity for particle***********/
real k_eff_p; /* effective thermal conductivity for nano particle***/

real lambda;
real gamma;
lambda =(B(A-1)/(A*pow((1-B/A),2)))*log(A/B)-((B-1)/(1-B/A))-((B+1)/2);

gamma =2/(1-B/A)*lambda;

k_p= sqrt(1-phi_l)*(omega*A+(1-omega)*gamma)*kl;/***Thermal Conductivity of water at ***/
k_eff_p = k_p/phi_p;
return k_eff_p;
}

Last edited by zh_cfd; September 25, 2018 at 06:50. Reason: Attaching error message
zh_cfd 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
Error during interpreting UDF for VoF vekh Fluent UDF and Scheme Programming 9 March 12, 2018 02:57
Parse error interpreting UDF mrwts Fluent UDF and Scheme Programming 2 September 14, 2015 17:45
Parse error in UDF Agad15 Fluent UDF and Scheme Programming 2 April 7, 2015 04:16
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
UDF parse error on line 1 ..... (Unusual) Amit Maha FLUENT 4 June 30, 2006 13:15


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