|
[Sponsors] |
Using DEFINE_SPECIFIC_HEAT, How to get the Cell-Pressure? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 8, 2009, 05:25 |
Using DEFINE_SPECIFIC_HEAT, How to get the Cell-Pressure?
|
#1 |
New Member
Join Date: Oct 2009
Posts: 1
Rep Power: 0 |
at first my code:
#include "udf.h" DEFINE_SPECIFIC_HEAT(specific_heat_N2, T, Tref, h, yi) { real cp; real temp = T; real A0 = 1.0787e3; real A1 = 3.059e-1; real A2 = 6.6177e-4; real A3 = 2.6368e-7; real A4 = 2.1333e-12; real A5 = 1.886e-3; real A6 = 273; real Y0; real pressure; pressure = C_P(c,t); Y0 = A0-A1*temp+A2*(pow(temp,2))-A3*(pow(temp,3))- A4*(pow(temp,4)) ; cp = Y0 *(1+A5*((pressure/10e5)-1)*(pow((A6/temp),2.4))); //[J / kg K] *h = cp; return cp; } The problem is that the index variable c and the thread pointer t are not passed to the UDF, but they are needed in the cell-pressure marco. What do I have to do? Last edited by vast01; October 8, 2009 at 05:48. |
|
October 9, 2009, 05:13 |
|
#2 |
New Member
anonymous
Join Date: Oct 2009
Posts: 3
Rep Power: 17 |
Hi
This DEFINE_SPECIFIC_HEAT macro is not containt cell pressure and any threads and domains. So if you want to get cell pressure, you have to define thread and domain like below, then you can get it. --- DEFINE_SPECIFIC_HEAT(sample, T, Tref, h, yi) { Domain *domain = Get_Domain(1); Thread *t; cell_t c; real pressure; thread_loop_c(t, domain) { begin_c_loop(c, t) { pressure = C_P(c, t); }end_c_loop(c, t) } } --- NOTE: The above udf duplicates cell loop since DEFINE_SPECIFIC_HEAT loops all cell loop first as itself, so it takes a long time. |
|
June 30, 2010, 23:58 |
|
#3 |
New Member
Herbert
Join Date: Jun 2010
Posts: 1
Rep Power: 0 |
I don't know why FLUENT don't let the solver to do the loop work as in the DEFINE_PROPERTY Macro, and this is very annoying.
About your solution, I don't know how you deal with *h = Cp*(T-Tref); return Cp; these two lines (quoted from DEFINE_SPECIFIC_HEAT example in FLUENT UDF Mannual )in your loop structure: thread_loop_c(t, domain) { begin_c_loop(c, t) { pressure = C_P(c, t); }end_c_loop(c, t) } In my view, every cell must have a h and Cp value returned, but the Macro could have only one value returned. Looking forward to your respond. |
|
June 13, 2017, 12:46 |
|
#4 |
New Member
Estêvão Lannes Tolentino
Join Date: Oct 2016
Posts: 9
Rep Power: 10 |
Hi,
I'm having the same problem and I would like to know if this issue has been solved. If so, how was it solved? Thank you. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pressure averaging at the outlets. | KM | CFX | 6 | April 1, 2021 07:28 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |
How to get the pressure in a cell | liqiangnwpu | OpenFOAM Running, Solving & CFD | 1 | April 10, 2005 10:32 |
Pressure Inlet yields wrong velocities | Ben | FLUENT | 0 | November 21, 2004 02:47 |
Pressure Reference Cell | mimì | Siemens | 1 | June 17, 2002 09:29 |