|
[Sponsors] |
March 17, 2021, 16:15 |
Filtering Adjust using position
|
#1 | |
Member
Pierce
Join Date: May 2019
Posts: 40
Rep Power: 7 |
Hello,
I implemented a user defined scalar which outputs entropy flux, however, I now want it to only do so within a defined x and y region. I thought I was on the right track but cant get this to interpret.
|
||
March 18, 2021, 00:49 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
p_gauge
p_free are not defined in code, fix it. compile code Code:
#include "udf.h" DEFINE_ADJUST(adjust1,d) { Thread *t; cell_t c; real xc[ND_ND]; int X; thread_loop_c (t,d) { begin_c_loop (c,t) C_CENTROID(xc,c,t) if (xc[0] >0.25) X = 1; else X = 0; C_UDSI(c,t,0)= X*(1006.43*log(C_T(c,t)/255.556) -287.04*log((C_P(c,t)+p_gauge)/p_free)); end_c_loop(c,t) }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to use acoustic lib in openfoam | zeinelserfy | OpenFOAM Running, Solving & CFD | 47 | September 29, 2023 04:50 |
Filtering DNS solutions Vs projecting filtered DNS solution | juliom | Main CFD Forum | 5 | May 19, 2016 17:06 |
how to read in a position file | jiejie | OpenFOAM | 0 | May 23, 2011 05:38 |
DPM UDF particle position using the macro P_POS(p)[i] | dm2747 | FLUENT | 0 | April 17, 2009 02:29 |
Combustion Convergence problems | Art Stretton | Phoenics | 5 | April 2, 2002 06:59 |