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/)
-   -   problem with coupling UDFs (https://www.cfd-online.com/Forums/fluent-udf/170185-problem-coupling-udfs.html)

hamidreza118 April 26, 2016 05:32

problem with coupling UDFs
 
Hello,

I wrote a UDF and it is compiled and loaded without any error, but there seems to be a deficiency as it is not ending in the result i'm expecting.

I have a DEFINE_PROFILE macro with a begin and end loop and there's another UDF called "void transformation (Thread *f_thread)" which i introduced in my udf to store some vectors in F_UDMI. but my problem is that i can not couple these UDFs when i'm compiling. I think i need something like if (RP_Get_Integer (...)) transformation (f_thread) in the first udf but i have no idea how to trigger the coupling as i'm inexperienced in this subject.
Thanks in Advance.:)

Bruno Machado April 26, 2016 06:30

Quote:

Originally Posted by hamidreza118 (Post 596726)
Hello,

I wrote a UDF and it is compiled and loaded without any error, but there seems to be a deficiency as it is not ending in the result i'm expecting.

I have a DEFINE_PROFILE macro with a begin and end loop and there's another UDF called "void transformation (Thread *f_thread)" which i introduced in my udf to store some vectors in F_UDMI. but my problem is that i can not couple these UDFs when i'm compiling. I think i need something like if (RP_Get_Integer (...)) transformation (f_thread) in the first udf but i have no idea how to trigger the coupling as i'm inexperienced in this subject.
Thanks in Advance.:)

can you post your UDF or the void transformation (Thread *f_thread) so we can see it and try to come with a solution?

hamidreza118 April 26, 2016 07:29

Quote:

Originally Posted by Bruno Machado (Post 596735)
can you post your UDF or the void transformation (Thread *f_thread) so we can see it and try to come with a solution?

I've already done that but as i previously mentioned the links between DEFINE_PROFILE and void is not there! I see somewhere used the if(RP_Integer ... ) to trigger the link, so my code looks like this now:

DEFINE_PROFILE(HF,f_thread,index)

/*declaring all variables*/
if (RP_Get_Integer(“needing_transformation")==1) transformation (f_thread)
{
..
..
..
}


void transformation(Thread *f_thread)
{
..
..
..
}

but when i'm trying to compile this Fluent says:
there is a missing ';' before '{' in my if line !!

but i'm sure after if we shouldn't use semi colon, should we??
and I'm very sorry but do you have any idea how should i assign "needing_transformation" a value like 1 to link these two, since i don't know what RP_Integer.. really does although i've read a lot about it..
Thank you so so so much :)


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