CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Extract 2D velocity values (http://www.cfd-online.com/Forums/fluent/72819-extract-2d-velocity-values.html)

zalho February 18, 2010 13:19

Extract 2D velocity values
 
Hi.

I'm trying to extract the values of the velocity vectors of a 2D simulation but i don't know how to do it...
I want to write those values into a file to read in other program to simulate a robot navigation.

At this moment i can make an animation of the vectors but what i really want is the steady-state values of that vectors written in a file...

Someone knows how if it is possible to do it and how????:confused:

Thanks

hvem10 February 18, 2010 17:32

you can create a line in surfaces or use an edge you already have defined. You then extract the values in Plot, XY plot, there you can write to file.
You can also do the same by define a profile on the edge and write the values

zalho February 19, 2010 07:57

Quote:

Originally Posted by hvem10 (Post 246515)
you can create a line in surfaces or use an edge you already have defined. You then extract the values in Plot, XY plot, there you can write to file.
You can also do the same by define a profile on the edge and write the values

For example i have this environment with the vectors of velocity:

http://img63.imageshack.us/img63/9634/semttulotw.png

What i want is a file with the position and the values of those vectors...
for example:
X=0.1; Y=0.5; VX=1.23; VY=0.14;
for all the 2D positions...

thanks...

zalho February 19, 2010 10:42

Hi.

I already discover how to do it...
Using the option File -> Export -> ASCII
It creates a file with the XY position and the value of the velocity but only in one instant of time.

Anyone knows how to do this to all instants of the time of simulation??

ekakavand February 24, 2010 12:25

Quote:

Originally Posted by hvem10 (Post 246515)
you can create a line in surfaces or use an edge you already have defined. You then extract the values in Plot, XY plot, there you can write to file.
You can also do the same by define a profile on the edge and write the values



hi

i do like this for extracting velocity profile but it is wrong and do not match with velocity vectors, do you have any idea about it?

best
elahe

jas_z February 28, 2010 21:57

time instance data export / variables' names at data export
 
hi,

a little bit late responce, but this caused me a lot of trouble, till i found out how to do it, so let it be posted...

1} export your data for each instant of time by executing a command:

Solve --> Execute Commands --> ...

there you define the rest of the export parameters (how,when...).

2} command is entered in the following form:

file/export/ file-type file name [list-of-surfaces ()] [list-of-scalars q]

(for more look at 4.12.18 Fluent Documentation)

the tricky thing with this is to find out how should you enter the variables' names???

and the answer is:

3} write the variables' names, depending on the filetype you want to export your data at.....

that means you must have a clue of how the specific program calls each variable you want to export

(hint: find it out by opening a steady-state simulation data file with the certain program!!!)

------------------------------

to sum up, here's an example of a command exporting data (axisymmetric duct) in tecplot filetype:

file/export/tecplot Re=100 axis.8 default-interior outflow.7 velocity_inlet.5 wall.6 () pressure velocity-magnitude axial-velocity radial-velocity strem-function velocity-angle vorticity-mag viscocity-lam wall-shear axial-wall-shear radial-wall-shear strain-rate-mag daxial-velocity-dx dradial-velocity-dx daxial-velocity-dy dradial-velocity-dy dp-dx dp-dy q

data filename: Re=100
surfaces: axis.8 , default-interior , outflow.7 , velocity_inlet.5 , wall.6
variables' examples: [tecplot name]-->[fluent export name]

pressure --> Static Pressure
vorticity-mag --> Vorticity
axial-wall-shear --> Axial Wall Shear

(be careful:... for a 2D duct there would be x-velocity and no axial-velocity)


( if you wanted the file name to be changing after each timestep, then you'd put as filename: Re=100-%f.ps

(more options about that: 4.12.18 Fluent Documentation) )


.................................................. .................................................. ..

zalho March 1, 2010 12:30

Quote:

Originally Posted by jas_z (Post 247833)
hi,

a little bit late responce, but this caused me a lot of trouble, till i found out how to do it, so let it be posted...

1} export your data for each instant of time by executing a command:

Solve --> Execute Commands --> ...

there you define the rest of the export parameters (how,when...).

2} command is entered in the following form:

file/export/ file-type file name [list-of-surfaces ()] [list-of-scalars q]

(for more look at 4.12.18 Fluent Documentation)

the tricky thing with this is to find out how should you enter the variables' names???

and the answer is:

3} write the variables' names, depending on the filetype you want to export your data at.....

that means you must have a clue of how the specific program calls each variable you want to export

(hint: find it out by opening a steady-state simulation data file with the certain program!!!)

------------------------------

to sum up, here's an example of a command exporting data (axisymmetric duct) in tecplot filetype:

