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

Unsteady Inlet Velocity Boundary Condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2018, 14:09
Default Unsteady Inlet Velocity Boundary Condition
  #1
New Member
 
Antoine Aad
Join Date: Apr 2011
Posts: 10
Rep Power: 15
rocketeer is on a distinguished road
I am writing a UDF to define an unsteady velocity profile at an inlet of a domain. I will show a sample of the code and explain what am I looking for.

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, t, i)
{
face_t f;
real t = CURRENT_TIME;
real velocity = V_e
real pressure = P_stat

Domain *domain;
Thread *c_thread;
thread_loop_overset_c(c_thread, domain) /*loops over all cell threads participating in overset */
/*interfaces in the domain */
{

V_e = SQRT(Ux^2 + Uy^2 + Uz^2)
P_stat
}

begin_f_loop(f, thread)/*begin calculation*/
{
F_PROFILE(f, thread, position) = (cst*V_e + cst*(P_stat + 3500*t) - x_wall_shear_stress(cylindrical_wall) - static_pressure(cylindrical_wall) - (cst- cst*t)*cst);
}
end_f_loop(f, thread)
}

I want to calculate the velocity at the inlet as seen by the f_loop;
cst is a constant number, V_e is the velocity at a fluid interface, P_stat is the static gauge pressure at that interface too inside my global domain, moreover calculating the x-wall shear stress on a cylindrical wall inside the global domain with the static pressure at this cylindrical wall also. t is the real-time or time step of the transient simulation. I am using the pressure-based coupled algorithm.
My request is: how to properly code this velocity equation?
rocketeer is offline   Reply With Quote

Old   October 4, 2018, 13:31
Default
  #2
Member
 
Oula
Join Date: Apr 2015
Location: United Kingdom
Posts: 81
Rep Power: 11
Oula is on a distinguished road
Quote:
Originally Posted by rocketeer View Post
I am writing a UDF to define an unsteady velocity profile at an inlet of a domain. I will show a sample of the code and explain what am I looking for.

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, t, i)
{
face_t f;
real t = CURRENT_TIME;
real velocity = V_e
real pressure = P_stat

Domain *domain;
Thread *c_thread;
thread_loop_overset_c(c_thread, domain) /*loops over all cell threads participating in overset */
/*interfaces in the domain */
{

V_e = SQRT(Ux^2 + Uy^2 + Uz^2)
P_stat
}

begin_f_loop(f, thread)/*begin calculation*/
{
F_PROFILE(f, thread, position) = (cst*V_e + cst*(P_stat + 3500*t) - x_wall_shear_stress(cylindrical_wall) - static_pressure(cylindrical_wall) - (cst- cst*t)*cst);
}
end_f_loop(f, thread)
}

I want to calculate the velocity at the inlet as seen by the f_loop;
cst is a constant number, V_e is the velocity at a fluid interface, P_stat is the static gauge pressure at that interface too inside my global domain, moreover calculating the x-wall shear stress on a cylindrical wall inside the global domain with the static pressure at this cylindrical wall also. t is the real-time or time step of the transient simulation. I am using the pressure-based coupled algorithm.
My request is: how to properly code this velocity equation?
I believe you need to define U, also if cst is constant then why don't you put it in the equation to avoid any confusion. One last comment, can you write your equations without coding.
Oula is offline   Reply With Quote

Reply


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
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 02:44
Linear Velocity Inlet Boundary Condition in Openfoam shahilc OpenFOAM Pre-Processing 1 February 27, 2016 04:00
Time dependant pressure boundary condition yosuke1984 OpenFOAM Verification & Validation 3 May 6, 2015 07:16
Velocity inlet boundary condition for porous medium Chander CFX 3 March 11, 2012 22:18
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 14:19.