Sei sulla pagina 1di 18

Chapter 1.

Starting and Executing FLUENT

This chapter provides instructions for starting and executing FLUENT.

• Section 1.1: Starting FLUENT


• Section 1.2: Remote Execution
• Section 1.3: Batch Execution
• Section 1.4: Checkpointing a FLUENT Simulation
• Section 1.5: Cleaning Up Processes From a FLUENT Simulation
• Section 1.6: Exiting the Program

1.1 Starting FLUENT


The way you start FLUENT will be different for UNIX and Windows systems, as described
below in Sections 1.1.2 and 1.1.3. The installation process (described in the separate
installation instructions for your computer type) is designed to ensure that the FLUENT
program is launched when you follow the appropriate instructions. If it is not, consult
your computer systems manager or your Fluent support engineer.

1.1.1 Single-Precision and Double-Precision Solvers


Both single-precision and double-precision versions of FLUENT are available on all com-
puter platforms. For most cases, the single-precision solver will be sufficiently accurate,
but certain types of problems may benefit from the use of a double-precision version.
Several examples are listed below:

• If your geometry has features of very disparate length scales (e.g., a very long,
thin pipe), single-precision calculations may not be adequate to represent the node
coordinates.
• If your geometry involves multiple enclosures connected via small-diameter pipes
(e.g., automotive manifolds), mean pressure levels in all but one of the zones can be
quite large (since you can set only one global reference pressure location). Double-
precision calculations may therefore be necessary to resolve the pressure differences
that drive the flow, since these will typically be much smaller than the pressure
levels.


c Fluent Inc. January 11, 2005 1-1
Starting and Executing FLUENT

• For conjugate problems involving high thermal-conductivity ratios and/or high-


aspect-ratio grids, convergence and/or accuracy may be impaired with the single-
precision solver, due to inefficient transfer of boundary information.

1.1.2 Starting FLUENT on a UNIX System


There are several ways to start FLUENT on a UNIX system:

• Start the appropriate version from the command line.

• Start the solver from the command line without specifying a version, and then use
the Select Solver panel to choose the appropriate version.

• Start the solver from the command line without specifying a version, and then read
in a case file (or a case file and data file) to start the appropriate version.

Specifying the Solver Version from the Command Line


When you start FLUENT from the command line, you can specify the dimensionality
of the problem (2D or 3D), as well as whether you want a single- or double-precision
calculation:
fluent 2d
runs the two-dimensional, single-precision solver,
fluent 3d
runs the three-dimensional, single-precision solver,
fluent 2ddp
runs the two-dimensional, double-precision solver, and
fluent 3ddp
runs the three-dimensional, double-precision solver.
See Section 32.2: Starting the Parallel Version of the Solver for information about starting
the parallel solvers.

1-2
c Fluent Inc. January 11, 2005
1.1 Starting FLUENT

Specifying the Solver Version in the Select Solver Panel


If you type fluent on the command line with no arguments, the startup console window
(the text window and the main menu bar) will appear as shown in Figure 1.1.1.

Figure 1.1.1: Console Window at Startup

You can start a single-precision version of FLUENT by typing 2d or 3d at the version>


prompt. For a double-precision version, type 2ddp or 3ddp.
If you would rather use the GUI to start the correct version, select the Run... menu item
in the File menu.
File −→Run...
The Select Solver panel will appear as shown in Figure 1.1.2, and you can pick the
appropriate version. (You can also start FLUENT on a remote machine or start the
parallel version from this panel, as described in Sections 1.2 and 32.2.)
You will normally follow the steps below to start a solver from the panel:

1. Specify a 2D or 3D solver by turning the 3D option on or off under Versions.

2. Specify the precision by turning the Double Precision option on or off under Versions.

3. Click the Run button.

If the program executable is not in your search path, you can specify a complete pathname
to the executable in the Program text entry box before clicking Run.


c Fluent Inc. January 11, 2005 1-3
Starting and Executing FLUENT

Figure 1.1.2: The FLUENT version can be selected from the Select Solver
panel

Specifying the Solver Version by Reading a Case File


