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/)
-   -   Trouble with compiling/hooking (https://www.cfd-online.com/Forums/fluent-udf/136793-trouble-compiling-hooking.html)

Crow June 4, 2014 08:21

Trouble with compiling/hooking
 
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);
}

pakk June 5, 2014 09:27

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.

Crow June 5, 2014 10:56

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

pakk June 5, 2014 11:11

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.

Crow June 5, 2014 13:15

It worked! :)

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

djn June 27, 2014 04:58

How to activate or deactivate Solve/Set/Expert in Ansys fluent 14.5?

PLease help..

Crow June 27, 2014 07:22

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...

djn June 27, 2014 07:40

Thanks Crow,

That problem is sorted out.

djn


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