EMSO Installation on Ubuntu 10.04 32 bit

This is a short instruc­tion to how to install EMSO on last Ubuntu ver­sion: 10.04 LTS (code­name Lucid Lynx). First of all get the last releases of EMSO and VRTherm here. VRTherm is a ther­mo­dy­namic prop­er­ties pack­age that works as a plu­gin of EMSO. Cur­rently 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 avail­able for all users you should copy them to a com­mon place:

user@computer:$ sudo cp –r emso /usr/local
user@computer:$ sudo cp –r dist/vrtherm /usr/local

And cre­ate sym­bolic links to call EMSO and VRTherm:

user@computer:$ sudo ln –s /usr/local/emso/bin/emso /usr/local/bin/emso
user@computer:$ sudo ln –s /usr/local/vrtherm/vrtherm /usr/local/bin/vrtherm

So you can call them any­where by typ­ing in the terminal:

user@computer:$ emso
user@computer:$ vrtherm

Let’s start get­ting all the pack­ages nec­es­sary from Ubuntu repository.

user@computer:$ sudo apt-get install libumfpack5.4.0 libxml++2.6–2 libxerces-c28 libsuitesparse-metis-3.1.0

And finally the libfox1.4 pack­age must be tak­ing from an old repos­i­tory. It is essen­tial to run EMSO and VRTherm promptly:

user@computer:$ wget –c http://archive.ubuntu.com/ubuntu/pool/universe/f/fox1.4/libfox1.4_1.4.34-1ubuntu1_i386.deb
user@computer:$ sudo dpkg –i libfox1.4_1.4.34-1ubuntu1_i386.deb

Addi­tion­ally to run all sam­ples you should give write per­mis­sion to folder /mso/sample (or copy it to your /home folder). EMSO needs to cre­ate tem­po­rary files to open dia­gram files (.PFD) oth­er­wise EMSO crashes.

user@computer:$ sudo chmod 771 –R /usr/local/emso/mso/sample

Plugins Configuration
To start using EMSO for all appli­ca­tions you must prop­erly con­fig­ure the ther­mo­dy­namic pack­age. Call EMSO and go to “Con­fig” > “Plu­g­ins…” and add a plu­gin calls PP and the path to the file libvrpp.so under /usr/local/vrtherm/libvrpp.so as shown in Fig­ure. Press­ing “Add Plu­gin” and “Ok”, PP will be shown in “Reg­is­tered Plu­g­ins” sec­tion above. EMSO will be ready after restart application.

Simulating dynamic tanks in EMSO (Part 2)

This is the sec­ond part of our text “Sim­u­lat­ing a dynamic tank in EMSO”. The first part shows the basic the­ory about EMSO mod­el­ing lan­guage applied to model a dynamic tank. The code to a sin­gle tank was imple­mented and expanded to a set of tanks in series.

Fig. 1. Dynamic tanks in series.

Fig. 1. Dynamic tanks in series.

Last post did the expan­sion of a sin­gle tank to series using codes how­ever, in bigger/more com­plex sys­tems, it could be hard build­ing. In this sense, it should be more inter­est­ing if there is a GUI where a flow­sheet (dia­gram) can be built con­nect­ing blocks in a work­space such as in sequen­tial mod­u­lar sim­u­la­tors (Aspen Plus, HYSYS, etc.)

In EMSO we can attribute an image/icon to a Model adding a new sec­tion calls ATTRIBUTES. The reserved key­words in and out are required to pro­mote the input and out­put data from a model those are phys­i­cally rep­re­sented by the inlet and out­let flows (streams). How­ever, in order to take the block con­nec­tions actived the inlet and out­let flows must be com­pat­i­ble and defined by their own Model. For this pur­pose the “tank_flow” model was cre­ated (lines 3–6).

Thus all con­nec­tions are com­pat­i­ble but the inter­face design dia­gram does not admit a sin­gle block for sim­u­la­tion. One block needs at least one input block. For this a block calls “tank_source_test” (lines 8–15) was cre­ated using the “tank_flow” model. So it rep­re­sents a source block that gets the flow­sheet started.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using "types";
 
Model tank_flow
    VARIABLES
    F as flow_vol (Brief="Flow");
end
 
Model tank_source_test
    ATTRIBUTES
    Pallete = true;
    Icon = "source_icon";
 
    VARIABLES
out Outlet as tank_flow (Brief="Inlet stream", PosX=1, PosY=0.65);
end
 
Model simple_tank_test
    ATTRIBUTES
    Pallete = true;
    Icon = "tank_icon";
 
    PARAMETERS
    k as Real (Brief="Valve constant", Default=4, Unit='m^2.5/h');
    A as area (Brief="Tank area", Default=2);
 
    VARIABLES
