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

the DEFINE_MASS_TRANSFER is only a interpreting udf IN ANSYS 14.0

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By murdock88
  • 1 Post By coglione

Reply
 
LinkBack Thread Tools Display Modes
Old   August 13, 2012, 05:07
Red face the DEFINE_MASS_TRANSFER is only a interpreting udf IN ANSYS 14.0
  #1
New Member
 
Fangdian
Join Date: Aug 2012
Posts: 19
Rep Power: 5
fangdian is on a distinguished road
HI
when i use the DEFINE_MASS_TRANSFER udf in ansys 14.0 . I compile the .c source file success ,then load it sucess as follows:
.....
(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.
正在创建库 libudf.lib 和对象 libudf.exp
Done.
Opening library "F:\rongdi\seconddimension\libudf"...
Library "F:\rongdi\seconddimension\libudf\ntx86\2ddp\libud f.dll" opened
cell_vis
liq_gas_source
Done.
.....
But when i use the liq_gas_source in Multiphase Model dialog box , a error found in the messgage box:
Error: NO user-defined function have been loaded
Error object: #f

when i use it with Interpreting UDFs, it is OK!
on the other time, I use it with compile udf in the ansys 12.1. it is also ok!
why?
thanks!
fangdian


PS: my .c source file>
#include "udf.h"

DEFINE_PROPERTY(cell_vis,cell,thread) /*viscosity*/
{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);
}
fangdian is offline   Reply With Quote

Old   February 14, 2013, 09:37
Default
  #2
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 227
Rep Power: 6
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 the compiled UDF can be easily selected in interaction menu.
msaeedsadeghi is offline   Reply With Quote

Old   February 15, 2013, 03:57
Default
  #3
New Member
 
Murdy Baskan
Join Date: Dec 2012
Posts: 4
Rep Power: 5
murdock88 is on a distinguished road
i have same problem in mass transfer udf i solved using these formulas:

1)Do not make copy pastes because of character set of program it gives direct errors

2)Do not use thread pointer like this

Thread *liq = THREAD_SUB_THREAD(thread, from_index);
Thread *soild = THREAD_SUB_THREAD(thread, to_index);

instead use thread pointer like this

Thread *liq;
liq = THREAD_SUB_THREAD(thread, from_index);
Thread *soild;
solid = THREAD_SUB_THREAD(thread, to_index);

i have solved my problem using these tips.

Have a good day.
6863523 likes this.
murdock88 is offline   Reply With Quote

Old   February 15, 2013, 04:10
Default
  #4
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 227
Rep Power: 6
msaeedsadeghi is on a distinguished road
Are you running in licensed version of Fluent?
Our problem is that the compiled UDF can not be hooked in interaction menu. It says "No user-defined functions have been loaded", but I have really compiled and loaded it.
I am highly professional in UDF writing but couldn't solve this problem yet.
msaeedsadeghi is offline   Reply With Quote

Old   September 12, 2014, 02:08
Default
  #5
New Member
 
Sam
Join Date: Feb 2010
Posts: 4
Rep Power: 8
godspeedsam is on a distinguished road
Quote:
Originally Posted by msaeedsadeghi View Post
Are you running in licensed version of Fluent?
Our problem is that the compiled UDF can not be hooked in interaction menu. It says "No user-defined functions have been loaded", but I have really compiled and loaded it.
I am highly professional in UDF writing but couldn't solve this problem yet.

Does anyone solve the problem?
I have the same problem running in licensed version of Fluent.
godspeedsam is offline   Reply With Quote

Old   September 12, 2014, 04:28
Default
  #6
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 9
coglione is on a distinguished road
UDF-Manual 2.4.6. DEFINE_MASS_TRANSFER:

By default, FLUENT will attempt to hook mass transfer UDFs defined using DEFINE_LINEARIZED_MASS_TRANSFER. In order to hook a DEFINE_MASS_TRANSFER UDF to FLUENT, you must first issue the TUI command solve/set/expert and enter no at the Linearized Mass Transfer UDF? prompt.

cheers
godspeedsam likes this.
coglione is offline   Reply With Quote

Old   September 12, 2014, 04:33
Default
  #7
New Member
 
Sam
Join Date: Feb 2010
Posts: 4
Rep Power: 8
godspeedsam is on a distinguished road
Quote:
Originally Posted by coglione View Post
UDF-Manual 2.4.6. DEFINE_MASS_TRANSFER:

By default, FLUENT will attempt to hook mass transfer UDFs defined using DEFINE_LINEARIZED_MASS_TRANSFER. In order to hook a DEFINE_MASS_TRANSFER UDF to FLUENT, you must first issue the TUI command solve/set/expert and enter no at the Linearized Mass Transfer UDF? prompt.

cheers
Thank you. It works.
godspeedsam is offline   Reply With Quote

Old   April 19, 2016, 03:53
Default my once success
  #8
New Member
 
Cheer
Join Date: Sep 2015
Posts: 1
Rep Power: 0
cheersend is on a distinguished road
I created a new .cs file in the VS, and saved it as x.c (C program file). Then I copied the udf code into the programming text frame and deleted some of the spaces in the udf (maybe actually they are not all real space). Amazingly, the x.c works.

I don't know which step is the key, but it can be a bit of help.
cheersend is offline   Reply With Quote

Reply

Tags
define_mass_transfer

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remeshing_ ANSYS 14.0_ System Coupling acdesa ANSYS 3 February 25, 2013 11:09
Ansys FLUENT UDF - Velocity profile (of known values) across edge / surface emmkell Fluent UDF and Scheme Programming 2 October 21, 2011 13:12
Ansys FLUENT UDF - Velocity profile (of known values) across edge / surface emmkell FLUENT 0 October 20, 2011 07:37
UDF Interpreting Error stephen Fluent UDF and Scheme Programming 1 May 8, 2010 01:10
Exporting results from CFX to ANSYS ?? sohail ahmed CFX 1 December 20, 2007 02:10


All times are GMT -4. The time now is 00:25.