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

an udf for boundry condition of reciprocating flow

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2017, 05:59
Default an udf for boundry condition of reciprocating flow
  #1
New Member
 
farid
Join Date: Nov 2017
Posts: 1
Rep Power: 0
mohamad-p is on a distinguished road
I want to model the time dependent reciprocating flow through a pipe. the boundary conditions at inlet and outlet are sinusoidal velocity and fully developed flow condition respectively which change in each half cycle.
So i need an udf to define a time dependent sinusoidal velocity profile at inlet and define fully developed condition at the other end of the pipe which be reversed in each half cycle.
the following udf is which i use for left boundry

#include <stdio.h>
#include <math.h>
#include "udf.h"
DEFINE_PROFILE(left_vel_x_comp,thread,index)
{
double t,PI,h_cyc,vel;
face_t f;
Thread *t0=THREAD_T0(thread);
cell_t c0;
t = CURRENT_TIME;

begin_f_loop(f,thread)
{
c0=F_C0(f,thread);
PI=4.*atan(1.);
h_cyc=sin(5.*t); /****half cycle****/
if (h_cyc>=0.0)
{
vel = h_cyc;
}
else
{
vel=(C_U(c0,t0))/0.2;
}
F_PROFILE(f,thread,index)=0.2*vel;
}
end_f_loop(f,thread)
}

DEFINE_PROFILE(left_vel_y_comp,thread,index)
{
face_t f;
begin_f_loop(f,thread)
{
F_PROFILE(f,thread,index)=0.0;
}
end_f_loop(f,thread)
}


I would be so grateful if anyone help me.
Regards.

Last edited by mohamad-p; November 27, 2017 at 07:23.
mohamad-p 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
Appropriate pressure boundary condition in incompressible flow lonelywing OpenFOAM Running, Solving & CFD 21 June 6, 2022 09:44
What will be the state or condition in fluid volume when flow is not full? shivasluzz CFX 2 May 17, 2015 02:59
Mass flow rate boundary condition with negative values ashtonJ CFX 3 November 26, 2014 05:21
Boundary condition for bifurcated flow jiejie OpenFOAM 12 March 3, 2011 10:35
External,incompressible flow boundary condition? John Main CFD Forum 0 October 1, 2003 00:00


All times are GMT -4. The time now is 22:49.