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, 16:15
Default Filtering Adjust using position
  #1
Member
 
Pierce
Join Date: May 2019
Posts: 40
Rep Power: 7
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 18, 2021, 00: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 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


All times are GMT -4. The time now is 00:15.