in  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

There­fore “tank_source_test” (lines 8–15) and “simple_tank_test” (lines 17–37) define the blocks that would be load­ing on the pal­lete in Model tab accord­ing to their ATTRIBUTES sec­tions. Icon gives the icon as a PNG image (source_icon.png, tank_icon.png) so that Pal­lete set as true means that the related icon is loaded on the EMSO pal­lete (Model tab). PosX and PosY guide the posi­tions for point con­nec­tions.
Adding our work folder to EMSO library (Con­fig > Libraries > Add Library) and restart­ing it, we will be the new blocks loaded on the EMSO pal­lete of equip­ments.
Now let us build the flow­sheet of 2 tanks as in last post. Firstly cre­ate a new file of type “Dia­gram” so that a “Dia­gram setup” win­dow will open to edit­ing prop­er­ties. Go to “Options” tab and set start time, end time, and step time respec­tively as 0, 2, 0.1 hours. Here­after it already pos­si­ble to build the flow­sheet using the blocks and con­nec­tions. After that you will be some­thing like Fig. 2.

Fig. 2. Flow­sheet diagram

Dou­ble clicks on blocks in the dia­gram open the edit­ing prop­er­ties. For this case you must spec­ify the inlet flowrate and the ini­tial level for the 2 tanks.

For “tank_source”, the vari­able Outlet.F is spec­i­fied as 10 m3/h. For “tank_1” and “tank_2”, the vari­ables h are ini­tial­ized both as 1 m.

Check­ing the con­sis­tency of prob­lem and run­ning the plot results for the out­let tank flowrates will be as shown in Fig. 3.

Fig. 3. Plot results

OpenFOAM

openfoam

The Open­FOAM (Open Field Oper­a­tion and Manip­u­la­tion) is an open source CFD tool­box pro­duced by OpenCFD Ltd from UK. It can sim­u­late any­thing from com­plex fluid flows involv­ing chem­i­cal reac­tions, tur­bu­lence and heat trans­fer, to solid dynam­ics, elec­tro­mag­net­ics and the pric­ing of finan­cial options.

The core tech­nol­ogy of Open­FOAM is a flex­i­ble set of effi­cient C++ mod­ules. These are used to build a wealth of: solvers, to sim­u­late spe­cific prob­lems in engi­neer­ing mechan­ics; util­i­ties, to per­form pre– and post-processing tasks rang­ing from sim­ple data manip­u­la­tions to visu­al­i­sa­tion and mesh pro­cess­ing; libraries, to cre­ate tool­boxes that are acces­si­ble to the solvers/utilities, such as libraries of phys­i­cal models.

An exten­sive set of Open­FOAM solvers has evolved (and is for­ever grow­ing) that are avail­able to users. Below is the list of solvers available:

  • Basic CFD
  • Incom­press­ible, com­press­ible, and mul­ti­phase flows
  • Direct numer­i­cal sim­u­la­tion (DNS) and large eddy sim­u­la­tion (LES)
  • Com­bus­tion
  • Heat trans­fer and buoyancy-driven flows
  • Particle-tracking flows
  • Mol­e­c­u­lar dynam­ics methods
  • Elec­tro­mag­net­ics
  • Stress analy­sis of solids
  • Finance

OpenCFD devel­ops Open­FOAM in the Linux/UNIX oper­at­ing sys­tem because they believe it is the best plat­form for this kind of high end sim­u­la­tion code devel­op­ment and oper­a­tion. How­ever Open­FOAM is open source soft­ware so peo­ple can freely com­pile it on any oper­at­ing sys­tem they choose. Most users are run­ning Linux, so offi­cially it is offered the down­load of bina­ries for selected Linux sys­tems (32/64bits).

If you are a Win­dows user and you have never used Linux before I have a per­sonal tip. You should test Open­FOAM by means of a Linux LiveDVD. A liveDVD is DVD con­tain­ing a bootable com­puter oper­at­ing sys­tem. Specif­i­cally there is a spe­cial dis­tri­b­u­tion of Linux ded­i­cated to com­puter aided engi­neer­ing: CAELinux. So that you can down­load the image file (.ISO) of last release to your sys­tem (32/64bits) and burn it in a DVD. After you must boot your com­puter start­ing from the DVD rather than from the hard drive. CAELinux comes with Open­FOAM installed by default (see Fea­tures sec­tion). Once liveDVD has many video tuto­ri­als to instruc­tion it becomes easy get­ting start OpenFOAM.

Project web­site:

Screen­shots:


paraview

Par­aView interface

Video sam­ple:

  • High Reynolds num­ber flow over cir­cu­lar cylinder

  • Slosh6DOF: OpenFoam-1.5 tutorial

Related Posts with Thumbnails