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/)
-   -   how to define a function that outputs vector instead of scalar? (https://www.cfd-online.com/Forums/fluent-udf/191628-how-define-function-outputs-vector-instead-scalar.html)

alinik August 14, 2017 12:36

how to define a function that outputs vector instead of scalar?
 
Hi all,

Is it possible for us to define a function in UDF that outputs a vector (array) instead of a scalar?
I could not find an example.

Thanks,
Ali

CeesH August 16, 2017 05:01

typically, the DEFINE macro you use specifies the required output of the function. This may be a vector - for example, when using the DEFINE_VR_RATE macro the return needs to be a vector. It depends on the sort of data FLUENT is expecting.

Of course, within the UDF itself, you can use all the arrays you want.

alinik August 16, 2017 09:47

Thank you Cees for your reply.
Can I use DEFINE macro to define a vector field?
For example whenever we want to define a scalar function, we use somthing like this:

real func1(cell_t c, Threat *t){
.
.
.
}

Is there something similar to this for defining vector functions?

Thanks,
Ali

CeesH August 17, 2017 05:09

Maybe this helps?

https://www.tutorialspoint.com/cprog...m_function.htm


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