Velocity_gradient_calculation

Questions and remarks about Code_Saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
C0st4s
Posts: 43
Joined: Fri May 11, 2018 12:21 pm

Velocity_gradient_calculation

Post by C0st4s » Sat Jun 29, 2019 4:38 pm

Hi all,

I came across a problem when I tried to call the 'call field_gradient_vector(ivarfl(iu), 1, imrgra, inc, gradv)' or the pressure gradient in a subroutine that I build up in the cs_user_module.f90. For some reason it works fine when I use 1 processor. When I switch to more, I get " MPI error (communicator MPI_COMM_WORLD):
MPI_ERR_TRUNCATE: message truncated"

Any ideas how I can fix the way the gradient variable are communicate with the other processors to fix it?

Thanks,
Costas

Yvan Fournier
Posts: 2780
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity_gradient_calculation

Post by Yvan Fournier » Sun Jun 30, 2019 7:45 pm

Hello,

Yes, I have some ideas, but not enough info to work with.

Regards,

Yvan

C0st4s
Posts: 43
Joined: Fri May 11, 2018 12:21 pm

Re: Velocity_gradient_calculation

Post by C0st4s » Mon Jul 01, 2019 4:07 pm

Dear Yvan,

Thanks for the response.
The idea is to compute the tangential pressure and the velocity gradient of the boundary cell and then pass that info to a define module. The define module will include both subroutines for the gradients, the subroutine that calls for further calculations and any additional functions that are needed.
Please find attached the error message .
Selection_001.png
Selection_002.png
.

Regards,
Costas
Attachments
Selection_003.png

Yvan Fournier
Posts: 2780
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity_gradient_calculation

Post by Yvan Fournier » Mon Jul 01, 2019 4:36 pm

Hello Costas,

This is still not the information I need. The error is probably in your data setup.

Regards,

Yvan

C0st4s
Posts: 43
Joined: Fri May 11, 2018 12:21 pm

Re: Velocity_gradient_calculation

Post by C0st4s » Tue Jul 02, 2019 11:42 pm

Dear Yvan,

Thank you for your reply.
I cannot find anything wrong with my setup but I have attached the files.


Regards,
Costas
Attachments
listing.txt
(24.08 KiB) Downloaded 8 times
setup.log
(24.24 KiB) Downloaded 12 times
Last edited by C0st4s on Wed Jul 03, 2019 8:10 am, edited 1 time in total.

Yvan Fournier
Posts: 2780
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity_gradient_calculation

Post by Yvan Fournier » Wed Jul 03, 2019 7:52 am

Hello,

I cannot understand how you can pass information to a dedicated module as you describe with no user subroutines.

Regards,

Yvan

C0st4s
Posts: 43
Joined: Fri May 11, 2018 12:21 pm

Re: Velocity_gradient_calculation

Post by C0st4s » Wed Jul 03, 2019 8:10 am

Dear Yvan,

I have not included my subroutines on purpose. If you think that the problem arises from the way I define the module I will check that again. Otherwise, what is the easiest way to compute the velocity and pressure gradients of cell?

Regards,
Costas

Yvan Fournier
Posts: 2780
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity_gradient_calculation

Post by Yvan Fournier » Wed Jul 03, 2019 5:49 pm

Hello,

Using the field_gradient_* functions is usually th simplest solution.

Best regards,

Yvan

C0st4s
Posts: 43
Joined: Fri May 11, 2018 12:21 pm

Re: Velocity_gradient_calculation

Post by C0st4s » Wed Jul 10, 2019 12:05 pm

Dear Yvan,

I think the problem arises because I try to select a boundary face,<call getfbr>, and based on that selection call the gradient function for the near boundary face cell. For 1 processor the code runs ok but when I switch to 2< it fails since the second processor does not see that information on the same near wall boundary face. I tried to use the synsca function before the gradient call in my module subroutine and print the rank in a file but aparently the second processor which the boundary face is not included it does not show/sync. Any suggestions how can I get the right synchronize gradient information on each processor for the corresponding face selection?

Note that I also use periodicity and halo cells are involved.


Regards,
Costas

Yvan Fournier
Posts: 2780
Joined: Mon Feb 20, 2012 3:25 pm

Re: Velocity_gradient_calculation

Post by Yvan Fournier » Thu Jul 11, 2019 6:08 pm

Hello,

I do not understand how you use the gradient function for specific cells, since the function applies to all cells.

In any case in parallel it is a collective function so all processes must make the same call (with their local data of course).

Regards,

Yvan

Post Reply