As discussed above, if you type fluent on the command line without specifying a version
argument, the console window will appear as shown in Figure 1.1.1. You can then auto-
matically execute the appropriate solver by selecting a case file or case and data files using
the File/Read/Case... or File/Read/Case & Data... menu item (see Section 4.3: Reading
and Writing Case and Data Files) or using the read-case or read-case-data command
in the version text menu.
File −→ Read −→Case...
File/Read/Case... or read-case starts the solver that is appropriate for the specified case
file and then reads in the file.
File −→ Read −→Case & Data...
File/Read/Case & Data... or read-case-data starts the solver that is appropriate for the
specified case file and then reads in the specified case and data files (where the case and
data files have the same name with .cas and .dat extensions, respectively).

1-4
c Fluent Inc. January 11, 2005
1.1 Starting FLUENT

1.1.3 Starting FLUENT on a Windows System


There are two ways to start FLUENT on a Windows system:

• Click the Start button, select the Programs menu, select the Fluent.Inc menu,
and then select the FLUENT 6 program item. (Note that if the default “Fluent.Inc”
program group name was changed when FLUENT was installed, you will find the
FLUENT 6 menu item in the program group with the new name that was assigned,
rather than in the Fluent.Inc program group.)

• Start from an MS-DOS Command Prompt window by typing fluent 2d (for the
2D single-precision solver), fluent 3d (for the 3D single-precision solver), fluent
2ddp (for the 2D double-precision solver), or fluent 3ddp (for the 3D double-
precision solver) at the prompt. Before doing so, however, you must first modify
your user environment so that the MS-DOS Command utility will find fluent.
You can do this by selecting the program item “Set Environment”, which is also
found in the Fluent.Inc program group. This program will add the Fluent.Inc
directory to your command search path.
From the MS-DOS Command Prompt window, you can also start the parallel
version of FLUENT. To start the parallel version on x processors, type fluent
version -tx at the prompt, replacing version with the desired solver version (2d,
3d, 2ddp, or 3ddp) and x with the number of processors (e.g., fluent 3d -t3 to
run the 3D version on 3 processors). For information about the parallel version of
FLUENT, see Chapter 32: Parallel Processing.


c Fluent Inc. January 11, 2005 1-5
Starting and Executing FLUENT

1.1.4 Remote Simulation Facility (RSF)


FLUENT’s Remote Simulation Facility (RSF) is a highly secure mechanism for executing
large, complex simulations at a remote data center. You can use FLUENT to access the
RSF using the File menu.
File −→RSF...
When you select this option, FLUENT displays the Remote Simulation Facility panel (Fig-
ure 1.1.3).

Figure 1.1.3: The Remote Simulation Facility Panel

If a case and data file are already loaded into FLUENT, the Case & Data button under
Write will be active, which will allow you to write out the case and data files for the
current session. You must save your case and data files in order to use them on the RSF.
Once you save the case and data files and launch the RSF, you can exit from FLUENT.
To start an RSF session, click Start RSF to open your web browser and load the page for
the FLUENT Remote Simulation Facility (RSF).
For more information about the RSF, see
http://www.fluent.com/software/rsolve/index.htm.

To link to the RSF on UNIX platforms, you must first have installed the
i contents of the FLUENT 6.x Documentation CD, which contains the files
necessary to launch your browser so you can automatically view the ap-
propriate web pages.

1-6
c Fluent Inc. January 11, 2005
1.1 Starting FLUENT

1.1.5 Startup Options


To obtain information about available versions, releases, etc. before starting up the solver,
you can type fluent -help. Available options are as shown below:

Usage: fluent [version] [-help] [options]


options:
-cl following argument passed to fluent,
-cxarg following argument passed to cortex,
-cx host:p1:p2 connect to the specified cortex process,
-driver [ opengl | x11 | null ],
sets the graphics driver (available drivers vary by platform),
-env show environment variables,
-g run without gui or graphics,
-gr run without graphics,
-gu run without gui,
-hcl following argument passed to fluent host,
-help this listing,
-i journal read the specified journal file,
-loadx load mpp from host x,
-lsf run fluent under LSF,
-manspa manually spawn compute nodes,
-n no execute,
-ncl following argument passed to fluent node,
-nocheck disable checks for valid license file and server,
-pathx specify root path x to Fluent.Inc,
-post run a post-processing-only executable,
-px specify communicator x,
-r list all releases,
-rx specify release x,
-sge run fluent under Sun Grid Engine,
-sgeq queue name of queue for a given computing grid,
-sgeckpt ckpt_obj,
set Checkpointing object to ckpt_obj for SGE,
-sgepe fluent_pe min_n-max_n,
set parallel environment for SGE to fluent_pe,
min_n and max_n are number of min and max nodes requested,
-v list all versions,
-vx specify version x,
-tx specify number of processors x,

