|
[Sponsors] |
February 8, 2019, 17:04 |
time dependent boundary condition
|
#1 |
New Member
yehiaismail
Join Date: Feb 2019
Posts: 4
Rep Power: 7 |
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 |
|
February 11, 2019, 02:28 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
ansys fluent customization manual
look for define_profile macro best regards |
|
February 12, 2019, 12:28 |
|
#3 |
New Member
yehiaismail
Join Date: Feb 2019
Posts: 4
Rep Power: 7 |
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 |
|
February 12, 2019, 22:47 |
|
#4 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
log describes your error
Quote:
t-local is not defined ( no type) best regards |
||
February 22, 2019, 15:29 |
Udf
|
#5 |
New Member
yehiaismail
Join Date: Feb 2019
Posts: 4
Rep Power: 7 |
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) } |
|
February 24, 2019, 22:47 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
(int)number not int(number) |
|
|
|
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 |