CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Porosity as function of position (https://www.cfd-online.com/Forums/fluent-udf/220492-porosity-function-position.html)

IRobin September 9, 2019 09:21

Porosity as function of position
 
Hello,

I would like to create a UDF which sets the porosity value at a fixed value at a given position. I have been struggling with this for the last couple of days but I am still not succesful :(. That is why I ask you guys, as I hope you might help me a bit further.

So the problem, I have the following UDF written:

#include "udf.h"

DEFINE_PROFILE(PROF_Pm_Zeta,thread,i)
{

cell_t cell;
real x[ND_ND];
real a;

begin_c_loop(cell,thread)
{
if (x[0] > 0.2)
{
a = 0.0;
}
else
{
a = 1.0;
}
C_PROFILE(cell,thread,i) = a;

} end_c_loop(cell,thread) }

I call this UDF in Fluent as: Cell zone conditions -> Porous Zone -> Fluid porosity

Its goal is to set the porosity equal to 0, when the x-value is larger than 0.2m. However, after implementing this in a rather simple test case (1 inlet + 3 outlet boundaries), it seems to not work. The velocity is not affected what so ever. Does any one have an idea why the porosity is not changed as I intended it to do?

Robin

IRobin September 13, 2019 01:52

Solved
 
No need to comment anymore, I managed to fix the problem.
For those wondering, if you want to create a pressure drop in a certain location use the same UDF mentioned above, but change the value of a=1.0 to 1e9 (or something high). After interpreting this code in Fluent, you should go to:
Cell Zone Condition -> Porous zone -> Inertia and viscous losses. This will result in an artificial solid or a seal of some sort which blocks the fluid. If you want to influence the heat transfer, than use the above mentioned UDF for the porosity. If you want to know more, I suggest checking out the ANSYS Fluent User Guide.

Hope this will help some of you struggling with the same :),

Robin

RF_ November 6, 2020 03:00

Quote:

Originally Posted by IRobin (Post 744589)
No need to comment anymore, I managed to fix the problem.
For those wondering, if you want to create a pressure drop in a certain location use the same UDF mentioned above, but change the value of a=1.0 to 1e9 (or something high). After interpreting this code in Fluent, you should go to:
Cell Zone Condition -> Porous zone -> Inertia and viscous losses. This will result in an artificial solid or a seal of some sort which blocks the fluid. If you want to influence the heat transfer, than use the above mentioned UDF for the porosity. If you want to know more, I suggest checking out the ANSYS Fluent User Guide.

Hope this will help some of you struggling with the same :),

Robin

Hi IRobin
I appreciate your guidance.


All times are GMT -4. The time now is 17:29.