Laval nozzle

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
kemmerch
Posts: 8
Joined: Mon Jan 02, 2017 8:37 am

Laval nozzle

Post by kemmerch »

Good morning and a happy new year,

I am completely new to Code_Saturne and I am struggling with my first model. I am running Code-Saturne version 4.3.1 on a windows 7 operating system and so far, for the setup I have just used the GUI.

I am trying to simulate a two-dimensional flow through a laval nozzle shape. Inlet pressure is 4.98 bar, inlet temperature 462 K and the speed equals 118.90 m/s (Ma*_inlet = 0.3). The outlet conditions are: Ma*_outlet = 1.5, p_outlet = p_ambience = 101325 Pa, T_outlet = T_ambience = 293.15 K.

I don’t understand why and how I have to initialize i.e. pressure and density. In case I set their values to zero I receive the following error message:

../../../src/cfbl/cs_cf_thermo.c:284: Fatal error.
Error in thermodynamics computations for compressible flows
:
Negative values of the density were encountered in 5936 cells.

If I initialize the pressure and density with p_ambience and density_ambience = 1.204 kg/m^3 I get a different error message.
The xml file as well as the error message and a picture of the meshed geometry are attached to this post.

I appreciate any kind of help.

Best regards,
Chris
Attachments
Lavalduese_mesh.PNG
error_r2.txt
(1.25 KiB) Downloaded 312 times
Lavalduese_case01.xml
(9.06 KiB) Downloaded 383 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Laval nozzle

Post by Yvan Fournier »

Hello and Happy New Year to you too,

The second error seems strange. We just released 4.3.2, but do not have the Windows build yet (the Windows build is a bit complex and I am not too familiar with it).

I may try to see if I can reproduce your error, but the coming week will be very busy (preparing for branching of version 5.0), so there may be a few days wait.

Best regards,

Yvan
kemmerch
Posts: 8
Joined: Mon Jan 02, 2017 8:37 am

Re: Laval nozzle

Post by kemmerch »

Hello Yvan,

thank you for your reply. It would be nice if you could help me with this issue.

However, in case you couldn’t provide any help regarding this specific problem, you maybe can help me in a different way.
Indeed I spent some time to get familiar with Code_Saturne since it is my task to examine whether it might be an interesting CFD solver for applications in the aero engine industry.
So my long term goal is to simulate the flow field around a rather complex fan blade geometry and to compare the numerical solution of the pressure distribution with existing measurement data.

By now I couldn’t find a definitely reliable answer to the following questions:

• Is it possible to run such a simulation as described above with version 4.3.1 of Code_Saturne?
• I would like to start with a steady state simulation of an air flow but it seems as if this is not an available option, at least not due the GUI?

There was no answer to the same question here in the forum:
http://code-saturne.org/forum/viewtopic.php?f=4&t=1603
So this leads me directly to the question:

• When I have to use user subroutines for a successful simulation? What are the GUI’s limitations?
• Is there any official support offer besides the Code_Saturne training courses?

Since I know you are quite busy during the next few days I am really looking forward to hearing from you as soon as it will be possible.

Best regards and thank you very much for your time,

Chris
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Laval nozzle

Post by Yvan Fournier »

Hello,

Not sure about all the answers (there are not many users for the compressible module), so finding help may be a bit harder than usual, but to get you started, I attach the setup we have for our own Laval nozzle testcase, except for the mesh (which is not huge, but still a few megabytes). So you'll need to adapt boundary condition references and maybe the time step, but this should help you get started.

I'll also recommend the developper who worked on the compressible version to check on your post.

Best regards,

Yvan
Attachments
laval_nozzle_4.3.tar.gz
(31.85 KiB) Downloaded 333 times
kemmerch
Posts: 8
Joined: Mon Jan 02, 2017 8:37 am

Re: Laval nozzle

Post by kemmerch »

Hello Yvan,

please, excuse me for delayed answering. Thanks to your help I got the simulation started and the results are quite promising. The problem was the time step input. Do you know if it is possible to contact the person who is involved in developing the compressible module? It would be nice if I could clarify the questions from my last post.

Best regards,

Chris
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Laval nozzle

Post by Yvan Fournier »

Hello,

Yes, I informed the developer already. He is quite busy, but should hopefully take a look soon.

Best regards,

Yvan
Erwan Le Coupanec
Posts: 45
Joined: Sun Sep 08, 2013 8:50 pm

Re: Laval nozzle

Post by Erwan Le Coupanec »

Hello,

Sorry for the long delay,

I believe the steady state algorithm can be enabled together with the compressible module, I mean there should be no "hardcoded" limitations.
It is not available in the GUI, but setting idtvar=2 in the user subroutine usipsu (cs_user_parameters.f90) should allow to try it with the compressible module (you can let the compressible module enabled in the GUI). The time algorithm choice (value of idtvar) will be overwritten by the Fortran code.

This algorithm allows for the time step to vary in space. I believe it has never been tested with the compressible module, and I don't know how it will behave.

What do you mean by official support?

For your question about the GUI, my answer will be very generic (also true for incompressible flows), complex boundary conditions or complex thermodynamical laws will be easier to set in the user subroutines. Some models (not many) are only available in user subroutines, for example, the perfect gas mix thermo. compatible with the compressible module can only be activated in user subroutines (keyword igmix).

Regards,
Erwan.
Erwan Le Coupanec
Posts: 45
Joined: Sun Sep 08, 2013 8:50 pm

Re: Laval nozzle

Post by Erwan Le Coupanec »

Hello again,

With respect to your question about the no-slip condition (sent in mp) that is not fulfilled, can you give some details?

Erwan.
kemmerch
Posts: 8
Joined: Mon Jan 02, 2017 8:37 am

Re: Laval nozzle

Post by kemmerch »

Good morning Erwan,

Thank you for replying. I changed my setup a little bit and attached the xml file to this post.
I am wondering why I can’t see the no-slip condition at the wall. I chose the k-ω-SST turbulence model and the smooth wall boundary condition and expected the velocity at the wall to be zero. I refined the mesh size but it didn’t help much. You can find the velocity profile at the inlet as well as the mesh in the attachments, too. Can you please help me with this issue?

Best regards,
Chris
Attachments
Velocity_distribution_inlet.PNG
Laval-Duese.7z
(1012.67 KiB) Downloaded 308 times
Case04_subsonic_inlet.xml
(11.18 KiB) Downloaded 353 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: Laval nozzle

Post by Yvan Fournier »

Hello,

I'm not sure, but k-omega is not a low-Reynolds model, and in Code_Saturne, the postprocessing output is the value at boundary cells, not truly at the boundary face, so your result is probably not surprising.

I'll check.

Regards,

Yvan
Post Reply