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

the macro DEFINE_MASS_TRANSFER can't use as compile udf in ansys14.0

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By sooroo3
  • 2 Post By hane

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 27, 2012, 11:31
Cool the macro DEFINE_MASS_TRANSFER can't use as compile udf in ansys14.0
  #1
New Member
 
Fangdian
Join Date: Aug 2012
Posts: 19
Rep Power: 14
fangdian is on a distinguished road
hi,
These days, I use the macro DEFINE_MASS_TRANSFER in the ansys14.0, I found that this macro can't be correctly used as compiling UDF.
In the C source file, i define two macros: one is the DEFINE_PROPERTY to set the material properties and the other is the DEFINE_MASS_TRANSFER to set the mass tranfer between two phases.

#include "udf.h"
DEFINE_PROPERTY(cell_vis,cell,thread) /*定义材料粘度*/
{real ga_visy;
real temp=C_T(cell,thread);
if(temp<=1773)
ga_visy=2;
else if(temp<=1853)
ga_visy=1e-3*(119.003-0.061*temp);
else if(temp<=1873)
ga_visy=1e-3*(10.603-0.0025*temp);
else if(temp<=1973)
ga_visy=1e-3*(36.263-0.0162*temp);
else
ga_visy=3e-3;
return ga_visy;
}

DEFINE_MASS_TRANSFER(liq_gas_source,cell,thread,fr om_index,from_species_index,to_index,to_species_in dex)
{
real m_lg;
real T_frost=1773;
Thread *liq = THREAD_SUB_THREAD(thread, from_index);
Thread *soild = THREAD_SUB_THREAD(thread, to_index);
m_lg = 0.;
if (C_T(cell, soild) >= T_frost)
{
m_lg = -0.1*C_VOF(cell,soild)*C_R(cell,soild)*fabs(C_T(cel l,soild)-T_frost)/T_frost;
}
if ((m_lg == 0. ) && (C_T(cell, liq) <= T_frost))
{
m_lg = 0.1*C_VOF(cell,liq)*C_R(cell,liq)*fabs(T_frost-C_T(cell,liq))/T_frost;
}
return (m_lg);
}

I compile the C source file and load them success which can be verified by the messages in the message window:

