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

Trouble with compiling/hooking

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Crow

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2014, 09:21
Default Trouble with compiling/hooking
  #1
New Member
 
Join Date: Mar 2014
Posts: 11
Rep Power: 12
Crow is on a distinguished road
I'm trying to define the mass transfer between two phases using an UDF. The full version of my UDF need to be compile and not interpreted since I'll be using the function Scalar_Reconstruction and Scalar_Derivatives (from what I've read). There seem to be a problem with the compilation because when I compile the simple UDF below, it says it have been compile (except the warning: udf_names.c(8) : warning C4113: 'void (*)()' differs in parameter lists from 'void (*)(void)'), when I load the UDF, there doesn't seem to be any problem since it shows the name I have given the function (name).

The problem is when I try to hook the UDF in the models it says: No User-defined funciton has been loaded.

It anyone has experience a similar problem or have any advise. It would be greatly appreciated.

#include"udf.h"

DEFINE_MASS_TRANSFER(name,cell,mixture_thread,from _phase_index,from_species_index,to_phase_index,to_ species_index)
{
real m_lg = 0.0;
return (m_lg);
}
Hesam_Ami likes this.
Crow is offline   Reply With Quote

Old   June 5, 2014, 10:27
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Try to remove the 'libudf' folder, and compile again. It might help; I don't understand why, but it helped me before in a similar context.
pakk is offline   Reply With Quote

Old   June 5, 2014, 11:56
Default
  #3
New Member
 
Join Date: Mar 2014
Posts: 11
Rep Power: 12
Crow is on a distinguished road
Thanks for your advise.

I've actually found the problem. I was activating the Linearized mass transfer from the solve/set/expert command and it seems like it was confusing fluent. So by setting it to [no], the problem was solved...until the next.

Unfortunately, I am now experiencing problem with the UDF below where it doesn't print anything on the screen.

#include "udf.h"
DEFINE_ADJUST(my_adjust,d)
{
printf("---------------------TEST------------\n\n");
}

I'll be needing the DEFINE_ADJUST macro to calculated the volume of fluid gradient in each cell.

P.S: I still get the warning tho
Crow is offline   Reply With Quote

Old   June 5, 2014, 12:11
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I also get those warnings since switching from Fluent 14.5 to 15.0, and I just ignore them

About printf: use Message instead in compiled functions.
pakk is offline   Reply With Quote

Old   June 5, 2014, 14:15
Default
  #5
New Member
 
Join Date: Mar 2014
Posts: 11
Rep Power: 12
Crow is on a distinguished road
It worked!

Thanks a lot. Hopefully it will help me figured out what is wrong with the rest of my UDF.
Crow is offline   Reply With Quote

Old   June 27, 2014, 05:58
Default
  #6
djn
New Member
 
Dhananjaya
Join Date: May 2014
Posts: 7
Rep Power: 12
djn is on a distinguished road
How to activate or deactivate Solve/Set/Expert in Ansys fluent 14.5?

PLease help..
djn is offline   Reply With Quote

Old   June 27, 2014, 08:22
Default
  #7
New Member
 
Join Date: Mar 2014
Posts: 11
Rep Power: 12
Crow is on a distinguished road
I'm working with the version 15.0 but it should be similar. You left-click on the main windows where there is the output for the iterations, then you type solve/set and press enter.

Fluent will ask the following question:

Linearized Mass transfer UDF?
use alternate formulation for wall temperatures?
Save cell residuals for post-processing?
Keep temporary solver memory from being freed?
Allow selection of all applicable discretization schemes?

You answer each one by typing yes or no and then pressing enter.

Hope that is what you are looking for...
Crow is offline   Reply With Quote

Old   June 27, 2014, 08:40
Default
  #8
djn
New Member
 
Dhananjaya
Join Date: May 2014
Posts: 7
Rep Power: 12
djn is on a distinguished road
Thanks Crow,

That problem is sorted out.

djn
djn 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
[ANSYS Meshing] Trouble meshing revolved feature evoeng ANSYS Meshing & Geometry 1 August 27, 2012 04:54
Trouble with Turbulent(K-Epsilon) solver imzy Main CFD Forum 0 October 27, 2011 18:34
[ICEM] trouble with mesh quality from ICEM in CFX Solver escher25 ANSYS Meshing & Geometry 0 February 28, 2011 08:38
[GAMBIT] Trouble meshing complex VOF geometry RPJones ANSYS Meshing & Geometry 2 February 14, 2011 19:54
Trouble migrating oodles to pisoFoam while changing from OF 1.5 to 1.7 sebi OpenFOAM 0 December 7, 2010 10:00


All times are GMT -4. The time now is 15:14.