file/export/tecplot Re=100 axis.8 default-interior outflow.7 velocity_inlet.5 wall.6 () pressure velocity-magnitude axial-velocity radial-velocity strem-function velocity-angle vorticity-mag viscocity-lam wall-shear axial-wall-shear radial-wall-shear strain-rate-mag daxial-velocity-dx dradial-velocity-dx daxial-velocity-dy dradial-velocity-dy dp-dx dp-dy q

data filename: Re=100
surfaces: axis.8 , default-interior , outflow.7 , velocity_inlet.5 , wall.6
variables' examples: [tecplot name]-->[fluent export name]

pressure --> Static Pressure
vorticity-mag --> Vorticity
axial-wall-shear --> Axial Wall Shear

(be careful:... for a 2D duct there would be x-velocity and no axial-velocity)


( if you wanted the file name to be changing after each timestep, then you'd put as filename: Re=100-%f.ps

(more options about that: 4.12.18 Fluent Documentation) )


.................................................. .................................................. ..

thanks

i'm using the command:
file/export/ascii cont_c2h6 default-interior () yes mass-fraction-of-c2h6 q yes

but it only exports the X and Y coordinates..
what i have to change to export the mass fraction values ???
how can i create various files for diferent instant of time?

jas_z March 1, 2010 19:24

variable name in export commands / files for diferent instants of time
 
hi again,

i'm not sure what exactly is the problem with your command, but two are the possible errors...

@ the variable's name you gave...

--> change the name of the variable (ex. mass-fraction-ethane)

{ to find out for sure, run a simple simulation, with no commands in the middle, export your data in an ascii file and see how this variable is written in the specific dataset }


@ the surface's name

--> write the surface with its number extension (ex. default-interior.2) { it's the one you gave to it at the meshing procedure }


try both changes and each one seperately.


about creating various files for diferent instants of time there are a lot of options...

copy from the 4.1.17 Fluent Documentation:

For unsteady-state calculations, you can save files with names that reflect the flow-time at which they are saved by including the character string %f in the file name. The usage is similar to %t. For example, when you specify filename-%f.ps for the file name, the solver will save a file with the appropriate name (e.g., filename-005.000000.ps for a solution at a flow-time of 5 seconds). By default, the flow-time that is included in the file name will have a field width of 10 and 6 decimal places. To modify this format, use the character string %x.yf, where x and y are the preferred field width and number of decimal places, respectively. FLUENT will automatically add zeros to the beginning of the flow-time to achieve the prescribed field width. To eliminate these zeros and left align the flow-time, use the character string %-x.yf instead.

so if you write:

file/export/ascii cont_c2h6-%7.3f.ps default-interior () yes mass-fraction-of-c2h6 q yes

data from time step dt=1sec are written in file: cont_c2h6-001.000.ps



hope i shed some light to your questions...

unfortunately, when there is lack of specified information about a topic in fluent, you have to go through a try-error procedure to find out the right way to do what you want.

zalho March 2, 2010 09:57

Quote:

Originally Posted by jas_z (Post 248000)
hi again,

i'm not sure what exactly is the problem with your command, but two are the possible errors...

@ the variable's name you gave...

--> change the name of the variable (ex. mass-fraction-ethane)

{ to find out for sure, run a simple simulation, with no commands in the middle, export your data in an ascii file and see how this variable is written in the specific dataset }


@ the surface's name

--> write the surface with its number extension (ex. default-interior.2) { it's the one you gave to it at the meshing procedure }


try both changes and each one seperately.


about creating various files for diferent instants of time there are a lot of options...

copy from the 4.1.17 Fluent Documentation:

For unsteady-state calculations, you can save files with names that reflect the flow-time at which they are saved by including the character string %f in the file name. The usage is similar to %t. For example, when you specify filename-%f.ps for the file name, the solver will save a file with the appropriate name (e.g., filename-005.000000.ps for a solution at a flow-time of 5 seconds). By default, the flow-time that is included in the file name will have a field width of 10 and 6 decimal places. To modify this format, use the character string %x.yf, where x and y are the preferred field width and number of decimal places, respectively. FLUENT will automatically add zeros to the beginning of the flow-time to achieve the prescribed field width. To eliminate these zeros and left align the flow-time, use the character string %-x.yf instead.

so if you write:

file/export/ascii cont_c2h6-%7.3f.ps default-interior () yes mass-fraction-of-c2h6 q yes

data from time step dt=1sec are written in file: cont_c2h6-001.000.ps



hope i shed some light to your questions...

unfortunately, when there is lack of specified information about a topic in fluent, you have to go through a try-error procedure to find out the right way to do what you want.

thanks

the correct command is:
file/export/ascii cont_c2h6-%5.3f default-interior () yes c2h6 q yes

to export the mass fraction of c2h6


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