i On Windows systems, only -cx, -driver, -env, -gu (with restrictions),


-help, -i journal, -r, -rx, -v, -vx, and -tx are available.
The first three options are for specifying arguments for FLUENT and Cortex. Cor-
tex is a process that provides the user interface and graphics for FLUENT. The op-


c Fluent Inc. January 11, 2005 1-7
Starting and Executing FLUENT

tion -cx host:p1:p2 is used only when you are starting the solver manually (see Sec-
tion 1.1.2: Specifying the Solver Version in the Select Solver Panel).
If you type fluent -driver, you can specify the graphics driver to be used in the
solver session (e.g., fluent -driver xgl). Typing fluent -env will list all environment
variables before running FLUENT.
fluent -g will run Cortex without graphics and without the graphical user interface.
This option is useful if you are not on an X Window display or if you want to submit a
batch job. fluent -gu will run Cortex without the graphical user interface and fluent
-gr will run Cortex without graphics. (On Windows systems, fluent -gu will run FLU-
ENT keeping it in a minimized window; if you maximize the window, the GUI will be
available. This option can be used in conjunction with the -i journal option to run a
job in “background” mode.)
To start the solver and immediately read a journal file, type fluent -i journal, replac-
ing journal with the name of the journal file you want to read. The -nocheck option
speeds up the solver startup by not checking to see if the license server is running. This is
useful if you know that the license daemon is running or you would rather not try to start
it if it is not running (e.g., if you do not have privileges to do so). fluent -post will run
a version of the solver that allows you to set up a problem or perform postprocessing,
but will not allow you to perform calculations.
Typing fluent version -r, replacing version with the desired version, will list all
releases of the specified version. fluent -rx will run release x of FLUENT. You may
specify a version as well, or you can wait and specify the version when prompted by
the solver. fluent -v will list the available versions. fluent -vx will run version x of
FLUENT.
You can type fluent -n or use the -n option in conjunction with any of the others to
see where the (specified) executable is without actually running it.
The remaining options are used in association with the parallel solver. -hcl is used to
pass an argument to the FLUENT host process and -ncl is used to pass an argument
to the FLUENT compute node process(es). -loadx is used to start the parallel compute
node processes on a dedicated parallel machine from its remote front-end machine (x).
-manspa is used to disable the default automatic spawning of compute node processes.
-px specifies the use of parallel communicator x, where x can be any of the communicators
listed in Section 32.2.1: Running on a Multiprocessor UNIX Machine. -pathx specifies
the root path (path) to the Fluent.Inc installation directory. -tx specifies that x
processors are to be used. For more information about starting the parallel version of
FLUENT, see Section 32.2: Starting the Parallel Version of the Solver.

1-8
c Fluent Inc. January 11, 2005
1.2 Remote Execution

1.2 Remote Execution


There may be situations when you want to view FLUENT on one machine, but run it on
a different (remote) machine. This section explains how to do this.

1.2.1 Overview and Limitations


If FLUENT has been started without a version argument (e.g., 3d), you can select the
solver after startup. Starting the solver in this manner allows you to run it on a remote
processor. By default, when you type the command to start FLUENT and include the
version, you actually start Cortex (a process that provides the user interface and graphics
for FLUENT) and Cortex then starts FLUENT on the same processor on which Cortex is
running. When you type the startup command without specifying a version, you just
start Cortex. This gives you the opportunity to specify a different processor on which to
run the solver.
Note the following limitations when you run FLUENT on a remote UNIX machine from
a local Windows machine:

• You will not be able to read or write files using the items in the File pull-down menu;
use the text commands for reading and writing files instead. See the separate Text
Command List for details.

• You will not be able to use user-defined functions.

1.2.2 Steps for Running on a Remote Machine


