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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2017, 12: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, 05: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, 09: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, 05: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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 15:46
solving passive scalar by user function in AVLFIRE huyp Main CFD Forum 0 September 4, 2008 10:21
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 06:27
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 13, 2000 23:03
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 03:43


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