Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Sunday, 4 March 2012

README first

News - From June 2010, I started to spend money on Google AdWords to maximise my effort to share experiences by writing this blog.

Welcome to my blog on CFD, numerical modelling and parallel programming. Though relevant things are included, the CFD part of this blog focuses on the packages SALOME, Code_Saturne and ParaView etc. The complete content can be directed by the Labels list on the right side.


All the posts here are kept updated. Following or subscribing a blog is a good idea if it really helps. Up to March 2012, as reported by Google, there are 90 friends who are following or subscribing my posts using Google.

The most popular posts are summarised as follows

1. Installation of SALOME on Ubuntu

The latest SALOME version is 6.3.1. However I haven't tried this version; I am still using the 5.1.x.

For 5.1.x the latest version is 5.1.6. The complete instruction, "Installation of SALOME 5.1.3 on Ubuntu 10.04 (64 bit)", should help when install SALOME 5.1.x onto Ubuntu; at least according to feedbacks, this works up to 5.1.4 onto Ubuntu 10.04 (32/64 bit). The tips also suit Ubuntu 9.10, if all packages are updated in the system.

For Ubuntu 9.10, an older post is "Installation of SALOME 5.1.2 on (K)Ubuntu 9.10 64 bit". The notes might be slightly outdated.

If preferring Ubuntu 9.04, it is also easy to install SALOME by only following "Installation of SALOME 5.1.1 on Ubuntu 9.04". The post actually helps up to the latest version 5.1.3.

For those who still use the old 4.* versions of SALOME, "Polishing GUI of older SALOME versions" is recommended to read.

2. SALOME tutorials

"CFD tutorial: laminar flow along a 2D channel - Part I" is a brief tutorial on using SALOME to do the geometry modelling and meshing.

More examples are still on the way.

3. Installation of Code_Saturne on Ubuntu

The latest Code_Saturne 2.1.0 is much easier to compile and install than ever. An instruction on this version is on the way. By the way I also successfully ported this version onto Windows 7.

Since version 2.0 Code_Saturne started to adopt the typical source build and install procedure on Linux. By following "Installation of Code_Saturne 2.0-rc1 on Ubuntu 10.04 (64 bit)" I am confident it would be an easy job for you. In the meantime, if you are also a SALOME user, I strongly recommend you to read "Compile Code_Saturne with SALOME binary libraries" in order to reuse the binary libraries already shipped with SALOME.

Two slightly outdated but helpful posts are "Installation of Code_Saturne 2.0.0 on Ubuntu 9.04" and "Installation of Code_Saturne 2.0-rc1 on Ubuntu 9.10".

You can also try to test installing Code_Saturne with apt-get. Please read "apt-get, the ideal way to install the software onto Ubuntu".

The instruction on installation of the last stable version, 1.3.3, was written in "Installation of Code_Saturne 1.3.3 on Ubuntu 9.04". On the other hand, for the version 1.4.0 the installation procedure is quite similar to that of 1.3.3, except 1.4.0 turned to use PyQt4 and Qt4. Please check "Installation of Code_Saturne 1.4.0 on Ubuntu 9.04" to see how to use (Py)Qt4 instead of the python-tk and tix.

4. Code_Saturne tutorials

"CFD tutorial: laminar flow along a 2D channel - Part II" gives a brief tutorial on how to apply Code_Saturne to solve a CFD problem.

More examples are still on the way.

5. Installation and usage of ParaView

Installation of ParaView is relatively easier and please read "Installation of ParaView 3.6.1 on Ubuntu 9.04". The usage of ParaView is briefly illustrated by an example in the article "Post-processing with ParaView".

For the latest version of ParaView, please refer to its official site.

6. GPGPU acceleration with CUDA techniques

A basic idea of using NVIDIA CUDA and the template library thrust is shown in "A simple test on the efficiency of thrust". An example to use CUDA practically is "Apply CUDA to solve a 1D heat transfer problem".

Last but not least, any comments are sincerely welcome and your support is always my motivation. The visitors here are from all over the world. See the visits map overlay below, which is provided by Google Analytics for the half-a-year period from January 2010.

Tuesday, 20 December 2011

SALOME version 6.4.0 is released

CEA/DEN, EDF R&D and OPEN CASCADE are pleased to announce SALOME version 6.4.0. Please visit news for more details.

This is a public minor release that contains improvements and bug fixes against SALOME version 6.3.1 released in July 2011.

Proceed to the download page to get this release for a go. Note that the Windows version 32bit is also available to download at the same page.

Saturday, 5 November 2011

Code_Saturne 2.1.0 has been released

On 31 Oct, 2011, Code_Saturne 2.1.0 (intermediate version) has been released and is available for downloading. The details of the new features are described on the corresponding news page.

The selective major features include:
  • Packaging: Code_Saturne is now provided as a single package, grouping all existing libraries (BFT, FVM, MEI, libsyrcs). It also includes preliminary source code for SALOME plugin (CFDSTUDY module and Code_Aster coupling).
  • Code coupling: Code_Saturne 2.1 can be coupled with SYRTHES 4.0.0-10 (at least). SYRTHES 4.0 is a complete rewrite of SYRTHES 3.4 with many new features and should shortly be released. Code_Saturne 2.1 also contains preliminary code for Code_Aster coupling (more to come on this topic in next versions).
  • User interface: both the script user interface and the graphical user interface have been simplified and completed to enhance user experience. Just give a try to the new runcase script (and its Python overloading) and to the new features of the graphical interface (more to come also on this topic in next versions).
  • New mesh readers: Code_Saturne pre- and post- processing has been updated to support CGNS 3.1 and MED 3.0 format. MED 3.0 is compatible with SALOME 6.3.
  • Documentation: the user manual has been slightly improve and a Doxygen documentation of the sources is now available. An installation manual is now provided too.
  • Configuration: a configuration file can be completed, either globally or by user, to setup some runtime options like the scratch directory, an optional mesh database or SYRTHES 4.0 version to be used.
  • Automatic V&V: a tool for automatic run of Code_Saturne has been developped, enabling the user to automatically run simulations, plot graphs and receive a PDF report by e-mail. It can be very useful for automatic Verification & Validation, though it is still in the very early stage of development.

Friday, 28 October 2011

ParaView 3.12.0 RC-3 available for download

ParaView 3.12.0 Release Candidate 3 binaries are available for download on the official page http://paraview.org/paraview/resources/software.html. It is a bug-fix release and the details can be found at http://www.paraview.org/Bug/changelog_page.php?version_id=85.

Thursday, 29 September 2011

Release of SALOME version 5.1.6 and ParaView 3.12.0 RC-2

SALOME version 5.1.6 is a public maintenance release for series 5.x of SALOME platform. The version provides several major and minor bug fixes against SALOME version 5.1.5 released in December 2010.

