Page 1 of 1

porosity model : usporo() subroutine called every time step?

Posted: Mon Nov 07, 2016 3:20 pm
by jtache
Dear team,

I have a problem with porosity model in C_S 4.0. I try to define a porosity in some cells of the fluid domain that change dynamically during the computation.

I read in the user's guide that "To define the porosity, the user must fill in the subroutine usporo and set the keyword iporos to 1 in the cs user parameters file. This subroutine is called every time step."

I set the 'iporos' keyword to 1 in 'usipsu' subroutine of cs_user_parameters.f90 user's file and I try to define a porosity in 'usporo' subroutine of cs_user_porosity.f90 user's file (I don't use the GUI).

But the usporo subroutine seems to be called only once at the beginning of the job (even before the cs_user_initialization subroutine) and it's not called for later time steps. So my value for porosity can't be updated during the computation.

Could you please tell me if there's a trick to get usporo() called at each time steps?
Thank you for your feedback.

Jeremie

Re: porosity model : usporo() subroutine called every time s

Posted: Tue Nov 08, 2016 11:15 am
by Pisolino
Hi jtache,
for what is my experience i worked on porosity values importing their value also in cs_user_extra_operations, such subroutine is loaded at the end of each time step, and thus i'm able to have a changing porosity value

Re: porosity model : usporo() subroutine called every time s

Posted: Tue Nov 08, 2016 2:36 pm
by jtache
Hi Pisolino,
This works perfectly! I didn't realize that I could call field_get_val_s(ipori, xxx) in cs_user_extra_operations...
Thanks a lot!

Re: porosity model : usporo() subroutine called every time s

Posted: Wed Nov 09, 2016 2:02 am
by Yvan Fournier
Hello,

Yes, usporo is called before the time loop, not inside the loop as advertised.

I'll check with the other developers if we have any good reason for this. If not, we'll fix it for 5.0.

In the meantime, the solution suggested by Andrea should work fine.

Best regards,

Yvan