CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Filtering Adjust using position

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2021, 15:15
Default Filtering Adjust using position
  #1
Member
 
Pierce
Join Date: May 2019
Posts: 39
Rep Power: 6
PierceH is on a distinguished road
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.

Quote:
DEFINE_ADJUST(adjust1,d)
{
Thread *t;
cell_t c;
real xc[ND_ND];
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;
return X;



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)
}
}





PierceH is offline   Reply With Quote

Old   March 17, 2021, 23:49
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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)
}
PierceH likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 03:50
Filtering DNS solutions Vs projecting filtered DNS solution juliom Main CFD Forum 5 May 19, 2016 16:06
how to read in a position file jiejie OpenFOAM 0 May 23, 2011 04:38
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29
Combustion Convergence problems Art Stretton Phoenics 5 April 2, 2002 05:59


All times are GMT -4. The time now is 18:44.