Velocity output for Melissa

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
jankolino
Posts: 12
Joined: Fri Jun 22, 2018 2:03 pm

Velocity output for Melissa

Post by jankolino »

Hi,

I am using Code Saturne with Melissa software. I try to get it to output three different quantities. Scalar(concentration), velocity_x and velocity_y. I do it with cs_user_postprocess_var.f90, but I only manage to output the scalar field, the other two are empty and I am not sure what is wrong with my code. The thing is, it does output, if I check the Ensight format,, but not with Melissa output. Should I change anything else?
Below is my code:

Code: Select all

if (ipart .eq. 2) then
    idimt = 1        
    ientla = .true.  
    ivarpr = .true.
    call field_get_val_s_by_name('scalar1', cvar_scalar1)
    do n = 1, ncel
        myvar1(n) = cvar_scalar1(n)
    enddo
    call post_write_var(ipart, 'scalar1', idimt, ientla, ivarpr,              &
                        ntcabs, ttcabs, myvar1, rvoid, rvoid)


else if (ipart.eq.1 ) then

  idimt = 1      
  ientla = .true. 
  ivarpr = .true.
  
  call field_get_val_v(ivarfl(iu), cvar_vel) 
  do n = 1, ncel
    myvar(n) = cvar_vel(2, n)
  enddo

  call post_write_var(ipart, 'velocity_y, idimt, ientla, ivarpr,              &
                      ntcabs, ttcabs, myvar, rvoid, rvoid)
                        
else if (ipart.eq. -1) then
  idimt = 1     
  ientla = .true.   
  ivarpr = .true.
  
  call field_get_val_v(ivarfl(iu), cvar_vel) 
  do n = 1, ncel
    myvar2(n) = cvar_vel(1. n)
  enddo

  call post_write_var(ipart, 'velocity_x', idimt, ientla, ivarpr,              &
                      ntcabs, ttcabs, myvar2, rvoid, rvoid)
Thanks for the help.
Yvan Fournier
Posts: 4251
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity output for Melissa

Post by Yvan Fournier »

Hello,

Your component extraction seems OK, so the issue might be due to the number of fields output. Did you try velocity_y first ?

Also, is the fact that you are not outputting velocity components and the scalar on the same mesh related to your test or not ? So far as I know, Melissa can only handle one single mesh (and the partitioning needs to be identical on all computations, which is easy to do using a space-filling curve option, but needs to be improved by reordering output on the Code_Saturne side in the future).

Best regards,

Yvan
jankolino
Posts: 12
Joined: Fri Jun 22, 2018 2:03 pm

Re: Velocity output for Melissa

Post by jankolino »

Hello,

I tried to put only velocity x without a scalar, but then it does not output anything. I also tried to put everything on one writer and it does not work that way either, but didnt play with it as much. I`ll try with everything on one writer. The domain is the same for all three fields.

Thanks for the help.
Yvan Fournier
Posts: 4251
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity output for Melissa

Post by Yvan Fournier »

Hello,

I am not too familiar with Melissa script settings (I worked more on the integration of the "writer" side), but If I remember correctly, there might be values to set also on the script side (not too sure here, just trying to find why it does not work).

Regards,

Yvan
jankolino
Posts: 12
Joined: Fri Jun 22, 2018 2:03 pm

Re: Velocity output for Melissa

Post by jankolino »

HI again,

I tried outputting only one velocity field at once and it does not work that either. If I try to output scalar and velocity fields it outputs scalar but does not output velocity. I do not have any other ideas currently, so any suggestions are welcome.

Kind regards

EDIT: Spotted the problem. It is in the file fvm_to_melissa.c. Got to compile it differently to add the fields you want to perform an analysis on. Thanks for the help!
Yvan Fournier
Posts: 4251
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity output for Melissa

Post by Yvan Fournier »

Hello,

Which version of the code are you using ? If you have a bug fix (or a suggestion for improvement), you are welcome to post it here or on the bugtracker in GitHub (especially if you conform the issue exists in the latest version).

Best regards,

Yvan
Post Reply