|
[Sponsors] |
How to modify the k value in wall-adjacent cells |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 23, 2019, 11:17 |
How to modify the k value in wall-adjacent cells
|
#1 |
New Member
Jianjian Wei
Join Date: Jul 2019
Posts: 1
Rep Power: 0 |
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) } |
|
July 23, 2019, 22:54 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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); } } read Ansys Fluent Customization manual for more information and examples of UDF best regards |
|
Tags |
lookup_thread |
|
|
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 14:36 |
cellZone not taking all the cells inside | rahulksoni | OpenFOAM Running, Solving & CFD | 6 | January 25, 2019 01:11 |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
[ICEM] Export ICEM mesh to Gambit / Fluent | romekr | ANSYS Meshing & Geometry | 1 | November 26, 2011 13:11 |