# Code_Saturne

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 4, 2010, 12:14 Code_Saturne #1 New Member   Join Date: Mar 2010 Posts: 4 Rep Power: 7 Hi, I'm a begginner at CFD, and I'm studying it with Code_Saturn. I have some doubts about the inputs of the initial and boundary conditions, and I hope that someone could help me. The first thing is: what does the initial value, of the scalars initialization, means? Depending the value I input, the results are totally different from one and another, and the mass and energy balance are never satysfied. Second, If I'm simulating a injection of two or more gaseous fluids in a pipe, with different thermodynamic states, the effects of compressibility aren't negligible. So, the density of the mixture should vary from the inlet to the outlet, so as the viscosity and specific heat, but is not what I'm observing, they remain constant (even when I choose to be variable). So, how can I define the states of each gas separatly? Third, and last, why the relaxation coefficient cannot be more than one? What if I'm trying to accelerate the convergence of the Navier-Stokes numerical solution? Thank's a lot.

 March 8, 2010, 18:38 #2 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, The initial value of scalars means the value those scalars have a time zero of a calculation (by default, a calculation is based on an "unsteady" approach, a steady flow being converged once all transients are "finished"). The energy balance probably does not seem satisfied if boundary conditions do not match initial conditions, as physically, in such a case, you will have a transient in which the volume gains or loses energy. Mass balance should on the other hand always be verified for an incompressible flow, unless you have convergence issues (due for example to a too big time step leading to very high CFL numbers), or some other error. If you have a compressible flow (for which a Boussinesq type approximation is not sufficient), be sure to use the compressible module of Code_Saturne (which precludes using the GUI, and which I have never used, but whose user Fortran subroutines are in the users/cfbl subdirectory, and for which ippmod must be set in users/pprt/usppmo.f90 or usppmo.F for versions prior to 2.0). In any case, if you define physical properties as being variable, you must define the appropriate laws in usphyv for a standard calculation, or uscfpv for a compressible calculation. As Code_Saturne is basically a single-phase code, you must define the properties of the mix using your own laws, which you could base on an additional scalar alpha representing the mass fraction of the second fluid (where alpha = 0 for the first fluid, 1 for the second). If the two fluids have very different physical properties (such as water/vapor), specific numerical algorithms are necessary, so Code_Saturne is probably not a good fit (its sibling code NEPTUNE_CFD would be better adapted, but it is not freely distributed). Finally to accelerate the convergence of the Navier-Stokes solution, you may reduce the linear solver precision from 1e-8 to 1e-5 for all equations, and if you are looking for a steady solution, you may use a local (time and space varying) time step. Increasing the time step may help, but if you increase it too much, the calculation may fail or give bas results (as a rule of thumb, if a the max. Courant (CFL) number is not more than 5, you should be fine. You may also try the steady-state solver option, though Iam not sure it is compatible with the compressible module of the code. Regards,

 March 9, 2010, 20:28 #3 New Member   Join Date: Mar 2010 Posts: 4 Rep Power: 7 Hello, Yvan, I understand that the scalars initialization, in the case of steady flow, means the value of the "end" of transients, like you said. I reached some good results. However, it's wired that you have to impose the energy conservation, since it's one of the equations to be solved by the processor. About the compressible flow; so If I use the GUI I cannot use the compressible module, is that right? Well, that changes a lot, since I am not familiar with Fortran (a good excuse to learn that too). Anyway, for now the compressibility effects aren't so significant in the models I am studying. But it will be important in the future. Thank you very much for your attention, I will remember your advices. Regards.

 March 13, 2010, 18:38 #4 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, That is correct : you cannot currently use the GUI with the compressible module (and version 2.0 which will be out in a few months will not improve upon this, though future versions may). Note that some of us Code_Saturne developers check on this forum occasionally, but you may have a faster response to questions regarding Code_Saturne on the http://code-saturne.info forum (does not resuire registering to read, but to post, you need to ask for an account by e-mailing saturne-support at edf.fr). Regards

 March 26, 2010, 08:49 #6 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, What version of Code_Saturne are you using ? If it comes with CAELinux, it is probably a pre-version 1.4, which I do not remember much about. The commands used by Code_Saturne have been translated into English and made more consitent over time, so I would recommend version 2.0-rc1, which you may find in the announces section of the Forum on http://code-saturne.info. To build a study/case directory using version 1.4, you must run cs_create -study in the directory of your choice (it will create subdirectories with a prescribed structure). The cs_create command should be available if you sourced the environment correctly (run ". /MESH, //DATA, and //SRC) from the tutorials to the matching directories in the case you created, and you should be ready to run. Regards,

 March 29, 2010, 05:29 #7 Member   MSarkar Join Date: Dec 2009 Posts: 99 Rep Power: 7 Hi Yvan, Thanks a lot for your help! I am using Code_Saturne-1.4.b. With your help I am able to run the first tutorial, Simple_junction. When I was following the tutorial, the commands are written in French (like cs_cree -study instead of cs_create -study) and I was blindly following their commands. So it did not work. Anyway It works now following your commands. I have some other queries, for my particular problem, to create geometry and mesh, do I have to have a seperate software like ICEM, I-deas, Gambit etc? Saturne does not have any mesher with it? How do I post process the results? I have paraview installed in my machine, can I use paraview to visulalize the results?

 March 30, 2010, 17:43 #8 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, For Post-Processing, either ParaView (using EnSight Gold output) or VisIt (using EnSight Gold or CGNS output) should do. In both cases, I recommend using recent versions. There is now also a free (as in beer, not free software) version of EnSight CFD, usable on meshes up to 2 million cells (or 200000 polyhedra). If you use non-conforming meshes, ParaView will read the resulting polyhedra correctly, giving you only minor visualization artifacts, while I am not sure about VisIt (though Code_Saturne may be configured to split polyhedra for post-processing output to avoid post-processing issues). Regarding meshing, you may use several external tools : the best free tools we know of are Gmsh and SALOME's SMESH, both of which (at least SALOME) should be available on CAELinux, which you seem to be using. On the commercial tool side, Code_Saturne may also use meshes generated by ICEM CFD (preferrably using CGNS format), GAMBIT (neutral forma), or Star CCM+ (requiring an additional library provided upon request by CD-ADAPCO). Harpoon (using EnSight format output) is also a possible choice. We haven't tested Pointwise yet, but its CGNS output should be fine for Code_Saturne. Best regards,