.....
Done.
Copied F:\rongdi\seconddimension/F:\rongdi\seconddimension est.c to libudf\src
Copied F:\rongdi\seconddimension/F:\rongdi\seconddimension\udf.h to libudf\src
(system "copy "E:\softwear\special\ansys14\ANSYSI~1\v140\fluent" \fluent14.0.0\src\makefile_nt.udf "libudf\ntx86\2ddp\makefile" "
(chdir "libudf"()
(chdir "ntx86\2ddp"()
# Generating ud_io1.h
test.c
# Generating udf_names.c because of makefile test.obj
udf_names.c
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj test.obj
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.

Done.
Opening library "F:\rongdi\seconddimension\libudf"...
Library "F:\rongdi\seconddimension\libudf\ntx86\2ddp\libud f.dll" opened
cell_vis
liq_gas_source
Done.
....
Subsequently, I can use the cell_vis to chang the material property, but when i use the function "liq_gas_source" in the phase interaction window, I can't find the function and an error was found as follows:
Error:No user-defined functions have been loaded.
Error Object:#f

IF i use the marco DEFINE_MASS_TRANSFER as interpreted UDF, it is OK.

On the other hands, i can successly use this marco in the ansys12.0 as compile UDF.
That is to say, I can't use the marco as compile UDF in the ansys 14.0 but only the interpreted UDF.
Is the version problem??Or there is a defect in the ansys14.0 ?

ps: My case file, mesh file and C source file is attached in the attachments.
Attached Images
File Type: jpg compile UDF_error.jpg (97.4 KB, 227 views)
File Type: jpg interpreted UDF_correct.jpg (82.9 KB, 222 views)
Attached Files
File Type: c test.c (914 Bytes, 27 views)
File Type: zip mesh.zip (92.1 KB, 13 views)
File Type: zip case.zip (39.9 KB, 16 views)
fangdian is offline   Reply With Quote

Old   September 4, 2012, 03:31
Default
  #2
New Member
 
lzc
Join Date: Dec 2011
Posts: 3
Rep Power: 15
jajun is on a distinguished road
I have the same problem. I am searching for a solution.
jajun is offline   Reply With Quote

Old   September 4, 2012, 22:30
Default
  #3
New Member
 
Fangdian
Join Date: Aug 2012
Posts: 19
Rep Power: 14
fangdian is on a distinguished road
Quote:
Originally Posted by jajun View Post
I have the same problem. I am searching for a solution.
jajun:
Do you use the compile UDF? It is well if you use the Interpreting UDF. I think it is probalely solved by the mixture UDF?
fangdian is offline   Reply With Quote

Old   September 5, 2012, 11:02
Default
  #4
New Member
 
Tenglong Cong
Join Date: Jun 2011
Posts: 3
Rep Power: 15
softice2006 is on a distinguished road
Quote:
Originally Posted by fangdian View Post
jajun:
Do you use the compile UDF? It is well if you use the Interpreting UDF. I think it is probalely solved by the mixture UDF?
Is mixture UDF available in ANSYS FLUENT 14? Do you find a solution?

If there are any solutions, please send me a message, thank you!
softice2006 is offline   Reply With Quote

Old   September 6, 2012, 02:49
Default
  #5
New Member
 
lzc
Join Date: Dec 2011
Posts: 3
Rep Power: 15
jajun is on a distinguished road
Quote:
Originally Posted by fangdian View Post
jajun:
Do you use the compile UDF? It is well if you use the Interpreting UDF. I think it is probalely solved by the mixture UDF?
When I interpreted the UDF, after initialization, there are errors as "mpi_error=10054". And I don't know how to solve it.
jajun is offline   Reply With Quote

Old   September 6, 2012, 07:58
Wink
  #6
New Member
 
Fangdian
Join Date: Aug 2012
Posts: 19
Rep Power: 14
fangdian is on a distinguished road
Quote:
Originally Posted by jajun View Post
When I interpreted the UDF, after initialization, there are errors as "mpi_error=10054". And I don't know how to solve it.
Are there other UDFs beside the DEFINE_MASS_TRANSFER? Sometimes there are the UDFs which can't be used with the interpreting measure.
When I use the macro DEFINE_MASS_TRANSFER with interpreting way, there is only one DEFINE_PROPERTY macro except the macro DEFINE_MASS_TRANSFER.
psid you use the parallel UDF with Windows system?

As far as the error_10054, perhaps there are many reasons.You could search the possible answer on the internet. for example:
http://cape-forum.com/index.php?topic=1283.0
Good luck to you!
fangdian is offline   Reply With Quote

Old   September 6, 2012, 08:01
Arrow
  #7
New Member
 
Fangdian
Join Date: Aug 2012
Posts: 19
Rep Power: 14
fangdian is on a distinguished road
Quote:
Originally Posted by softice2006 View Post
Is mixture UDF available in ANSYS FLUENT 14? Do you find a solution?

If there are any solutions, please send me a message, thank you!
softice2006:
Sorry! I have not get the solutions with the mixture UDF. I will send you a message if i get the solution.
Best Wishes!
fangdian is offline   Reply With Quote

Old   September 11, 2012, 13:07
Default
  #8
New Member
 
lzc
Join Date: Dec 2011
Posts: 3
Rep Power: 15
jajun is on a distinguished road
Quote:
Originally Posted by fangdian View Post
softice2006:
Sorry! I have not get the solutions with the mixture UDF. I will send you a message if i get the solution.
Best Wishes!
Another way to the problem was identified a mass source and energy source, and it'll work well too.
jajun is offline   Reply With Quote

Old   September 25, 2012, 03:33
Default
  #9
New Member
 
Fangdian
Join Date: Aug 2012
Posts: 19
Rep Power: 14
fangdian is on a distinguished road
Quote:
Originally Posted by jajun View Post
Another way to the problem was identified a mass source and energy source, and it'll work well too.
dear jajun:
Thank you for your reply!I will try it out.
fangdian is offline   Reply With Quote

Old   November 26, 2012, 10:12
Default
  #10
New Member
 
YG Kim
Join Date: Nov 2010
Posts: 15
Rep Power: 16
sooroo3 is on a distinguished road
Did you succeed it? I try to implement UDF mass transfer by use of phase interaction tab, but I fail to run the calculation. How you can access the phase level temperature “C_T(cell, soild)”? I use VOF model that solves mixture level enthalpy equation instead of temperature type energy equation. In this sence, I couldn’t understand phase level temperature macro (C_T(cell, solid). Is there some physics I didn’t catch yet? Thank you.

Last edited by sooroo3; November 28, 2012 at 01:04.
sooroo3 is offline   Reply With Quote

Old   February 14, 2013, 09:35
Default
  #11
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 15
msaeedsadeghi is on a distinguished road
I have asked Ansys Fluent support team. The problem is with the cracked version of fluent. In licensed version it can be easily be selected in interaction menu.
msaeedsadeghi is offline   Reply With Quote

Old   November 22, 2013, 04:50
Default
  #12
Member
 
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 13
mehdimoradi. is on a distinguished road
Quote:
Originally Posted by sooroo3 View Post
Did you succeed it? I try to implement UDF mass transfer by use of phase interaction tab, but I fail to run the calculation. How you can access the phase level temperature “C_T(cell, soild)”? I use VOF model that solves mixture level enthalpy equation instead of temperature type energy equation. In this sence, I couldn’t understand phase level temperature macro (C_T(cell, solid). Is there some physics I didn’t catch yet? Thank you.
Hi;
Could you access the phase level temperature? because i want to interpret a mass transfer udf but have a difficulty in definition of phase temperature. if you solved your problem anyway let me know kindly.
thanks
mehdimoradi. is offline   Reply With Quote

Old   November 22, 2013, 07:36
Default
  #13
New Member
 
YG Kim
Join Date: Nov 2010
Posts: 15
Rep Power: 16
sooroo3 is on a distinguished road
Mehdimoradi;
If VOF model is employed, there may be no way to access the phase level temperature because a enthalpy equation is solved for mixture level energy. Under one field assumption in multiphase flow, VOF method, usually, solves single set of Navier stokes as well as energy equation for two phase.
6863523 likes this.
sooroo3 is offline   Reply With Quote

Old   August 23, 2014, 11:00
Default hamed.moradkhani@yahoo.com
  #14
New Member
 
sarighulikhan
Join Date: Mar 2014
Posts: 15
Rep Power: 12
hane is on a distinguished road
do the following and keep me inform about the results
+ first write case file and data file
then hook the compiled udf


1.define->user-defined->functions->interprated..
interprate the q.c file
2.type on the command window of fluent
solve(press enter)
set(press enter)
expert(press enter)
answer for the 4 comming questions respectively are:
no-yes-no-yes

after these 2 steps u can hook the udf from phase intraction->mass tab->user defined->selecting udf...
now you can start runing calculation
6863523 and yiouyang2020 like this.
hane 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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29
udf compile in parallel system tahereh FLUENT 1 December 9, 2008 10:48
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 11:55
compile the UDF Li Jingping FLUENT 2 April 14, 2003 22:18


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