CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   transient inlet boundary - reading from file (https://www.cfd-online.com/Forums/cfx/26534-transient-inlet-boundary-reading-file.html)

John October 16, 2008 08:19

transient inlet boundary - reading from file
 
Hi, I have a measured transient inlet velocity profile which i want to read into CFX (~90 files). The manual only deals with reading steady-state inlet profiles, but i guess there's a way to modify the Fortran code to be able to read a number of files instead? Unfortunately, my knowledge in Fortran isn't the best so if anyone could give me some hints (or provide a code) I would be very grateful.

Or is there another way, not using Fortran?

regards John

CycLone October 20, 2008 16:59

Re: transient inlet boundary - reading from file
 
If the inlet is planar (say in the XY plane), you could load all the data into a single profile and offset each profile in "time" at different offset in the Z direction. Whey you load the profile, instead of passing the Z location, pass it time, but multiply it by C [m/s], where C maps the time to the Z position.

I would make sure the Z separation of the profiles is on the order of the average mesh edge length. The other Z planes will have little influence on the interpolated value when the current time value makes you fall on a profile Z plane.

Another benefit of this approach is that you can use timesteps that are in-between your profile time values.

-CycLone

John October 22, 2008 03:08

Re: transient inlet boundary - reading from file
 
Hi CycLone and thanks for your answer.

I don't think I understood everything, do you mean that I should create a .csv file with the following contents:

X1,Y1,t0,u1,v1

X2,Y2,t0,u2,v2

X3,Y3,t0,u3,v3

. . . . . . .

. . . . . . .

. . . . . . .

X1,Y1,t1,u1,v1

X2,Y2,t1,u2,v2

X3,Y3,t1,u3,v3

. . . . . . .

etc...

How can I pass time to CFX instead of Z? The method seems promising if I can use timesteps that are in-between the measured values!

Thanks, John

CycLone October 22, 2008 10:29

Re: transient inlet boundary - reading from file
 
Basically, set the units for t to [m] and write your profile file. Imagine your profile as a 3D volume extended in space, but the third dimension is really time. What you want is to move the profile in time so it intersects your boundary condition at the right point.

When you use a profile, you need to pass coordinates to it. If Pre inserts the profile for you it will automatically create the corresponding expressions and insert x,y,z as the coordinates. The format of the CEL function used to interpolate from a profile is very simple. If you have a profile called "inletProfile" for instance and a variable u1, the function will be:

inletProfile.u1(coord 1,coord 2,coord 3)

The coordinates are CEL expressions passed to the function to be evaluated. Usually you would use x, y, z, but you can use any expression you want, as long as it has the right units. In your case you would use x, y, and f(t), where f(t) is a function of time that returns a "z" location. For example, if you list time in your profile as the real time, but with units of [m], and your boundary is located at z=.25 [m], then your function would be:

zVirtual=.25[m] + 1 [m/s] * t

More generally you could write this as

zVirtual= a + b*t a = .25 [m] b = 1 [m/s]

For you profile, you would put:

inletProfile.u1(x,y,zVirtual)

and voila! you have a time dependant profile.

You can use the same method to offset profiles in space, rotate them, move them in time etc.

You gotta love CEL!

-CycLone

John October 22, 2008 10:35

Re: transient inlet boundary - reading from file
 
"You gotta love CEL! "

VERY true, and I've got it working now :) Thanks very much for your help and suggestion!

John


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