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

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
jtache
Posts: 25
Joined: Thu Apr 19, 2012 4:01 pm

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

Post 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
Pisolino
Posts: 86
Joined: Thu Apr 26, 2012 1:55 pm

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

Post 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
Andrea
CEO and R&D manager @ ARGO srl

mail: info@argosrl.eu
site: www.argosrl.eu
jtache
Posts: 25
Joined: Thu Apr 19, 2012 4:01 pm

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

Post 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!
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

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

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