To run FLUENT on a remote processor, you will normally follow the procedure listed
below.

1. Start FLUENT by typing the following:


• On a UNIX machine, type
fluent
• On a Windows machine (in an MS-DOS Command Prompt window), type
fluent -serv -a

2. Open the Select Solver panel.


File −→Run...

3. In the Select Solver panel, under Remote Execution, set the internet name of the
remote machine (Hostname), your username at that machine (Username), and your
password at that machine (Password).


c Fluent Inc. January 11, 2005 1-9
Starting and Executing FLUENT

4. Specify the appropriate solver version under Versions and Options in the Select
Solver panel. (More information about these items is available in Sections 1.1 and
32.2.)
5. Click the Run button.

If the remote processor refuses to start the solver, you may need to try the procedure
described in Section 1.2.3: Starting the Solver Manually on the Remote Machine.

1.2.3 Starting the Solver Manually on the Remote Machine


If the remote process fails when you click the Run button in the Select Solver panel (as
described in Section 1.2.2: Steps for Running on a Remote Machine), you can use the
“listen” option to work around network security devices that prevent Cortex from creating
a remote process directly. The procedure is as follows:

1. Click the Listen button in the Select Solver panel or type listen at the version>
prompt (and press <RETURN> to accept the default “time out”).
FLUENT will print a message telling you what arguments you should use to start
the solver on a remote machine. The arguments will be in this format:
-cx host:p1:p2
where host is the name of the host Cortex is running on, and :p1:p2 are two
colon-separated integers indicating the port numbers being used.
2. Open a telnet or xterm window and log onto the remote machine where you want
to launch the solver.
3. In the telnet or xterm window, type the following to start the desired version of
FLUENT:
fluent version -cx host:p1:p2
replacing version by the version that you wish to run (e.g., 3d), and the host and
port numbers by the values displayed above when you clicked Listen in the Select
Solver panel or typed listen in the FLUENT console window.

1.2.4 Executing Remotely by Reading a Case File


If you plan to start the appropriate version of FLUENT by reading in a case file (as
described in Section 1.1.2: Specifying the Solver Version by Reading a Case File), but
you wish to run the solver on a remote machine, you can specify the remote machine
in the Select Solver panel as described in Section 1.2.2: Steps for Running on a Remote
Machine, and then click Apply instead of Run. This will save the settings for remote
execution. When you start the solver by specifying a case file, the solver will be run on
the specified remote machine.

1-10
c Fluent Inc. January 11, 2005
1.3 Batch Execution

1.3 Batch Execution


FLUENT can be used interactively, with input from and display to your computer screen,
or it can be used in a batch or background mode in which inputs are obtained from and
outputs are stored in files. Generally you will perform problem setup, initial calculations,
and postprocessing of results in an interactive mode. However, when you are ready to
perform a large number of iterative calculations, you may want to run FLUENT in batch
or background mode. This allows the computer resources to be prioritized, enables you
to control the process from a file (eliminating the need for you to be present during
the calculation), and also provides a record of the calculation history (residuals) in an
output file. While the procedures for running FLUENT in a batch mode differ depend-
ing on your computer operating system, Section 1.3.1: Background Execution on UNIX
Systems provides guidance for running in batch/background on UNIX systems, and Sec-
tion 1.3.2: Background Execution on Windows Systems provides guidance for running in
batch/background on Windows systems.

1.3.1 Background Execution on UNIX Systems


To run FLUENT in the background in a C-shell (csh) on a UNIX system, type a command
of the following form at the system-level prompt:

fluent 2d -g < inputfile >& outputfile &

or in a Bourne/Korn-shell, type:

fluent 2d -g < inputfile > outputfile 2>&1 &

In these examples,

• fluent is the command you type to execute FLUENT interactively.

• -g indicates that the program is to be run without the GUI or graphics (see Sec-
tion 1.1: Starting FLUENT).

• inputfile is a file of FLUENT commands that are identical to those that you would
type interactively.

• outputfile is a file that the background job will create and which will contain the
output that FLUENT would normally print to the screen (e.g., the menu prompts
and residual reports).

• & tells the UNIX system to perform this task in background and to send all standard
system errors (if any) to outputfile.


c Fluent Inc. January 11, 2005 1-11
Starting and Executing FLUENT

