|
[Sponsors] |
June 25, 2020, 04:55 |
Question about using Macro F_FLUX(f,t)
|
#1 |
New Member
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8 |
Hello everybody,
I want to implement an equation (governing equation of flow in porous media) which is very similar to Navier-Stokes equation, in ansys fluent. I have attached a photo of the equation. As can be seen from the photo i need to change the convective term. In fact the convective term is multiplied by a constant (1/phi^2 phi is porosity). I think the appropriate macro is F_FLUX(f,t) and i also wrote UDF to do that however after compiling the UDF i receive fatal signal (segmentation fault). Below is the UDF i have developed. It would be highly appreciate if anyone helps me to fix this problem. #include "udf.h" #include "mem.h" #include "math.h" DEFINE_ADJUST(set_convective_flux, d) { real porosity = 0.95; Thread *t; cell_t c; face_t f; thread_loop_c(t,d) { begin_c_loop(c,t) { thread_loop_f(t,d) { begin_f_loop(f,t) { F_FLUX(f,t) = F_FLUX(f,t)/(porosity*porosity); } end_f_loop(t, d) } } end_c_loop(c,t) } } |
|
June 25, 2020, 05:06 |
Loop
|
#2 |
Senior Member
|
That's because you are using two loops. You don't need two outermost loops. Just thread_loop_f and begin_f_loop.
However, there are other problems with the code. You can looping over all the boundaries, while F_FLUX exists only for openings, such as, inlet, outlet, etc.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 25, 2020, 06:21 |
|
#3 | |
New Member
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8 |
Quote:
|
||
June 25, 2020, 06:54 |
F_flux
|
#4 |
Senior Member
|
The function exists irrespective of the condition. What I meant is that the fluxes will have a non-zero value only for the openings. Of course, you wouldn't expect fluxes for the walls or symmetry. Periodic conditions on the other hand will have fluxes and so does the interior. But, it would still be better to call this function only on openings.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 25, 2020, 12:03 |
|
#5 |
New Member
Kaazem
Join Date: Jul 2018
Posts: 14
Rep Power: 8 |
You're right. The fluxes will have a non-zero value only for the openings but i think convective flux of each internal face is not zero. That's why i loop over all faces(internal and external) to change convective flux to implement the equation. I guess this is the only way to manipulate convective terms of Navier-Stokes equations in ansys fluent.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro Heat Exchanger not selecting (Please help!) | zdeth | FLUENT | 2 | September 11, 2012 14:52 |
Run macro for Multiple file | furione | STAR-CCM+ | 6 | November 28, 2011 15:54 |
Macro Problem!!! | eRzBeNgEl | STAR-CCM+ | 3 | August 9, 2011 03:04 |
Movie Macro in Tecplot | TedBrogan | Tecplot | 2 | February 4, 2011 11:59 |
Macro problem | cfddummy | Siemens | 1 | April 9, 2007 13:37 |