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

Trouble: Sandia UV UDF on FLUENT 12.0.16

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2010, 17:22
Question Trouble: Sandia UV UDF on FLUENT 12.0.16
  #1
New Member
 
Ryan Jones
Join Date: Mar 2009
Location: MA, USA
Posts: 7
Rep Power: 17
RPJones is on a distinguished road
I am trying to us a UV Dose UDF available from Sandia National Labs.

http://www.sandia.gov/cfd-water/uvdisinfection.htm

But it does not appear to be working right. The UDF is supposed to allow me to output a custom particle variable, in this case UV Dose, through the Reports->Discrete->Sample function. When I try to do this only a header line is produced, but no numbers are filled in.

Outside of the reporting problem, the UDF appears to work. I am able to view particle tracks colored by the user defined dose. Although I belive I could possibly output data from the particle track portion, having the data in the DPM form would be ideal for post processing.

The UDF is provided with a shared library. If I try to rebuild the library, with changes to the source files, I get the following:

for d in lnx86/[23]*; do \
( \
cd $d; \
for f in ../../src/*.[ch] ../../src/makefile; do \
if [ ! -f `basename $f` ]; then \
echo "# linking to" $f "in" $d; \
ln -s $f .; \
fi; \
done; \
echo ""; \
echo "# building library in" $d; \
if [ "" = "1" ]; then \
echo "# using gcc64"; \
make ARCHC=gcc64 -k>makelog 2>&1; \
else \
if [ "" = "1" ]; then \
echo "# using gcc"; \
make ARCHC=gcc -k>makelog 2>&1; \
else \
make -k>makelog 2>&1; \
fi; \
fi;\
cat makelog; \
) \
done

# building library in lnx86/3d
make[1]: Entering directory `/home4/rjones/UVFlowSim/MSWork/libudf/lnx86/3d'
make[1]: Circular udf_names.c <- udf_names.c dependency dropped.
make[2]: Entering directory `/home4/rjones/UVFlowSim/MSWork/libudf/lnx86/3d'
make libudf.so "CFLAGS=-fpic -shared -ansi -Wall -m32 -O " "LDFLAGS=-shared -lm -m elf_i386"
make[3]: Entering directory `/home4/rjones/UVFlowSim/MSWork/libudf/lnx86/3d'
make[3]: Circular udf_names.c <- udf_names.c dependency dropped.
# Compiling udf_names.o because of udf_names.c
cc -fpic -shared -ansi -Wall -m32 -O -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/`expr \`pwd\` : '.*/\(.*\)/[23].*'`/`basename \`pwd\`` -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/cortex/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/client/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/tgrid/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/multiport/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/multiport/mpi_wrapper/include -I. -c udf_names.c
# Compiling uvdose_par_6326.o because of uvdose_par_6326.c
cc -fpic -shared -ansi -Wall -m32 -O -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/`expr \`pwd\` : '.*/\(.*\)/[23].*'`/`basename \`pwd\`` -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/cortex/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/client/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/tgrid/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/multiport/src -I/usr/local/ansys_inc/v120/fluent/fluent12.0.16/multiport/mpi_wrapper/include -I. -c uvdose_par_6326.c
uvdose_par_6326.c: In function ‘uv_dosage’:
uvdose_par_6326.c:16: warning: unused variable ‘c’
# Linking libudf.so because of makefile udf_names.c udf_names.o uvdose_par_6326.o
ld -shared -lm -m elf_i386 udf_names.o udf_names.o uvdose_par_6326.o -o libudf.so
udf_names.o: In function `UDF_Inquire_Release':
udf_names.c: (.text+0x0): multiple definition of `UDF_Inquire_Release'
udf_names.o:udf_names.c: (.text+0x0): first defined here
udf_names.o: (.data.rel+0x0): multiple definition of `udf_data'
udf_names.o: (.data.rel+0x0): first defined here
udf_names.o: (.data+0x0): multiple definition of `n_udf_data'
udf_names.o: (.data+0x0): first defined here
make[3]: *** [libudf.so] Error 1
make[3]: Leaving directory `/home4/rjones/UVFlowSim/MSWork/libudf/lnx86/3d'
make[2]: *** [lnx86] Error 2
make[2]: Leaving directory `/home4/rjones/UVFlowSim/MSWork/libudf/lnx86/3d'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home4/rjones/UVFlowSim/MSWork/libudf/lnx86/3d'

The system I am workin with is the following:

Linux box running RedHat
X86 chip
FLUENT 12.0.16 Serial
3D, pbns, vof, ske

Thanks for any help that you can provide. I'm sure I'm missed showing some helpful, important information, so let me know and I'll add whatever helps.

Ryan
RPJones is offline   Reply With Quote

Old   June 9, 2010, 08:43
Default
  #2
Member
 
novice
Join Date: Nov 2009
Posts: 33
Rep Power: 17
novice is on a distinguished road
Hi
You said u r using the VOF model so please check whether the UDF is for multiphase or only for single phase.

Regards
novice is offline   Reply With Quote

Old   June 24, 2010, 19:21
Default Sandia UDF for UV dose calculations
  #3
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
Hi Jones,

I also used Sandia UDF to calculate UV dose on Fluent 6.2.36 successfully and when I switched the same Fluent version you are using I am having trouble. I was advised to remove old libraries and build again but the outlet.dpm is empty ...did you manage to make it work? are you using Unix-version or Windows?
banerji is offline   Reply With Quote

Old   July 1, 2010, 10:56
Default
  #4
Member
 
novice
Join Date: Nov 2009
Posts: 33
Rep Power: 17
novice is on a distinguished road
Hi Banerji and Jones,

May I ask u in which application u are calculating the UV doses. Is it in some food processing industry or Water purification etc.

Best Regards
novice is offline   Reply With Quote

Old   July 1, 2010, 13:38
Default
  #5
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
My application is for water purification
banerji is offline   Reply With Quote

Old   July 3, 2010, 19:54
Default
  #6
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
Novice

do you by chance used fluent 12.1 version?
banerji is offline   Reply With Quote

Old   July 12, 2010, 07:06
Default
  #7
Member
 
novice
Join Date: Nov 2009
Posts: 33
Rep Power: 17
novice is on a distinguished road
Hi Banerji
I haven't used the FLUENT 12.1 version yet? May i know y r u asking this?
One more question: may i know in which company (which country) u r working. I'm also in the same industry working in Germany.

Regards
novice is offline   Reply With Quote

Old   July 20, 2010, 17:01
Default
  #8
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
Novice, sorry to reply late. It is a Phd research at a US university.

I also solved the problem, my UDF was not compiling because my MS windows SDKs were old and I had to reiinstall Microsoft VS.

Thanks guys for shearing knowledge.
banerji is offline   Reply With Quote

Old   July 20, 2010, 17:12
Default
  #9
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
Novice, your other question I forgot to answer was why I was asking whether you use Fluent 12. it is because I was thinking to send my code to someone using this version and compile it, then send to me a compiled folder for me to upload. this could have shown me quickly that the problem was the compiler and SDKs issues.
banerji is offline   Reply With Quote

Old   August 2, 2010, 05:55
Default
  #10
New Member
 
Lauri Parviainen
Join Date: Jul 2010
Posts: 8
Rep Power: 16
lauripar is on a distinguished road
Hi all. I'm also calculating dose with Sandia UDF for UV dose calculations, but when I'm loading the UDF I get this error message:

open_udf_library: %1 is not a valid Win32 application

I'm using Fluent 12.1. what should I do to get it work?
lauripar is offline   Reply With Quote

Old   August 5, 2010, 13:28
Default
  #11
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
lauripar..sorry to reply late..but if you have not got it..

did you build your UDF before you load it? if not ..try copying only the C-file from libduf put it in the same folder with your case file then at the window you load compiled UDFs , go to add and search for the C-file and click build and then load. Hope this helps
banerji is offline   Reply With Quote

Old   August 6, 2010, 02:29
Default
  #12
New Member
 
Lauri Parviainen
Join Date: Jul 2010
Posts: 8
Rep Power: 16
lauripar is on a distinguished road
Thanks for your reply Benerji... I tried your instructions but when I did so I got the following error message:

Error: open_udf_library: The system cannot find the file specified.

If you know what to do now, I would be clad to hear it. Thank you for helping.
lauripar is offline   Reply With Quote

Old   August 6, 2010, 02:42
Default
  #13
New Member
 
Lauri Parviainen
Join Date: Jul 2010
Posts: 8
Rep Power: 16
lauripar is on a distinguished road
When I looked at the log file at ...dp0\FFF\Fluent\libudf\win64\3d, there was following message:

NMAKE : U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.EXE"' : return code '0xc0000135'
Stop.

If some one has an answer what to do next, I would appreciate it.
lauripar is offline   Reply With Quote

Old   August 7, 2010, 13:34
Default
  #14
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
Lauripar: what I can see.. you have the compiling error..
so there are many things you have to check that take part in compilation.
1) make sure when you compile there is no any other folder or file in the folder where you put the case file and the C-file(i think the sandia C-file is named demand) .
2) check whether once you click on build there is any libduf folder created if not.. you might be getting NMAKE Error related to the compiler issues.
3) NMAKe errors might be due to the compiler. so check whether visual studio is installed and the environment are set properly.
banerji is offline   Reply With Quote