The file inputfile can be a journal file created in an earlier FLUENT session, or it can
be a file that you have created using a text editor. In either case, the file must consist
only of text interface commands (since the GUI is disabled during batch execution). A
typical inputfile is shown below:

; Read case file


rc example.cas
; Initialize the solution
/solve/initialize/initialize-flow
; Calculate 50 iterations
it 50
; Write data file
wd example50.dat
; Calculate another 50 iterations
it 50
; Write another data file
wd example100.dat
; Exit FLUENT
exit
yes

This example file reads a case file example.cas, initializes the solution, and performs
100 iterations in two groups of 50, saving a new data file after each 50 iterations. The
final line of the file terminates the session. Note that the example input file makes use
of the standard aliases for reading and writing case and data files and for iterating. (it
is the alias for /solve/iterate, rc is the alias for /file/read-case, wd is the alias for
/file/write-data, etc.) These predefined aliases allow you to execute commonly-used
commands without entering the text menu in which they are found. In general, FLUENT
assumes that input beginning with a / starts in the top-level text menu, so if you use any
text commands for which aliases do not exist, you must be sure to type in the complete
name of the command (e.g., /solve/initialize/initialize-flow). Note also that
you can include comments in the file. As in the example above, comment lines must
begin with a ; (semicolon).
An alternate strategy for submitting your batch run, as follows, has the advantage that
the outputfile will contain a record of the commands in the inputfile. In this ap-
proach, you would submit the batch job in a C-shell using:

fluent 2d -g -i inputfile >& outputfile &

or in a Bourne/Korn-shell using:

fluent 2d -g -i inputfile > outputfile 2>&1 &

1-12
c Fluent Inc. January 11, 2005
1.3 Batch Execution

1.3.2 Background Execution on Windows Systems


To run FLUENT in the background on a Windows system, the following commands can
be used:

fluent 3d -g -i journal

fluent 3d -g -wait -i journal

fluent 3d -g -hidden -i journal

In these examples,

• fluent is the command you type to execute FLUENT interactively.

• -g indicates that the program is to be run minimized in the taskbar.

• -i journal reads the specified journal file.

• -wait is the command you type in a DOS batch file or some other script in a
situation where the script needs to wait until FLUENT has completed its run.

• -hidden is similar to the -wait command, but also executes FLUENT completely
hidden and noninteractively.

To get an output (or transcript) file while running FLUENT in the background on a Win-
dows system, the journal file must contain the following command to write a transcript
file:

; start transcript file


/file/start-transcript outputfile.trn

where the outputfile is a file that the background job will create and which will contain
the output that FLUENT would normally print to the screen (e.g., the menu prompts
and residual reports).
See Section 4.7: Creating and Reading Journal Files for details about journal files. See
Section 4.8: Creating Transcript Files for details about transcript files.


c Fluent Inc. January 11, 2005 1-13
Starting and Executing FLUENT

1.3.3 Batch Execution Options


During a typical session, FLUENT may require feedback from you in the event of a
problem it encounters. FLUENT usually communicates problems or questions through
the use of Error dialog boxes, Warning dialog boxes, or Question dialog boxes. While
executing FLUENT in batch mode, you may want to suppress this type of interaction in
order to, for example, create journal files more easily.
There are three common batch configuration options available to you when running
FLUENT in batch mode. You can access these options using the Batch Options panel.
File −→Batch Options...

Figure 1.3.1: The Batch Options Panel

The Batch Options panel contains the following items:

Confirm File Overwrite determines whether FLUENT confirms a file overwrite. This
option is turned on by default.

Hide Questions allows you to hide Question dialog boxes. This option is turned off by
default.

Exit on Error allows you to automatically exit from batch mode when an error occurs.
This option is turned off by default.

Note that these options are also available in the file/set-batch-options command in
the text interface.
file −→set-batch-options
Any combination of these options can be turned on or off at any given time prior to
running in batch mode.

1-14
c Fluent Inc. January 11, 2005
1.4 Checkpointing a FLUENT Simulation

Batch option settings are not saved with case files. They are meant to
i apply for the duration of the current FLUENT session only. If you read in
additional mesh or case files during this session, the batch option settings
will not be altered. As batch options are not saved with case files, journal
files developed for use in batch mode should begin by enabling the desired
batch option settings (if different from the default settings).

