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
Turbulent Channel Flow with Periodic Boundary Conditions
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
Turbulent Channel Flow with Periodic Boundary Conditions
- Attachments
-
- cs_meg_initialization.c
- (2.28 KiB) Downloaded 968 times
-
- cs_user_source_terms.c
- (6.34 KiB) Downloaded 1016 times
-
- Posts: 4233
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Turbulent Channel Flow with Periodic Boundary Conditions
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
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
Re: Turbulent Channel Flow with Periodic Boundary Conditions
Hi everyone,
I encountered a similar issue, using version 6.0.8, on this very case of periodic turbulent channel flow, however in RANS mode.
In cs_user_source_terms.f90, I implemented the source (pressure gradient) supposed to balance the viscous stresses. At the same time, I initialized the velocity field to be Ux = 20 (corresponding to the expected Umax_x at convergence). But the calculation behaved as if the initial velocity was 0 everywhere (while listing shows an initialization with Ux = 20 everywhere). Finally, convergence was reached, however after some really long time.
Afterwards, I encountered the same problem when initializing another calculation with the output of the aforementioned one: right source term but Umax_x very low at the first time step, and long time to converge back towards the right velocity values.
Any idea? I put the listing file and ythe cs_user_source_terms.f90 of the RANS calculation (first one above) in attachment.
Thanks in advance,
Christophe
I encountered a similar issue, using version 6.0.8, on this very case of periodic turbulent channel flow, however in RANS mode.
In cs_user_source_terms.f90, I implemented the source (pressure gradient) supposed to balance the viscous stresses. At the same time, I initialized the velocity field to be Ux = 20 (corresponding to the expected Umax_x at convergence). But the calculation behaved as if the initial velocity was 0 everywhere (while listing shows an initialization with Ux = 20 everywhere). Finally, convergence was reached, however after some really long time.
Afterwards, I encountered the same problem when initializing another calculation with the output of the aforementioned one: right source term but Umax_x very low at the first time step, and long time to converge back towards the right velocity values.
Any idea? I put the listing file and ythe cs_user_source_terms.f90 of the RANS calculation (first one above) in attachment.
Thanks in advance,
Christophe
- Attachments
-
- cs_user_source_terms_RANS.f90
- (29.94 KiB) Downloaded 971 times
-
- listingRANS.txt
- (484.71 KiB) Downloaded 939 times
-
- Posts: 46
- Joined: Tue Apr 09, 2024 3:26 am
Re: Turbulent Channel Flow with Periodic Boundary Conditions
Hi Everybody,
I would just like to confirm how people are undertaking their channel flow calculations in Code Saturne.
I have successfully undertaken a channel flow calculation with the inlet/outlet mapping condition in the GUI. The results look good, but I could only get the case running well with a URANS calculation.
Now, I am studying the periodic hills case, and I cannot get the correct profile at the inlet of the problem, and this is a region where RANS is expected to provide the correct answer. The bulk velocity in the inlet is reasonably close the the value that I was expecting, however the velocity profile seems to be heavily biased to one region of the domain, and this bias is present even when the solver has converged.
Is there a different way to set up this calculation? I would be happy to use a source term in the x-momentum equations, to develop a pressure-gradient in the flow, but I am unsure of what boundary conditions I need to set this up. I cannot see a periodic boundary condition in the documentation, and the best I can do is the inlet/outlet mapping function.
Any guidance on this would be greatly appreciated.
Best regards,
Sean Hanrahan
I would just like to confirm how people are undertaking their channel flow calculations in Code Saturne.
I have successfully undertaken a channel flow calculation with the inlet/outlet mapping condition in the GUI. The results look good, but I could only get the case running well with a URANS calculation.
Now, I am studying the periodic hills case, and I cannot get the correct profile at the inlet of the problem, and this is a region where RANS is expected to provide the correct answer. The bulk velocity in the inlet is reasonably close the the value that I was expecting, however the velocity profile seems to be heavily biased to one region of the domain, and this bias is present even when the solver has converged.
Is there a different way to set up this calculation? I would be happy to use a source term in the x-momentum equations, to develop a pressure-gradient in the flow, but I am unsure of what boundary conditions I need to set this up. I cannot see a periodic boundary condition in the documentation, and the best I can do is the inlet/outlet mapping function.
Any guidance on this would be greatly appreciated.
Best regards,
Sean Hanrahan
- Attachments
-
- Channel_Comp_2.pdf
- (30.53 KiB) Downloaded 10 times