ASCII file for Inlet boundary condition

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Alexandre Lebouvier

ASCII file for Inlet boundary condition

Post by Alexandre Lebouvier »

Hello,
 
I have an ASCII file (got from Fluent) that I would like to use as an input in code_saturne (1.3.3) for velocity. I attached the file.
 
My ASCII file is composed of 7 columns : the number of the cell, the 3 coordinates (x,y,z) of the cell centers and the velocity along x, y and z (separated by space). The meshes are not the same between the 2 models (unstructured for Fluent model, and structured for the code-saturne one) so maybe a treatment is necessary to smooth the data.
 
Is there a possibility in Code_saturne to treat that ASCII file and use it in uselcl (I use MHD model) as it is done for dp_ELE file in DATA ?

Regards
 
Alexandre
Attachments
velocity_inlet_file.txt
(81.6 KiB) Downloaded 246 times
Alexandre Douce

Re: ASCII file for Inlet boundary condition

Post by Alexandre Douce »

Hi,

it is possible to set a profile of velocity for an inlet from an input file but you have to write your own reader and interpolator and to plug them in uselcl.F (if you want I can upload a model for a 1D profile).

I am wondering why your mesh seems to be a 2D grid, whereas your velocity is a 3D vector?
Alexandre Lebouvier

Re: ASCII file for Inlet boundary condition

Post by Alexandre Lebouvier »

Thanks for the answer.
 
I would appreciate an example if you can upload it.
 
My mesh is a 3D grid. The file I have uploaded is the 2D grid of my inlet (in the plane x,y) with values of the velocity along the 3 directions I would like to insert in my boundary conditions
Peter Molcan

Re: ASCII file for Inlet boundary condition

Post by Peter Molcan »

Hello,
i am also interested how to use velocity profile from input file, as in my case it is difficult to describe profile by a function. Would it be possible to see an example?
And this brings up another question. Is it possible to export velocity profile into a text file from outlet face?
thanks for replies
 
Peter
Yvan Fournier

Re: ASCII file for Inlet boundary condition

Post by Yvan Fournier »

Hello,

Regarding your second question, you can always manage your own text output using the usproj.f90 user subroutine.

In parallel, you have to be careful, though, as outlet faces may not all be on the same rank. You may use the "paragv" function (see src/base/cs_parall.h for the description) to work around that.

A simpler solution would be to use usdpst.f90 to define and additional post-processing output, so as to extract a surface mesh matching exactly the output face you are interested (using "getfbr"), and assigning that to a writer using the EnSight gold format output with the text option. You won't have the choice of format, but at least you won't need any additional work and will have something that works in parallel also.

Best regards,

  Yvan
Post Reply