SALOME 5.1.6 can be downloaded from the official page http://www.salome-platform.org/downloads/salome-v5.1.6.

On the other hand ParaView 3.12.0 Release Candidate 2 binaries are already available for download on the official page http://paraview.org/paraview/resources/software.html.

ps, Firefox 7.0 has also been released yesterday and it becomes really faster than the previous versions :)

Friday, 22 July 2011

SALOME version 6.3.1 is released

The maintenance version SALOME 6.3.1 has been released, which contains planned bug fixes against the version 6.3.0 released in June 2011. SALOME 6.3.1 does not include any improvements or new features comparing to the version 6.3.0.

Please download from the official page to have a go.

Thursday, 23 June 2011

New software updates including OpenFOAM

Recently there have been some interesting software updates including

1. OpenFOAM version 2.0.0

OpenCFD released OpenFOAM version 2.0.0 and many significant developments have been made. In parallel to the release of OpenFOAM 2.0.0, the git repository was updated to 2.0.x.

2. GeekoCFD 2

GeekoCFD 2 has been released.

3. VMware Fusion 3.1.3

VMware Fusion 3.1.3 (416484) has been release at the end of May. Bugs were fixed and more importantly, Ubuntu 11.04 has been officially supported. The previous version needed patches for its VMware tool because of its incompatibility to Linux Kernel 2.6.37/38.

4. Firefox 5

Mozilla greatly shortened its new version release periods. As a convention Microsoft IE team sent Mozilla a cupcake for launching Firefox 5.


Firefox has been updated automatically to this latest version on my Mac and all extensions work very well. On Windows there is only one exception, IE Tab Plus.

Saturday, 11 June 2011

SALOME version 6.3.0 is released

In the good news, CEA/DEN, EDF R&D and OPEN CASCADE are pleased to announce SALOME version 6.3.0. It is a public release that contains the results of planned major and minor improvements and bug fixes against SALOME version 5.1.5 released in December 2010.

SALOME version 6.3.0 provides the results of the porting of SALOME to the newer versions of 3rd party pre-requisite products.

In addition, SALOME 6.3.0 includes several new modules:

  • PARAVIS (new post-processing module based on Kitware’s ParaView application)
  • HEXABLOCK (hexahedral meshing by creating of a model of the blocks)
  • HOMARD (the adaptation of the mesh generated by the Homard solver for the SALOME platform)
  • New sample modules and tutorials

This new release of SALOME introduces new features and improvements:

  • New Geometry operations
    • Create edge by length
    • Create vertex by length
    • Improved "Sub-shapes selection" dialog box
    • Analytical curve definition
    • Glue edges
    • Projection
    • Unpublish objects
  • New Mesh operations
    • Copy mesh
    • Convert to/from quadratic on sub-meshes
  • New Mesh controls
    • Over-constrained faces / volumes
    • Bare border faces / volumes
    • Element diameter 2D / 3D
  • New Mesh hypotheses and algorithms
    • Viscous layers
    • Advanced size maps in BLSurf
    • Enforced meshes with Ghs3D
    • Use existing 1D / 2D elements
  • Controls Distribution operations in Mesh module: plot in 2D viewer, show histogram in 3D viewer, dump to the file
  • Improved behavior of clipping planes in Mesh module
  • Mesh measurements: Minimum distance, Bounding box
  • Preview on most of Geometry and Mesh operations
  • Visibility icons in the Object browser
  • New view operations
    • Rotate view 90° clockwise / counterclockwise
    • Zoom at point
  • Dump study to the single Python script file
  • And more ... see SALOME 6.3.0 Release Notes for details

The latest installation packages can be retrieved from the official download page, and pre-compiled binaries are also available.

For Ubuntu users it is recommended to download the latest package for Debian 6.0 Squeeze; although there is only a 64 bit version, why not take the chance to upgrade to 64 bit? For other Ubuntu distributions, in detail David suggested downloading packages for

  • Ubuntu 9.04: Debian 4.0 Etch or 5.0 Lenny
  • Ubuntu 9.10: Debian 4.0 Etch or 5.0 Lenny
  • Ubuntu 10.04: Debian 5.0 Lenny or 6.0 Squeeze
  • Ubuntu 10.10: Debian 5.0 Lenny or 6.0 Squeeze
  • Ubuntu 11.04: Debian 6.0 Squeeze

Sunday, 24 April 2011

Next SALOME version 6.3.0 due in May 2011

According to David's message on the SALOME forum, the next major release of SALOME will be SALOME v6.3.0 and the planned release date is May 2011. [1]

Part of the improvements and features this new version will bring to us can be referred from [2], listed as
  • Automatic meshing of boundary layers
  • SMESH: Histogram of the quality controls
  • Option Single/Multi file dump
  • "RemoveFromStudy" Function
  • Hide/Show Icon (as in paraview)
  • GEOM: Performance enhanced when manipulating large models
  • SMESH: Mesh common borders
  • SMESH: detection of over-constrained elements
  • SMESH: create a new mesh from a selected group or from selected elements
  • SMESH: Create a clipping plane on several groups
Additionally the MED library version will be 3.0. This is a major change since the API is not compatible with the previous version. This version will read MED files of both format 2.2 and 3.0 and will write format 3.0.

In version 6.3.0 it will be possible to define viscous layer (inflation layers in ANSYS) [3]. It will be defined as an additional hypothesis for the 3D algorithms Netgen, GHS3D and Hexahedron, and the parameters will include:
  • Total thickness
  • Number of layers
  • Stretch factor
The example of viscous layers defined on tetra and hexa meshes, David posted on the SALOME forum, is


Certainly there will also be lots of bug fixes. We are absolutely enthusiastic with the new version and looking forward to its release.

Sunday, 13 March 2011

Share some helpful articles

1. Installation of Code_Saturne on Mandriva

A very helpful wiki page on how to compile and install Code_Saturne onto Mandriva has been contributed as follows

http://wiki.mandriva.com/fr/index.php?title=Code_Saturne

Since it is a French instruction, I also paste the Google translated English version here, as

The Google translated English version

2. A practical Code_Saturne study example

It is interesting to read a CFD example which combines the usage of SALOME, Code_Saturne and ParaView.

http://www.caelinux.org/wiki/index.php/Contrib:Claws/Real_world_study_CodeSaturne

3. Installing OpenFOAM 1.7.x on openSUSE 11.4

For those who want to install OpenFOAM onto openSUSE, probably this article is interesting.

Installing OpenFOAM 1.7.x on openSUSE 11.4

4. Compiling OpenFOAM 1.7.x on Mac OS X Snow Leopard

For those who want to use OpenFOAM on Mac OS X, the article could be helpful.

Compiling OpenFOAM 1.7.x for OS X 10.6

I hope these articles help you.

Wednesday, 9 March 2011

ParaView 3.10.0 is released

The ParaView team has announced the availability of the ParaView 3.10.0 final binaries for download on the ParaView download page.