Old   August 9, 2010, 03:43
Default
  #15
New Member
 
Lauri Parviainen
Join Date: Jul 2010
Posts: 8
Rep Power: 16
lauripar is on a distinguished road
Hi, I Started Fluent from SDK command promt and I had only demand2.c and case file in the folder. But when I built the library I got the following message and error:

> 1 file(s) copied.
(system "copy "C:\PROGRA~1\ANSYSI~1\v121\fluent"\fluent12.1.4\sr c\makefile_nt.udf libudf\win64\3d\makefile")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\3d")()
# Generating ud_io1.h
demand2.c
c:\program files\ansys inc\v121\fluent\fluent12.1.4\src\config.h(110) : error C2143: syntax error : missing '{' before ':'
c:\program files\ansys inc\v121\fluent\fluent12.1.4\src\config.h(110) : error C2059: syntax error : ':'
C:\PROGRA~1\ANSYSI~1\v121\fluent\fluent12.1.4\cort ex\src\dll.h(68) : error C2061: syntax error : identifier 'CX_DLL_GetProc'
C:\PROGRA~1\ANSYSI~1\v121\fluent\fluent12.1.4\cort ex\src\dll.h(68) : error C2059: syntax error : ';'
C:\PROGRA~1\ANSYSI~1\v121\fluent\fluent12.1.4\cort ex\src\dll.h(68) : error C2059: syntax error : 'type'