April 5, 2010, 05:01
#9
Member

MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
Hello Yvan,

I am trying to simulate convective and radiative heat transfer with natural convection inside a 2D square cavity. I created geometry and mesh using GMSH and I set up everything using Saturne GUI but while I am trying to run it, it is giving error in preprocessing stage. The error message is as below:

msarkar@obelix:~/Code_Saturne-1.4/Project/RUN1/CASE1/DATA\$ ./SaturneGUI
nohup: redirecting stderr to stdout

Single processor Code_Saturne simulation

Code_Saturne is running
***********************

Working directory (to be periodically cleaned) :
/home/msarkar/tmp_Saturne/RUN1.CASE1.04051315

Kernel version: /opt/code_saturne/Noyau/ncs-1.4.b
Preprocessor version: /opt/code_saturne/Enveloppe/ecs-1.4.a

************************************************** *************
Compilation of user subroutines and linking of Code_Saturne
************************************************** *************
/home/msarkar/tmp_Saturne/RUN1.CASE1.04051315/compil.log

*** "make" in a user directory

********************************************
Preparing calculation
********************************************

********************************************
Calculation starting
********************************************

Error running the preprocessor.
Check preprocessor log (listpre) for details.

********************************************
Error in preprocessing stage.
********************************************
msarkar@obelix:~/Code_Saturne-1.4/Project/RUN1/CASE1/DATA\$

The preprocessor log file is attached here. Could you please help me to fix this problem. I tried to generate 2D geometry but Saturne says it is 3 dimensional and there is no volumetric mesh. I did not have any clue how it is a 3D problem. I also attached the mesh file here.

Any help would be very much appreciated.

