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

How to modify the k value in wall-adjacent cells

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2019, 10:17
Default How to modify the k value in wall-adjacent cells
  #1
New Member
 
Jianjian Wei
Join Date: Jul 2019
Posts: 1
Rep Power: 0
weij is on a distinguished road
Dear all,

I want to modify the k (turbulent kinetic energy) value in wall-adjacent cells, but the following UDF doesn't work. When I compile the UDF, it reads that 'error C2275: 'Thread', illegal use of this type as an expression..'

Does anyone know how to solve this problem? Appreciated...

#include "udf.h"
DEFINE_ON_DEMAND(kmodification)
{
Domain *d;
Thread *t;
Thread *tf;
cell_t c;
face_t f;

int zone_ID=13; /*13 is the ID of a wall*/

d=Get_Domain(1);
Thread *tf=Lookup_Thread(d,zone_ID);
begin_c_loop(c,tf)
{
C_K(c,t)=0.5*C_K(c,t);
}
end_c_loop(c,t)
}
weij is offline   Reply With Quote

Old   July 23, 2019, 21:54
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
#include "udf.h"
DEFINE_ON_DEMAND(kmodification)
{
Domain *d;
Thread *t;
cell_t c;
int zone_ID=13; /*13 is the ID of a wall*/

d=Get_Domain(1); 
Thread *t=Lookup_Thread(d,zone_ID);
thread_loop_c(t, domain)
{
/* Loop over all cells */
begin_c_loop(c, t)
{
C_K(c,t)=0.5*C_K(c,t);
}
end_c_loop(c, t);
}
}
however, I'm not you, that you can control K this way
read Ansys Fluent Customization manual for more information and examples of UDF

best regards
AlexanderZ is offline   Reply With Quote

Reply

Tags
lookup_thread


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
How to use a UDF to set the volume fraction in the cells next to a wall? DF15 Fluent UDF and Scheme Programming 33 August 20, 2020 13:36
cellZone not taking all the cells inside rahulksoni OpenFOAM Running, Solving & CFD 6 January 25, 2019 00:11
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
[ICEM] Export ICEM mesh to Gambit / Fluent romekr ANSYS Meshing & Geometry 1 November 26, 2011 12:11


All times are GMT -4. The time now is 14:04.