Problem with the synthetic turbulence inlet

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Jundi He
Posts: 106
Joined: Fri Jan 13, 2017 3:23 pm

Problem with the synthetic turbulence inlet

Post by Jundi He »

Hi Code Saturne developers:

I am using Code Saturne to run a LES, and I need to impose a synthetic turbulence inlet condition for the face named 'inlet'. According to the documentation, I used subroutine "cs_user_les_inflow_define" to define the synthetic inlet, with my inlet bulk velocity = 2m/s. When I run the simulation, it seems that the synthetic inlet condition is not correctly imposed.

Could you simply point out if the subroutine is correctly written? The .xml file for my case and the subroutine is attached. Thanks for the time.

Regards!
Jundi
Attachments
setup.xml
(8.81 KiB) Downloaded 113 times
cs_user_les_inflow.f90
(5.79 KiB) Downloaded 125 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Problem with the synthetic turbulence inlet

Post by Yvan Fournier »

Hello,

I did not see any obvious error in your definition, but am not too familiar with tat part of the code.

Just in case, did you check if using another method (i.e. SEM instead of Batten) works better or has the same issue ?

Best regards,

Yvan
Jundi He
Posts: 106
Joined: Fri Jan 13, 2017 3:23 pm

Re: Problem with the synthetic turbulence inlet

Post by Jundi He »

Hi Yvan:

Thanks for the checking, I have changed the synthetic inlet condition to SEM method, but still it is not correctly imposed. I have 2 further questions for this:

1. Is the subroutine compiled and executed? I've put some output statement (at line 194 and 197, please see the screenshot), if the subroutine is executed, there will be "CODE 1" & "CODE 2" printed on the screen or the linsting file when the simulation is running, but there is not.

2. In the GUI, should I define face "inlet" as an inlet condition? If I did, I need to specify an inlet velocity in the GUI. Will Code Saturne read the subroutine and use the synthetic inlet flow, rather than using the inlet condition defined in the GUI?
screenshot.png
Thanks for your time.

Regards!
Jundi
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Problem with the synthetic turbulence inlet

Post by Yvan Fournier »

Hello,

What type of system are you running on, and do other user-defined subroutines seem to work/be accounted for ? Both C and Fortran ?

You can check if the subroutine is compiled looking at the compile.log in your execution directory. If it is executed, you should see your write output somewhere.

It may not be executed either if you are not in an LES case, or if there are some issues with reference and user-defined function priorities, which have appeared on some builds (which is the reason for my first question).

Regards,

Yvan
Jundi He
Posts: 106
Joined: Fri Jan 13, 2017 3:23 pm

Re: Problem with the synthetic turbulence inlet

Post by Jundi He »

Hi Yvan:

I am running the simulation on a Linux (Ubuntu 16.04) machine. I have also looked at the compile.log file, there is no critical error. Just in case I have attached the compile.log file.

I am trying this simulation on another machine.

Regards!
Jundi
Attachments
compile.log
(5.59 KiB) Downloaded 107 times
Jundi He
Posts: 106
Joined: Fri Jan 13, 2017 3:23 pm

Re: Problem with the synthetic turbulence inlet

Post by Jundi He »

Hi,

Just to update, this problem has been solved, the synthetic inlet condition is imposed successfully now. The previous failure is due to a simple mistake: I didn't include a initialization statement, this is to switch on the synthetic inlet condition. Without that statement, even though a subroutine of synthetic inlet condition is compiled, the solver will not impose that.

Regards!
Jundi
Post Reply