best regards
M. Sarkar
Attached Files
 listpre.txt (2.8 KB, 3 views) cavitymesh.txt (23.3 KB, 1 views)

 April 5, 2010, 07:14 #10 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, Code_Saturne only accepts 3D meshes, so you need to extrude your 2D mesh so as to have 1 layer of cells (hexahedra instead of quads in your case), and apply symmetry boundary conditions to the bottom and top faces. The recommended extrusion thickness would be your average element width. Best regards,

April 6, 2010, 05:38
#11
Member

MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
Thanks a lot Yvan! I fixed that problem. Now I am using 3D geometry and symmetric boundary conditions on both sides in Z direction but while running code_saturne, it is giving error in calculation stage. I could not figure out the problem yet. There may be some problem with geometry, mesh or boundary conditions etc.. During boundary definition, I guess the color number represenat the localization number. If I am wrong please correct me. The error message is pasted below. The mesh file, error file and listing files are attached here. Please let me know if you can figure out the problem.

Error Message:
msarkar@obelix:~/Code_Saturne-1.4/Project/RUN1/CASE1/DATA\$ ./SaturneGUI
nohup: redirecting stderr to stdout

Single processor Code_Saturne simulation

Code_Saturne is running
***********************

Working directory (to be periodically cleaned) :
/home/msarkar/tmp_Saturne/RUN1.CASE1.04061527

Kernel version: /opt/code_saturne/Noyau/ncs-1.4.b
Preprocessor version: /opt/code_saturne/Enveloppe/ecs-1.4.a

************************************************** *************
Compilation of user subroutines and linking of Code_Saturne
************************************************** *************
/home/msarkar/tmp_Saturne/RUN1.CASE1.04061527/compil.log

*** "make" in a user directory

********************************************
Preparing calculation
********************************************

********************************************
Calculation starting
********************************************

Error running the calculation.

Check Kernel log (listing) and error* files for details

********************************************
Error in calculation stage.
********************************************
msarkar@obelix:~/Code_Saturne-1.4/Project/RUN1/CASE1/DATA\$

Best Regards
M. Sarkar
Attached Files
 cavitymesh.txt (39.1 KB, 1 views) error.txt (401 Bytes, 2 views) listing.txt (3.2 KB, 2 views)

Last edited by msarkar; April 6, 2010 at 05:59.

April 7, 2010, 04:54
#12
New Member

Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Hello,

