|
[Sponsors] |
make the inlet volume fraction equal to the outlet - udf syntax error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 23, 2014, 15:46 |
make the inlet volume fraction equal to the outlet - udf syntax error
|
#1 |
New Member
kong
Join Date: Sep 2011
Posts: 21
Rep Power: 15 |
Hello everyone,
I am new to writing udf. Currently, I would like to write a udf file to make the inlet volume fraction equal to the outlet. The code is following. however when I compiled it, the fluent shows: Copied C:\Users\LKong\Documents ank\mt\1nz/C:\Users\LKong\Documents ank\mt\1nz\ioc.c to libudf\src udf_names.c file in 2d_host is upto date. (system "copy "C:\PROGRA~1\ANSYSI~1\v145\fluent"\fluent14.5.0\sr c\makefile_nt.udf "libudf\win64\2d_host\makefile" ") 1 file(s) copied. (chdir "libudf")() (chdir "win64\2d_host")() # Generating ud_io1.h ioc.c ..\..\src\ioc.c(21) : error C2143: syntax error : missing ';' before '{' ..\..\src\ioc.c(24) : error C2059: syntax error : '}' udf_names.c file in 2d_node is upto date. (system "copy "C:\PROGRA~1\ANSYSI~1\v145\fluent"\fluent14.5.0\sr c\makefile_nt.udf "libudf\win64\2d_node\makefile" ") 1 file(s) copied. (chdir "libudf")() (chdir "win64\2d_node")() # Generating ud_io1.h ioc.c ..\..\src\ioc.c(21) : error C2143: syntax error : missing ';' before '{' ..\..\src\ioc.c(24) : error C2059: syntax error : '}' Done. I did not found I miss the ; before the { or }. could some one help me with this, thank you very much #include "udf.h" DEFINE_ADJUST(outletvf,d) { face_t face; real vf=0.0; real tarea=0.0; real avevf=0.0; real A[ND_ND]; int ID1=14; Thread *outlet_thread=Lookup_Thread(d,ID1); int ID2=13; Thread *inlet_thread=Lookup_Thread(d,ID2); begin_f_loop(face,outlet_thread) { tarea +=F_AREA(A,face,outlet_thread); vf +=F_AREA(A,face,outlet_thread)*F_VOF(face,outlet_t hread); } end_f_loop(face,oulet_thread) avevf=vf/tarea; beginf_f_loop(face,inlet_thread) { F_UDMI(face,inlet_thread,1)=avevf; } end_f_loop(face,inlet_thread) } DEFINE_PROFILE(inletvf,t,i) { face_t f; begin_f_loop(f,t) { F_PROFILE(f,t,i)=avevf; } end_f_loop(f,t) } |
|
October 27, 2014, 06:52 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
First of all: there seems to be a space in your folder name. ("Documents ank") I don't see it giving any problems now, but it can give you problems later, and it is safer to do it without space, for example with an underscroe. ("Documents_ank")
Secondly: you wrote "beginf_f_loop" where you meant "begin_f_loop". |
|
October 27, 2014, 14:02 |
|
#3 | |
New Member
kong
Join Date: Sep 2011
Posts: 21
Rep Power: 15 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 01:21 |
Compile calcMassFlowC | aurore | OpenFOAM Programming & Development | 13 | March 23, 2018 08:43 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
Compiling dynamicTopoFvMesh for OpenFOAM 2.1.x | Saxwax | OpenFOAM Installation | 25 | November 29, 2013 06:34 |
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! | alban | Fluent UDF and Scheme Programming | 2 | June 8, 2010 19:54 |