|
[Sponsors] | |||||
UDF velocity inlet. Different values (compile - Fluent) |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Member
South Yorkshire
Join Date: May 2018
Posts: 33
Rep Power: 9 ![]() |
Hi all,
I am trying to make a UDF file for the inlet velocity of my flow. The flow needs to follow a stepped function: 0 to 0.5 m/s - 0 to 1 second constant 0.5 m/s - 1 to 2 second 0.5 - 1 m/s - 2 to 3 seconds, and so on. Looking tutorials around I made this UDF: Code:
#include "udf.h"
DEFINE_PROFILE(Vinlet, t, i)
{
real velocity,ct,m;
int NN;
int N=1;
real tstop[7] = {0,1,2,3,4,5,6};
real Vstop[4] = {0,0.2,0.4,0.6};
ct = CURRENT_TIME;
face_t f;
if (N % 2 != 0)
{
NN = N*0.5+0.5;
m = (Vstop[NN]-Vstop[NN-1])/(tstop[N+1]-tstop[N]);
velocity = Vstop[NN-1] + m*(ct-tstop[N-1]);
}
else
{
if (N == 2)
{
velocity = Vstop[1];
} else {
velocity = Vstop[NN];
}
}
if (ct <= tstop[N]+0.001 && ct >= tstop[N]-0.001)
{
N = N+1;
}
begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = velocity;
}
end_f_loop(f,t)
}
Anyone knows what could be the reason? thank you, |
|
|
|
|
|
![]() |
| Tags |
| fluent - udf, udf |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UDF - Inlet Velocity Profile (Ansys Fluent) | vinayak4399 | Fluent UDF and Scheme Programming | 3 | August 25, 2020 15:15 |
| How to solve UDF compilation problems in Fluent. | pakk | Fluent UDF and Scheme Programming | 16 | September 10, 2018 03:48 |
| UDF for inlet velocity alongwith UDF for properties | akshayy224 | FLUENT | 0 | February 1, 2018 10:17 |
| UDF inlet velocity profile mismatch with Fluent | ChristineL | Fluent UDF and Scheme Programming | 15 | November 25, 2016 07:45 |
| (UDF) Sinusoidal inlet velocity in Fluent | star | Fluent UDF and Scheme Programming | 1 | December 19, 2013 17:23 |