Velocity profile from file

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
andrea28
Posts: 41
Joined: Fri Apr 15, 2016 7:25 pm

Velocity profile from file

Post 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
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Velocity profile from file

Post 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
andrea28
Posts: 41
Joined: Fri Apr 15, 2016 7:25 pm

Re: Velocity profile from file

Post by andrea28 »

Thanks for the reply, no is a boundary condition.
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Velocity profile from file

Post 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
andrea28
Posts: 41
Joined: Fri Apr 15, 2016 7:25 pm

Re: Velocity profile from file

Post by andrea28 »

Thanks!!!
andrea28
Posts: 41
Joined: Fri Apr 15, 2016 7:25 pm

Re: Velocity profile from file

Post 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.
Luciano Garelli
Posts: 280
Joined: Fri Dec 04, 2015 1:42 pm

Re: Velocity profile from file

Post 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
Post Reply