Running Ansys Fluent on Ansys Cloud using a Journal File and a UDF

Cloud computing is becoming more and more popular with the recent changes in the work environment, and Ansys Cloud solution is no exception. While running a Fluent simulation on the Ansys Cloud is now a more familiar task among CFD users since its introduction around a year ago, there are still some cases that might be challenging and need more attention. One of these cases is performing a Fluent simulation using a UDF.

The first thing users might notice when launching an Ansys Cloud Fluent job through the ACT extension is that the UDF files won’t be uploaded, which is why they might see their cases are failing if they don’t pay extra attention. In order to avoid this issue, users must follow one of the options below.

The first and most commonly used method to launch a Fluent job with a UDF is via the CLI (Command Line Interface). With this method, the .c and all other files in the working directory will be uploaded to the Cloud. Then UDF will then be compiled on the Cloud.

Since the Cloud computers already have compilers installed, one doesn’t need to anything special. The local directory should have .c file, case file with UDF plugged-in, and a journal file. As a side note, Ansys Fluent 19.3 and higher supports expressions that can be used to define boundary conditions instead of UDF. Starting with Ansys Fluent 2020R2, the C compiler is built-in with the software. Please refer to the product documentation.

We highly recommend that the user should have the required compiler installed locally to compile, hook, and test the routine before submitting it to the cloud.

If you have not used CLI to submit a Fluent job to the clouds, please read the article below:

https://cloudforum.ansys.com/t/80njy9/how-to-running-fluent-on-cloud-using-a-journal-file-and-udf

In short, you have to open a command prompt (cmd.exe) and navigate to your working folder. This folder should contain all the Fluent input files needed for the run: journal file, case file, etc. Once you login using ansyscloudcli command, you are ready to submit your job on the cloud.

Below is a common example for the commands to run Fluent on the cloud:

ansyscloudcli runfluent -j fluent_via_journal --jou tjunction.jou –q Flexible_eastus_Standard_HC44rs_2020r2 -n 1 -m 36 -v 2020r2

Here is some description of these commands:

> AnsysCloudCLI runFluent -j <job name> [--jou <journal>] -q <queue>  [-n <num nodes>] [-m <max cores>] -v <solver version>
-j: job name
-q: name of the queue 
    (run: ansyscloudcli getQueues, to get a list of all queues. Queue name is case sensitive)
-i: name of the input file for the solver
--jou: journal to execute (if set, -i is not used)
-n: number of nodes
-m: (optional) max number of cores. Useful if you want to make a run with 4 cores on a computer with 16 cores
-v: target solver version

The second method is to compile the UDF locally and upload all files to a virtual desktop infrastructure (VDI) session. Then the compiled UDF can be used with Fluent through the VDI session. Note that the UDF can’t be compiled on a VDI session with versions 2020R2 and earlier.

Lastly, with 2021R1 Fluent has a built in Clang compiler which will allow you to compile a UDF in a VDI session. However, the Clang compiler still won’t allow you to submit a Fluent job with a UDF through the ACT.

Ansys Cloud VDI solution running on a local desktop via RDP

Meshing in the New Ansys Fluent Task-based Workflows

Working with a variety of users with different levels of CFD (Computational Fluid Dynamics) backgrounds, I have to admit that Fluent meshing used to be a challenging and confusing task for beginners and even intermediate users.

Ansys has addressed this challenge by redesigning the Fluent user interface to provide a task-based workflow for meshing that enables engineers to do more and solve more complex problems than ever before in less time. The new Fluent task-based workflow streamlines the user experience by providing a single window that offers only relevant choices and options and prompts the user with best practices that deliver better simulation results.

Best practices are embedded into the workflow in the form of defaults and messages to the user. This reduces the amount of training required to start using the software and makes it easier for occasional users to return to the software.

How to Mesh Watertight CFD Geometry in the New Ansys Fluent Task-based Workflow

In order to use this workflow, you need a relatively clean watertight solid and/or fluid regions that can be meshed by surface meshing and then volume filling (no wrapping required.) Geometry can consist of single or multiple bodies.

Going through the task-based workflow is straightforward. You are presented with several steps, like:

  • Surface mesh.
  • Describe geometry. (Fluid and/or solid)
  • Capping. (If you are creating an internal flow volume, then the capping tools in Fluent makes extraction easy)
  • Volume meshing. (If you wish to use the latest Mosaic meshing technology, select “Poly-hexcore”)
Mosaic Meshing Technology

Now, click on “Switch-to-Solution,” to bring the mesh into a familiar Fluent interface.

Fault-Tolerant Workflow for Ansys Fluent Meshing Wraps and Seals Leaks and Gaps

Sometimes CFD simulations contain dirty, non-watertight geometries. For instance, 3D scanned or manufacturing geometry files. These geometries may contain missing faces, gaps, holes, overlaps, and other issues. As a result, they require extensive cleanup before simulation.

To overcome this obstacle, Ansys offers a new Fluent meshing workflow that wraps dirty geometry without cleanup.

The workflow for non-watertight geometry offers distinct advantages over other meshing technologies such as:

Part management:

Users can perform CAD-level changes to any geometry or assembly, including dragging and dropping objects from the CAD model into the simulation model.

Leakages and overlaps:

The fault-tolerant workflow seals leakages caused by gaps and misalignments between solid bodies. This significantly reduces the manual efforts required to clean up geometry.

The fault-tolerant workflow can easily wrap leaky geometry

STL file input

The workflow can create fluid regions directly from STL files or scanned data. This eliminates the need to convert STL files into solid geometry for the biomedical, oil and gas, automotive and other industries.

Imported STL File

2020R2 updates:

There are a few important improvements both in Watertight meshing (WTM) and Fault-Tolerant meshing (FTM) workflows in the 2020R2 release.

FTM/WTM: Wild card selection in lists

The Meshing Workflows now have an option to use a persistent Wildcard string for selecting labels or zones. This is in addition to the Filter Text option previously available. The new Use WildCard option stores the wildcard string itself in recorded workflows instead of an explicit list of locations so that when they are played back with new geometries, the matching will be performed again and pick up any matching zones/labels that were not in the earlier geometry.

WTM: Support of Region-specific Sizing 

You can specify region-specific Max Size and Growth Rates during the Volume Meshing task.  If you enable Region-based Sizing, Fluent will compute default sizing specifications for each region.  These can then be adjusted as required for each region.

WTM: Start From Imported Surface Mesh

This is useful if you have an established surface-meshing workflow or if you already have a mesh generated (perhaps from another preprocessor or an existing Fluent case) and want to use that as a starting point for Fluent meshing. Once you import the surface mesh you have the option of using it as it is, or selectively adding additional Local Size controls and/or remeshing particular surfaces as needed.

FTM: Continuous prism layers for Poly and Poly-Hexcore for Fluids

For the Fault-Tolerant Meshing Workflow you can now create continuous prism layers without stair-stepping within poly and poly-hexcore fluid regions.  Note that this will apply in all zones of the region.

WTM: Support of Local Sizing on Labeled Edges

Once you have labeled the edges, you can select Edge Size in Add Local Sizing to prescribe a target size on the selected edge(s).