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

How to get the local coordinate Z via UDF or other way in Fluent

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 17, 2015, 08:33
Default How to get the local coordinate Z via UDF or other way in Fluent
  #1
New Member
 
Joćo Silva
Join Date: Jul 2015
Location: Portugal, Lisbon
Posts: 1
Rep Power: 0
JoaoSilva is on a distinguished road
Hello everyone,

I am trying to simulate the wind flow over a terrain where I need to define the turbulent viscosity via UDF as function of height above the ground.
The problem is that the following UDF give the absolute coordinate z (over the plan z=0) rather than local coordinate (over the ground surface):

#include "udf.h"
#define L -86
#define Ustar 0.4

DEFINE_TURBULENT_VISCOSITY(user_mu_t,c,t)
{
real x[ND_ND];
real mu_t, z;
C_CENTROID(x,c,t);
z=x[2];
mu_t=0.41*Ustar*z/pow((1-16*z/L),-0.25);
return mu_t;
}

I don't know how I can get the height of the terrain (h) for each iteration at the same x and y position that a given cell centroid along the domain given by C_CENTROID(x,c,t). With that I would intend subtract h from z to get the local coordinate z.
This could not the unique way to get local coordinate z, but I don't know another one.

I would appreciate any suggestion to solve this problem.
JoaoSilva 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
A Problem of Fluent Interpreted UDF: parse error knight Fluent UDF and Scheme Programming 25 August 16, 2018 11:26
UDF doesn't work how I need it to - problems with the coordinate system in Fluent SarahG Fluent UDF and Scheme Programming 10 January 25, 2015 17:51
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16
UDF problem caused by various version of Fluent Yurong FLUENT 3 January 15, 2006 11:57


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