Question about the mapped inlet subroutine

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Question about the mapped inlet subroutine

Post by Yvan Fournier »

Hello,

Actually, setup is not a module of the code itself, but part of the associated case setup, which I had forgotten to attach with the example.

Here it is.

Best regards,

Yvan
Attachments
cs_user_modules.f90
(1.73 KiB) Downloaded 176 times
CFD_JK
Posts: 3
Joined: Tue Feb 25, 2020 5:41 pm

Re: Question about the mapped inlet subroutine

Post by CFD_JK »

Hello,

I am trying to simulate flow in an annulus and compute statistics. I am computing average fields and RMS of fluctuations, as can be seen in statistics.c. I am also trying to add mapped inlet, but here is the catch. The RMS of fluctuations is not the same at the inlet and at the mapped region. I have tried turning off the normalization, but then the flow dies out, so this is not the solution. Otherwise, RMS part does not seem to be the same. It starts off high and then slowly decreases.

Is there anything I should be careful about? Any ideas on what I am doing wrong?

Mesh can be found here: https://mega.nz/#!oRxHDAha!TmGkLFlMd5PU ... 3NRGZvwBPI
Thanks
Kind regards,
Jan
Attachments
setup_popr.xml
(9.61 KiB) Downloaded 200 times
statistics.c
(11.95 KiB) Downloaded 189 times
cs_boundary_conditions-mapped_inlet.f90
(8.48 KiB) Downloaded 176 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Question about the mapped inlet subroutine

Post by Yvan Fournier »

Hello,

I won't have time to check your mesh before a few days, but are the mapped region and the inlet conforming ? If not, the issue may be due to (P0) interpolation. Even if it is, there might still be an interpolation issue in the flow direction, but a more subtle one (and harder to solve).

Best regards,

Yvan
CFD_JK
Posts: 3
Joined: Tue Feb 25, 2020 5:41 pm

Re: Question about the mapped inlet subroutine

Post by CFD_JK »

Hi,

the mapped region and the inlet are conforming.
C.FLAG.
Posts: 32
Joined: Fri Apr 08, 2016 2:19 pm

Re: Question about the mapped inlet subroutine

Post by C.FLAG. »

Hello,

It might be a good idea to include a source term in the momentum equation in the recycling region to compensate the friction at the wall? See cs_user_source_terms-momentum.c for example.

EDIT: you can also use the GUI to add a source term

Kind regards,
Cédric
CFD_JK
Posts: 3
Joined: Tue Feb 25, 2020 5:41 pm

Re: Question about the mapped inlet subroutine

Post by CFD_JK »

Hello,

thank you for the suggestion. Setting normalization to zero and adding the source term made the results better (the RMS of fluctuations are still a little bit developing, but a lot less). However, when I add the source term, I should expect that the pressure gradient will be zero in periodic domain, but actually, the pressure gradient becomes bigger than when the normalization was turned on and is definitely not zero. Am I missing something fundamental here?

Kind regards,
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Question about the mapped inlet subroutine

Post by Yvan Fournier »

Hello,

Others could provide a more precise answer, but the mapped inlet does not imply a true periodicity. Rather, it recycles the flow so as to establish a converged profile. Adding a source term is usually done in a "pure periodic" case, where this should lead to a result more similar to what you expect.

If the flow dies out without normalization, it confirms the interpolation has some effect on the total mass flow rate and must be corrected by the normalization (it could as well increase indefinitely as die out, depending on the interpolation and thus mesh). The turbulence variables such as k, omega, Rij, .. are not renormalized, as that would imply enforcing that the mean values are the same as the initial values, defeating the purpose.

For LES, this mode of recycling might be insufficient. Computing a flow on a (hidden) true periodic inlet section and then projecting this on the main inlet is recommended by at least one turbulence expert, but involves more complex changes in the code.

How big is your variation in the RMS fluctuation values ? Is the mesh locally conforming between the place where you set the inlet mapping and the inlet itself ?

Best regards,

Yvan
Post Reply