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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2017, 13:36
Default how to define a function that outputs vector instead of scalar?
  #1
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 18
alinik is on a distinguished road
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
alinik is offline   Reply With Quote

Old   August 16, 2017, 06:01
Default
  #2
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
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.
CeesH is offline   Reply With Quote

Old   August 16, 2017, 10:47
Default
  #3
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 18
alinik is on a distinguished road
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
alinik is offline   Reply With Quote

Old   August 17, 2017, 06:09
Default
  #4
Senior Member
 
Cees Haringa
Join Date: May 2013
Location: Delft
Posts: 607
Rep Power: 0
CeesH is on a distinguished road
Maybe this helps?

https://www.tutorialspoint.com/cprog...m_function.htm
CeesH is offline   Reply With Quote

Reply

Tags
array, function, scalar, udf, vector


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
access to member function variable Rahand OpenFOAM Programming & Development 3 March 29, 2016 16:46
solving passive scalar by user function in AVLFIRE huyp Main CFD Forum 0 September 4, 2008 11:21
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 07:27
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 14, 2000 00:03
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 04:43


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