This is a short instruction to how to install EMSO on last Ubuntu version: 10.04 LTS (codename Lucid Lynx). First of all get the last releases of EMSO and VRTherm here. VRTherm is a thermodynamic properties package that works as a plugin of EMSO. Currently the last ones are emso-beta-linux2-i386-0.10.3.tar.gz and vrtherm-linux2-i386-1.4.2.tar.gz. So that untar them:
user@computer:$ tar xzvf emso-beta-linux2-i386-0.10.3.tar.gz user@computer:$ tar xzvf vrtherm-linux2-i386-1.4.2.tar.gz
If you want to have EMSO and VRTherm available for all users you should copy them to a common place:
Additionally to run all samples you should give write permission to folder /mso/sample (or copy it to your /home folder). EMSO needs to create temporary files to open diagram files (.PFD) otherwise EMSO crashes.
To start using EMSO for all applications you must properly configure the thermodynamic package. Call EMSO and go to “Config” > “Plugins…” and add a plugin calls PP and the path to the file libvrpp.so under /usr/local/vrtherm/libvrpp.so as shown in Figure. Pressing “Add Plugin” and “Ok”, PP will be shown in “Registered Plugins” section above. EMSO will be ready after restart application.
This is the second part of our text “Simulating a dynamic tank in EMSO”. The first part shows the basic theory about EMSO modeling language applied to model a dynamic tank. The code to a single tank was implemented and expanded to a set of tanks in series.
Fig. 1. Dynamic tanks in series.
Last post did the expansion of a single tank to series using codes however, in bigger/more complex systems, it could be hard building. In this sense, it should be more interesting if there is a GUI where a flowsheet (diagram) can be built connecting blocks in a workspace such as in sequential modular simulators (Aspen Plus, HYSYS, etc.)
In EMSO we can attribute an image/icon to a Model adding a new section calls ATTRIBUTES. The reserved keywords in and out are required to promote the input and output data from a model those are physically represented by the inlet and outlet flows (streams). However, in order to take the block connections actived the inlet and outlet flows must be compatible and defined by their own Model. For this purpose the “tank_flow” model was created (lines 3–6).
Thus all connections are compatible but the interface design diagram does not admit a single block for simulation. One block needs at least one input block. For this a block calls “tank_source_test” (lines 8–15) was created using the “tank_flow” model. So it represents a source block that gets the flowsheet started.
using"types";
Model tank_flow
VARIABLES
F as flow_vol (Brief="Flow");
endModel tank_source_test
ATTRIBUTESPallete = true;
Icon = "source_icon";
VARIABLESout Outlet as tank_flow (Brief="Inlet stream", PosX=1, PosY=0.65);
endModel simple_tank_test
ATTRIBUTESPallete = true;
Icon = "tank_icon";
PARAMETERS
k asReal(Brief="Valve constant", Default=4, Unit='m^2.5/h');
A as area (Brief="Tank area", Default=2);
VARIABLESin Inlet as tank_flow (Brief="Input flow", PosX=0, PosY=0.17);
out Outlet as tank_flow (Brief="Output flow", PosX=1, PosY=0.94);
h as length (Brief="Tank level");
EQUATIONS"Material balance"diff(A*h) = Inlet.F - Outlet.F;
"Valve equation"
Outlet.F = k*sqrt(h);
end
Therefore “tank_source_test” (lines 8–15) and “simple_tank_test” (lines 17–37) define the blocks that would be loading on the pallete in Model tab according to their ATTRIBUTES sections. Icon gives the icon as a PNG image (source_icon.png, tank_icon.png) so that Pallete set as true means that the related icon is loaded on the EMSO pallete (Model tab). PosX and PosY guide the positions for point connections.
Adding our work folder to EMSO library (Config > Libraries > Add Library) and restarting it, we will be the new blocks loaded on the EMSO pallete of equipments.
Now let us build the flowsheet of 2 tanks as in last post. Firstly create a new file of type “Diagram” so that a “Diagram setup” window will open to editing properties. Go to “Options” tab and set start time, end time, and step time respectively as 0, 2, 0.1 hours. Hereafter it already possible to build the flowsheet using the blocks and connections. After that you will be something like Fig. 2.
Fig. 2. Flowsheet diagram
Double clicks on blocks in the diagram open the editing properties. For this case you must specify the inlet flowrate and the initial level for the 2 tanks.
For “tank_source”, the variable Outlet.F is specified as 10 m3/h. For “tank_1” and “tank_2”, the variables h are initialized both as 1 m.
Checking the consistency of problem and running the plot results for the outlet tank flowrates will be as shown in Fig. 3.
The OpenFOAM (Open Field Operation and Manipulation) is an open source CFD toolbox produced by OpenCFD Ltd from UK. It can simulate anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to solid dynamics, electromagnetics and the pricing of financial options.
The core technology of OpenFOAM is a flexible set of efficient C++ modules. These are used to build a wealth of: solvers, to simulate specific problems in engineering mechanics; utilities, to perform pre– and post-processing tasks ranging from simple data manipulations to visualisation and mesh processing; libraries, to create toolboxes that are accessible to the solvers/utilities, such as libraries of physical models.
An extensive set of OpenFOAM solvers has evolved (and is forever growing) that are available to users. Below is the list of solvers available:
Basic CFD
Incompressible, compressible, and multiphase flows
Direct numerical simulation (DNS) and large eddy simulation (LES)
Combustion
Heat transfer and buoyancy-driven flows
Particle-tracking flows
Molecular dynamics methods
Electromagnetics
Stress analysis of solids
Finance
OpenCFD develops OpenFOAM in the Linux/UNIX operating system because they believe it is the best platform for this kind of high end simulation code development and operation. However OpenFOAM is open source software so people can freely compile it on any operating system they choose. Most users are running Linux, so officially it is offered the download of binaries for selected Linux systems (32/64bits).
If you are a Windows user and you have never used Linux before I have a personal tip. You should test OpenFOAM by means of a Linux LiveDVD. A liveDVD is DVD containing a bootable computer operating system. Specifically there is a special distribution of Linux dedicated to computer aided engineering: CAELinux. So that you can download the image file (.ISO) of last release to your system (32/64bits) and burn it in a DVD. After you must boot your computer starting from the DVD rather than from the hard drive. CAELinux comes with OpenFOAM installed by default (see Features section). Once liveDVD has many video tutorials to instruction it becomes easy getting start OpenFOAM.