|
[Sponsors] |
an udf for boundry condition of reciprocating flow |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 27, 2017, 06:59 |
an udf for boundry condition of reciprocating flow
|
#1 |
New Member
farid
Join Date: Nov 2017
Posts: 1
Rep Power: 0 |
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 08:23. |
|
|
|
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 10:44 |
What will be the state or condition in fluid volume when flow is not full? | shivasluzz | CFX | 2 | May 17, 2015 03:59 |
Mass flow rate boundary condition with negative values | ashtonJ | CFX | 3 | November 26, 2014 06:21 |
Boundary condition for bifurcated flow | jiejie | OpenFOAM | 12 | March 3, 2011 11:35 |
External,incompressible flow boundary condition? | John | Main CFD Forum | 0 | October 1, 2003 01:00 |