This article contains answers for Ansys related FAQ. Please feel free to add questions and answers here!
My steady state solution converges for a while but stops converging before reaching my convergence criteria
Failure to obtain full convergence is a common issue for steady state simulations. It often occurs when doing mesh refinement studies, where coarse mesh simulations converge fully and quickly but as the mesh is refined the simulation fails to achieve the same residuals convergence. Frequently the cause for this behaviour is by the coarse mesh not resolving small shedding features, but as the mesh is refined smaller flow features are resolved and unless they are properly handled by the simulation setup it can lead to convergence problems.
To resolve the issue work through the following points:
- Read the CFX documentation. Specifically section 15 ("Advice on Flow Modelling"), section 15.10.6 ("Problems with Convergence"), and and any best practises guide applicable to your simulation.
- The first thing to consider is whether your simulation is sufficiently converged even though your specified criteria has not been met. To check whether your simulation is sufficiently converged, output the parameters important to your simulation to monitor points and display them in the solver manager. Appropriate parameters could be lift, drag, pressure loss, flow rate - what ever is an important parameter to your simulation. If these parameters are not changing to an accuracy tolerance suitable for your simulation then your simulation is almost certainly OK as it is and no further work needs be done.
If important parameters have not converged so a tighter convergence is required, the next thing to try is trying to get the simulation as it currently is to converge. Tips here are:
- Use a larger physical time step. A time step approximately equal to the average residence time in the simulation domain is a good guide for most simulations. If it is a recirculating system without an inlet or outlet then use the turn over time of the largest flow feature. You can get the residence time in CFX-Post by placing a streamline and looking at the "Time" variable on it. The maximum value of time is the residence time.
- Use Local Timescale Factor. A factor of about 5 is a good guess to start with. If this is successful you should run the final few iterations to convergence with a physical timescale (not local timescale all the way to convergence).
- For some simulations using double precision can help, particularly if there is a large range between maximum and minimum values of dimensions or flow parameters (velocity, pressure etc). It can also useful for buoyancy driven simulations.
- If using the hybrid differencing scheme you can consider reducing the blend factor. Don't reduce it below 0.75 without showing it does not harm accuracy by a sensitivity check.
If you cannot get it to fully converge then you should look at why it has not converged and try to fix the problem. Check:
- The physics of the simulation is correct.
- Do a test run with the residuals included in the result file. It is likely a small region of the flow has high residuals while the rest is converging. Consider why are the residuals high in that region - Is it:
- Poor quality mesh - the fix is obviously do a better quality mesh
- A physical instability, such as vortex shedding - the fix here is to use a larger timescale, a coarser mesh in the vortex shedding region, decrease the blend factor (if using hybrid differencing) or use a lower order turbulence model. The first option is preferred as the latter options can have accuracy implications.
- If you still cannot get the simulation to converge then try running it as a transient simulation. Adaptive time stepping can be useful here to quickly find the appropriate timescale. Transient simulations are much slower than steady state simulations so be aware that you will need extra patience.
- If the transient simulation shows the results to not be steady state then give up on the steady state model as the flow is transient and needs a transient solution to properly capture it.
How to avoid 6000 - 7000 K temperatures using finite rate chemistry model
Edit the def file and add the following to the edited ccl file. (You can do it by simply clicking the EDIT button in cfx5solver or using cfx5cmds command) Add these lines to the EXPERT section:
EXPERT PARAMETERS: stiff chemistry = t END
If you don't have this section, you can create it and then add a line there (see the manual).
Can CFX do a 2D simulation?
This is discussed in the CFX documentation, but it has been asked so many times on the CFD-Online Forum it is worth repeating. CFX cannot do a 2D simulation.
Is there any way of doing a 2D simulation in CFX?
Yes. From a 2D mesh of the geometry, extrude it one element in the normal direction. For a 2D planar simulation this would be one element in the normal vector direction, for a 2D axisymmetric simulation this would be sweeping a small angle with one element. For the planar mesh the extrusion should be approximately equal to the smallest element edge length in the model, for the axisymmetric mesh the sweep should be a small angle, maximum 5° but smaller if you want high accuracy.
In CFX-Pre you should set the top and bottom faces of the extrusion as symmetry planes. If you want to include swirl in the model use periodic boundaries. The remaining boundaries should be set as walls, inlets, openings and outlets to define the flow.
The CFX documentation discusses 2D simulations and it is recommended you read it before proceeding.
I get the error "Floating point exception: Overflow". What does this mean and what do I do about it?
This error means the linear solver has diverged badly. You will need to improve the numerical stability of the simulation for this simulation to converge. There can be many causes for this divergence, but the main ones are (listed in approximately the order they should be checked in):
- Is the physics of the simulation set up correctly? Have you forgot a material property? Or have you entered a material property incorrectly? Have you left out a vital physical model? Does your CEL correctly evaluate?
- Is the mesh of high enough quality? Different simulations have different mesh quality requirements. Simple low Reynolds number flow can handle lower quality elements than high Reynols number flows, and some physical models require high quality mesh. Multiphase modelling usually requires a higher mesh quality than single phase, and some multiphase models are very strict - for instance accurate surface tension modelling can require aspect ratios of less than 1.5, but simple flows can handle aspect ratios 10 or 100 times worse than this. Also note that high aspect ratio elements in prism layers does not necessarily cause problems as the element is aligned with the flow direction.
- Is a better initial condition required? The closer the initial condition is to the real flow field the easier it will be for the solver to converge. You can achieve this improved initial condition by:
- Using a previous simulation which has converged at a condition close to the problem simulation's condition.
- Using upwinding for the advection terms. Note this is not very accurate and is not recommended for final results, but it is a useful way of generating initial conditions which are close.
- Using a coarse mesh and interpolating as an initial condition onto the final mesh.
- Doing a simulation which does not include tricky physics, for instance doing a single phase model before introducing the multiphase physics.
- Is double precision required? Some models require additional numerical accuracy to solve. Examples include multiphase (especially surface tension) and buoyancy driven flows.
- Does the model require small time steps to start? Some simulations require small time steps to start, but once going the time step can be increased.
During the solution process, I get the warning message "A wall has been placed at portion(s) of an OUTLET"
This message appears whenever backflow would occur at a pressure outlet boundary condition. This type of boundary condition cannot handle backflow into the computational domain.
If the warning message disappears before obtaining the final solution, the results are still valid. If the warning persists, you have three options:
- Use an opening type boundary condition like the warning message suggests. However, you have to specify the direction of the backflow at an opening. Unless you have information about the direction of the backflow, the second option involves less modelling uncertainties.
- Move the outlet further downstream to a position where no backflow occurs.
- If the outlet and the wall is not significantly affecting your results you can ignore it and accept the solution with the back flow warning.
Calculating the Heat Transfer Coefficient in CFX
The Heat Transfer coefficient calculated by CFX will be quite different from standard film coefficients calculated by other means, but it is possible to output values that reflect the standard definition.
In CFX, the Wall Heat Transfer Coefficient = Wall Heat Flux / (Wall Temperature - Wall Adjacent Temperature) Most standard engineering equations we are familiar with use some "bulk temperature" in place of the Wall Adjacent Temperature. Of course CFX has no idea what your "bulk temperature" would be, and must use some other value. When using Wall Adjacent Temperature, which is the fluid temperature of the first fluid node off the wall, the returned value for HTC is going to be completely mesh dependent. Where coarser meshes will give you answers approaching the standard definition using bulk temperature, and a fine mesh would give you very large values, as the denominator of the HTC equation is approaching zero.
If you want the HTC to use a different value for the Reference Temperature instead of Wall Adjacent Temperature, there are a two approaches:
- Use the expert parameter "Tbulk for HTC" and set this to your some reference temperature. CFX will now calculate: Wall Heat Transfer Coefficient = Wall Heat Flux / (Wall Temperature - Tbulk for HTC)
Create your own expression for MyBulkTemperature through the geometry, for example, along the pipe length, which may be a function of the length.
- Create a new expression for MyHTC = Wall Heat Flux / (Wall Temperature - MyBulkTemperature).
- The tricky part is how do you get "Wall Temperature"? Well from the original HTC equation, we can see: Wall Heat Transfer Coefficient = Wall Heat Flux / (Wall Temperature - Wall Adjacent Temperature) Rearrange this equation to: Wall Temperature = (Wall Heat Flux / Wall Heat Transfer Coefficient) + Wall Adjacent Temperature
- You can then make a new variable from your "MyHTC" expression, and make a contour, or plot it on a graph with a line running along the wall. Remember this is a boundary only variable.
- The same approach can be used for Nusselt numbers as well.
Why are my results inaccurate?
- Firstly, is the simulation correctly set up? Does your model include all relevant physics?
- Has your solution converged to a reasonable value (see above)? For a simple analysis, an RMS residual of 1E-5 should be sufficient. Keep lowering your residual value until the solution no longer converges monotonically.
- Perform a sensitivity analysis on the relevant features of your simulation. In its simplest form, a sensitivity analysis involves altering one parameter (e.g., grid refinement) while keeping the other parameters constant and observing the effect this parameter has upon the simulation accuracy (e.g., by monitoring skin friction). The purpose of a sensitivity analysis is to obtain a simulation that is both accurate and cost effective. For just about every simulation a sensitivity analysis on mesh size and convergence tolerance is required. Depending on what you are modelling other sensitivity analyses may be required, covering things such as:
- Domain size (how close can the boundaries be to the region of interest?)
- Grid density
- Grid quality
- Grid type (e.g., structured versus unstructured),
- Spatial discretization (or advection) scheme
- Temporal discretisation scheme
- Turbulence model,
- Turbulence numerics,
- Turbulence intensity,
- Boundary condition type,
- Any empirical models used, such as heat/mass transfer coefficients, drag laws, free surface model,
- Two- versus three-dimensional simulations,
- and timestep size.
- Perform an error analysis:
- Calculate your discretization errors. A calculation should be performed on each quantitative parameter of interest (e.g., lift). The Journal of Fluids Engineering provides an explanation of predicting discretization errors here: Calculating Discretization Errors. In terms of errors, discretization errors are the greatest concern to a CFD modeler. Discretization errors are those that occur as a result of modeling the governing flow equations as algebraic expressions in a discrete space-time domain. Discretization errors should approach zero as the grid is resolved (i.e., as more grid points are generated and the solution becomes grid-independent). However, discretization errors also depend on grid quality (e.g., aspect ratio, orthogonality, skew). A well-refined grid is not necessarily a high quality grid and, thus, grid resolution and quality sensitivity analyses are recommended.
- Physical approximation errors can cause significant accuracy issues. This type of error is caused by physically approximating something to simplify the simulation (e.g., modeling a real fluid as an ideal gas).
- Computer round-off errors are caused when a computer stores floating point data. Depending on the accuracy your computer stores the data at, some round-off may occur. This type of error is usually negligible compared to the others and can be easily decreased by running the simulation in Double Precision mode.
- Iterative convergence errors are due to the resolution of the RANS equations. Since the Navier-Stokes equations are not solved directly, the solution iterates until a specified convergence criterion is reached (e.g., a residual value of a certain size is reached). This type of error can be decreased by allowing convergence to an acceptable level (see above).
- Usage errors are caused by user specifications. For example, the user may run a turbulent simulation as laminar or an unsteady simulation as steady. These errors can be monitored via a convergence study.
- And finally - consider the results are you comparing against. Are they accurate? How do you know? Are you modelling EXACTLY the same conditions as the results you are comparing against?
Are my results publishable?
The Journal of Fluids Engineering provides a good guide of recommendations regarding publishing your data. Journal of Fluids Engineering Numerical Accuracy
Why do I see a non-zero velocity at the walls?
CFX uses control volumes centred on the nodes, so the nodes on the walls generate control volumes whose centroids is off the walls. That is why the wall control volumes have non-zero velocities.
To make it display as expected in post processing, CFX has added the "hybrid" variable option for velocities, where it forces the velocity to zero (or more generally the wall velocity) at the wall. The "conservative" variables show the actual control volume values, and will not in general, be zero at the wall.
Why are my streamlines discontinuous as it crosses from a stationary frame of reference to a rotating frame of reference?
The variable "Velocity" is relative to the local frame of reference. If the frame of reference is rotating then it is relative to the rotating frame - so it will be different to the stationary frame by radius x omega. So when streamlines go from a stationary frame to a rotating frame the velocity jumps by radius x omega.
To see continuous streamlines plot the variable "Velocity in stationary frame". This is referenced to the stationary frame regardless of whether the frame is rotating or not, so will be continuous. You might need to access this variable using the puzzlingly labelled "..." button.
FSI (Fluid Structure Interaction)
Which ANSYS products are necessary to solve a FSI simulation?
Beginning with ANSYS 11.0, Ansys Workbench with Simulation and CFX are required.
Prior to ANSYS 11.0 you needed to use CFX (standalone or in workbench) and the ANSYS Prep7 GUI.
Which Ansys licenses are required for FSI in Ansys?
Working with Ansys 10.0 or older, a Muliphysics and a CFX license are required.
Ansys 11.0 has multiple options. It is possible to run an FSI simulation with a single license now.
What kind of coupling methods are possible?
One-way or two-way FSI coupling.
Is it possible to perform a steady-state FSI simulation?
Yes, Ansys 11.0 enables steady state and transient FSI simulations as well.
What is the general procedure for a FSI simulation in Ansys 11.0?
For a two-way simulation:
1. Define the Solid setup in Ansys Simulation (Ansys Workbench). This includes an Fluid-Solid-Interface.
2. Write an Ansys Input File (.inp) of this setup.
3. Define the Fluid setup in Ansys CFX-Pre. A link to the Ansys Input File is required.
4. Write an Ansys Definition File (.def) of this setup from CFX Pre
5. Start the coupled FSI run with the CFX Solver Manger
6. Postprocess both the CFD and solids results in CFX-Post.
How do I start an FSI simulation in Ansys 11.0?
Start the CFX Solver Manager and load the .def File. Ansys will load the .inp file automatically.
Is it necessary to define the Ansys Insallation Root in "Define Run" in Ansys 11.0?
On a Windows PC it is not, on Unix it is necessary.
Is it possible to stop a running FSI simulation in Ansys 11.0?
Yes, hit the stop button. It works.
Is it possible to write back-up files of a FSI simulation in Ansys 11.0?
Yes. You can write backup files from CFX in the usual way.
The solver terminates with the error message "A negative volume appeared". What went wrong?
This error often appears with FSI simulations. Normally it comes together with a large deflection simulation of the solid part. Mostly the CFD-mesh deformation is too big and negative elements appear. Possible solutions might be
- a better fluid mesh
- meshsiffness 1/wall distance
- smaller timesteps
These error messages can be difficult to debug as the solver often crashes without leaving a results file so it can be hard to see where the problem is. So a good way to debug these problems is set this up in CFX-Pre for your simulation:
- On the Output tab, go to "Transient Results Files" and set it to save a results file every time step. To keep the file size manageable, select "Include mesh", but make it "Selected Variables" and select no variables.
- If the mesh motion is prescribed (ie not FSI or 6DOF) then you can turn the fluid, turbulence, energy and any other solvers off using an expert parameter. This means the only work the solver is doing is calculating the mesh motion. Obviously this will speed the simulation up immensely.
- Run the simulation and load the results files up in CFD-Post
- Pay particular attention to the time steps immediately before it crashed. The region of highly distorted mesh should be obvious. If not use the mesh quality calcualtor to find the region of poor mesh.
If I open the FSI simulation in CFX-Post 11.0 only the fluid data are available. Where are the solid data?
CFX-Post only opens the .res file by default. If you want to postprocess fluid and solid data together you have to load the solid data additionally: File -> Load Result -> Load the Ansys .rst or similar data an activate the radio button "add data". Now you can postprocess all data in CFX-Post.
A well-refined grid is essential for properly capturing the viscous flow effects. For turbulence modeling, a boundary layer thickness of y+max < 1 is recommended to capture the viscous sublayer properly. However, many turbulence models now include wall scales that allow for y+ values larger than one, thereby creating a cost-effective and robust grid. As Reynolds number increases, grid refinement must, too. Grids used in laminar flows can be considered refined once they are resolved (see below).
A resolved grid is one in which the solution parameters of interest (e.g., skin friction) no longer change with further refinement. Proper grid resolution is required for simulation accuracy.
The third parameter to successful grid development is grid quality, a factor that is often overlooked. Grid quality parameters include (but are not limited to):
- Aspect ratio
- Determinant of the Jacobian matrix
- Expansion factor
- Type of grid
- Advantages of a structured grid
- Very efficient numerical procedures can be implemented on structured grids.
- Multi-block grids allow for customization of various regions.
- Structured boundary layers and other anisotropic regions limit discretization errors.
- Structured grids allow for decreased storage and less complicated data structures.
- Advantages of an unstructured grid
- Unstructured grids are highly robust and simpler to generate.
- There is a lack of restriction on where nodes are placed, increasing the automation of generation.
- Unstructured grids allow for subdivision of cells in areas requiring increased accuracy.
- Advantages of a structured grid
ICEM CFD includes a quality calculator for a priori grid accuracy. CFX-Post also allows for some a posteriori mesh quality calculations. For external aerodynamic applications, a C-grid with a multi-block structured mesh is recommended with aspect ratios near unity, high orthogonality on walls, minimal skew, and a very low expansion factor (1.01-1.05, if possible) in the boundary layer regions.
Where can I find a basic ICEM tutorial?
There are some tutorials available on the ANSYS Customer Portal. ANSYS also has a YouTube page (ANSYS YouTube page), which includes a tutorial on creating a structured C-grid around an airfoil.
How should I ask my question on the CFX forum to get the best possible answer?
The CFD-Online forum has general comments on this issue which everybody should be aware of here.
The most important point to understand about the CFX forum is that the quality of the answer to your question will depend entirely on the quality of your question!
Most of the questions posed on the CFX forum are so poorly posed that it's impossible to understand what the poster is actually asking. If you want effective help with your problem adhere to the following guidelines:
- Make sure your question is as clear, concise and as intelligible as possible. Use punctuation. Other forum readers are not going to spend time trying to decipher a garbled question.
- Give a clear general description of what class of problem and/or application you are working on BEFORE you start asking specific questions. This will aid other forum readers to better understand your specific questions.
- Describe precisely what you have done yourself to try and solve your problem, giving examples.
- Depending on your problem you should always include the following:
- A copy of your command file as a file attachment. Many simple problems can be spotted in a command file by an expert user.
- If you are asking a mesh quality related question then include some sample images of your mesh, including the boundary layer.
- If you are asking a user Fortran and/or user CEL question then include a copy of your existing code file as an attachment.
- Dont ask over broad questions e.g. "How do I simulate a 4-stroke engine". Nobody is going to type out fifty pages of guidance. They have better things to do.
- Don't shorten the words. It's a web forum, not a SMS text message. It's very hard to read it. Or R U 2 lazy? People may tend to be lazy to decipher and answer.
How do I post an image or attachment on the forum?
- Create the image/attachment on your local machine e.g. skew_mesh.jpg
- Click "Go Advanced"
- Click on "Attachments" (The icon looks like a paperclip)
- Click "Choose File" and browse to your image (such as skew_mesh.jpg). Click OK when you have selected your image file.
- Click "Upload"
- Your image/attachment should now appear in the attachments window. Close the attachments window.
- You should be back on the Go Advanced editor now. Move the cursor to where you would like to insert your image/attachment.
- Click on "Attachments" (the paperclip) and select the image/attachment file.
- You should now have some markup text inserted into your post. When you click "Submit Reply" on the post images will be displayed as thumbnails (and are clickable for the full image), and attachments are shown as a link to download.