What is Open Source?
From CFD-Wiki
Contents |
Introduction
Definition and Need
If you were to ask ten different people what Open Source Software (OSS) is, you would most likely get ten different answers. The official definition can be found, from The Open Source Initiative, along with guidelines and information related to an Open Source license. From an engineer's standpoint: "Open-source software ... is computer software that is ... provided under a software license that permits users to study, change, and improve the software."
For any decision, especially those related to significant cost and safety impacts, to rely on the analysis based on the results from a software package, the engineer or decision maker needs a mechanism whereby the validity of the algorithms and their implementation can be verified easily. This aspect is all the more important in the case of CFD, where several assumptions and simplifications are made in the process of breaking down the problem, into a set of parameters that can be computed with the available resources. Other factors resulting in the increased interest in CFD, other than the boom in computing power in recent years, is the cost and feasibility of setting up the facilities to realistically experiment and study complicated physical phenomenon.
Granted, not all of us are going to go digging around in the code to determine that a particular piece of software actually cranks out viable results; however, the fact that there are a large number of other users who ARE validating and improving the code provides us with a greater sense of confidence than taking some commercial entity's word for it. There are of course technical paper's and validation studies done using the commercial codes. However, the huge leap ahead in the User Interfaces, available applications and ease of use of Linux operating systems, in the past few years, have made OSS and custom Linux distributions a realistic solution to providing increased efficiency at lower costs along with more freedom
Other than the cost savings, there is another peripheral benefit that is often overlooked : the user community can be quite diverse, not to mention vast. Through forums and mailing lists, a good deal of support and assistance can be accessed without having to navigate through a corporate "Help" desk. These communities are often comprehensive sources of answers to specific questions. The kind of unofficial support, usually found in OpenSource Software, is often purely a function of 'getting things done' and 'gaining knowledge', sans the set commercial limitations. There are also an increasing number of official support channels and training programs offered by organisations like the OpenFOAM foundation
Of course, in parallel, commercial software giants like ANSYS and Altair have made their own powerful impact on the industry and have become conventional, albeit 'reliable' solutions. They have comprehensive after-sales support and often hire well qualified professionals, including PhD's as application engineers, to solve the problems of their clients. Many of them are also active in developing new and probably more customized solutions in collaborations with Universities and the Industry as well. There are plenty of industries and users satisfied with being end users, as it serves their purpose well.
Another huge area where open source and literally 'free' applications are useful is for students with no access to commercial programs.
The objective of this wiki section is to provide a comprehensive reference and guide for harnessing the power of OpenSource and to make an informed and unbiased decision of the kind of package that will provide the most efficient/comprehensive solution to the problem being faced.
Cost and Licensing Considerations
Note that there's nothing in the definition of OpenSource software about its cost. Fortunately, many of the OpenSource solutions now available for engineering applications also happen to be free of any licensing fees (although this is not always the case). Some of the OpenSource software that is available for free is restricted to personal-use; you are not allowed to use it in your commercial engineering practice. Yet many of the best tools we have encountered are not hindered by restrictive licenses. Still, one must be aware of such restrictions to avoid ethical violations or possible legal problems. More information can be found on The Open Source Initiative website.
One's focus will naturally be upon Free and Open software. But, this particular category may not provide a viable solution for every circumstance. Therefore, as necessity dictates, the engineer should swerve off the path to explore some possibilities that are not free, or that may involve restrictive licenses. The goal is to identify the most cost-effective tools for engineering applications. And, of course, part of the cost that must be considered is the time one must invest in learning how to use the software. It lies in the engineer's purview to understand the software and make informed decisions about which kind of tool to use.
Based on the definitions above, it is not necessary for open source to be Operating system biased. It basically means code accessible to be modified and used. This can take place in Windows as well. In fact, there are articles suggesting that in many cases, Windows is simply the hassle free option where service is guaranteed and you do not have to get deeply involved with developmental sort of work (See this article on 'The Economist') CFD is also probably moving out in such directions, branching out to knowledgeable end users and those that play with numerical schemes and writing better code to put these schemes into use.
Getting Started
Different ways in which you can get started with using Open Source software. There are plenty of codes available, which can be found in the Related Links section at the bottom. Fundamentally, one should know which operating system, a particular software caters to. It has been made amply clear that open source is not restricted only to Linux. The objective for the section would be to eventually possess comprehensive references, case studies and guides to practically using free CFD softwares, on both Windows and Linux. This will include reviews and links to interesting articles as well. Since most Users are predominantly from a Windows background, the section also outlines some popular options chosen to get started with Linux.
Setting up a Linux OS
The first step is to possess an installation CD/image of the OS of choice. This is available for free, and can be downloaded off the internet or procured inexpensively via the disks that are offered 'free' with popular monthly computer magazines. The next step is to choose the mode of setting up the OS based on your preferences and the restrictions posed by the available facilities. A brief overview with links to the corresponding tutorials can be found below :
Virtual Operating System
The advent of functional User Interfaces in Linux distributions, even with styles matching that of Windows has made it a lot more easier to experiment with Open Source applications. One of the easiest ways to kickstart your open source experience within Windows itself is to use a virtual environment. There are free applications (eg : VirtualBox , VMWare ) which allow you to experience the Linux Operating system within Windows itself. All that is required is an ISO image or CD of the Operating System setup. It is possible to setup the virtual system to use a particular amount of RAM and also give it permission to access the host systems data and hardware. This method is often preferred as a starting point and also where very limited usage of other distributions is required. However, this method does not allow you to efficiently utilise all the computer's resources because Windows is the base OS and requires a minimum amount of RAM to keep running. This solution is also not effective for handling large geometries or heavy number crunching.
Using Live USB/CD systems
Another method is by using a Live CD/ USB system. A precondition is that the computer must be able to boot off a USB disk. Modern computers have this facility. Here, the operating system utilises the CD or USB as the primary harddisk with the OS related files. The RAM of the host computer is used for it's functioning. It is also possible to install the OS onto the USB itself, but this is not recommended as it will wear out your USB stick very fast, simply because any such device has a limit on the number of read/write cycles that can be performed on it. The disadvantage here used to be that, changes made to files/ settings were not preserved on shut down. However, this can be overcome by using a Persistent File storage. Since Linux is about customisation, it is recommended to setup persistence and use a Live USB stick rather than a CD. There are several ways to make a USB stick or a CD bootable. Among the more popular windows based solutions are using Universal USB installer or UNetBootin. The above mentioned applications allow you to set a certain amount of 'persistence' on the USB stick. This space will be used to preserve the User settings and all the changes made to the Operating System. Step by step tutorials with screenshots are available on Pen Drive Linux. This method is a lot faster than using a virtual operating system. There may be an initial lag everytime you start up, but since the entire RAM is available for use, the feel of the OS as well the applications could be a lot faster than using a virtual system. With USB 3.0, it could be a much faster process with very less lag due to increased data transfer speeds. With the later versions of Ubuntu, there is a built in option to install the current OS onto a USB drive. The updates installed till date, can be selectively/collectively chosen to be written onto a CD/image and saved, using applications like Apton CD, see this tutorial. Partitions of drives are similar to partition tools inbuilt in windows, eg Gparted. A large pendrive or a Harddisk can easily be partitioned into primary's for OS or space for portable storage, files that you want to take along with your portable OS.
It is also possible to use tools like [www.pendrivelinux.com/yumi-multiboot-usb-creator/ YUMI] for holding multiple Operating Systems on a single pendrive. The current version only allows persistent storage for one of the operating systems. It offers a GUI where the user can choose the Operating Sytem at the time of start up. It also automatically makes groups of the OS based on the kind of distribution or the type. (Eg Windows Based and Linux based).
Dual/Multiple Booting
Dual/Multiple Booting with Windows and Linux is another solution. Open source distributions like those of SUSE and Ubuntu have the option, with an icon on the desktop, to install the OS onto the current Hard Disk. Windows 7, came out with the option of getting installed onto a pendrive. It is anyhow possible to do this using tools mentioned in the previous section, as long as CD/ISO image of the OS is available. Here both the operating systems work independently of each other. It is recommended to install Windows first and then install Linux and use Linux's boot selection software called GRUB. Live systems also provide the option of installing Linux 'within windows', using the Windows boot manager to choose the operating system of choice. The primary partition used by windows is shared by the Linux distribution. However, it should be noted the Windows loader is notorious, with cases reported where a maintenance/repair operation has resulted in the Linux distribution from being deleted from the boot selection.
Current Linux configurations usually are able to identify popular hardware configurations. Official and unoficial drivers for graphics cards exists. But it also can be seen in forums that particular laptop models (Eg : Acer Aspire Timeline 4820TG) with switchable graphics configurations have trouble with the Ubuntu distribution. This has been reported to cause a great deal of increase in the heat generated by the CPU. Applications like 'Jupiter' can be used to control the CPU usage and bring down the heat. Jupiter is basically a software with customisable 'CPU performance' modes (ranging from 'Maximum Performance' to 'Power Saver'. The Power Saver option, has been reported to reduce the temperature by about 5-10 degrees as long as the laptop remains plugged in to a power source (and doesn't have to switch to battery performance).
Useful Linux Distributions
In the past, installing the applications and using the Command Line Interface (CLI) was an issue for users used to the easy Graphical USer Interface (GUI) in windows. There are customised Linux Distributions that solve this issue.
CAE- Linux is an Ubuntu based distribution with a huge number of pre installed applications that cater specifically to the Engineer. Currently, the 2011 edition is only available as a x64 edition though there was an earlier edition (2008) which also had a x32 option. 64 bit architecture is however always preferred and required for serious computational efforts. Though the ubuntu distribution is an older version, (10.04), it is absolutely functional with minimal interference from the interface. The newer Linux distributions are veering more towards designing a slick interface for users to quickly migrate from Windows/Mac. A simpler interface is reccommended to the new user.
GeekoCFD is a SUSE based distribution with pre installed applications. There are far more such applications on CAE-Linux. However, it is possible to customise your linux distribution online, using the SUSE studio to include exactly the applications that you would like in your basic OS installation/setup disc. This disc/configuration can be saved and downloaded as an ISO image, both x32 and x64 versions are available.
OpenFOAM (OF)
OpenFOAM (OF) is a well known solver based on the Finite Volume method and written in C++. More details, including the history and links to the unofficial OF forum/communities can be found in the Related links section and the official website. OF's capabilities don't end with that of being a Finite Volume Solver. A more comprehensive presentation of OF's capabilities can be found at
The [OF Official Website OF also contains a detailed tutorial for Windows users to setup a Virtual Operating system and install OF on it.
For CAE-Linux Users : OF V 2.01 will already be installed. The files will be available in the 'opt' folder (which stands for Optional) that can be viewed in the 'Home' folder. The best way to begin with OF is to start with the User's Guide, which will be available in the 'docs' folder within openFOAM. For the new users and the uninitiated, the guide tutorials should be followed step by step until an understanding can be gained of the work flow. The first step in the tutorial involves copying the tutorial files to the User's own work folder so that the original documents will be available in the 'Opt' folder for reference. The tutorials
As mentioned above, following the openFOAM manual's tutorials provides a good overview of questions related to What/Where/How. It can be noted that efforts and projects are on, to wrap the different solvers available in OpenFOAM with GUI's enabling easier input of boundary/operating conditions. Some simple GUI's already exist for solvers like SimpleFOAM which caters to incompressible laminar flow.
The inbuilt meshing application, 'blockMesh', of OF is quite /primitive/ or difficult to use for complicated geometry. It requires the definition of a geometry by the vertice or face. It is reccommended to couple an application like Salome or GMsh or Elmer to generate the CAD and setup a Mesh. The above mentioned applications are widely preferred and reccomended in online forums. Salome, based on Python also has post processing capabilities, though Paraview is usually the preferred post processor that comes coupled with OpenFoam. Using a python based pre processor has it's advantages as python libraries interfacing with OF are available like PyFOAM and PyFlu which enable the user to input/control/manage/extract data from OpenFOAM. These libraries thus enable hooking up Salome to OpenFOAM and eventually facilitating automated simulation setups.
References
Related Links
Internal:
- Codes section on CFD Wiki - Contains a pretty long list of Free & Commercial codes
- Source Code Archive - CFD Wiki - Donated Source Codes and External Links
- CFD Online - OpenFOAM Forum
External:
Linux Distro's :
- CAE- Linux - Official website of CAE- Linux, an x64 Ubuntu based Linux Distribution with a huge variety of pre installed engineering applications.
- GeekoCFD - A customisable SUSE based distribution with both x64 and x32 versions. Contains a few applications pre installed, but the Live CD can be customised online via SUSE studio.
Learning Linux :
- Learning Linux - a Collation - This is a collection of web resources for learning Linux and gaining some practical skills, such as handling a Command Line Interface.
- Pen Drive Linux - Very useful source of technical articles and tutorials