There is bug in rayopt.F in this version of the code (due to a test that should have been removed when changing preprocessor_output file format but was not). The attached version may solve your problem (just add it with your user Fortran subroutines, in the case's SRC subdirectory).

Note that version 1.4.b of Code_Saturne is an intermediate developpement version, and is not recommended (unfortunately, it is the version packaged by CAELinux).

I recommend using version 2.0-rc1, which you may find in the "anounces " section of the forum at http://code-saturne.info. It requires installation, but if that's OK for you, you would have more English translations, a more complete GUI, ... and many improvements done between August 2008 and January 2010. In addition, 2.0-rc1 has undergone a first validation pass (the second pass will lead to 2.0 final), which is not the case of V1.4.b, and the bug you happened upon has already been corrected in version 2.0.

Regards,
Attached Files
 rayopt.F (31.5 KB, 3 views)

April 7, 2010, 08:10
#13
Member

MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
Thank you Yvan for your continuous help. You are right, that may be the reason, the code was not running with radiation effect. My simulation is running without radiation but this problem requires the inclusion of radiation effect. So, I have to use radiation model.
I tried to run the simulation using the subroutine you provided (rayopt.F) but it did not run. Again it gave error in calculation stage.. The error message is attached here. I think it is better to install version 2.0-rcl as you recommended. I will try to install this version and let you know the status.

Best Regards
M. Sarkar
Attached Files
 error.txt (706 Bytes, 2 views)

 April 7, 2010, 11:41 #14 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 There might be other issues, but the error you obtain only means you need to increase the Fortran work arrays sizes, which you may do using the "Calculation Management" section of the GUI. Regards,

April 8, 2010, 05:41
#15
Member

MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
Hello Yvan,

I tried to increase the Fortran work array sizes through Calculation Management section of GUI but it did not work yet. I will look into again. If you have any idea about the number of array size, please let me know.
I got another problem while installing Code_Saturne-2.0-rc1 as you recommended. I was using automatic installer python script and upto BFT (CGNS, HDF5, Metis, MPI, BFT) installed properly but found error during configuring stage of FVM. Could you please suggest me how to install it properly? The part of the install_saturne log file and FVM config log files are attached here.

M. Sarkar
Attached Files
 install_saturnelog.txt (49.5 KB, 2 views) configlog.txt (79.3 KB, 1 views)

 April 8, 2010, 06:18 #16 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, The error seems to come from the Open MPI installation. On our systems, linking with "-lmpi" automatically pulls "libopen-pal.so", while this does not seem to be the case in your installation (try "ldd libmpi.so" in your openmpi-1.4.1/libs directory). You could try to edit FVM's configure file to replace "-lmpi" with "-lmpi -lopen-pal" where comments describe testing MPI (basic test), which should be line 13165, or do a two-stage install in which you edit the installer script so as not to reinstall what is already installed (i.e. BFT, ...), and change the compiler to Open MPI's compiler wrapper (replace cc with /home/msarkar/opt/openmpi-1.4.1/bin/mpicc). Regards,

April 8, 2010, 08:59
#17
Member

MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
Hi,

I resolved that problem by updating the path of updated MPI version. Actually I had another version of mpi installed in my system with OpenFOAM. Anyway that problem is solved but I got another problem to configure ncs. The install_saturne log file is attached here. It says that it cannot find PyQt4 dev tools, Graphical User Interface cannot be installed and I am not able to install PyQt4. Please let me know if you have any suggestions.

Thanks and Regards
M. Sarkar
Attached Files
 install_saturne_log.txt (8.1 KB, 0 views)

 April 8, 2010, 11:38 #18 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, What system are you running on, and who administers it ? It is possible to install PyQt4 in a user account, but this requires installing Qt4 (quite easy, though it is big and takes time to compile), then SIP, then PyQt4 (both of which use Python install scripts in which prefix, include, and lib directories maust each be set). Installing a user version of Python first and installing SIP and PyQt4 relative to that may make things easier if you do not want to bother with PYTHONPATH variables). We do this as rarely as possible, as using packages is much simpler. If you are administrator of your machine and it is a recent enough Linux distribution, checking PyQt4 (with the corresponding -dev and -dev-tools packages) in the package manager is far simpler, and if you are not administrator but can ask an administrator to install those packages, do not hesitate: it will save you a lot of time compared to installing all those packages on your account. If you are using a recent version of SALOME (i.e. version 5.1.x), you may also install Code_Saturne using SALOME's Python and PyQt4 libraries, which will probably save you some efforts in installing PyQt4. Best regards,

April 9, 2010, 07:59
#19
Member

MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
Hi Yvan,

I am running Ubuntu debian linux system and I am not the administrator of my machine. I tried to install PyQt4 in my user account but I could not succeed yet. I spend a good amount of time. The administrator will be back on Monday, so probably I will ask him to install those packages. I don't have recent version of SALOME in my machine. I have a older version installed through CAELinux but I have recent version of paraview installed on it, I tried to use the paraview's Python and PyQt4 libraries but it is giving some error. I will again try them on Monday. Anyway, in the meanwhile I was trying to run Code_saturne 1.4.b version what I was running before but somehow I could not run it because of Fortran work array sizes what we discussed before. You suggested me to increase the Fortran work array through "Calculation management" using GUI. However I could not do it as I did not get this option. I do not know what is wrong with it. I think, I should see this option under "batch analysis" preperation under Calculation Management. In tutorial, I saw this option there. The screen shot of my GUI when I am processing "Calculation Management" is attached here. Please let me know what I am missing or why I can not get that option to increase the array sizes.

Best regards
Attached Images
 Screenshot-Code_Saturne user interface.jpg (34.0 KB, 16 views)

 April 9, 2010, 09:40 #20 New Member   Yvan Fournier Join Date: Mar 2010 Posts: 20 Rep Power: 7 Hello, Slightly above "calculation management" on the tree (on the left pane of the GUI), you have "memory management", which should work Regards,

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

All times are GMT -4. The time now is 04:11.