CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   the macro DEFINE_MASS_TRANSFER can't use as compile udf in ansys14.0 (https://www.cfd-online.com/Forums/fluent-udf/106373-macro-define_mass_transfer-cant-use-compile-udf-ansys14-0-a.html)

fangdian August 27, 2012 10:31

the macro DEFINE_MASS_TRANSFER can't use as compile udf in ansys14.0
 
5 Attachment(s)
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" "http://emuch.net/bbs/images/smilies/wink.gif
(chdir "libudf"http://emuch.net/bbs/images/smilies/wink.gif()
(chdir "ntx86\2ddp"http://emuch.net/bbs/images/smilies/wink.gif()
# 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
http://www.cfd-online.com/Forums/att...1&d=1346077678
IF i use the marco DEFINE_MASS_TRANSFER as interpreted UDF, it is OK.
http://www.cfd-online.com/Forums/att...1&d=1346077678
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.

jajun September 4, 2012 02:31

I have the same problem. I am searching for a solution.

fangdian September 4, 2012 21:30

Quote:

Originally Posted by jajun (Post 380094)
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?

softice2006 September 5, 2012 10:02

Quote:

Originally Posted by fangdian (Post 380244)
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!

jajun September 6, 2012 01:49

Quote:

Originally Posted by fangdian (Post 380244)
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.

fangdian September 6, 2012 06:58

Quote:

Originally Posted by jajun (Post 380480)
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.
ps:Did you use the parallel UDF with Windows system?:D

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 September 6, 2012 07:01

Quote:

Originally Posted by softice2006 (Post 380369)
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!

jajun September 11, 2012 12:07

Quote:

Originally Posted by fangdian (Post 380533)
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.

fangdian September 25, 2012 02:33

Quote:

Originally Posted by jajun (Post 381252)
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.

sooroo3 November 26, 2012 09:12

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.

msaeedsadeghi February 14, 2013 08:35

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.

mehdimoradi. November 22, 2013 03:50

Quote:

Originally Posted by sooroo3 (Post 394213)
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

sooroo3 November 22, 2013 06:36

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.

hane August 23, 2014 10:00

hamed.moradkhani@yahoo.com
 
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


All times are GMT -4. The time now is 05:49.