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

make the inlet volume fraction equal to the outlet - udf syntax error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 23, 2014, 14:46
Default make the inlet volume fraction equal to the outlet - udf syntax error
  #1
New Member
 
kong
Join Date: Sep 2011
Posts: 21
Rep Power: 14
kongl1986 is on a distinguished road
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)
}
kongl1986 is offline   Reply With Quote

Old   October 27, 2014, 05:52
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   October 27, 2014, 13:02
Default
  #3
New Member
 
kong
Join Date: Sep 2011
Posts: 21
Rep Power: 14
kongl1986 is on a distinguished road
Quote:
Originally Posted by pakk View Post
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".
thank you.
kongl1986 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
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 00:21
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 07:43
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
Compiling dynamicTopoFvMesh for OpenFOAM 2.1.x Saxwax OpenFOAM Installation 25 November 29, 2013 05:34
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 18:54


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