Page 1 of 1

Velocity output for Melissa

Posted: Tue Aug 21, 2018 12:15 pm
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.

Re: Velocity output for Melissa

Posted: Tue Aug 21, 2018 1:16 pm
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

Re: Velocity output for Melissa

Posted: Wed Aug 22, 2018 7:54 am
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.

Re: Velocity output for Melissa

Posted: Thu Aug 23, 2018 1:33 am
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

Re: Velocity output for Melissa

Posted: Wed Aug 29, 2018 10:20 am
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!

Re: Velocity output for Melissa

Posted: Wed Aug 29, 2018 7:23 pm
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