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

Boundary conditions of UDF writing speed changing with time

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 13, 2020, 22:48
Default Boundary conditions of UDF writing speed changing with time
  #1
New Member
 
Join Date: May 2020
Posts: 8
Rep Power: 7
ZengJiChuan is on a distinguished road
The speed changes periodically with time, and UDF is loaded by means of compilation. Fluent is parallel computing, and there are other UDFs. But the recorded data shows that the speed has not changed over time. Please help to see what might be the reason. The following is UDF:
#include"udf.h"
DEFINE_PROFILE(air_inlet_velocity,thread,position)
{
real t,v,a;
face_t f;
begin_f_loop(f,thread)
{
t=RP_Get_Real("flow-time");
{
a=(int)t%240;
if(a>=0&&a<60)
{
v=(float)a/60+4.63;
}
else if(a>=60&&a<180)
{
v=-(float)a/60+6.63;
}
else if(a>=180&&a<240)
{
v=(float)a/60+0.63;
}
}
F_PROFILE(f,thread,position)=v;
}
end_f_loop(f,thread)
}
ZengJiChuan is offline   Reply With Quote

Old   September 15, 2020, 23:01
Default
  #2
New Member
 
Dico Nico
Join Date: Oct 2018
Posts: 12
Rep Power: 9
Diconico is on a distinguished road
Could it be because you are running in parallel? Maybe, because your domain is solved by diferent nodes, and you are looping in the domain, it is overwriting something, try running in serial, just to see if the velocity changes. When I have more time, I'll give a better look to give you a proper answer.
Diconico is offline   Reply With Quote

Old   September 16, 2020, 03:54
Default
  #3
New Member
 
Join Date: May 2020
Posts: 8
Rep Power: 7
ZengJiChuan is on a distinguished road
Quote:
Originally Posted by Diconico View Post
Could it be because you are running in parallel? Maybe, because your domain is solved by diferent nodes, and you are looping in the domain, it is overwriting something, try running in serial, just to see if the velocity changes. When I have more time, I'll give a better look to give you a proper answer.
Thank you for your answer. I have found my wrong place. I shouldn't use cast, which causes a to be zero at the beginning.
ZengJiChuan is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script for pseudo-parallel usage of reconstructPar kwardle OpenFOAM Post-Processing 43 October 28, 2025 04:19
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 6, 2023 00:48
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
dynamic Mesh is faster than MRF???? sharonyue OpenFOAM Running, Solving & CFD 14 August 26, 2013 08:47


All times are GMT -4. The time now is 20:05.