Fluent
Fluent is a computational fluid dynamics (CFD) application. On Hamilton it is accessed via the ansys module and can be run either interactively or in a batch job.
Fluent batch jobs
Most long and intensive Fluent sessions should be run as batch jobs. In order to run Fluent in a batch job, you will need two files:
- A Fluent journal (.jou) file.
This is a text file that contains the list of Fluent commands to be run, ie. the commands you would type in the GUI or TUI if working interactively. The journal file should not contain commands to display graphical windows as batch jobs are unable to do this. - A batch script.
This is also a text file. It lists the resources needed for your computation and the linux commands you want to run. An example batch script is given below. The example uses shared-memory parallelisation, which is Fluent’s default.
#!/bin/bash
# The #SBATCH lines specify the resources required. Adjust to suit your case.
#SBATCH –c 1 # number of CPU cores, up to 128
#SBATCH --mem=1G # memory required, up to 246G
#SBATCH –t 00-01:00:00 # job time limit, normally up to 3 days
#SBATCH –p shared # queue name. ‘Shared’ is usually appropriate
# Load an ansys module. The command 'module avail ansys' will list alternative versionsmodule load ansys/24.2
# Run Fluent. This example script uses the following Fluent options:
# 3ddp = 3D, double precision. Alternatives are 3d, 2ddp,2d# -i your_filename = input file. Replace with your own input filename.
# -t = number of parallel processes. Leave this as $SLURM_CPUS_PER_TASK
# for shared-memory parallelisation
# -g = run without graphical interface. Required for batch jobs
fluent -t$SLURM_CPUS_PER_TASK 3ddp -g -i your_filename.jou
Once you have created your .jou file and batch script, submit the computation as a batch job by typing:
sbatch <your batch script filename>
Fluent interactive jobs.
Fluent can be run interactively on Hamilton, but interactive sessions are best run on compute nodes rather than on the login nodes as they can use considerable resources. In order to run Fluent this way, you will need to:
- Connect to Hamilton in a way that allows you to open graphical windows. While there are many ways to connect successfully, you may wish to try x2go for good performance.
- Once you have connected to Hamilton, start an interactive Slurm job that requests the resources your Fluent session will need. For example:
srun --pty --x11 –c 1 –mem=1G –t 1:00:00 bash
The options “--pty --x11" are required. This example requests 1 CPU core, 1GB memory and 1 hour but you will need to specify sufficient resources for your work.
Note that at peak times there may not immediately be space free for your job, so you may have to wait before it starts.
- When the interactive job starts, your prompt will change to show the name of a compute node, such as cn001, instead of a login node. Start Fluent on the compute node by typing:
module load ansys/24.2
fluent
If you wish to use a different version, the command module avail ansys will list the versions available.
- When you have finished with your interactive Fluent session:
- In the Fluent interface, go to
File -> Exit
- At your compute node command prompt, type exit to end the interactive job and return to the login node.
- In the Fluent interface, go to