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

using one macro in another

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 29, 2020, 02:48
Default using one macro in another
  #1
Member
 
mohammadreza
Join Date: Feb 2020
Posts: 31
Rep Power: 6
mohammadreza_hj is on a distinguished road
Hi everybody,

I have a UDF that includes two define a macro, for example, two define source. I want to use the output of the first macro in the second.
What should I do?
I know that you can call one function in the C programming language, but in that case, you should define the function prototype first and other things.

So I want to use the output of first in second; what should I do?
Thanks
mohammadreza_hj is offline   Reply With Quote

Old   December 29, 2020, 05:24
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
The output of the macro is... well, not something you can use directly. You have (for example) defined source A in a complicated way, and want to say that source B should be twice source A. There is no direct way to do that, or at least no simple way. Options are:

1. Just define two sources, put the code in twice.
2. Make a (classic) c-function, and let both macro's go that function.
3. Use a UDM to store the source from A, and read that UDM in B.

All can work. What is best, depends on the specific problem, and on your programming skills.
mohammadreza_hj likes this.
pakk is offline   Reply With Quote

Old   December 29, 2020, 06:33
Default
  #3
Member
 
mohammadreza
Join Date: Feb 2020
Posts: 31
Rep Power: 6
mohammadreza_hj is on a distinguished road
Quote:
Originally Posted by pakk View Post
The output of the macro is... well, not something you can use directly. You have (for example) defined source A in a complicated way, and want to say that source B should be twice source A. There is no direct way to do that, or at least no simple way. Options are:

1. Just define two sources, put the code in twice.
2. Make a (classic) c-function, and let both macro's go that function.
3. Use a UDM to store the source from A, and read that UDM in B.

All can work. What is best, depends on the specific problem, and on your programming skills.
Well, thanks for your attention.
I think the first option is the best for me.
mohammadreza_hj is offline   Reply With Quote

Reply


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
Implement a non-orthogonal correction on the boundary snGrad yyy155klt OpenFOAM Running, Solving & CFD 3 September 29, 2020 21:33
fvOptions npatricia OpenFOAM 6 May 23, 2018 05:21
timestep extraction for macro manuc Tecplot 0 August 10, 2016 12:20
StarCCM+ Command line options and Macro execution isidp STAR-CCM+ 8 January 29, 2013 05:00
Macro problem cfddummy Siemens 1 April 9, 2007 12:37


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