|
[Sponsors] |
June 13, 2016, 12:35 |
DEFINE_ADJUST Application
|
#1 |
New Member
Join Date: Nov 2015
Posts: 16
Rep Power: 11 |
Hi All,
I am confused on the DEFINE_ADJUST macro as there is not much in the UDF manual. Would it be possible to alter material properties (e.g. diffusivity) via DEFINE_ADJUST? In addition, can someone please explain how the DEFINE_ADJUST macro works? Thanks all! |
|
June 14, 2016, 05:02 |
|
#2 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
|
||
June 14, 2016, 09:51 |
|
#3 |
New Member
Join Date: Nov 2015
Posts: 16
Rep Power: 11 |
Hi Bruno,
Thank you for the reply. Can elaborate when you say "add functions to your code and call for these inside the DEFINE_ADJUST"? Do you mean I could call on the DEFINE_ADJUST code from a DEFINE_DIFFUSIVITY code? I am asking because I am not exactly sure how DEFINE_ADJUST works as I am not sure how it can alter values in specific fields such as boundary conditions. Thank you for the help! Much appreciated. |
|
June 14, 2016, 10:02 |
|
#4 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
You can have different functions in your code, eg real function1(c,t) { . . . } real function2(c,t) { . . . } real function3(c,t) { . . . } In your define adjust, you can call these functions and it will be computed each iteration DEFINE_ADJUST(whatever,d) { Thread *t; cell_t c; real variable; thread_loop_c (t,d) { begin_c_loop (c,t) C_UDMI(c,t,0) = function1(c,t) + function2(c,t) + function3(c,t); end_c_loop (c,t) } } In this piece of code, you have 3 distinct functions and in your define adjust, you are defining an UDM as the sum of the three. This is one example, but you can apply many other purposes at it. You can also call the functions you define in the DEFINE_DIFFUSIVITY. Again, thousands of examples on internet. |
||
June 14, 2016, 10:20 |
|
#5 |
New Member
Join Date: Nov 2015
Posts: 16
Rep Power: 11 |
Hi Bruno,
Thank you for the help. I believe I am understanding what you are saying. Can you elaborate on if the the following is possible via the DEFINE_ADJUST macro? I would like to alter kinetic theory results from diffusivity by a factor (e.g. 1/x^2). Would this be possible via DEFINE_ADJUST or would I have to store the values via UDMI and then somehow recall it via DEFINE_DIFFUSIVITY and something like C_PROFILE? |
|
June 14, 2016, 18:53 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
There are a number of macros available within most hooks such as the x-velocity: C_U(c,t). However, if you alter the velocity, for example by setting it to uniform flow:
Code:
C_U(c,t) = 1.; C_V(c,t) = 0.; C_W(c,t) = 0.; |
|
June 15, 2016, 10:04 |
|
#7 |
New Member
Join Date: Nov 2015
Posts: 16
Rep Power: 11 |
Hi e,
thank you for the reply. Here is what I am trying to do. I am trying to implement something to this extent in the diffusivity field kinetic theory * some multiplicative factor (e.g. 0.5) I do not want to rewrite the kinetic theory equation in a UDF as it will take a long time so I was wondering if the DEFINE_ADJUST can accomplish this. The problem I am running into is that all DEFINE_ADJUST macro example I can find are storing the values via UDSI or UDMI which will then require a UDF (most likely DEFINE_DIFFUSIVITY macro) to use this value for diffusivity. Doing this will remove the kinetic theory field for diffusivity, thus this process seems like it is invalid. If this is not possible, please tell me, so I may go along another route. Thank you so much, GF |
|
June 16, 2016, 08:27 |
|
#8 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Check if the laminar species (C_DIFF_L) or effective species (C_DIFF_EFF) diffusivity macros return the value you're after.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error in compute process - No Active Application | yetlyg | FLUENT | 8 | October 27, 2018 23:30 |
Results application error | mich_K | ANSYS | 2 | December 16, 2016 08:07 |
uninstall the user application | milad653279 | OpenFOAM Programming & Development | 2 | April 8, 2016 09:04 |
Problem with mpi_waitAll in application using openfoam | shivaramakrishna | OpenFOAM Programming & Development | 0 | March 9, 2016 08:20 |
Is Playstation 3 cluster suitable for CFD work | hsieh | OpenFOAM | 9 | August 16, 2015 15:53 |