Page 1 of 1

Problem with the synthetic turbulence inlet

Posted: Fri May 21, 2021 12:00 am
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

Re: Problem with the synthetic turbulence inlet

Posted: Fri May 21, 2021 5:12 pm
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

Re: Problem with the synthetic turbulence inlet

Posted: Fri May 21, 2021 6:39 pm
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

Re: Problem with the synthetic turbulence inlet

Posted: Fri May 21, 2021 9:56 pm
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

Re: Problem with the synthetic turbulence inlet

Posted: Sat May 22, 2021 11:52 am
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

Re: Problem with the synthetic turbulence inlet

Posted: Mon May 24, 2021 2:08 pm
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