Page 1 of 1

Velocity profile from file

Posted: Wed May 11, 2016 3:44 pm
by andrea28
Hi everyone,
I have a file with all the velocity components for the y-coordinate, is there a way to read this file in code saturne?
Thanks for your help
andrea

Re: Velocity profile from file

Posted: Thu May 12, 2016 4:23 pm
by Luciano Garelli
Hello,

Do you want to use this velocity field to initialize the simulation?. If so, please check the cs_user_initialization-base.f90 and cs_user_initialization-compressible.f90 files at /SRC/EXAMPLES

Regards,

Luciano

Re: Velocity profile from file

Posted: Fri May 13, 2016 10:04 am
by andrea28
Thanks for the reply, no is a boundary condition.

Re: Velocity profile from file

Posted: Fri May 13, 2016 1:41 pm
by Luciano Garelli
Ok,

Did you check cs_user_boundary_conditions-base.f90, cs_user_boundary_conditions-advanced.f90, cs_user_boundary_conditions-mapped_inlet.f90 ?

The file with the velocity comes from another simulation with a different mesh or same mesh? If the profile comes from a different mesh you will have to map or interpolate the values.

Also check this post http://code-saturne.org/forum/viewtopic.php?f=2&t=1872

Regards,
Luciano

Re: Velocity profile from file

Posted: Fri May 13, 2016 2:12 pm
by andrea28
Thanks!!!

Re: Velocity profile from file

Posted: Sat May 21, 2016 9:31 am
by andrea28
Luciano Garelli wrote:Ok,

Did you check cs_user_boundary_conditions-base.f90, cs_user_boundary_conditions-advanced.f90, cs_user_boundary_conditions-mapped_inlet.f90 ?

The file with the velocity comes from another simulation with a different mesh or same mesh? If the profile comes from a different mesh you will have to map or interpolate the values.

Also check this post http://code-saturne.org/forum/viewtopic.php?f=2&t=1872

Regards,
Luciano
Hi,
Yes the mesh is the same. I checked the files, but what for me is not clear is how to loop over the y-coordinate.
Thanks for your time.

Re: Velocity profile from file

Posted: Thu May 26, 2016 3:50 pm
by Luciano Garelli
Hello,

Inside of the boundary faces loop, you can access to the coordinates of the centers of the boundary faces thought the pointer cdgfbo

Code: Select all

! Boundary faces of group '3'
 call getfbr('3', nlelt, lstelt)
  do ilelt = 1, nlelt
    ifac = lstelt(ilelt)
! y-coordinate Face center
    ycoord = cdgfbo(2, ifac)
  enddo
Regards,

Luciano