Skip to content

Commit 2fa4259

Browse files
committed
Use snippets for ansys example on Gautschi.
1 parent 1cb061a commit 2fa4259

5 files changed

Lines changed: 5 additions & 287 deletions

File tree

docs/snippets/examples/apps/ansysfluent/submit_fluent_jobs_to_slurm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Submitting Fluent jobs to SLURM
22

3-
The Fluent simulations can also run in batch. In this section we provide an example script for submitting Fluent jobs to the SLURM scheduler. Please refer to the [Running Jobs](../../../index.md) section of our user guide for detailed tutorials of submitting jobs.
3+
The Fluent simulations can also run in batch. In this section we provide an example script for submitting Fluent jobs to the SLURM scheduler. Please refer to the Running Jobs section of our user guide for detailed tutorials of submitting jobs.
44

55
```
66

docs/userguides/gautschi/run_jobs/ansysfluent/calculating.md

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,6 @@ search:
99
boost: 2
1010
---
1111

12-
# Case Calculating with Fluent
13-
14-
### Calculation with Fluent
15-
16-
Now all the files are ready for the Fluent calculations. Both “Geometry” and “Mesh” cells should have green checks. We can set up the CFD simulation parameters in the Ansys Fluent by double-clicking the “Setup” cell.
17-
18-
Ansys Fluent Launcher can be started by selecting “editing” on the “Setup” cell with many startup options (e.g. Precision, Parallel, Display). Note that “Dimension” is fixed to “3D” because we are using a 3D model in this project.
19-
20-
![Ansys Fluent Launcher options](../../../../assets/images/userguides/gautschi/ansys/4-Ansys Fluent Launcher options.png)
21-
22-
Ansys Fluent Launcher options.
23-
24-
After the Fluent is opened, an Ansys Fluent settings file `FFF.set` is written under the folder `$Ansys_PROJECT_FOLDER/elbow_demo_file/dp0/FFF/Fluent/`.
25-
26-
Then we are going to set up all the necessary parameters for Fluent computation. Here are the key steps for the setup:
27-
28-
1. Setting up the domain:
29-
* Change the units for length to be consistent with the Mesh;
30-
* Check the mesh statistics and quality;
31-
2. Setting up physics:
32-
* Solver: “Energy”, “Viscous Model”, “Near-Wall Treatment”;
33-
* Materials;
34-
* Zones;
35-
* Boundaries: Inlet, Outlet, Internal, Symmetry, Wall;
36-
3. Solving:
37-
* Solution Methods;
38-
* Reports;
39-
* Initialization;
40-
* Iterations and output frequency.
41-
42-
Then the calculation will be carried out and the results will be written out into `FFF-1.cas.gz` under folder `$Ansys_PROJECT_FOLDER/elbow_demo_file/dp0/FFF/Fluent/`.
43-
44-
This file contains all the settings and simulation results which can be loaded for post analysis and re-computation (more details will be introduced in the following sections). If only configurations and settings within the Fluent are needed, we can open independent Fluent or submit Fluent jobs with bash commands by loading the existing case in order to facilitate the computation process.
45-
46-
Parameters used in demo case (use default if not assigned):
47-
48-
1. Domain Setup: Length Units=”mm”;
49-
2. Solver: Energy=”on”; Viscous Model=”k-epsilon”; Near-Wall Treatment=”Enhanced Wall Treatment”;
50-
3. Materials: water (Density=1000[kg/m^3]; Specific Heat=4216[J/kg-k]; Thermal Conductivity=0.677[w/m-k]; Viscosity=8e-4[kg/m-s]);
51-
4. Zones=”fluid (water)”;
52-
5. Inlet=”velocity-inlet-large” (Velocity Magnitude=0.4m/s, Specification Method=”Intensity and Hydraulic Diameter”, Turbulent Intensity=5%; Hydraulic Diameter=100mm; Thermal Temperature=293.15k) &”velocity-inlet-small” (Velocity Magnitude=1.2m/s, Specification Method=”Intensity and Hydraulic Diameter”, Turbulent Intensity=5%; Hydraulic Diameter=25mm; Thermal Temperature=313.15k); Internal=”interior-fluid”; Symmetry=”symmetry”; Wall=”wall-fluid”;
53-
6. Solution Methods: Gradient=”Green-Gauss Node Based”;
54-
7. Report: plot residual and “Facet Maximum” for “pressure-outlet”
55-
8. Hybrid Initialization;
56-
9. 300 iterations.
57-
58-
### Results analysis
59-
60-
The best methods to view and analyze the simulation should be the Ansys Fluent (directly after computation) or the Ansys CFD-Post (entering “Results” in Ansys Workbench). Both methods are straightforward so we will not cover this part in this tutorial. Here is a final simulation result showing the temperature of the symmetry after 300 iterations for reference:
61-
62-
![Simulated temperature](../../../../assets/images/userguides/gautschi/ansys/5-Simulated temperature profile of the symmetry.png)
63-
64-
Simulated temperature profile of the symmetry.
12+
--8<-- "docs/snippets/examples/apps/ansysfluent/case_calculating_with_fluent.md"
6513

6614
[**Back to Ansys Fluent**](../ansysfluent_example.md)

docs/userguides/gautschi/run_jobs/ansysfluent/preparing_cases.md

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -9,115 +9,6 @@ search:
99
boost: 2
1010
---
1111

12-
# Preparing Case Files for Fluent
13-
14-
### Creating a Fluent fluid analysis system
15-
16-
In the Ansys Workbench, create a new fluid flow analysis by double-clicking the Fluid Flow (Fluent) option under the Analysis Systems in the Toolbox on the left panel. You can also drag-and-drop the analysis system into the Project Schematic. A green dotted outline indicating a potential location for the new system initially appears in the Project Schematic. When you drag the system to one of the outlines, it turns into a red box to indicate the chosen location of the new system.
17-
18-
![Ansys Workbench GUI](../../../../assets/images/userguides/gautschi/ansys/1-Ansys Workbench GUI and the Fluid Flow system for Fluent.png)
19-
20-
Ansys Workbench GUI and the Fluid Flow system for Fluent.
21-
22-
The red rectangle indicates the Fluid Flow system for Fluent, which includes all the essential workflows from “2 Geometry” to “6 Results”. You can rename it and carry out the necessary step-by-step procedures by double-clicking the corresponding cells.
23-
24-
It is important to save the project. Ansys Workbench saves the project with a `.wbpj` extension and also all the supporting files into a folder with the same name. In this case, a file named `elbow_demo.wbpj` and a folder `$Ansys_PROJECT_FOLDER/elbow_demo_files/` are created in the Ansys project folder:
25-
26-
```bash
27-
$ ll
28-
total 33
29-
drwxr-xr-x 7 username itap 9 Mar 3 17:47 elbow_demo_files
30-
-rw-r--r-- 1 username itap 42597 Mar 3 17:47 elbow_demo.wbpj
31-
```
32-
33-
You should always “Update Project” and save it after finishing a procedure.
34-
35-
### Creating Geometry in the Ansys DesignModeler
36-
37-
Create a geometry in the Ansys DesignModeler (by double-clicking “Geometry” cell in workflow), or import the appropriate geometry file (by right-clicking the Geometry cell and selecting “Import Geometry” option from the context menu).
38-
39-
You can use Ansys DesignModeler to create 2D/3D geometries or even draw the objects yourself. In our example, we created only half of the elbow pipe because the symmetry of the structure is taken into account to reduce the computation intensity.
40-
41-
![DesignModeler](../../../../assets/images/userguides/gautschi/ansys/2-Elbow pipe created in Ansys DesignModeler.png)
42-
43-
Elbow pipe created in Ansys DesignModeler.
44-
45-
After saving the geometry, a geometry file `FFF.agdb` will be created in the folder: `$Ansys_PROJECT_FOLDER/elbow_demo_file/dp0/FFF/DM/`. The project in Workbench will be updated automatically.
46-
47-
If you import a pre-existing geometry into Ansys DesignModeler, it will also generate this file with the same filename at this location.
48-
49-
### Creating mesh in the Ansys Meshing
50-
51-
Now that we have created the elbow pipe geometry, a computational mesh can be generated by the Meshing application throughout the flow volume.
52-
53-
With the successful creation of the geometry, there should be a green check showing the completion of “Geometry” in the Ansys Workbench. A Refresh Required icon within the “Mesh” cell indicates the mesh needs to be updated and refreshed for the system.
54-
55-
![AnsysWorkbenchCells](../../../../assets/images/userguides/gautschi/ansys/3-Status for different cells shown in Ansys Workbench.png)
56-
57-
Status for different cells shown in Ansys Workbench.
58-
59-
Then it’s time to open the Ansys Meshing application by double-clicking the “Mesh” cell and editing the mesh for the project. Generally, there are several steps we need to take to define the mesh:
60-
61-
1. Create names for all geometry boundaries such as the inlets, outlets and fluid body. Note: You can use the strings “velocity inlet” and “pressure outlet” in the named selections (with or without hyphens or underscore characters) to allow Ansys Fluent to automatically detect and assign the corresponding boundary types accordingly. Use “Fluid” for the body to let Ansys Fluent automatically detect that the volume is a fluid zone and treat it accordingly.
62-
2. Set basic meshing parameters for the Ansys Meshing application. Here are several important parameters you may need to assign: Sizing, Quality, Body Sizing Control, Inflation.
63-
3. Select “Generate” to generate the mesh and “Update” to update the mesh into the system. Note: Once the mesh is generated, you can view the mesh statistics by opening the Statistics node in the Details of “Mesh” view. This will display information such as the number of nodes and the number of elements, which gives you a general idea for the future computational resources and time.
64-
65-
After generation and updating the mesh, a mesh file `FFF.msh` will be generated in folder `$Ansys_PROJECT_FOLDER/elbow_demo_file/dp0/FFF/MECH/` and a mesh database file `FFF.mshdb` will be generated in folder `$Ansys_PROJECT_FOLDER/elbow_demo_file/dp0/global/MECH/`.
66-
67-
Parameters used in demo case (use default if not assigned):
68-
69-
1. Length Unit=”mm”
70-
2. Names defined for geometry:
71-
* velocity-inlet-large (large inlet on pipe);
72-
* velocity-inlet-small (small inlet on pipe);
73-
* pressure-outlet (outlet on pipe);
74-
* symmetry (symmetry surface);
75-
* Fluid (body);
76-
3. Mesh:
77-
* Quality: Smoothing=”high”;
78-
* Inflation: Use Automatic Inflation=“Program Controlled”, Inflation Option=”Smooth Transition”;
79-
4. Statistics:
80-
* Nodes=29371;
81-
* Elements=87647.
82-
83-
### Calculation with Fluent
84-
85-
Now all the preparations have been ready for the numerical calculation in Ansys Fluent. Both “Geometry” and “Mesh” cells should have green checks on. We can set up the CFD simulation parameters in Ansys Fluent by double-clicking the “Setup” cell.
86-
87-
When Ansys Fluent is first started or by selecting “editing” on the “Setup” cell, the Fluent Launcher is displayed, enabling you to view and/or set certain Ansys Fluent start-up options (e.g. Precision, Parallel, Display). Note that “Dimension” is fixed to “3D” because we are using a 3D model in this project.
88-
89-
After the Fluent is opened, an Ansys Fluent settings file `FFF.set` is written under the folder `$Ansys_PROJECT_FOLDER/elbow_demo_file/dp0/FFF/Fluent/`.
90-
91-
Then we are going to set up all the necessary parameters for Fluent computation. Here are the key steps for the setup:
92-
93-
1. Setting up the domain:
94-
* Change the units for length to be consistent with the Mesh;
95-
* Check the mesh statistics and quality;
96-
2. Setting up physics:
97-
* Solver: “Energy”, “Viscous Model”, “Near-Wall Treatment”;
98-
* Materials;
99-
* Zones;
100-
* Boundaries: Inlet, Outlet, Internal, Symmetry, Wall;
101-
3. Solving:
102-
* Solution Methods;
103-
* Reports;
104-
* Initialization;
105-
* Iterations and output frequency.
106-
107-
Then the calculation will be carried out and the results will be written out into `FFF-1.cas.gz` under folder `$Ansys_PROJECT_FOLDER/elbow_demo_file/dp0/FFF/Fluent/`.
108-
109-
This file contains all the settings and simulation results which can be loaded for post analysis and re-computation (more details will be introduced in the following sections). If only configurations and settings within the Fluent are needed, we can open independent Fluent or submit Fluent jobs with bash commands by loading the existing case in order to facilitate the computation process.
110-
111-
Parameters used in demo case (use default if not assigned):
112-
113-
1. Domain Setup: Length Units=”mm”;
114-
2. Solver: Energy=”on”; Viscous Model=”k-epsilon”; Near-Wall Treatment=”Enhanced Wall Treatment”;
115-
3. Materials: water (Density=1000[kg/m^3]; Specific Heat=4216[J/kg-k]; Thermal Conductivity=0.677[w/m-k]; Viscosity=8e-4[kg/m-s]);
116-
4. Zones=”fluid (water)”;
117-
5. Inlet=”velocity-inlet-large” (Velocity Magnitude=0.4m/s, Specification Method=”Intensity and Hydraulic Diameter”, Turbulent Intensity=5%; Hydraulic Diameter=100mm; Thermal Temperature=293.15k) &”velocity-inlet-small” (Velocity Magnitude=1.2m/s, Specification Method=”Intensity and Hydraulic Diameter”, Turbulent Intensity=5%; Hydraulic Diameter=25mm; Thermal Temperature=313.15k); Internal=”interior-fluid”; Symmetry=”symmetry”; Wall=”wall-fluid”;
118-
6. Solution Methods: Gradient=”Green-Gauss Node Based”;
119-
7. Report: plot residual and “Facet Maximum” for “pressure-outlet”
120-
8. Hybrid Initialization;
121-
9. 300 iterations.
12+
--8<-- "docs/snippets/examples/apps/ansysfluent/preparing_case_files_for_fluent.md"
12213

12314
[**Back to Ansys Fluent**](../ansysfluent_example.md)

docs/userguides/gautschi/run_jobs/ansysfluent/submit_jobs.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,6 @@ search:
99
boost: 2
1010
---
1111

12-
# Submitting Fluent jobs to SLURM
13-
14-
The Fluent simulations can also run in batch. In this section we provide an example script for submitting Fluent jobs to the SLURM scheduler. Please refer to the [Running Jobs](../../run_jobs/index.md) section of our user guide for detailed tutorials of submitting jobs.
15-
16-
```bash
17-
#!/bin/bash
18-
# Job script for submitting a FLUENT job on multiple cores on a single node
19-
20-
# Apply resources via SLURM
21-
#SBATCH --nodes=1
22-
#SBATCH --ntasks=4
23-
#SBATCH --time=01:00:00
24-
#SBATCH --job-name=fluent_test
25-
#SBATCH -o fluent_test_%j.out
26-
#SBATCH -e fluent_test_%j.err
27-
28-
# Loads Ansys and sets the application up
29-
module purge
30-
module load ansys/2022R1
31-
32-
#Initiating Fluent and reading input journal file
33-
fluent 3ddp -t$NTASKS -g -i testJournal.jou
34-
```
35-
36-
For more information about submitting Fluent jobs, please refer to [Fluent FAQ]( https://www.cfd-online.com/Wiki/Fluent_FAQ) .
12+
--8<-- "docs/snippets/examples/apps/ansysfluent/submit_fluent_jobs_to_slurm.md"
3713

3814
[**Back to Ansys Fluent**](../ansysfluent_example.md)

docs/userguides/gautschi/run_jobs/ansysfluent/tui_journal.md

Lines changed: 1 addition & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -9,103 +9,6 @@ search:
99
boost: 2
1010
---
1111

12-
# Fluent Text User Interface and Journal File
13-
14-
### Fluent Text User Interface (TUI)
15-
16-
If you pay attention to the “Console” window in the Fluent window when setting up and carrying out the calculation, corresponding commands can be found and executed one after another. Almost all the setting processes can be accomplished by the command lines, which is called Fluent Text User Interface (TUI). Here are the main commands in Fluent TUI:
17-
18-
```
19-
adjoint/ parallel/ solve/
20-
define/ plot/ surface/
21-
display/ preferences/ turbo-workflow/
22-
exit print-license-usage views/
23-
file/ report/
24-
mesh/ server/
25-
```
26-
27-
For example, instead of opening a case by clicking buttons in Ansys Fluent, we can type `/file read-case case_file_name.cas.gz` to open the saved case.
28-
29-
### Fluent Journal Files
30-
31-
A Fluent journal file is a series of TUI commands stored in a text file. The file can be written in a text editor or generated by Fluent as a transcript of the commands given to Fluent during your session.
32-
33-
A journal file generated by Fluent will include any GUI operations (in a TUI form, though). This is quite useful if you have a series of tasks that you need to execute, as it provides a shortcut. To record a journal file, start recording with File -> Write -> Start Journal..., perform whatever tasks you need, and then stop recording with File -> Write -> Stop Journal...
34-
35-
You can also write your own journal file into a text file. The basic rule for a Fluent journal file is to reproduce the TUI commands that controlled the configuration and calculation of Fluent in their order. You can add a comment in a line starting with a `;` (semicolon).
36-
37-
Here are some reasons why you should use a Fluent journal file:
38-
39-
1. Using journal files with bash scripting can allow you to automate your jobs.
40-
2. Using journal files can allow you to parameterize your models easily and automatically.
41-
3. Using a journal file can set parameters you do not have in your case file e.g. autosaving.
42-
4. Using a journal file can allow you to safely save, stop and restart your jobs easily.
43-
44-
The order of your journal file commands is **highly important**. The correct sequences must be followed and some stages have multiple options e.g. different initialization methods.
45-
46-
Here is a sample Fluent journal file for the demo case:
47-
48-
```
49-
;testJournal.jou
50-
;Set the TUI version for Fluent
51-
/file/set-tui-version "22.1"
52-
;Read the case. The default folder
53-
/file read-case /home/jin456/Fluent_files/tutorial_case1/elbow_files/dp0/FFF/Fluent/FFF-1.cas.gz
54-
;Initialize the case with Hybrid Initialization
55-
/solve/initialize/hyb-initialization
56-
;Set Number of Iterations to 1000, Reporting Interval to 10 iterations and Profile Update Interval to 1 iteration
57-
/solve/iterate 1000 10 1
58-
;Outputting solver performance data upon completion of the simulation
59-
/parallel timer usage
60-
;Write out the simulation results.
61-
/file write-case-data /home/jin456/Fluent_files/tutorial_case1/elbow_files/dp0/FFF/Fluent/result.cas.h5
62-
;After computation, exit Flent
63-
/exit
64-
```
65-
66-
Before running this Fluent journal file, you need to make sure:
67-
68-
1) the ansys module has been loaded (it’s highly recommended to load the same version of Ansys when you built the case project);
69-
70-
2) the project case file (`***.cas.gz`) has been created.
71-
72-
Then we can use Fluent to run this journal file by simply using:`fluent 3ddp -t$NTASKS -g -i testJournal.jou` in the terminal. Here, `3d` indicates this is a 3d model, `dp` indicates double precision, `-t$NTASKS` tells Fluent how many Solver Processes it will take (e.g. `-t4`), `-g` means to run without the GUI or graphics, `-i` testJournal.jou tells Fluent to read the specific journal file.
73-
74-
Here is a table for the available command line Options for Linux/UNIX and Windows Platforms in Ansys Fluent.
75-
76-
Options for Fluent TUI
77-
78-
| Option | Platform | Description |
79-
| --- | --- | --- |
80-
| `-cc` | all | Use the classic color scheme |
81-
| `-ccp x` | Windows only | Use the Microsoft Job Scheduler where x is the head node name. |
82-
| `-cnf=x` | all | Specify the hosts or machine list file |
83-
| `-driver` | all | Sets the graphics driver (available drivers vary by platform - opengl or x11 or null(Linux/UNIX) - opengl or msw or null (Windows)) |
84-
| `-env` | all | Show environment variables |
85-
| `-fgw` | all | Disables the embedded graphics |
86-
| `-g` | all | Run without the GUI or graphics (Linux/UNIX); Run with the GUI minimized (Windows) |
87-
| `-gr` | all | Run without graphics |
88-
| `-gu` | all | Run without the GUI but with graphics (Linux/UNIX); Run with the GUI minimized but with graphics (Windows) |
89-
| `-help` | all | Display command line options |
90-
| `-hidden` | Windows only | Run in batch mode |
91-
| `-host_ip=host:ip` | all | Specify the IP interface to be used by the host process |
92-
| `-i journal` | all | Reads the specified journal file |
93-
| `-lsf` | Linux/UNIX only | Run FLUENT using LSF |
94-
| `-mpi=` | all | Specify MPI implementation |
95-
| `-mpitest` | all | Will launch an MPI program to collect network performance data |
96-
| `-nm` | all | Do not display mesh after reading |
97-
| `-pcheck` | Linux/UNIX only | Checks all nodes |
98-
| `-post` | all | Run the FLUENT post-processing-only executable |
99-
| `-p` | all | Choose the interconnect = default or myr or inf |
100-
| `-r` | all | List all releases installed |
101-
| `-rx` | all | Specify release number |
102-
| `-sge` | Linux/UNIX only | Run FLUENT under Sun Grid Engine |
103-
| `-sge queue` | Linux/UNIX only | Name of the queue for a given computing grid |
104-
| `-sgeckpt ckpt_obj` | Linux/UNIX only | Set checkpointing object to ckpt\_objfor SGE |
105-
| `-sgepe fluent_pe min_n-max_n` | Linux/UNIX only | Set the parallel environment for SGE to fluent\_pe, min\_nand max\_n are number of min and max nodes requested |
106-
| `-tx` | all | Specify the number of processors x |
107-
108-
For more information for Fluent text user interface and journal files, please refer to [Fluent FAQ]( https://www.cfd-online.com/Wiki/Fluent_FAQ).
109-
12+
--8<-- "docs/snippets/examples/apps/ansysfluent/fluent_text_user_interface_and_journal_file.md"
11013

11114
[**Back to Ansys Fluent**](../ansysfluent_example.md)

0 commit comments

Comments
 (0)