-
-
May 16, 2023 at 7:19 am
anhvu lee
SubscriberHi everyone,
I used the UDF file for the Wind direction and speed in transient mode. But the result looks not true while the upper wind speed is much slower than the building surrounding. Below is my script for the UDF.
Looking forward for your suggestions.
Thanks a lot
#include "udf.h"DEFINE_PROFILE(velocity,t,i){face_t f;real flow_time;flow_time=RP_Get_Real("flow-time");real x[ND_ND];real z;if(flow_time >=0 && flow_time < 3600){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(1-1)*flow_time/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >=3600 && flow_time < 7200){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-3600)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 7200 && flow_time < 10800){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-7200)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 10800 && flow_time < 14400){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(1.6-1)*(flow_time-10800)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 14400 && flow_time < 18000){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1.6+(1.9-1)*(flow_time-14400)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 18000 && flow_time < 21600){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1.9+(1-1.9)*(flow_time-18000)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 21600 && flow_time < 25200){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(2.5-1)*(flow_time-21600)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 25200 && flow_time < 28800){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (2.5+(4.1-2.5)*(flow_time-25200)/3600)*pow(270/10,0.14)*pow(z/370,0.14);}end_f_loop(f,t)}if(flow_time >= 28800 && flow_time < 32400){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (4.1+(3.1-4.1)*(flow_time-28800)/3600)*pow(270/10,0.22)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 32400 && flow_time < 36000){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (3.1+(1.8-3.1)*(flow_time-32400)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 36000 && flow_time < 39600){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1.8+(1-1.8)*(flow_time-36000)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 39600 && flow_time < 43200){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(1.6-1)*(flow_time-39600)/3600)*pow(270/10,0.14)*pow(z/370,0.14);}end_f_loop(f,t)}if(flow_time >= 43200 && flow_time < 46800){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1.6+(1-1)*(flow_time-43200)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 46800 && flow_time < 50400){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-46800)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time >= 50400 && flow_time < 54000){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = (1+(1-1)*(flow_time-50400)/3600)*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}if(flow_time == 54000){begin_f_loop(f,t){F_CENTROID(x,f,t);z=x[2];F_PROFILE(f,t,i) = 1*pow(270/10,0.14)*pow(z/370,0.22);}end_f_loop(f,t)}} -
May 16, 2023 at 10:47 am
Rob
Ansys EmployeePlot the profile(s) that you've specificied above: do they make sense? What z coordinate is the ground in the Fluent model?
-
May 16, 2023 at 1:18 pm
anhvu lee
SubscriberHi,
Please explain more to me, I followed the Ansys manual for UDF so there're might be something wrong.
Thanks
-
-
May 16, 2023 at 1:47 pm
Rob
Ansys EmployeePossibly. Starting point is to see if the profiles you used are correct: plot in Excel to see if they're giving the values you expect. Use the equations from the UDF and not what you wrote to create the curves in the first instance.
-
May 17, 2023 at 12:48 pm
anhvu lee
SubscriberDear Rob,
It's true with this equations when tested on excel or the expression function of Ansys. I really dont know why
-
-
May 17, 2023 at 1:07 pm
Rob
Ansys EmployeeThe profiles are correct? I didn't follow your statement.
What z-value is the ground, and what z-value is the sky? Use the surface reports in Fluent to find the values.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5454
-
3419
-
2473
-
1310
-
1022
© 2023 Copyright ANSYS, Inc. All rights reserved.