Turbulent Channel Flow with Periodic Boundary Conditions

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
LHL123
Posts: 1
Joined: Sun Apr 28, 2024 4:17 pm

Turbulent Channel Flow with Periodic Boundary Conditions

Post by LHL123 »

Dear Code_Saturne developers,

I am a novice user of Code_Saturne and currently undertaking LES of turbulent channel flow using the WALE model. In my simulation setup, I have configured periodic boundary conditions at the inlet/outlet and two sidewalls, with volume forces driving the fluid flow.

However, I have encountered two specific challenges that I hope to address with your expertise:

1. Custom Velocity Initialization: I aim to introduce random perturbations to the velocity initialization. To achieve this, I modified the velocity initialization code generated by the GUI, as shown in the attached file "cs_meg_initialization.c". However, upon inspecting the simulation results, I discovered that the velocity initialization was still determined by the values specified in the GUI rather than by my custom code. I seek guidance on how to ensure that user-defined code dictates the velocity initialization process.

2. Volume Forces and Flow Stability: I have implemented volume forces using the code provided in the attached file "cs_user_source_terms.c". Despite my efforts to configure the volume forces, I have been unable to maintain a constant mean flow velocity, thus hindering the attainment of statistically steady turbulent flow fields. I believe that setting a constant pressure gradient could potentially address this issue. I would greatly appreciate any insights or recommendations on how to achieve this.
I am grateful for any assistance or advice you can provide to help me overcome these challenges and improve the accuracy and stability of my LES simulations.

Thank you sincerely for your support and guidance!

Best regards,
Liu Honglei
Attachments
cs_meg_initialization.c
(2.28 KiB) Downloaded 5 times
cs_user_source_terms.c
(6.34 KiB) Downloaded 6 times
Yvan Fournier
Posts: 4091
Joined: Mon Feb 20, 2012 3:25 pm

Re: Turbulent Channel Flow with Periodic Boundary Conditions

Post by Yvan Fournier »

Hello,

Regarding 1), cs_meg* functions are not user-defined functions. They are generated by the code based on the definitions in the GUI, so your changes will be overwritten. Use cs_user_initialization instead.

Regarding 2), how much fluctuations do you have ? I am not sure you can get something completely steady using a source term, but fluctuations should be very small. I would need to check in some of our examples, but you may also find some examples on this forum. We do need to put a better example in the documentation as this question comes up quite frequently...

Best regards,

Yvan
Post Reply