CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Code_Saturne

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 4, 2010, 12:14
Default Code_Saturne
  #1
New Member
 
Join Date: Mar 2010
Posts: 4
Rep Power: 7
dbacellar is on a distinguished road
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.
dbacellar is offline   Reply With Quote

Old   March 8, 2010, 18:38
Default
  #2
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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,
Yvan Fournier is offline   Reply With Quote

Old   March 9, 2010, 20:28
Default
  #3
New Member
 
Join Date: Mar 2010
Posts: 4
Rep Power: 7
dbacellar is on a distinguished road
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.
dbacellar is offline   Reply With Quote

Old   March 13, 2010, 18:38
Default
  #4
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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
Yvan Fournier is offline   Reply With Quote

Old   March 26, 2010, 01:48
Default
  #5
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Hello Code_Saturne users,

I am a beginner in code_saturne but not in CFD. I am facing difficulty to start with it. Basically I have it installed on my machine but I am little confused how to start. I was trying to follow user manual and tutorial but I am not successful yet. I set up the environment variable properly as described in user manual. Then how do I approach to do any tutorial? By following tutorial case1, I was trying to create study directory T_JUNCTION CAS1 but I could not do it. It says "command not found". Could anyone please guide me how to start a tutorial? What will be my working directory? Do I need to create any new directory inside my Home directory and copy tutorials there and start it? I really do not have any idea, please help me out. My machine has Ubuntu Linux system and code_saturne was installed with CAE Linux by root. I am an user only. Please someone guide me how to start with it? I would appreciate any help!!

Thanks and Regards
M. Sarkar

Last edited by msarkar; March 26, 2010 at 02:07.
msarkar is offline   Reply With Quote

Old   March 26, 2010, 08:49
Default
  #6
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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 <your_study_name> 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 ". <code_saturne_home/bin/cs_profile", or "source <code_saturne_home/bin/cs_profile").
The directory structure should resemble that of the tutorials, except that the runcase scripts (in CASE1/SCRIPTS for example) will contain the correct paths for your installation. You may copy the other files from the tutorials (in <study>/MESH, <study>/<case>/DATA, and <study>/<case>/SRC) from the tutorials to the matching directories in the case you created, and you should be ready to run.

Regards,
Yvan Fournier is offline   Reply With Quote

Old   March 29, 2010, 05:29
Default
  #7
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
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?
msarkar is offline   Reply With Quote

Old   March 30, 2010, 17:43
Default
  #8
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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,
Yvan Fournier is offline   Reply With Quote

Old   April 5, 2010, 05:01
Default
  #9
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
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

Use the radiative transfer module

*** "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
File Type: txt listpre.txt (2.8 KB, 3 views)
File Type: txt cavitymesh.txt (23.3 KB, 1 views)
msarkar is offline   Reply With Quote

Old   April 5, 2010, 07:14
Default
  #10
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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,
Yvan Fournier is offline   Reply With Quote

Old   April 6, 2010, 05:38
Default
  #11
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
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

Use the radiative transfer module

*** "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
File Type: txt cavitymesh.txt (39.1 KB, 1 views)
File Type: txt error.txt (401 Bytes, 2 views)
File Type: txt listing.txt (3.2 KB, 2 views)

Last edited by msarkar; April 6, 2010 at 05:59.
msarkar is offline   Reply With Quote

Old   April 7, 2010, 04:54
Default
  #12
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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
File Type: f rayopt.F (31.5 KB, 3 views)
Yvan Fournier is offline   Reply With Quote

Old   April 7, 2010, 08:10
Default
  #13
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
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
File Type: txt error.txt (706 Bytes, 2 views)
msarkar is offline   Reply With Quote

Old   April 7, 2010, 11:41
Default
  #14
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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,
Yvan Fournier is offline   Reply With Quote

Old   April 8, 2010, 05:41
Default
  #15
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
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.

thanks and regrads
M. Sarkar
Attached Files
File Type: txt install_saturnelog.txt (49.5 KB, 2 views)
File Type: txt configlog.txt (79.3 KB, 1 views)
msarkar is offline   Reply With Quote

Old   April 8, 2010, 06:18
Default
  #16
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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,
Yvan Fournier is offline   Reply With Quote

Old   April 8, 2010, 08:59
Default
  #17
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
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
File Type: txt install_saturne_log.txt (8.1 KB, 0 views)
msarkar is offline   Reply With Quote

Old   April 8, 2010, 11:38
Default
  #18
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
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,
Yvan Fournier is offline   Reply With Quote

Old   April 9, 2010, 07:59
Default
  #19
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
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
File Type: jpg Screenshot-Code_Saturne user interface.jpg (34.0 KB, 16 views)
msarkar is offline   Reply With Quote

Old   April 9, 2010, 09:40
Default
  #20
New Member
 
Yvan Fournier
Join Date: Mar 2010
Posts: 20
Rep Power: 7
Yvan Fournier is on a distinguished road
Hello,

Slightly above "calculation management" on the tree (on the left pane of the GUI), you have "memory management", which should work

Regards,
Yvan Fournier is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On



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