|
[Sponsors] |
March 23, 2017, 08:05 |
Compute/Extract cell wall distance
|
#1 |
New Member
G Ionut
Join Date: Sep 2016
Posts: 29
Rep Power: 10 |
Hi,
I want to determine the cell wall distance or to get its values from FLUENT Solver. I need the cell wall distance to compute the yStar, and eventually to calculate the velocity (to use a custom wall function). I tried to calculate the cell wall distance by identify the wall thread. The code that I used it is written below. After I did a simulation I compared the values from of "Cell Wall Distance" variable from fluent with the ones that I compute "dist". I attached a the graph comparing the two variables. 1. What I did wrong in my code? 2. It is possible to get the values of the "Cell Wall Distance" from the solver so that I can use them in my udf? Like a macro or something like that? 3. Is this function "C_STORAGE_R(f,t,SV_WALL_YPLUS)" the yStar? The geometry that I use is a 3D asymetric diffuser (Diffuser 1 from the article "Geometric sensitivity of three-dimensional separated by Erica M. Cherry" http://www.sciencedirect.com/science...42727X08000131). Code:
DEFINE_ADJUST(ystar, d) { d = Get_Domain(1); Thread *t_wall; Thread *t_adj; cell_t c_adj; face_t f; real f_cen[ND_ND], c_cen[ND_ND], dist; real k, y_star; // Identify the wall cell thread int wall_id = 11; t_wall = Lookup_Thread(d,wall_id); begin_f_loop(f,t_wall) { // Identify the adjacent cells and thread to the wall c_adj = F_C0(f,t_wall); t_adj = THREAD_T0(t_wall); // Extract Turbulent Kinetic Energy from solver k = C_K(c_adj,t_adj); // Get the face and cell centroid near the wall F_CENTROID(f_cen,f,t_wall); C_CENTROID(c_cen,c_adj,t_adj); // Compute the distance from the cell of first layer to the face on the wall dist = sqrt(ND_SUM(pow(c_cen[0]-f_cen[0],2),pow(c_cen[1]-f_cen[1],2),pow(c_cen[2]-f_cen[2],2))); C_UDMI(c_adj,t_adj,2) = dist; // Extract yStar C_UDMI(c_adj,t_adj,1) = C_STORAGE_R(f,t_wall,SV_WALL_YPLUS); // Compute yStar y_star = (DENSITY*pow(CMU,(1./4.))*pow(k,(1./2.))*dist)/MU; C_UDMI(c_adj,t_adj,0) = y_star; //printf("dist: %d\n", dist); } end_f_loop(f,t_wall) } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
Natural convection in a closed domain STILL NEEDING help! | Yr0gErG | FLUENT | 4 | December 2, 2019 01:04 |
yPlusRAS utility - value for wall distance | aylalisa | OpenFOAM Post-Processing | 1 | September 1, 2014 01:15 |
Bug in wall distance calculation | david | OpenFOAM Bugs | 3 | March 15, 2011 10:32 |