Simple Simulation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Matt Bondy

Simple Simulation

Post by Matt Bondy »

I have been attempting to familiarize myself with Code Saturne and I am posting the simulations I run on the CAELinux wik (http://www.caelinux.org/wiki/index.php/Contrib:BondMatt/LaminarPipeFlow).

I have a few concerns or problems.

How do I track residuals? I found a forum post elsewhere but it was based upon the terminal version of Code Saturne. I tried launching a shell and using the commands they suggested but I was not met with success.

I was forced to check off the 'pseudo-coupled velocity pressure solver' box under 'Global Parameters' to get reasonable results. I tried to change the finite differencing techniques and relaxation factors but the results were always extremely erroneous without that box checked. What does checking that box mean? If I had to guess I would say it would be used for incompressible flows where PV=nRT cannot be used to couple pressure and density. However, this does not seem right because a somewhat similar tutorial (flow over a step) included with CAELinux does not require that box to be checked.

My final results are not accurate. I tried refining the mesh and the results stayed about the same so I think I have grid independence as is. My simulation is a 2D analysis of half of a cross section of a pipe with laminar flow. The velocity field at the inlet is a uniform 1 m/s in the axial direction. A plot of the centerline velocity shows the fully developed centerline velocity to be approaching 1.5 m/s but it should be approaching 2 m/s. I cant imagine this is the result of a problem with the software. Where am I going wrong?

Best regards,

- Matt Bondy
Marc Sakiz

Re: Simple Simulation

Post by Marc Sakiz »

Hi Matt,
 
there seems to be a problem with your mesh, which is more like a section of a flow between two flat planes than a section of a circular pipe. Indeed, strictly speaking, Code_Saturne only deals with 3D flows. To simulate a 2D flow, you need to take the plane mesh and perform an extrusion in the third direction with one (or more) cell of width in this direction and symmetry conditions on both sides.

To simulate 2D-axisymmetrical flow, you need to do the same, except the extrusion must be made by rotating the plane mesh, so that the two planes with symmetry conditions join in the center of the pipe (I'm sure a drawing would help!). From what we understood of your test, it doesn't seem to be what you did.
 
I attached to this post the data from a calculation on a mesh similar to yours in size and discretisation (5x100 cells), but really axisymmetrical. The maximum of velocity I get is 1.9547 m/s, for a theoretical value of 1.98 m/s (indeed Code_Saturne is Finite Volumes colocated, the calculation point closest to the center is not strictly at the center but half a cell away). Considering the low refinement of the mesh (5 cells), it seems very much correct!
 
As for your other questions:
 
- Code_Saturne uses by default a SIMPLE_C algorithm for velocity/pressure resolution. Therefore, in the pressure correction phase, the convection and diffusion terms are neglected. The "pseudo-coupled velocity pressure solver" is a slightly improved algorithm where the pressure correction is not done only with the "delta_t" term but with something a bit more complex that partially takes into account the convection/diffusion terms. It's not easy to be more precise without writing equations. You can get info in the theory manual, under the chapter "resolp" ... but it is in french. Nevertheless, it is mainly designed for specific cases where for instance diffusive terms are very strong (high viscosity fluids) so in most cases it is useless and CPU time consuming to activate it (plus it is not compatible with certain features like steady state algorithm, rotation periodicity, ...).
 
- In the "listing" file created in the RESU directory, you get some information about the convergence of the code. At each time step (or at the NTLIS periodicity you specified), the code will write a block "INFORMATION ON CONVERGENCE" with info on each variables, especially:
 
  * N_iter: nb of iterations used to solve the linear system
 
  * Norm. residual: normed residual after solving the linear system (should be lower than EPSILO=1.e-8 which is the criterium for stopping the iterations)
 
  * derive: roughly corresponds to |u(n+1)-u(n)|/|u|
 
If you increase the verbosity of the code for certain variables, by putting IWARNI(IVAR)=2, 3 or 4 in usini1.f90, you will have much more information, in particular the residuals at each iterations of Jacobi or conjugate gradient.

Hope it helps!
 
Best regards

  --Marc--
Attachments
conduite.des
(86.41 KiB) Downloaded 220 times
Marc Sakiz

Re: Simple Simulation

Post by Marc Sakiz »

Due to limitations in the size of attached files, here is the rest of the case.
 
  --Marc--
Attachments
conduite-tar.gz
(78.4 KiB) Downloaded 216 times
Matt Bondy

Re: Simple Simulation

Post by Matt Bondy »

Thank you for the assistance. This was very enlightening.
This software and your 'customer service' are very impressive.
Post Reply