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

compiling problem of a mass transfer udf

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By majid_kamyab
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2014, 06:05
Unhappy compiling problem of a mass transfer udf
  #1
Member
 
majid kamyab
Join Date: Jul 2014
Posts: 32
Rep Power: 12
majid_kamyab is on a distinguished road
Hello
please help

I have asked some CFD experts in my faculty about compiling and I have used both visual studio 2010 and 2013 so I know the routine compiling method
I have tried on many computers and many people in our faculty have tried to compile it but all of the attempts were all unsuccessful
my system type is 64-bit OS
I have interpreted the code and there are no problems in interpreting but calculation diverges due to floating point exception
the error is
The UDF library that you are trying to load (libudf) is not compiled for parallell use on the current platform (win64)
the operation completed successfully
E:\MESH\udf\libudf\win64\3ddp_host\libudf.dll


here is the code

#include "udf.h"

DEFINE_MASS_TRANSFER(mass_tran, c, t, from_index, from_species_index, to_index, to_species_index)
{
Thread *gas = THREAD_SUB_THREAD(t, to_index);
Thread *liq = THREAD_SUB_THREAD(t, from_index);
real m_lg, k_l, dal, usg, kappa, m, c_sat, a;
dal = 1.46*0.000000001;
usg = 0.294188;
kappa = 0.000484011 / 748;
m = 1.204;
a = 2.287843;
k_l = 2 * sqrt((dal / 3.1415)*sqrt(usg*9.8 / kappa));
m_lg = k_l*a*(C_YI(c, liq, from_species_index) - m*C_YI(c, gas, to_species_index));
return (m_lg);
}
majid_kamyab is offline   Reply With Quote

Old   October 14, 2014, 06:42
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
If you see:

Quote:
The UDF library you are trying to load (...\Fluent\libudf) is not compiled ...
It means that the UDF did not compile. People ask this question all the time, but the answer is right there, just read the text.

Something went wrong when you tried to compile it. Look at the text that was written on the screen when you tried to compile, that will give a hint about what was wrong.
pakk is offline   Reply With Quote

Old   October 14, 2014, 08:10
Default
  #3
Member
 
majid kamyab
Join Date: Jul 2014
Posts: 32
Rep Power: 12
majid_kamyab is on a distinguished road
Quote:
Originally Posted by pakk View Post
If you see:


It means that the UDF did not compile. People ask this question all the time, but the answer is right there, just read the text.

Something went wrong when you tried to compile it. Look at the text that was written on the screen when you tried to compile, that will give a hint about what was wrong.
I know it did not... and thats why I posted this thread.
Ive found the problem.
the udf file was saved in this form masstr.C
but it must be saved in this form masstr.c
please note that the c must be written in lowercase.
ghost82 likes this.
majid_kamyab is offline   Reply With Quote

Old   October 14, 2014, 08:17
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Good that you found it. But for next time: it is more useful to include the error you get when compiling, than to include the error you get when loading.
pakk is offline   Reply With Quote

Old   October 14, 2014, 08:48
Default
  #5
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
Quote:
Originally Posted by majid_kamyab View Post
I know it did not... and thats why I posted this thread.
Ive found the problem.
the udf file was saved in this form masstr.C
but it must be saved in this form masstr.c
please note that the c must be written in lowercase.
So, this means that .C (uppercase) can be interpreted but not compiled?
ghost82 is offline   Reply With Quote

Old   October 14, 2014, 12:47
Default
  #6
Member
 
majid kamyab
Join Date: Jul 2014
Posts: 32
Rep Power: 12
majid_kamyab is on a distinguished road
Quote:
Originally Posted by pakk View Post
Good that you found it. But for next time: it is more useful to include the error you get when compiling, than to include the error you get when loading.
I did not understand what you mean?
do you mean when I built the library?
or load the file?
majid_kamyab is offline   Reply With Quote

Old   October 14, 2014, 12:50
Default
  #7
Member
 
majid kamyab
Join Date: Jul 2014
Posts: 32
Rep Power: 12
majid_kamyab is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
So, this means that .C (uppercase) can be interpreted but not compiled?
well I could have interpreted it ... It did not work correctly and diverged due to floating point exception. as I am not a programmer or computer engineer I cant say for sure but why do we have to risk when we know .c is correct
majid_kamyab is offline   Reply With Quote

Old   October 14, 2014, 12:51
Default
  #8
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
You wrote:
I have interpreted the code and there are no problems in interpreting

I'm assuming you interpreted the .C (uppercase file).
Then you wrote that when you compiled the .C file you had error.

So this means the .C uppercase extension file can be successfully interpreted but not compiled?

PS:
Floating point error is independent from successfully interpreting/compiling.
ghost82 is offline   Reply With Quote

Old   October 15, 2014, 03:41
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by majid_kamyab View Post
I did not understand what you mean?
do you mean when I built the library?
or load the file?
When you build. (In this context, build is the same as compile.)
That is the place where something went wrong, so there you can find information to solve the problem.
majid_kamyab likes this.
pakk is offline   Reply With Quote

Old   October 15, 2014, 11:18
Default
  #10
Member
 
majid kamyab
Join Date: Jul 2014
Posts: 32
Rep Power: 12
majid_kamyab is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
You wrote:
I have interpreted the code and there are no problems in interpreting

I'm assuming you interpreted the .C (uppercase file).
Then you wrote that when you compiled the .C file you had error.

So this means the .C uppercase extension file can be successfully interpreted but not compiled?

PS:
Floating point error is independent from successfully interpreting/compiling.
are you sure about the in-dependency of the divergence from interpreting?
majid_kamyab is offline   Reply With Quote

Reply

Tags
compile a udf, compile error, compile problems


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
using define mass transfer udf for cavitation Komon Fluent UDF and Scheme Programming 14 June 21, 2016 03:50
udf for mass transfer hane Fluent UDF and Scheme Programming 1 April 19, 2014 14:40
Problem with compiling the UDF raghu mohan Fluent UDF and Scheme Programming 10 December 17, 2011 00:34
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT subhankar_bhandari Main CFD Forum 0 August 19, 2010 04:01
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 01:43


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