Banerji have you encountered this kind of problem or du you know what to do next?
lauripar is offline   Reply With Quote

Old   August 9, 2010, 15:04
Default
  #16
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
I also had many compilation issues when I switched from fluent 6 to fluent 12. Well looking at your errors they suggest error in Fluent header files which is strange. But as I can see it got errors when building ud_i01. I remember at this stage the error was it can't find kernel.dll file and I read online that my MS SDKs might not be up to date and when I checked in program files (C:\Program Files\Microsoft SDKs\Windows\v6.1) here before I had v5.0 which was the issue. so, check also here whether you have V6.
banerji is offline   Reply With Quote

Old   August 10, 2010, 03:27
Default
  #17
New Member
 
Lauri Parviainen
Join Date: Jul 2010
Posts: 8
Rep Power: 16
lauripar is on a distinguished road
I checked my SDK and it is v7.1. I have windows 7 and 64 bit system, could some my problems be related to that?
lauripar is offline   Reply With Quote

Old   August 10, 2010, 17:02
Default
  #18
New Member
 
banerji
Join Date: Dec 2009
Posts: 22
Rep Power: 16
banerji is on a distinguished road
to know where the problem exactly is, I would suggest you first to check whether your C compiling system works properly by writting a basic C code (Hello world), compile it, if it works then you would move to Fluent to see why it is not compiling properly.

if you have not programed with C there are tutorials to do the Hello world in C if you google or search it on youtube.
banerji is offline   Reply With Quote

Old   August 11, 2010, 07:19
Default
  #19
New Member
 
Lauri Parviainen
Join Date: Jul 2010
Posts: 8
Rep Power: 16
lauripar is on a distinguished road
I was able to compile. The Problem was that I didn't check the box "Visual c++ compilers" when I installed the SDK 7.1, when I reinstalled SDK and checked that box it solved my problem.

Actually there was line complaining about x64 compliers in the SDK command promt window before I reinstalled SDK and checked that box. I didn't notice it earlier, how stupid...

Thanks Banerji for your help!
lauripar is offline   Reply With Quote

Old   January 26, 2011, 15:50
Default Sandia UDF file is worked
  #20
New Member
 
limin
Join Date: May 2009
Posts: 21
Rep Power: 17
zhang.limin is on a distinguished road
Hi
I am doing CFD UV disinfection simulation in a company in Canada, I tried this file, It is working very well, I think that you may forget the series or parallel complying; second, you should inject particles by file injection or surface injection, using report samples to capture the output file using DPM.
zhang.limin is offline   Reply With Quote

Reply

Tags
fluent, help me, udf


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
problem with loading udf in fluent 6.3 James Fluent UDF and Scheme Programming 6 January 22, 2015 06:51
problem loading UDF in parallel fluent Tim FLUENT 12 July 12, 2008 13:59
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07
UDF in Fluent to Match Mass Flow at Pressure Outlet Jonas Larsson Main CFD Forum 1 April 29, 1999 11:44


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