|
[Sponsors] |
December 29, 2020, 02:48 |
using one macro in another
|
#1 |
Member
mohammadreza
Join Date: Feb 2020
Posts: 31
Rep Power: 6 |
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 |
|
December 29, 2020, 05:24 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
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. |
|
December 29, 2020, 06:33 |
|
#3 | |
Member
mohammadreza
Join Date: Feb 2020
Posts: 31
Rep Power: 6 |
Quote:
I think the first option is the best for me. |
||
|
|
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 |