http://paraview.org/paraview/resources/software.html

I repost the Release Notes from the email list as follows:

ParaView 3.10

This release features notable developments, including mechanisms to incorporate advanced rendering techniques, improved support for readers and several usability enhancements and bug fixes.

For the 3.10 release, we have added 60 new readers. The new readers include: ANSYS, CGNS, Chombo, Dyna3D, Enzo, Mili, Miranda, Nastran, Pixie, Samrai, Silo, and Tecplot Binary. A full listing of supported readers can be found in the ParaView Users Guide. We also added the ability for developers to create ParaView reader plugins from previously developed VisIt reader plugins. You can find a full guide on how to do this on the VisIt Database Bridge: http://www.paraview.org/Wiki/VisIt_Database_Bridge.

With this release we have rewritten the ParaView User's Guide and are making it freely available for the first time. The complete guide can be obtained in the help system or online at:
http://paraview.org/Wiki/ParaView/Users_Guide/Table_Of_Contents.

We have included a Python-based calculator which makes it possible to write operations using Python. The Python calculator uses NumPy, which lets you use advanced functions such as gradients, curls, and divergence easily in expressions. Also the NumPy module is packaged in the ParaView binary and is importable from the ParaView Python shell.

There should also be a marked performance improvement for users dealing with large multi-block datasets. We have cleaned up the rendering pipeline to better handle composite datasets, avoiding the appending of all blocks into a single dataset as was done previously.

To better utilize multiple cores on modern multi-core machines, by default ParaView can now run using a parallel server, even for the built-in mode. This enables the use of all the cores for parallel data processing, without requiring the user to start a parallel server. ParaView binaries will also be distributed using an MPI implementation, making this feature available to users by simply downloading the binaries. Since this is an experimental feature, it is off by default, but users can turn it on by checking the Auto-MPI checkbox in the application settings dialog.

Additionally, the 3.10 release includes several usability enhancements. 3D View now supports smart context menus, accessed by right-clicking on any object in the 3D View to change its color, representation, color map and visibility. Left-clicking on an object in the 3D View makes it active in the pipeline browser. Within the spreadsheet view, sorting is now supported and an advanced parallel sorting algorithm ensures that none of the benefits of the spreadsheet view, such as streaming and selection, are sacrificed. Python tracing and macro controls are no longer hidden on the Python shell dialog and instead are now easily found on the Tools menu.

For developers interested in adding support for advanced multi-pass rendering algorithms to ParaView, this release includes a major refactoring of ParaView's rendering pipeline. View and representations have been redesigned and users should see improved performance in client-server mode from reduced interprocess communication during rendering.

LANL's MantaView interactive ray tracing plugin has been restructured to make it easier to use. Version 2.0 of the plugin is now multi-view capable and no longer requires ParaView to be run in a client/server configuration. Similarly both of LANL's streaming aware ParaView derived applications have been merged into ParaView proper in the form of a new View plugin. The underlying streaming algorithms have been rewritten to be more usable and extensible. Both plugins are available in standard binary package for the first time in this release.

For an exhaustive list of the new features and bug-fixes, please refer to the change log at: http://www.paraview.org/Bug/changelog_page.php.

As always, we rely on your feedback to make ParaView better. Please use http://paraview.uservoice.com/ or click on the "Tell us what you think" link on paraview.org to leave your feedback and vote for new features.

Thursday, 3 February 2011

Stable version Code_Saturne 2.0.1 is released

I am glad to let you know that the production release version Code_Saturne 2.0.1 can be downloaded from

http://research.edf.com/research-and-the-scientific-community/softwares/code-saturne/download-code-saturne-80059.html

I am curious that all the source code were packaged into zip format. When trying to compile the source code, unfortunately, an error could occur as

:/$ ./configure
Error: permission denied
# the solution
:/$ chmod +x configure

The easy solution is modifying the attributes of the configure file.

By this I succeeded to compile bft package; however when compiling fvm, I have got another error shown as

