- Akademische Forschung und Lehre
- Geräte des KIT
- Mitarbeiter des KIT
- Studierende des KIT (auch auf privaten Geräten)
- siehe Lizenzbedingungen
-
ANSYS FLUENT
-
ANSYS FLUENT is a finite volume program (CFD program) for the calculation of flow problems.
- Contact:
- Contact Person:
- Services:
ANSYS FLUENT
ANSYS FLUENT is a finite volume program for the calculation of all kinds of flow problems. Some of the program features are:
- steady-state, transient
- incompressible, compressible
- laminar, turbulent
- multiphase flow (fluid-fluid, fluid-solid)
- Newtonian and non-Newtonian fluids
- free surfaces
- coupled heat conduction and convection
- moving grids
- chem. reactions, burnings
- and much more.
FLUENT offers a surface, over which all necessary information for
- boundary conditions
- solvers
- solution control
can be entered. At the same time, the results can be displayed and visualized.
FLUENT is available together with other ANSYS products like ANSYS CFX, ANSYS Mechanical in the ANSYS Workbench which is a complete development environment for CFD or structural models. The functionalities of the preprocessors of older versions, such as GAMBIT, TGrid and others have been adopted in the Workbench modules DesignModeler and ANSYS-Meshing. More sophisticated post-processing of ANSYS calculation results can be done with CFD-Post, the common post-processor for ANSYS CFX and ANSYS FLUENT.
Fluent is installed centrally at SCC on the bwUniCluster (UC2), but is also available to all institutes for local installation.
License restrictions
Academic Usage
For Program(s) which contain the terms Academic, Associate, Research, EduPack or Teaching in the Program Name (hereinafter, “Academic Program(s)”), the following terms shall apply:
- The analysis work performed with the Academic Program(s) must be non-proprietary work.
- Licensee and its Contract Users must be or be affiliated with an academic facility. In addition to its employees and Contract Users, Licensee may permit individuals who are students at such academic facility to access and use the Academic Program(s). Such students will be considered Contract Users of Licensee.
- The Academic Program(s) may not be used for competitive analysis (such as benchmarking) or for any commercial activity, including consulting.
- Notwithstanding any terms of the Agreement to the contrary, Academic Program(s) may be accessed and used by Licensee at the Designated Site or any other location within a 50 mile/80 kilometer radius of the Designated Site. Academic Program(s) with Ansys Academic Multiphysics Campus Solutions and/or Academic Extended LAN in place (as may be identified in the License Form or Quotation) may be accessed and used by Licensee at the Designated Site or any other location within the same country as the Designated Site; provided, however, that (i) such access and use is and shall remain subject to Export Laws, (ii) Licensee is expressly prohibited from accessing or using the Academic Program(s) at or within any U.S. embargoed country or area; and (iii) access and use of the Academic Program(s) shall be limited to Licensee’s employees and Contract Users (including students) who are based and/or registered to attend classes at the Designated Site. Such limitations apply to any access and/or use of the Academic Program(s), including, but not limited to, access via a VPN connection or through license borrowing.
- TECS for the Academic Program(s) will be provided at the sole discretion of Licensor and/or its Affiliates and/or Channel Partners. In the event TECS is provided, all Customer Support requests must be initiated via the Ansys Learning Forum at www.ansys.com/forum, and Section 9 TECS of the Agreement shall apply.
Academic Program(s) which contain the term "Associate" in the Program Name may only be used for non-proprietary industry related research, degree and/or non-degree related research, student instruction, student projects, and student demonstrations.
Academic Program(s) which contain the term "Research" in the Program Name may only be used for non-proprietary degree and/or non-degree related research, student instruction, student projects, and student demonstrations.
Academic Program(s) which contain the term "Teaching" or “EduPack” in the Program Name as well as any free student downloads may only be used for student instruction, student projects, and student demonstrations.
Academic Program(s) which contain the term “Academic” or “Tools” but do not contain the terms "Associate", "Research", “EduPack” or "Teaching" in the Program Name assume the terms of use of the Academic Program(s) it is used with. When used as a standalone program, or if the Program(s) are not associated with any other Academic Program(s), the Program may only be used for degree and/or non-degree related research, student instruction, student projects, and student demonstrations.
Academic Program(s) which contain the term "Campus Solution" in the Program name contain combinations of Academic Research and Academic Teaching Products, and as such each of these component products must be used in accordance with the Academic Research & Academic Teaching terms of use described above.
Where Licensee is using the Academic Program(s) for research projects, Licensee will, if requested by Licensor, submit a Case Study prior to the end of the License Term. The Case Study will be in English, contain a title and an abstract, and include: (1) the purpose of the study; (2) the approach used to conduct the study; (3) the results obtained; (4) the conclusion as to the results obtained versus the objective of the study; (5) how the Academic Program(s) contributed to the study; (6) three color graphics of the model and meshes; and (7) the Academic Program(s) input files or session log file.
FLUENT Quick Start Guide
Table of Contents
Introduction
FLUENT System
FLUENTFiles
FLUENTcall
FLUENTcall on the Linux clusters of the SCC
Creating a FLUENT command file
User Defined Functions (UDF) in FLUENT
Introduction
FLUENT is a finite volume program for the calculation of flow problems. The problems that can be treated can be paraphrased as follows:
- isothermal: the energy equation is not solved
- non-isothermal: the energy equation is solved
- compressible and non-compressible fluids
- laminar and turbulent flows
- steady and unsteady flows
- Newtonian and non-Newtonian fluids
- multiphase flows (fluid-fluid, fluid-solid)
- coupled heat conduction and convection
- moving grids
- free surfaces
- chemical reactions, combustion processes
For a more intensive description, please refer to the FLUENT documentation.
FLUENT System
FLUENT can be used as a standalone application, but also as an integral module within ANSYS Workbench. In this quick guide we focus on the first aspect. The following graphic outlines the workflow of a FLUENT project:
HyperMesh is a modeler and mesher that can create or import the most important solver formats. In addition, GAMBIT and TGrid can be used to create FLUENT meshes until further notice. Information about this can be found here. There are other "Third Party" systems, but we limit ourselves here to the conditions at the SCC.
FLUENT Files
FLUENT works with the following files:
id.msh | is a file that contains the mesh information. It is generated within the Workbench or by ICEM_CFD, HyperMesh, GAMBIT and other preprocessors. |
id.cas | is the extended mesh file containing further model information entered during a FLUENT session |
id.dat | contains the calculation results, which must also be read in for post-processing |
id.ps .... |
various formats in which the graphics can be output, including PostScript, EPS, RGB, GIF, TIFF, PPM, TARGA, PICT, HPGL, Window Dump |
.cxlayout | is a file in the HOME directory where the layout of the graphical user interface is stored. In later sessions of FLUENT, FLUENT/Post, TGRID this file is taken as a template. This file is created by Save Layout in the File menu. |
bel. Name | During a FLUENT session a journal file and a transcript file can be created or a journal file can be read. |
FLUENT call
The list of options when calling FLUENT is very long, most of them are not interesting or valid for us. So here are only those that are of importance to and:
fluent | [version] |
[-driverx11|openglnull] | |
[-i journalfile] | |
[-g][-gu][-gr] |
with the meaning
version
2d |
specifies the FLUENT version to be executed:
two-dimensional problem |
g | neither the graphical user interface is opened, nor graphical functions are executed |
gu | the graphical user interface is not opened, pure command mode |
gr | no graphics are generated |
driver | sets the graphics driver; by default the OpenGL driver is set, but if it is not installed, the X11 driver is used |
i | a journal file is read and executed |
If neither the -g nor the -gu option is set, the FLUENT Launcher opens, where important default settings can be made:
If you click "Start With Selected Options", the actual FLUENT graphical user interface appears.
FLUENT call on the Linux clusters of the SCC
On the Linux cluster bwUniCluster a module concept is used. To use ANSYS, you must first load the appropriate module. You get all available software modules by calling
module avail
typing. To load the module of the current version of ANSYS, enter the following on the bwUniCluster:
module load cae/ansys
You can also load the module with the desired version number, e.g.
module load cae/ansys/2023R2
On the Linux clusters of the SCC, the execution of FLUENT should be under the control of a job management system that provides the computing resources for the FLUENT job. To simplify the use of FLUENT on these clusters, the startup script 'fluentjob' was provided. The call to the solver for the bwUniCluster is thus:
fluentjob -v version -j name -t cpu-time -m memory [-p procs][-n nodes][-q queue]
The meaning of the parameters is the following:
version | is the dimension/accuracy: 2d, 3d, 2ddp, 3ddp |
name | command file, contains FLUENT commands for initialization and calling the solver |
cpu-time | is the requested CPU time in minutes |
memory | is the requested main memory in MByte |
procs | number of processors |
nodes | Number of nodes |
queue | queue class / partition |
An example to start a Fluent parallel job on two nodes and 40 processors with 90.000 MB memory for 120 minutes:
fluentjob -v 3d -j test -t 120 -n 2 -p 40 -m 90000
The call of FLUENT can also be done by script. Here below a script "run_fluent.sh", how to start a FLUENT computation in parallel on two nodes with 40 processors each on thebwUniCluster:
1. with IntelMPI:
#!/bin/sh
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=40
#SBATCH --time=2:00:00
#SBATCH --mem=90gb
#SBATCH --partition=multiple
module load cae/ansys/2023R2
source fluentinit
scontrol show hostname ${SLURM_JOB_NODELIST} > fluent.hosts
time fluent 3d -mpi=intel -pib -g -t80 -cnf=fluent.hosts -i test.inp
2. with OpenMPI:
#!/bin/sh
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=40
#SBATCH --time=2:00:00
#SBATCH --mem=90gb
#SBATCH --partition=multiple
module load cae/ansys/2023R2
source fluentinit
scontrol show hostname ${SLURM_JOB_NODELIST} > fluent.hosts
time fluent 3d -mpi=openmpi -g -t80 -cnf=fluent.hosts -i test.inp
To submit the script to the job management system, execute the following
sbatch run_fluent.sh
For more information about the batch system of the respective clusters, see these links:
Creating a FLUENT command file
The FLUENT window allows FLUENT input via mouse-driven menus, but one can also, although more tedious, input via keyboard in command mode. Input via commands must be made available in a file in the case of a batch run. The journal file can contribute to this, but it must also be a log file resulting from a session in command mode, otherwise information about the user interface is included.
The simplest procedure, which then leads to a standard command file, is the following:
- One prepares the model completely, except for the initialization via the menus Solver -> Initialize... --> Initialize and Solver --> Iterate... --> I terate.
- The reading of the .cas file, the initialization, the start of the solver and the writing out of the results are then initiated by the command file, which is read in the fluentjob.
-
Post-processing is then again done interactively.
Example:
The FLUENT model is called cavity.cas. The following commands are in the cavity.inp file
file/rc cavity.cas | the file cavity.cas is read in |
solve/init | it is jumped to the Initialize submenu ofSolve |
s-d | set defaults |
x 1 | initial velocity in x-direction is set to 1 |
q | Return |
if | the program jumps to the Initialize ... submenu of Solve |
q | return to |
solve/iterate 10 | jumps to the iterate submenu of Solve and performs 10 iterations |
q | return to |
file/wcd cavity.cas | in the file menu case and data files are stored |
y | |
exit |
A corresponding call would then be e.g.
fluentjob -v 2d -j cavity.inp -n 1 -p 10 -t 10 -m 40000
Information about the FLUENT commands can be found in the FLUENT Users Guide.
User Defined Functions (UDF) in FLUENT
In FLUENT it is possible to access the solver during the solution phase. This is done via C programs to be created by the user, which directly influence the solution process via standard interfaces, the DEFINE macros, using special data types. UDFs are available for
- Boundary conditions: Profiles for velocities, temperature, turbulence, species.
- sources: Masses, momentum, energy, turbulence, species
- Material properties: viscosity, conductivity, density, etc.
- Initial conditions
- global functions
- scalar functions
- model specific functions: reaction rates, turbulent viscosity, discrete phase models.
A detailed description and examples can be found in the UDF manual.
UDFs can be integrated into a model in 2 ways, as interpreted UDF or compiled UDF.
Interpreted UDF | Compiled UDF |
The UDF is read and executed line by line by an interpreter at runtime. | The UDF is compiled before the FLUENT job and bound with the FLUENT libraries. |
Advantage: |
Advantage: Fast, efficient, no functional limitations |
Disadvantage: Slow and relatively large main memory requirements |
Disadvantage: Dependent on operating system and third party compiler |
Under the graphic surface the UDFs are merged over the menu sequence Define --> User-Defined --> Functions --> Compiled or Interpreted. They are "linked" into the model, depending upon type over the Define menu and then Boundary Conditions ... ,Cell Zone Conditions... , Materials ... etc. There is also a special menu Define --> User-Defined --> Function Hooks... which is used to hook functions and initial conditions. Again, a detailed description can be found in the UDF manual.
Afterwards the FLUENT model can be further prepared and the .cas file can be saved. When this .cas file is opened in subsequent FLUENT sessions, the UDFs are ready for use without further action. If a journal file was logged during preparation, it can again be used as the basis for a batch input file to start the FLUENT job on the Linux clusters of the SCC under fluentjob.
The procedure described above can also be done in command line format (see example below), so that an input file for fluentjob can be generated to run the whole thing in batch on the SCC clusters.
In the case of compiled UDFs, the translation and loading can also be done outside FLUENT. This has the advantage, especially in the development and testing of the UDF, that everything takes place at the operating system level, so it is faster. If the UDF is error-free and integrated in FLUENT, no UDF-specific input is required in the batch input file. Thus, this variant is the most flexible.
Example
The following example demonstrates what has been said above. It is described in detail in the UDF manual under the examples in chapter 8.2.4. It is a bent tube, one half of which along the axis consists of a porous material, in which a gas consisting of a species a and flowing in from the left is converted into a gas of species b according to a reaction rate. This reaction rate must be formulated as a UDF and is to be included in the model as a compiled UDF. The model is 2-dimensional.
The model is already available in the file rate.cas. The UDF rate.c looks like this
/******************************************************************/
/* */
/* Custom Reaction Rate */
/* RALF 5.0 */
/* */
/* Authors: Heather Andrews and Eric Bish */
/* Date: February 1998 */
/* */
/******************************************************************/
#include "udf.h"
#define K1 2.0e-2
#define K2 5.
DEFINE_VR_RATE(user_rate, cell, thread, r, mole_weight, species_mf, rate, rr_t)
{
float s1 = species_mf[0];
float mw1 = mole_weight[0];
if (FLUID_THREAD_P(thread) && THREAD_VAR(thread).fluid.porous)
*rate = K1*s1/pow((1.+K2*s1),2.0)/mw1;
else
*rate = 0.;
}
Interactive via graphical user interface
After calling FLUENT and reading rate.cas start Define --> User-Defined --> Compiled . ..
Via the Add... button you select rate.c and by default libudf is entered as name for the shared library to be created. With Build you start the Compile/Load process and with Load the just created shared library libudf is loaded into the model. The further procedure can be found in the UDF Manual Chap. 6.2.33 Hooking DEFINE_VR_RATE UDFs. Via Models --> Species --> Edit the following setting should have been done before and saved in rate.cas:
and via Define --> User-Defined --> Function Hooks ... you select the UDF user_rate, as the name was defined in rate.c.
Note that the shared library containing user_rate is also displayed. It remains to initialize and start the solver in the solver menu. One result, the proportion of species a, can be seen in the following contour plot:
Via command line
file/rc rate.cas define/user-defined/compiled-functions/compile libudf yes rate.c define/user-defined/compiled-functions/load libudf q |
Read in rate.cas |
The empty lines correspond to the pressing of the return key. If the job is to be further calculated, e.g. further iterations, or with other initial conditions, the following is sufficient as input file
file/rc rate.cas
solve/init
s-d
x 0.1
q
if
q
solve/iterate 50
q
file/wcd rate.cas
y
exit
Compile/Load on Linux level
The following description refers to the SCC cluster. On the working directory, which is the directory where the case file rate.cas is located, the following directory structure is built and Makefiles are copied:
mkdir libudf
cd libudf
cp /software/all/ansys_inc13/v130/fluent/fluent13.0.0/src/makefile.udf2 Makefile
mkdir src
cd src
cp /software/all/ansys_inc13/v130/fluent/fluent13.0.0/src/makefile.udf makefile
cd ..
mkdir lnamd64
cd lnamd64
In the subdirectory lnamd64 (the name corresponds to the Linux architecture) subdirectories are now created, depending on dimensionality and precision, i.e. one of
2d 2dp 3d 3dp
and if parallelized computation is to be performed, also
2d_host and 2d_node
or
3d_host and 3d_node
Afterwards the UDF rate.c is copied to src and in makefile the two variables
SOURCE=rate.c
FLUENT_INC=/software/all/ansys_inc13/v130/fluent
are set. Then go to the subdirectory libudf and start
make "FLUENT_ARCH=lnamd64".
The UDF is compiled and the library libudf is created. Afterwards the directory structure looks like this:
The shared library libudf only has to be loaded and the function hooks have to be set up (see above).
ANSYS Installation Guide
KIT members can download the software and the installation manual directly from our ftp server
https://ftp.scc.kit.edu/pub/campus/ANSYS/.
From the campus network you can also download directly via
CIFS: \\sccfs.scc.kit.edu\Service\SCC\sccfs-ftp\pub\campus resp.
NFS: sccfs.scc.kit.edu:/Service/SCC/sccfs-ftp/pub/campus.
The following directories contain the corresponding installation files in ISO, TAR, or ZIP format:
LINX64 ................... Linux, 64 Bit
WIN64 .................... Windows, 64 bit
A 32 bit version is no longer available.
In the Documentation directory you will find, among other things, the installation manual and the release notes (in ZIP format):
Some tutorials can be found in the Tutorials directory.
Proceed as follows:
- Download the ISO, TAR or ZIP files from the appropriate directory.
- Unpack or mount each of the packages in a separate folder. Under Windows you can mount IOS files e.g. with the program Virtual Clone Drive.
- Then start the setup.exe file under Windows. In the installation window that opens, first install the "Required Prerequisites", and then the ANSYS products.
Under Linux enter INSTALL -noroot. Do not install a local license manager. - After the installation, a window appears where you have to specify the license server. Here you enter
at SERVER : 10550@scclic4.scc.kit.edu
for ANSLI_SERVERS : 2325@scclic4.scc.kit.edu - You can also add the two lines afterwards in the shared-files/licensing or shared-files/licensing subdirectory in the ansyslmd.ini file:
SERVER=10550@scclic4.scc.kit.edu
ANSYSLI_SERVERS=2325@scclic4.scc.kit.edu
Documentation
The documentation is available online. For access (also to the Customer Portal), you must create an account with Ansys. Please ask for the Customer Number beforehand. A local installation(WINX64 / LINX64) is also possible.
Version 2023R1:
On the ftp server https://ftp.scc.kit.edu/pub/campus/ANSYS/ANSYS2023R1/Documentation/ you will find the following files:
- ansysproductpdfdocv212.zip manuals and installation guides ( list )
- ansysreleasedoc.7z version documentation
- ANSYS_Inc._Installation_Guides.pdf
- Info about the individual installation packages.
Version 2022R2:
On the ftp server https://ftp.scc.kit.edu/pub/campus/ANSYS/ANSYS2022R2/Documentation/ you will find the following files:
- ansysproductpdfdocv222.zip manuals and installation guides ( list )
- ansysreleasedoc.7z version documentation
- ANSYS_Inc._Installation_Guides.pdf
- Info about the individual installation packages.
From the campus network you can also update directly via
CIFS: \\sccfs.scc.kit.edu\Service\SCC\sccfs-ftp\pub\campus\ANSYS resp.
NFS: sccfs.scc.kit.edu:/Service/SCC/sccfs-ftp/pub/campus/ANSYS.