Skip to content

Quick start

Tim Greaves edited this page Apr 23, 2017 · 3 revisions

Installing fluidity

Fluidity supports Enterprise Linux (CentOS and Red Hat), and Ubuntu LTS for binary installers. Find instructions in the relevant FAQ:

This will install Fluidity as well as the key additional software (such as diamond and gmsh) needed to set up and run Fluidity. Your computer should now be set up to run Fluidity!

Using diamond to create a flml file that is input into Fluidity

The options file that is input into Fluidity uses spud. There is more information on spud in the libspud manual, which can be downloaded from this link.

The .flml input files may be created and edited using diamond.

First open diamond in the directory that you wish to run your problem from. Type:

 diamond foo.flml

This will open the file foo.flml or create a new file called foo.flml if it does not already exist. You may wish to run a test first. These are available in the tests directory in your fluidity folder. When you open diamond, all the options that need to be filled in are highlighted in blue. If you open a new flml file it will look like this:

New FLML

If you click on the arrows at the left hand side, more options will be displayed underneath. The greyed out options are switched off. To switch them on, click on the plus signs at the right hand side. The blue options are switched on, but still need values filling in - do not run Fluidity with some options blue. Black options are complete. The asterisk next to the file name is an indication that the file is unsaved. To save after adding a number or value, either click on store data and then file / save, or type control s.

Setting up a simple problem

This section will focus on a simple small-scale fluid dynamics problem with no rotation. In order to set up a simple P1P1 (polynomial order one), continuous galerkin problem you need certain options to be set.

  • The simulation name is just a name that you choose. Your output vtu files will be given this name.
  • For the simplest problems, the problem type should be fluids or oceans - these problem types are just for options checks (checks that fluidity does before it runs to see whether you options are compatible with each other or compatible with the type of problem that you are running)

===Options under geometry===

  • The dimension is 2 or 3 - it can only be set once, you can't change it later.
  • The Coordiante mesh is read in from a file. Type in the name of the file under the from_file option. A number of mesh formats are accepted, the type must be defined in the from_file/format option.
  • For P1P1 the CoordinateMesh is the only mesh you need. For P1DGP2 you will need other meshes.
  • The geostrophic pressure uses a mesh of order one greater than the order of the velocity mesh. In the P1P1 case, this is 2. Create a mesh called GeostrophicPressureMesh and select polynomial order one,
  • Set the quadrature degree to 3

Velocity Pressure mesh

IO and timestepping options

  • io contains options on the dump period (the amount of time or number of timesteps between vtu dumps) and checkpointing. Checkpointing is the option to save mesh files as well as a flml and vtus of the fields at a particular point in the simulation so that you can start it again from that point.
  • Timestepping options include the timestep and start time etc, they are fairly self-explanatory

Material Phase

  • There can be more than one material phase for multiphase flow, but for simple problems and many ocean problems there is only one.
  • The Velocity is the only field selected by default. It is a prognostic field (the momentum equation is solved for velocity as detailed in the Fluidity manual). You would normally add pressure and also one or more tracers (scalar fields such as temperature and salinity). These are added in the normal way (by clicking on the plus signs) and all the options that must be filled in are coloured blue.
  • The density field will not affect your results. If you wish you can set it as a diagnostic field (this will calculate the value of the density from the other fields, it will not solve an equation for density).
  • You may want geostrophic pressure setting.

You will have to set initial conditions for the fields, which can be done using Initialise from python or Initialise from file.

You also need to set solvers. More information on this is available in the manual.

More information on the options is available in the manual Chapter "Configuring Fluidity". Also see the sections on particular problem types at the end of this chapter.

There is more information on the finite element method and fluidity in the femtools manual:

 <<fluidity_source_path>>/femtools/doc/femtools_manual.pdf

Generating a mesh

To generate a mesh you can use gmsh which was installed as a dependency of the Fluidity package.

The mesh that you generate is read into Fluidity under geometry as detailed above. You will have five files with different file extensions. Just give the name of the mesh without the file extensions.

if you already have a .geo file (foo.geo say), eg from a test, you can make the other files you need by typing

 gmsh -2 foo.geo

in 2d, or

 gmsh -3 foo.geo

in 3d.

Running fluidity

To run fluidity, type

 <<fluidity_source_path>>/bin/fluidity foo.flml 

Alternatively, you can also use the options -v3, -v2 or -v for different levels of verbosity. You can use -l to create a log file:

 <<fluidity_source_path>>/bin/fluidity foo.flml  -v3 -l

Visualising the output

Fluidity outputs vtu files at times determined by the dump period. They contain values of all the fields at each node in the mesh. These can be visualised in paraview. The data can also be processed using vtktools.

A stat file will also be created. This contains information about all the fields at each timestep, normally the maximum, minimum, integral and L2 norm. It can be processed using stat parser or stat plot.

Clone this wiki locally