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

time dependent boundary condition

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 8, 2019, 17:04
Default time dependent boundary condition
  #1
New Member
 
yehiaismail
Join Date: Feb 2019
Posts: 4
Rep Power: 7
yehia ismail is on a distinguished road
Hi,
I am trying to model turbulent pulsed jet flow and I am trying to plot cycle average centerline velocity and the flow has a ratio of on and off equal 1:2.
I want to write a UDF for the t inlet velocity varying with time 172.47*sin(94.248*t) with 0<t<0.033 so anyone can help me in this?Thanks in advance
yehia ismail is offline   Reply With Quote

Old   February 11, 2019, 02:28
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
ansys fluent customization manual

look for define_profile macro

best regards
AlexanderZ is offline   Reply With Quote

Old   February 12, 2019, 12:28
Default
  #3
New Member
 
yehiaismail
Join Date: Feb 2019
Posts: 4
Rep Power: 7
yehia ismail is on a distinguished road
Thank you for your help.I managed to write this udf
#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
t-local= t - int(t/0.1)*0.1;
begin_f_loop(f, thread)
{
if (t-local < 0.033)
Uin=36.6*sin(94.24*t-local)
esle
Uin=0
else
F_PROFILE(f, thread, position) = Uin;
}
end_f_loop(f, thread)
}

however I received an error saying "line 6: local: undeclared variable" which is the line defining the t-local so do you an idea on how could I fix this?Thank you for your help
yehia ismail is offline   Reply With Quote

Old   February 12, 2019, 22:47
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
log describes your error
Quote:
"line 6: local: undeclared variable"
it means you have undeclared variable at line 6

t-local is not defined ( no type)

best regards
AlexanderZ is offline   Reply With Quote

Old   February 22, 2019, 15:29
Default Udf
  #5
New Member
 
yehiaismail
Join Date: Feb 2019
Posts: 4
Rep Power: 7
yehia ismail is on a distinguished road
I wrote this code but I get a parse error in line 7 where the t_local=t - 0.1*int(t/0.1) .Do you have any idea why could be the reason for that?
#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
real t_local;
t_local = t - 0.1*int(t/0.1);

begin_f_loop(f, thread)
{
if ( t_local < 0.033 )
F_PROFILE(f, thread, position) = 172.47*sin(94.25*t_local);
else
F_PROFILE(f, thread, position) = 0;
}
end_f_loop(f, thread)
}
yehia ismail is offline   Reply With Quote

Old   February 24, 2019, 22:47
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 33
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
(int)number
not
int(number)
best regards
AlexanderZ 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
fixedValue boundary condition with a time dependent value meth OpenFOAM Pre-Processing 11 May 25, 2023 03:03
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
Radiation interface hinca CFX 15 January 26, 2014 18:11
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 08:56


All times are GMT -4. The time now is 03:43.