checking for bft version >= "1.0.0"... configure: error: in `/home/wu/saturne_packages/version 2.0.1/fvm-0.15.2':
configure: error: compatible bft version not found

I checked and found that the "make install" script of bft didn't install proper header files into the destination directory (by default, /usr/local/include). I guess this is a bug to fix, though the headers can also be copied manually.

I didn't try the rest of the compilation yet.

Wednesday, 8 December 2010

SALOME version 5.1.5 is released

Please read the piece of news.

CEA/DEN, EDF R&D and OPEN CASCADE are pleased to announce SALOME 5.1.5. It is a public maintenance release that contains the results of planned major and minor improvements and bug fixes against SALOME version 5.1.4 released in July 2010.

This new release of SALOME includes the following important new features and improvements:
  • New operations in Geometry module: Automatic coordinate vectors and other.
  • Export CAD models to VTK native format in Geometry module.
  • New operations in Mesh module: Split hexahedrons to 24 tetrahedrons, Remove orphan nodes, Create boundary elements, Duplicate nodes / elements.
  • Improved Quadrangle mapping meshing algorithm: new Reduced (layers) type of meshing.
  • New filters in Mesh module: Coplanar faces.
  • Graduated axes trihedron in the OCC viewer.
  • Customizable shortcuts for some most frequently used operations.
  • New features in YACS module.
  • New TUI functions.
  • Multi-language support (plus French resources).
  • And more … see SALOME 5.1.5 Release Notes for details

SALOME 5.1.5 supports Debian 4.0 Etch 32bit and 64bit; both are Ubuntu compatible. The latest installation wizard packages can be retrieved from the download page of the official site. I expect the tutorial "Installation of SALOME 5.1.3 on Ubuntu 10.04 (64 bit)" would still be helpful when install the latest SALOME 5.1.5 onto Ubuntu 10.10. I also look forward to receiving your testing feedback on this.

Wednesday, 1 September 2010

OpenFOAM 1.7.1 is released

It is nice to read the piece of news that OpenCFD just released OpenFOAM version 1.7.1. The version optimises correctly using gcc-4.5.0 and has been verified to run on OpenSuSE-11.3.

Another good aspect is the debian packages prepared for this version, created for Ubuntu 10.04 LTS. Briefly, to install OpenFOAM in Ubuntu, execute the commands

# add the openfoam source into the source list
:/$ sudo echo "deb http://www.openfoam.com/download/ubuntu lucid main" >> /etc/apt/sources.list
# refresh the package list
:/$ sudo apt-get update
# Install OpenFOAM
:/$ sudo apt-get install openfoam171
# Install Paraview
:/$ sudo apt-get install paraviewopenfoam380

Please refer to this page for more information on the installation onto Ubuntu.

Monday, 28 June 2010

SALOME version 5.1.4 is released

In the good piece of news, CEA/DEN, EDF R&D and OPEN CASCADE are pleased to announce SALOME 5.1.4. It is a public maintenance release that contains the results of planned major and minor improvements and bug fixes against SALOME version 5.1.3 released in December 2009.

This new release of SALOME includes the following important new features and improvements:
  • Improved Filling algorithm in Geometry module.
  • Mesh scaling operation.
  • Split all 3d mesh elements (volumes) to the tetrahedrons.
  • Change sub-meshing order for the concurrent sub-meshes.
  • Find mesh element closest to the specified point.
  • Modify point markers in Mesh and Post-Pro modules.
  • Sort table data (Post-Pro module).
  • Using of two vertical axes in the Plot2d viewer.
  • Keyboard free interaction style in OCC viewer.
  • New features in YACS module.
  • And more … see SALOME 5.1.4 Release Notes for details

SALOME 5.1.4 supports Debian 4.0 Etch 32bit and 64bit; both are Ubuntu compatible. The latest installation wizard packages can be retrieved from the download page of the official site. As feedback from users, the tutorial "Installation of SALOME 5.1.3 on Ubuntu 10.04 (64 bit)" also works with SALOME 5.1.4 on Ubuntu 10.04.

We also look forward to the corresponding Windows version.

SALOME 5.1.4 for tests on windows available

As announced by Adam on 2nd July, 2010, SALOME version 5.1.4 for tests on windows is already available. Please refer to the download page and the how-to-compile page for more details.

Saturday, 26 June 2010

OpenFOAM 1.7.0 is released

A major, new release of version 1.7.0 of the OpenFOAM open source CFD toolbox is released. The new package can be downloaded from the official page. Version 1.7.0 is distributed: (1) as Debian packs created for Ubuntu 10.04 LTS; (2) as source code for compilation on other Linux systems. Please read the announcement, "OpenCFD release OpenFOAM® version 1.7.0", to know more.

The following introduction on the release of OpenFOAM 1.7.0 is borrowed from here.

OpenFOAM-1.7.0 is the latest release of OpenFOAM that contains new features both from OpenCFD’s development version of OpenFOAM and the repository 1.6.x distribution. This release passes our standard tests and the tutorials have been broadly checked. Please report any bugs by following the link: http://www.openfoam.com/bugs.

GNU/Linux version

This release of OpenFOAM is distributed primarily in 2 ways: (1) as a Debian pack containing binaries and source; (2) from a source code repository.

The Ubuntu/Debian pack is available for 32 and 64 bit versions of the 10.04 LTS operating system using the system compiler and libraries that will be installed automatically from standard Debian packs.

To use the source version, we provide a source pack of third-party packages that can be compiled on the user’s system. This does not include gcc, since the system installed version is typically sufficient, but includes paraview-3.8.0, openmpi-1.4.1, scotch_5.1, metis-5.0pre2, ParMetis-3.1 and ParMGridGen-1.0.

Library developments

There have been a number of developments to the libraries to support the extension of functionality in solver and utility applications.

Core library
  • Large number of code refinements and consistency improvements to support other developments.
Turbulence modelling
  • Wall function boundary conditions:
    • New mutWallFunction continuous wall function,
    • New mutLowReWallFunction continuous wall function,
    • New nutWallFunction continuous wall function,
    • New nutLowReWallFunction continuous wall function,
    • Standard wall functions, based on k, now renamed nutkWallFunction and mutkWallFunction,
    • omegaWallFunction now includes laminar blending function.
  • Conjugate heat transfer boundary conditions:
    • New turbulentTemperatureCoupledBaffleMixed BC,
    • New turbulentTemperatureCoupledBaffle BC.
Thermo-physical models

There has been a set of developments to redefine the thermodynamics in some solvers in terms of sensible enthalpy instead of total (i.e. including chemical) enthalpy. This was done to improve the handling of thermodynamics in the case of partially-premixed or non-premixed combustion systems, or to handle systems with non-unity Lewis number.
  • New hsPsiThermo thermophysical model calculation based on sensible enthalpy hs and compressibility psi.
  • New hsRhoThermo thermophysical model calculation based on hs and density rho.
  • New hsCombustionThermo thermophysical model calculation for a combustion mixture based on hs and psi.
  • New hsPsiMixtureThermo thermophysical model calculation for a mixture based on hs and psi.
  • New hsReactionThermo thermophysical model calculation for a complex reacting mixture based on hs.
DSMC
  • 1D and 2D planar simulations now possible by specifying empty patches in the usual way.
  • New MixedDiffuseSpecular wall boundary condition added.
  • New pressure field measurement.
  • New measurement of velocity slip and temperature jump.
Dynamic mesh
  • New sixDoFRigidBodyDisplacement six degree-of-freedom, fluid coupled rigid body motion, applied as a boundary condition to a patch in the pointDisplacement field for dynamic mesh cases. The motion may have any number of restraints (springs and dampers) and constraints (reductions in degrees-of-freedom) applied. Restraints include linearAxialAngularSpring, linearSpring, sphericalAngularSpring and tabulatedAxialAngularSpring. Constraints include fixedAxis, fixedLine, fixedOrientation, fixedPlane and fixedPoint.
Numerics
  • MULES now supports sub-cycling on moving meshes for interface capturing VoF (volume of fluid) calculations.
  • Developments to TimeActivatedExplicitSource, a class that allows a source to be applied to an equation according to an input dictionary at run-time, that can be switched on at particular times and within particular regions of the mesh, using cellZones.

Solvers

A number of new solvers have been developed for a range of engineering applications. There has been a set of improvements to certain classes of solver that are introduced in this release.

New solvers
  • fireFoam: Transient solver for fires and turbulent diffusion flames.
  • rhoPorousMRFPimpleFoam: Transient solver for laminar or turbulent flow of compressible fluids with support for porous media and MRF for HVAC and similar applications. Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and pseudo-transient simulations.
  • chtMultiRegionSimpleFoam: Steady-state version of chtMultiRegionFoam.
  • porousSimpleFoam: Steady-state solver for incompressible, turbulent flow with implicit or explicit porosity treatment.
  • interMixingFoam: Solver for 3 incompressible fluids, two of which are miscible, using a VoF method to capture the interface.
  • porousInterFoam: Solver for 2 incompressible, isothermal immiscible fluids using a VoF phase-fraction based interface capturing approach.
  • simpleWindFoam: Steady-state solver for incompressible, turbulent flow with external source in the momentum equation to approximate, e.g. wind turbines; located in tutorials, with associated turbineSiting test case.
Modifications to multiphase and buoyant solvers
  • Multiphase and buoyant flow solvers now solve for p = p - ρg ∙ x, rather than the static pressure p. This change is to avoid deficiencies in the handling of the pressure force / buoyant force balance on non-orthogonal and distorted meshes.
  • Improvements to boundary conditions and pressure referencing in closed domains have been developed to avoid the problems encountered in previous attempts to decompose pressure for buoyant flow.
  • The following solvers have been modified for p_rgh: fireFoam buoyantBoussinesqPimpleFoam, buoyantBoussinesqSimpleFoam, buoyantPimpleFoam, buoyantSimpleFoam, chtMultiRegionFoam, chtMultiRegionSimpleFoam, compressibleInterDyMFoam, compressibleInterFoam, interDyMFoam, porousInterFoam, MRFInterFoam, interFoam, interPhaseChangeFoam, multiphaseInterFoam, settlingFoam, twoLiquidMixingFoam.
Modifications to solvers for sensible enthalpy
  • The following solvers have been modified to solve for hs (instead of h): dieselEngineFoam, dieselFoam, reactingFoam, rhoReactingFoam, coalChemistryFoam, porousExplictSourceReactingParcelFoam, reactingParcelFoam.
Modifications to steady-state compressible solvers
  • Boundedness to the thermodynamics is ensured by limiting the density, rather than the pressure. This improves convergence by maintaining consistency between the pressure gradient and momentum changes.
  • Removed the Sp “boundedness” correction in the convection term from the momentum equation.
  • The following solvers have been modified with this change: rhoSimpleFoam, buoyantSimpleFoam, chtMultiRegionSimpleFoam.
Other modifications
  • Added diffusion number limit to the time-step correction in chtMultiRegionFoam.
  • Reformulated pressure correction during phase change to maintain boundedness of pressure in cavitatingFoam.

Boundary conditions

New boundary conditions have been introduced to support new applications in OpenFOAM.
  • Added new time varying boundary conditions.
  • Added new velocity inlets and wall boundary conditions: cylindricalInletVelocity, swirlFlowRateInletVelocity, translatingWallVelocity.
  • Added boundary conditions for wind/atmospheric simulation: atmBoundaryLayerInletEpsilon, atmBoundaryLayerInletVelocity, fixedShearStress.

Utilities

There have been some utilities added and updated in this release.

New utilities
  • foamToTecplot360: Tecplot binary file format writer.
  • IFCLookUpTableGen: Infinitely-fast chemistry (IFC) look-up table generator that calculates the infinitely-fast chemistry relationships as a function of ft for a given fuel.
Updated utilities
  • gmshToFoam: adapted for msh2.1 and 2.2 format.
  • snappyHexMesh: lower memory usage by pre-balancing and non-blocking transfers.
  • blockMesh: proper spline edges.
  • setSet: handling of faceZoneSet, cellZoneSet, pointZoneSet.
  • splitMeshRegions: option to use existing cellZones only for split.
  • changeDictionary: allow wildcards in changeDictionaryDict.

Post-processing

Post-processing has been extended particularly to function objects, the on-the-fly post-processing system.
  • New fieldValues function object, allows spatial averaging, sum, min/max calculations to be made on fields in sets of cells or faces in the geometry
  • New surfaceInterpolateFields function object to generate surface fields from volume fields where required
  • New sampledTriSurfaceMesh surface type for surface sampling function object
  • New readFields function object controls the loading of fields from time directories for further post-processing

New tutorials

There is a large number of new tutorials to support the new solvers in the release.
  • combustion/fireFoam/les/smallPoolFire2D
  • combustion/reactingFoam/ras/counterFlowFlame2D
  • compressible/rhoPorousMRFPimpleFoam/mixerVessel2D
  • heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater
  • incompressible/pimpleDyMFoam/wingMotion
  • incompressible/porousSimpleFoam/angledDuctExplicit
  • incompressible/porousSimpleFoam/angledDuctImplicit
  • incompressible/simpleWindFoam/turbineSiting
  • lagrangian/porousExplictSourceReactingParcelFoam/parcelInbox
  • lagrangian/porousExplictSourceReactingParcelFoam/verticalChannel
  • multiPhase/interDyMFoam/floatingObject
  • multiPhase/interMixingFoam/laminar/damBreak
  • multiPhase/interPhaseChangeFoam/cavitatingBullet

Saturday, 19 June 2010

Installation of Code_Saturne 2.0-rc1 on Ubuntu 10.04 (64 bit)

Based on the previous posts, "Installation of Code_Saturne 2.0.0 on Ubuntu 9.04" and "Installation of Code_Saturne 2.0-rc1 on Ubuntu 9.10", and David's comments, I double checked the installation of Code_Saturne onto Ubuntu 10.04 LTS (long-time support version) and record the procedure here.

1. Install prerequisites

Using apt-get install the packages as

:/$ sudo apt-get install build-essential gfortran libxml2 libxml2-dev libatlas-headers libatlas-base-dev openmpi-bin openmpi-dev libibverbs-dev openssh-server python-qt4 pyqt4-dev-tools swig python-dev

2. Install HDF5 and MED libraries

Thanks to David's help, I used apt-get to install the 2 packages

:/$ sudo apt-get install libhdf5-serial-dev libmedc-dev

On Ubuntu 10.04, this installs HDF5 1.8.4 and MED 2.3.5. What Code_Saturne really needs is a MED 2.3 mesh format, and thus the minimum version of MED required must be 2.3.0.

I am also glad to see that Code_Saturne supports to use HDF5 1.8.x now.

3. Compile METIS

Download a patched version of Metis-4.0 from my link, and extract it. Compile as

# ship into metis-4.0
:/$ make
:/$ sudo cp graphchk kmetis mesh2dual mesh2nodal oemetis onmetis partdmesh partnmesh pmetis /usr/local/bin/
:/$ sudo cp libmetis.a /usr/local/lib/
:/$ sudo cp Lib/*.h /usr/local/include/

Indeed, it is annoying to install METIS due to prototypes redefinition, non-standard directories installation, ... which probably make you don't want to use METIS, even though my patched version. As suggested, you can use the SCOTCH library instead (perhaps a bit less performant for many-processors calculation, but sufficient for standard ones), or only use the internal partioner of Code_Saturne (based on a Space-Filling Curve algorithm, which is good-enough for few-processors calculation, e.g. several-core but mono-processor computers).

4. Configure and compile bft, fvm, ecs and mei sequentially

# ship into bft-1.1.2
:/$ ./configure
:/$ make
:/$ sudo make install

# ship into fvm-0.15.0
:/$ ./configure --with-mpi=/usr/lib/openmpi
...
Configuration options:
 use debugging code: false
 MPI (Message Passing Interface) support: yes
   MPI I/O support: yes
   MPI2 one-sided communication support: yes
 HDF (Hierarchical Data Format) support: yes
 CGNS (CFD General Notation System) support: no
 MED (Model for Exchange of Data) support: yes
...
:/$ make
:/$ sudo make install

# ship into ecs-2.0.0-rc1
:/$ ./configure
...
Configuration options:
 use debugging code: false
 use long integers: false
 ADF support: no
 CCM support: no
 HDF5 (Hierarchical Data Format) support: yes
 CGNS (CFD General Notation System) support: no
 MED (Model for Exchange of Data) support: yes
 METIS (Graph Partitioning) support: yes
 SCOTCH (Graph Partitioning) support: no
...
:/$ make
:/$ sudo make install

MEI is not compulsory, but strongly recommended, as long as you want to define function expressions handily in the GUI.

# ship into mei-1.0.1
:/$ ./configure --with-bft=/usr/local
...
Configuration options:
 use debugging code: false
 Python bindings: true
...
:/$ make
:/$ sudo make install

5. Patch and compile ncs

Extract the patch patches-portability-ncs-20rc1.tgz to the ncs directory.

# ship into ncs-2.0.0-rc1
:/$ tar xzvf ../patch/patches-portability-ncs-20rc1.tgz

Extract the patch rho_mu-tar.gz to a directory. There are 2 files contained, cs_gui.c and FluidCharacteristicsView.py, and copy them accordingly.

# in ncs-2.0.0-rc1
:/$ find . -name cs_gui.c
./src/base/cs_gui.c
:/$ cp ../patch/rho_mu/cs_gui.c src/base/
:/$ find . -name FluidCharacteristicsView.py
./gui/Pages/FluidCharacteristicsView.py
:/$ cp ../patch/rho_mu/FluidCharacteristicsView.py gui/Pages/

Configure and compile ncs, as

# in ncs-2.0.0-rc1
:/$ ./configure --with-mpi=/usr/lib/openmpi --with-prepro=/usr/local --with-mei=/usr/local
...
Configuration options:
 use debugging code: false
 use graphical user interface: yes
 MPI (Message Passing Interface) support: yes
 OpenMP support: no
 BLAS (Basic Linear Algebra Subprograms) support: yes
 Libxml2 (XML Reader) support: yes
 MEI (Mathematical Expressions Interpreter) support: yes
 SYRTHES 3 coupling support: no
 IP socket support (for SYRTHES 3 or CFD_Proxy): yes
 Dynamic loader support (for YACS): yes
...
:/$ make
:/$ sudo make install

6. (optional) Compile latex documents

If you don't use latex, you don't have to bother to compile the documents. I already prepared my compiled documents (pdf files) for you to use directly.

If you want to do it manually, please follow

# for processing LaTeX documents
:/$ sudo apt-get install tetex-bin tetex-base transfig
# in ncs-2.0.0-rc1
:/S cp ~/fullpage.sty ~/lastpage.sty doc/style/
:/$ make pdf
:/$ sudo make install-pdf

7. Run Code_Saturne

After finished the procedure without rebooting the system, I tried to run Code_Saturne but encountered an error as

  ********************************************
    Starting calculation
  ********************************************

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

Error running the partitioner.
Check partitioner log (listpart) for details.

  ********************************************
    Error in partitioning stage.
  ********************************************

In listpart it was written that

/usr/local/bin/cs_partition: error while loading shared libraries: libbft.so.1: cannot open shared object file: No such file or directory

Don't worry. Update the dynamic library database to avoid it.

:/$ sudo ldconfig
[sudo] password for salad:
:/$ sudo updatedb

Monday, 24 May 2010

apt-get, the ideal way to install the software onto Ubuntu

Code_Saturne

In the past two years, since I started to use Code_Saturne, I compiled the packages over and over whenever I need to use it. I wrote posts and share my experiences in order to save others' precious time from solving all the compilation problems one might meet with. At the same time, I was also thinking, if we could use the standard apt-get to install Code_Saturne, it would be perfect.

salad@ubuntu:~$ sudo apt-get install code-saturne
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package code-saturne is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package code-saturne has no installation candidate

David said the code-saturne package is only available in Debian testing. Therefore, I add two lines into my source configuration /etc/apt/sources.list: (Please select a corresponding source which is fast in your area; you can refer to http://www.debian.org/mirror/list)

deb http://mirror.ox.ac.uk/debian/ testing main
deb-src http://mirror.ox.ac.uk/debian/ testing main

Then retrieve the list of packages and apt-get install code-saturne

:/$ sudo apt-get update
:/$ sudo apt-get install code-saturne

Gladly, this time I get positive information saying the packages can be installed.

salad@ubuntu:~$ sudo apt-get install code-saturne
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  qt4-doc libswscale0 libavutil49 libpthread-stubs0 libgl1-mesa-dev
  x11proto-kb-dev libqt4-opengl libavcodec52 mesa-common-dev xtrans-dev
  x11proto-input-dev libglu1-mesa-dev libdrm-dev libqt4-multimedia qt4-qmake
  libgsm1 libxau-dev libschroedinger-1.0-0 libavformat52 libx11-dev
  libdirac-encoder0 libxcb1-dev mpi-default-bin libopenjpeg2 x11proto-core-dev
  libxdmcp-dev libpthread-stubs0-dev qt4-designer libfaad2
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  code-saturne-bin code-saturne-data code-saturne-include ecs libaudio2
  libavcodec52 libavformat52 libavutil49 libbft1 libcgns2 libdb4.5
  libdirac-encoder0 libdrm-dev libdrm-intel1 libdrm-nouveau1 libdrm-radeon1
  libdrm2 libfaad2 libfvm0 libgl1-mesa-dev libglu1-mesa-dev libgsm1
  libhdf5-openmpi-1.8.4 libmedc1 libmei0 libmng1 libmysqlclient16 libncursesw5
  libopenjpeg2 libpthread-stubs0 libpthread-stubs0-dev libqt4-assistant
  libqt4-dbus libqt4-designer libqt4-help libqt4-multimedia libqt4-network
  libqt4-opengl libqt4-phonon libqt4-qt3support libqt4-script
  libqt4-scripttools libqt4-sql libqt4-sql-mysql libqt4-sql-sqlite libqt4-svg
  libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4
  libschroedinger-1.0-0 libsqlite3-0 libssl0.9.8 libswscale0 libx11-6
  libx11-dev libxau-dev libxau6 libxcb1 libxcb1-dev libxdmcp-dev libxdmcp6
  mesa-common-dev mpi-default-bin mysql-common python-qt4 python-sip python2.5
  python2.5-minimal qt4-designer qt4-doc qt4-qmake qt4-qtconfig syrthes
  x11proto-core-dev x11proto-input-dev x11proto-kb-dev xtrans-dev
Suggested packages:
  nas libmed-tools libmed-doc libqt4-dev python-qt4-dbg python2.5-doc
  python-profiler qt4-dev-tools
Recommended packages:
  paraview
The following NEW packages will be installed
  code-saturne code-saturne-bin code-saturne-data code-saturne-include ecs
  libaudio2 libavcodec52 libavformat52 libavutil49 libbft1 libcgns2 libdb4.5
  libdirac-encoder0 libdrm-dev libfaad2 libfvm0 libgl1-mesa-dev
  libglu1-mesa-dev libgsm1 libhdf5-openmpi-1.8.4 libmedc1 libmei0 libmng1
  libmysqlclient16 libopenjpeg2 libpthread-stubs0 libpthread-stubs0-dev
  libqt4-assistant libqt4-dbus libqt4-designer libqt4-help libqt4-multimedia
  libqt4-network libqt4-opengl libqt4-phonon libqt4-qt3support libqt4-script
  libqt4-scripttools libqt4-sql libqt4-sql-mysql libqt4-sql-sqlite libqt4-svg
  libqt4-test libqt4-webkit libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4
  libschroedinger-1.0-0 libswscale0 libx11-dev libxau-dev libxcb1-dev
  libxdmcp-dev mesa-common-dev mpi-default-bin mysql-common python-qt4
  python-sip python2.5 python2.5-minimal qt4-designer qt4-doc qt4-qmake
  qt4-qtconfig syrthes x11proto-core-dev x11proto-input-dev x11proto-kb-dev
  xtrans-dev
The following packages will be upgraded:
  libdrm-intel1 libdrm-nouveau1 libdrm-radeon1 libdrm2 libncursesw5
  libsqlite3-0 libssl0.9.8 libx11-6 libxau6 libxcb1 libxdmcp6
11 upgraded, 70 newly installed, 0 to remove and 655 not upgraded.
Need to get 131MB of archives.
After this operation, 245MB of additional disk space will be used.
Do you want to continue [Y/n]?

Accept it and all the related packages will be downloaded and installed. To see if it is really there, type

salad@ubuntu:~$ type code_saturne
code_saturne is hashed (/usr/bin/code_saturne)
salad@ubuntu:~$ code_saturne config
Directories:
  dirs.prefix = /usr
  dirs.exec_prefix = /usr
  dirs.bindir = /usr/bin
  dirs.includedir = /usr/include
  dirs.libdir = /usr/lib
  dirs.datarootdir = /usr/share
  dirs.datadir = /usr/share
  dirs.pkgdatadir = /usr/share/ncs
  dirs.docdir = /usr/share/doc/ncs
  dirs.pdfdir = /usr/share/doc/ncs

Auxiliary information:
  dirs.ecs_bindir = /usr/bin
  dirs.syrthes_prefix = /usr/lib/syrthes/3.4.2

MPI library information:
  mpi_lib.type =
  mpi_lib.bindir =
  mpi_lib.libdir =

Compilers and associated options:
  cc = cc
  fc = gfortran
  cppflags = -D_POSIX_SOURCE -DNDEBUG -I/usr/include/libxml2
  cflags = -std=c99 -funsigned-char -pedantic -W -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wunused -Wfloat-equal -g -O2 -g -Wall -O2 -funroll-loops -O2 -Wuninitialized
  fcflags = -x f95-cpp-input -Wall -Wno-unused -D_CS_FC_HAVE_FLUSH -O
  ldflags = -Wl,-export-dynamic -O
  libs = -lfvm -lm -lcgns -lmedC -lhdf5 -lmei -lbft -lz -lxml2 -lblas -L/usr/lib/gcc/i486-linux-gnu/4.4.3 -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../.. -lgfortranbegin -lgfortran -lm -ldl
  rpath = -Wl,-rpath -Wl,

Compilers and associated options for SYRTHES build:
  cc = /usr/bin/gcc
  fc = /usr/bin/gfortran
  cppflags = -I/usr/lib/syrthes/3.4.2/include
  cflags = -O2 -D_FILE_OFFSET_BITS=64 -DHAVE_C_IO
  fcflags = -O2 -DHAVE_C_IO -D_FILE_OFFSET_BITS=64
  ldflags = -L/usr/lib/syrthes/3.4.2/lib/Linux
  libs = -lbft -lz -lsatsyrthes3.4.2_Linux -lsyrthes3.4.2_Linux -L/usr/lib/gcc/i486-linux-gnu/4.4.3 -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.4.3/../../.. -lgfortranbegin -lgfortran -lm
salad@ubuntu:~$ code_saturne create -s STUDY -c CASE
Code_Saturne 2.0.0-rc1 study/case generation
  o Creating study 'STUDY'...
  o Creating case 'CASE'...

We see the MPI library information is blank, as the package currently miss MPI support (this will hopefully be corrected before final release).

SALOME

Ledru said SALOME has just been uploaded into Debian. (see the first comment of "Installation of SALOME 5.1.3 on Ubuntu 10.04 (64 bit)") That is right; there is a package salome but there is no source containing it. Let's hope for it.

salad@ubuntu:~$ sudo apt-get install salome
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package salome is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package salome has no installation candidate

ParaView

apt-get install paraview can install paraview 3.4.0 at the moment. Although the latest version is already 3.8.0, a not-quite-old 3.4.0 is pretty enough if want to enjoy the ease of apt-get.

salad@ubuntu:~$ type paraview
paraview is hashed (/usr/bin/paraview)
salad@ubuntu:~$ paraview --version
ParaView3.4

Sunday, 2 May 2010

Installation of SALOME 5.1.3 on Ubuntu 10.04 (64 bit)

NEW - According to your feedback in the comment list and my own experience, the present tutorial works with SALOME 5.1.5 on Ubuntu 10.10, Kubuntu 10.10 and the latest Ubuntu 11.04.

NEW - As the feedback from vaina, the present tutorial also works with the latest SALOME 5.1.4 on Ubuntu 10.04.

On 23 April 2010, I received the SALOME Newsletter and surprisingly read that they are advising my blog "Free your CFD" for my introduction on SALOME on different platforms. I feel pretty glad and deeply honored because this is definitely the first time I obtain acknowledgement from the SALOME official after my effort during the past more than one years. The part below is from the newsletter.

salome logo Welcome to the April 2010 SALOME Newsletter
...

Solvers' corner

...

"Free your CFD"

Have you bookmarked this blog. It provides useful information and tutorials on Code_Saturne and SALOME.
...
Salome platform logo

To thank you for your support and to celebrate the recent release of the latest Ubuntu 10.04 LTS, I summarise the two previous posts "Installation of SALOME 5.1.1 on Ubuntu 9.04" and "Installation of SALOME 5.1.2 on (K)Ubuntu 9.10 64 bit", test the installation procedure of SALOME version 5.1.3 on Ubuntu 10.04 (64 bit), hereby share my experience and hope it truly helps.

1. Preparation. Although a "Universal binaries for Linux" was released, I still suggest to use the install wizard version to install SALOME, because both of the source code and the corresponding pre-compiled binaries of the necessities are all shipped with the package, and thus it is even possible to share these libraries with Code_Saturne (see "Compile Code_Saturne with SALOME binary libraries").

Install the g++ compiler as SWIG has to be built from source.

:/$ sudo apt-get install build-essential

Replace the executable "sh" with "bash" to avoid some trivial errors.

:/$ sudo rm /bin/sh
:/$ sudo ln -s /bin/bash /bin/sh

Additionally, if it is for a 64 bit Linux, because the install wizard was written for 32 bit, a package ia32-libs is also necessary. It is of course not needed if the Linux environment is 32 bit version.

:/$ sudo apt-get install ia32-libs

Otherwise an error could be encounterred on the console when trying to launch the install wizard.

sh: ./bin/SALOME_InstallWizard: No such file or directory

2. Install. Download the install wizard package and extract it. Ship into the extracted directory and then execute runInstall.

:/$ ./runInstall

Sequentially, the wizard contained 8 steps, for which the screenshots below illustrate. Step 7 is for install progress. After it is started, during the install procedure, there will a warning dialog, shown below as well, poped out, complaining two compulsory libraries, libg2c and libgfortran, haven't been found. Click "OK", ignore the warning and procede until finish the last step of the wizard.




















3. Post-install. SALOME has been installed into the $HOME directory; run salome_appli_5.1.3/runAppli to launch the software. However, before the first launch, remember to create a directory USERS under the salome_appli_5.1.3 to avoid an error.

:/$ mkdir salome_appli_5.1.3/USERS
:/$ salome_appli_5.1.3/runAppli &

Up to now, launch SALOME and try to enable the MESH module, an error, shown below, is seen. This is because libg2c and libgfortran are still missing in the system.


To add libgfortran, sequentially execute (note that for Ubuntu 11.04, the libgfortran is in /usr/lib/x86_64-linux-gnu instead of /usr/lib)

:/$ sudo apt-get install gfortran
:/$ sudo ln -s /usr/lib/libgfortran.so.3 /usr/lib/libgfortran.so.1
:/$ sudo ldconfig
:/$ sudo updatedb

To add libg2c, download the packages libg2c0 and gcc-3.4-base (the latter actually provides a dependency for the former one) which suit the system, i386 or amd64, and then install both by dpkg command. For instance, on my Ubuntu 64 bit, execute

:/$ sudo dpkg -i gcc-3.4-base_3.4.6-8ubuntu2_amd64.deb libg2c0_3.4.6-8ubuntu2_amd64.deb

Finally SALOME is supposed to work well.

Friday, 12 March 2010

MEI is easy to use and works like a charm!

The most expected feature coming from Code_Saturne 2.0-rc1 is the better supported MEI functions. With help of the small CFD calculation case, I tested the feature and have to say that MEI is truly easy to use and works like a charm. Before when I used COMSOL I defined the fluid properties by writting simple MATLAB expressions; (COMSOL is easy to be integrated into MATLAB because originally it is a third party toolbox for MATLAB). It is as easy as you can imagine, and now, within Code_Saturne we are also able to have the same fun.

I used two methods to define the fluid density and viscosity expressions: FORTRAN user routines and MEI expressions. By comparing the results, both methods actually have the same effect. Because I already talked about the first method in the previous tutorial post, I focus on the second one here. Before following, make sure you read "Installation of Code_Saturne 2.0-rc1 on Ubuntu 9.10" and installed 2.0-rc1 with MEI properly.

With the SaturneGUI program, when using 'Physical properties > Fluid properties' to define fluid properties, we have options 'constant', 'user law' and 'user subroutine(usphyv)'. If the property is a constant, fill a value below as a reference value. If select 'user law', MEI expressions can be inputted by clicking the following edit button. Finally, as mentioned previously, the option 'user subroutine' is for using FORTRAN routines to define the properties.


Click the edit button, and see a dialog as the figure below shows. I input a simple density expression as an illustration. Actually there are three tabpages here and the third one also contains an example. TempC is a pre-defined variable, which can be looked up from the second tabpage 'Predefined symbols'. Most operators like +, -, *, /, and ^ can be used, and even simple statements like if ... else can be applied.


Then we don't need to define the temperture dependent density in FORTRAN user routines any more. Obviously this MEI method is more straightforward. I don't say more about the viscosity part, because it is almost the same.

Re-use density value when calculating dynamic viscosity

Dynamic viscosity is the product of density and kinematic viscosity . Sometimes when only a kinematic viscosity expression is available, we need to calculate the dynamic viscosity value with the help of the correlation, .

When using FORTRAN user routines of Code_Saturne, it is possible to realise the correlation directly, which actually implies the previously calculated density value could be read for the viscosity calculating part to use. However, on the other hand, within MEI we don't have a pre-defined symbol, for example rho, to express density when defining a dynamic viscosity mu, and thus we have to expand the rho expression with its original and complicated form into the mu definition expression.

Fortunately, Alexandre gives a patch to implement the idea (see the conversation). After apply the patch accordingly, re-compile ncs, a pre-defined variable rho can then be used for the mu definition. I tested the patch and it works properly.

Post-processing with ParaView

In order to judge whether both methods yield the same effect, the calculation results are analysed. If select to export results into 'EnSight Gold' format, ParaView is going to be used.

ParaView is a cross-platform tool to perform post-processing of numerical simulations. For a beginner I guess it slightly confusing about the mouse controls to move its camera view; at least for me it was true. Actually, select the menu item 'Edit > Settings...' and in the 'Options' dialog ship into the category 'Render View > Camera', can find and modify the controls.


It is not difficult to use ParaView to see the surface plot of a specific parameter, for example, temperature. Select the cell data TempC from the toolbar and the view can then be like this:


From the picture we can see the development of the thermal boundary layer attched to the top and the bottom surfaces of the channel. From the legend the temperature range is found to be 50 to 91.7293 degree C (50 degree C is the inlet temperature), which actually implies the density and viscosity ranges. With MATLAB I estimated them.

>> TempC = [50, 91.7293];
>> rho = 895 ./ (1 + 6.5e-4 .* (TempC - 20))

rho =

  877.8813  855.1304

>> visc = rho .* (0.75857 * (1.8 .* TempC + 32).^-2.34)

visc =

    0.0087    0.0028

Select the data Density and LamVisc in ParaView and see their ranges are 855.12872 to 877.88129 and 0.0027963 to 0.0087367, respectively. They match the results given by MATLAB very well expect the density at 91.7293 degree C, for which there is a very small error, 0.0002%. Thereby, we are happy to see Code_Saturne correctly used the parameter expressions as we expected.

Meanwhile, I compared the results from MEI and FORTRAN user routines, and found their results match exactly, which could imply they have the same effect.

Velocity development along the centreline

Using the filter 'Plot Over Line' we can examine the fluid flow velocity along the centreline of the 2D channel.


Apparently, the velocity rises rapidly at the beginning stage of the channel flow, and then gradually falls. The rise stage is actually within the entrance distance for the flow to be fully developed. On the other hand, the gradual reduction is because of the temperature dependency of the fluid viscosity, as discussed in the previous post "CFD tutorial: laminar flow along a 2D channel - Part I".