1.4 Checkpointing a FLUENT Simulation


The checkpointing feature of FLUENT allows you to save case and data files while
your simulation is running. While similar to the autosave feature of FLUENT (Sec-
tion 4.3.4: Automatic Saving of Case and Data Files), which allows you to save files
throughout a simulation, checkpointing allows you slightly more control in that you can
save a FLUENT job even after you have started the job and did not set the autosave
option. Checkpointing also allows you to save case and data files and then exit out of
FLUENT. This feature is especially useful when you need to stop a FLUENT job abruptly
and save its data.
There are two different ways to checkpoint a FLUENT simulation, depending upon how
the simulation has been started.

1. FLUENT running under LSF or SGE


FLUENT is integrated with load management tools like LSF and SGE. These two
tools allow you to checkpoint any job running under them. You can use the standard
method provided by these tools to checkpoint the FLUENT job. For more informa-
tion on using FLUENT and SGE, see Section 32.7: Running Parallel FLUENT under
SGE. For more information about using FLUENT and LSF, see Section 32.8: Run-
ning Parallel FLUENT under LSF.

2. Independently running FLUENT


When not using tools such as LSF or SGE, a different checkpointing mechanism
can be used when running a FLUENT simulation. You can checkpoint a FLUENT
simulation by saving case and data files while iterating, or by saving case and data
files upon exiting FLUENT.
• Saving case and data files while iterating:
On UNIX, create a file called check-fluent, i.e.,
/tmp/check-fluent
On Windows NT, create a file called check-fluent.txt, i.e.,
c:\\temp\check-fluent.txt


c Fluent Inc. January 11, 2005 1-15
Starting and Executing FLUENT

• Saving case and data files and exiting FLUENT:


On UNIX, create a file called check-fluent, i.e.,
/tmp/exit-fluent
On Windows NT, create a file called check-fluent.txt, i.e.,
c:\\temp\exit-fluent.txt
The saved case and data files will have the current iteration number appended to
their file names.
To change the default location of these saved case and data files, you can use the
following Scheme commands:

(set! checkpoint/check-filename "pathname")

and

(set! checkpoint/exit-filename "pathname")

where pathname is the path you wish to set as the new default location of the saved
case and data files.

1.5 Cleaning Up Processes From a FLUENT Simulation


FLUENT lets you easily remove extraneous processes in the event that a FLUENT simu-
lation needs to be stopped.
When a session is started, FLUENT creates a kill-fluent script file. The script can be
used to cleanly kill all FLUENT-related processes. FLUENT creates the kill-script file in
the current working directory with a file name that includes the machine name and the
process identification number (PID) (e.g., kill-fluent-mymachine-1234). On UNIX
and Linux platforms, if the current directory does not possess the proper write permis-
sions, then FLUENT will write the kill-script file to your home directory. On Windows,
FLUENT will save the kill-script file to a different directory (i.e., %APPDATA%/Fluent.Inc
where it is assumed that the APPDATA environment variable is already defined). The
Fluent.Inc directory will be created if it is not already present.
If, for example, FLUENT is started on a machine called thor and the process identification
number is 32895, FLUENT will create a kill-script called kill-fluent-thor-32895 in
the current directory. To run the kill-script, and kill all FLUENT processes related to
your session, on Linux or UNIX platforms, type the following command in the console
window:

sh kill-fluent-thor-32895

1-16
c Fluent Inc. January 11, 2005
1.6 Exiting the Program

Or, if the shell script already has executable permissions, simply type:

kill-fluent-thor-32895

To clean up extraneous FLUENT processes on Windows, double-click the corresponding


batch file (e.g., kill-fluent-thor-32895.bat) that FLUENT generates at the beginning
of each session.

1.6 Exiting the Program


You can exit FLUENT by selecting Exit in the File pull-down menu. If the present state
of the program has not been written to a file, you will receive a warning message. You
can cancel the exit and write the appropriate file(s) or you can continue to exit without
saving the case or data.


c Fluent Inc. January 11, 2005 1-17
Starting and Executing FLUENT

1-18
c Fluent Inc. January 11, 2005

Potrebbero piacerti anche