CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

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

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 17, 2015, 07:33
Default How to get the local coordinate Z via UDF or other way in Fluent
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

real x[ND_ND];
real mu_t, z;
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


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
A Problem of Fluent Interpreted UDF: parse error knight Fluent UDF and Scheme Programming 11 December 8, 2013 10:00
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10: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 13:58.