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

UDF for transient pressure outlet boundary from data array

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2015, 08:21
Default UDF for transient pressure outlet boundary from data array
  #1
New Member
 
Nate
Join Date: May 2015
Posts: 2
Rep Power: 0
nathanblank is on a distinguished road
I'm trying to simulate flow through an engine airbox with four intake runners. From 1D engine simulation software, I have generated arrays of pressure [Pa] at each intake runner ever 5 deg of crank angle (about 9.8e-5 second time steps) for 720 deg of rotation. The data looks something like this

0 88972.9
5 95712.1
10 102007
15 107885 and so on to 720...

I would like to use this data as pressure outlet boundary conditions in a transient simulation. A separate one for each of the four intake runners.

From what I've gathered, this requires a UDF to read in the array. Unfortunately I know NOTHING about C programming - don't even know what "program" you use to write it, or if you just use Notepad? I'm fairly well versed in MATLAB, but it's obviously different. I've seen the examples, for using a function to apply the BC (shown below), but I'd like to read a data array. I would really appreciate the help if someone could show me how to do this?

/************************************************** ********************
unsteady.c UDF for specifying a transient pressure profile boundary condition ************************************************** *********************/
#include "udf.h"

DEFINE_PROFILE(unsteady_pressure, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = 101325.0 + 5.0*sin(10.*t);
}
end_f_loop(f, thread)
}
nathanblank is offline   Reply With Quote

Old   June 1, 2015, 03:09
Default
  #2
Senior Member
 
Jordi Pina
Join Date: Mar 2015
Posts: 157
Rep Power: 11
jpina is on a distinguished road
Dear nathanblank,

I'm currently facing the same problem.

My only idea is to fit a polynomial and use it in each time step. I mean, for time step one the boundary condition is the polynomial one; for time step two, the boundary condition is the polynomial two, etc.

However, I don't feel very comfortable with my idea since precision is lost when fitting curves to experimental data.

I will keep an eye on this thread and please, if you solve or you have some idea concerning to your (our) problem, please share it here.
jpina 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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 06:40
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 14:06
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Setting outlet Pressure boundary condition using CAFFA code Mukund Pondkule Main CFD Forum 0 March 16, 2011 03:23
correct UDF code for unsteady pressure boundary James W FLUENT 0 November 2, 2005 11:38


All times are GMT -4. The time now is 20:08.