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

Porosity as function of position

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By IRobin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2019, 09:21
Default Porosity as function of position
  #1
New Member
 
Robin
Join Date: Sep 2019
Posts: 4
Rep Power: 6
IRobin is on a distinguished road
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 is offline   Reply With Quote

Old   September 13, 2019, 01:52
Default Solved
  #2
New Member
 
Robin
Join Date: Sep 2019
Posts: 4
Rep Power: 6
IRobin is on a distinguished road
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
Siba11 likes this.
IRobin is offline   Reply With Quote

Old   November 6, 2020, 03:00
Default
  #3
RF_
New Member
 
Aref
Join Date: Feb 2018
Posts: 5
Rep Power: 8
RF_ is on a distinguished road
Quote:
Originally Posted by IRobin View Post
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.
RF_ 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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
UDF for writing porosity as a function of distance from the wall rohinibc Fluent UDF and Scheme Programming 5 August 8, 2012 08:16
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42


All times are GMT -4. The time now is 00:03.