|
[Sponsors] |
October 16, 2008, 09:19 |
transient inlet boundary - reading from file
|
#1 |
Guest
Posts: n/a
|
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 |
|
October 20, 2008, 17:59 |
Re: transient inlet boundary - reading from file
|
#2 |
Guest
Posts: n/a
|
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 |
|
October 22, 2008, 04:08 |
Re: transient inlet boundary - reading from file
|
#3 |
Guest
Posts: n/a
|
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 |
|
October 22, 2008, 11:29 |
Re: transient inlet boundary - reading from file
|
#4 |
Guest
Posts: n/a
|
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 |
|
October 22, 2008, 11:35 |
Re: transient inlet boundary - reading from file
|
#5 |
Guest
Posts: n/a
|
"You gotta love CEL! "
VERY true, and I've got it working now Thanks very much for your help and suggestion! John |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 17:02 |
Transient Mass flow inlet boundary condition | nikhil | FLUENT | 1 | April 16, 2014 10:58 |
1.7.x Environment Variables on Linux 10.04 | rasma | OpenFOAM Installation | 9 | July 30, 2010 05:43 |
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 | BlGene | OpenFOAM Meshing & Mesh Conversion | 10 | August 6, 2009 05:26 |
Compiling OpenFOAM13 on AMD64 with Redhat Enterprise | mbeaudoin | OpenFOAM Installation | 20 | June 17, 2008 07:43 |