|
[Sponsors] |
November 8, 2016, 15:36 |
Trouble with Storing Values with F_UDMI
|
#1 |
Member
Joshua
Join Date: Aug 2014
Posts: 49
Rep Power: 12 |
I want to store some variables using F_UDMI so I can access them later, however I'm having issues with having Fluent store any data.
This is my test UDF: Code:
#include "udf.h" #include "storage.h" #include "mem.h" DEFINE_EXECUTE_AT_END(pos_write) { real pos[ND_ND]; int zone_ID; face_t f; cell_t c; Domain *d; Thread *t; zone_ID = 7; d = Get_Domain(1); t = Lookup_Thread(d,zone_ID); // choose BC zone ID from BC panel in Fluent begin_f_loop(f,t) { F_CENTROID(pos,f,t); Message("X = , %f\n",pos[0]); F_UDMI(f,t,0) = pos[0]; } end_f_loop(f,t) } Any ideas? |
|
November 9, 2016, 04:34 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Fluent is a cell centred solver, and its postprocessing takes values from the cells (either directly, or linearly interpolating for node values). You'll need to apply the same value to the adjacent cell as well to visualise in Fluent with contour plots etc. The adjacent cell and cell thread is retrieved with:
Code:
c = F_C0(f,t); ct = F_C0_THREAD(f,t); |
|
November 9, 2016, 12:13 |
|
#3 |
Member
Joshua
Join Date: Aug 2014
Posts: 49
Rep Power: 12 |
What about just a regular X-Y plot? I followed the steps in the manual and it doesn't seem to assign any values to adjacent cells. They just assign a value using F_UDMI. Code:
/* Compute face temperature and store in user-defined memory */ begin_f_loop(f,t) { temp = F_T(f,t); F_UDMI(f,t,0) = (temp - tmin) / (tmax-tmin); } end_f_loop(f,t) |
|
November 9, 2016, 13:03 |
|
#4 |
Member
Joshua
Join Date: Aug 2014
Posts: 49
Rep Power: 12 |
I changed my UDF to use the adjacent cell and cell thread. It seems to store the proper information now.
Code:
#include "udf.h" #include "storage.h" #include "mem.h" DEFINE_EXECUTE_AT_END(pos_write) { real pos[ND_ND]; int zone_ID; face_t f; cell_t c; Domain *d; Thread *t; Thread *ct; zone_ID = 7; d = Get_Domain(1); t = Lookup_Thread(d,zone_ID); // choose BC zone ID from BC panel in Fluent c = F_C0(f,t); ct = F_C0_THREAD(f,t); begin_c_loop(c,ct) { C_CENTROID(pos,c,ct); Message("x = %f\n",pos[0]); C_UDMI(c,ct,0) = pos[0]; } end_c_loop(c,ct) } |
|
Tags |
fluent, fluent - udf, f_udmi, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
using chemkin | JMDag2004 | OpenFOAM Pre-Processing | 2 | March 8, 2016 23:38 |
Setting patch field values equal to internal field values | leroyv | OpenFOAM Programming & Development | 1 | October 21, 2014 16:49 |
Loading Cell Values in Tecplot | P1361 | OpenFOAM Post-Processing | 3 | September 16, 2014 05:02 |
WARNINGS I don't want to have | Gabriel | Siemens | 3 | August 10, 2007 18:04 |
Plotting raw data values | Wilesco | Siemens | 0 | January 5, 2006 06:34 |