Showing posts with label Fluent. Show all posts
Showing posts with label Fluent. Show all posts

Tuesday, February 10, 2009

Enable the Vorticity Magnitude Computation in Fluent Inviscid Simulations

For inviscid models, Fluent does not allow you to compute the vorticity magnitude. While it should usually be available under the velocity section of the variables to plot, an inviscid fluent model lacks this feature. I am not sure why this is the case as inviscid flows are generally rotational! Only irrotational flows have zero vorticity.

So any way, some of my models are run under inviscid flow conditions and to compute the vorticity, one may define a UDF to compute it or simply export the velocity field data and compute it in a data analysis software. I find this rather cumbersome as it cost me a lot of time and the accuracy of my computations may suffer a bit. It could have been just easier if Fluent does that automatically.

Here’s a neat trick: to enable the computation of vorticity in an inviscid Fluent model, simply change your model to laminar and you’ll see that nice vorticity magnitude variable show up!

Go to: Define/Models/Viscous and select Laminar

Voila!

Of course, you should do this after you’re done with your inviscid simulation.


Cite as:
Saad, T. "Enable the Vorticity Magnitude Computation in Fluent Inviscid Simulations". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2009/02/enable-vorticity-magnitude-computation.html?m=0

Thursday, June 5, 2008

Polar to Cartesian Transformation in Fluent UDF

Download udf c file

When simulating a certain problem in CFD, the closer your initial values are to the exact solution, the faster your numerical solution will converge. Now of course, if we had the exact solution, who cares about CFD? That is true, but most of the time we have simplified models that describe the flowfield in a certain geometry. Therefore, it makes sense to initialize the numerical data with the quasi-exact analytical model.

On the other hand, there is a technique that I use to make high quality streamline animations for my analytical models. (I will explain this in a subsequent article). The bottom line is that I need to initialize my mesh with the analytical solution. Now this solution is most often in cylindrical/polar coordinates and Fluent does not offer that luxury (and I agree, because it is easier to write a general code for the Cartesian form of the fluid flow equations). Fluent reads the mesh and solves the problem using Cartesian coordinates and all cells are defined using (x,y,z), while all velocities refer to the x,y, and z components respectively.

It is very easy to initialize the Fluent model with your analytical solution when it is in cartesian coordinates. For polar/cylindrical models, a little bit of extra programming is required.

I have written the code to do this for 2D polar coordinates. The 3D version will follow in the next article as generalization is required (to account for axis and origin locations - In case your axis is in the z direction and located at (0,0), then you can simply extend the attached code by adding the z component for the velocity).

Please take a moment to look at the file. Everything is commented clearly and the locations where you need to make changes are capitlized. You basically have to modify the origin location and the analytical solution.

(I assume you have knowledge of how to hook a udf file to fluent. I will prepare an article on that in the future).

Download udf c file

Cite as:
Saad, T. "Polar to Cartesian Transformation in Fluent UDF". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2008/06/polar-to-cartesian-transformation-in.html?m=0

Monday, June 2, 2008

Computing Derivates in Fluent UDFs

To compute the derivatives at cell centers in a user defined function, one can make use of the several macros provided by Fluent, such as C_DUDY(c,t). However, this will not work for the inviscid solver. It will only work when viscous effects are included (laminar or turbulence models). I will expand on this in the articles to follow.

Cite as:
Saad, T. "Computing Derivates in Fluent UDFs". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2008/06/computing-derivates-in-fluent-udfs.html?m=0

Saturday, May 17, 2008

Optimize Fluent Simulations

One way to optimize a Fluent simulation is to reorder the topology (i.e. cells, faces, and nodes) in memory so that accessing neighboring cell or face information induces a minimal overhead. According to Fluent, reordering the domain improves the performance of the solver. After reading the mesh file do the following
Grid->Reorder->Domain
Voila!

You should notice some improvement in your simulation after performing the reordering operation. Make sure also to save the case file so that the reordering of the mesh is reflected in subsequent runs.

Cite as:
Saad, T. "Optimize Fluent Simulations". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2008/05/optimize-fluent-simulations.html?m=0

Friday, May 16, 2008

Fluent Axisymmetric Simulations

To run an axisymmetric simulation in Fluent you have to do the following

  1. In Gambit, make sure your axis of symmetry is aligned with the x-axis (i.e. y = 0)
  2. Set the axis edge as an "axis" boundary condition
  3. Once you import your mesh into Fluent, set the solver to Axisymmetric

Voila!


Cite as:
Saad, T. "Fluent Axisymmetric Simulations". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2008/05/fluent-axisymmetric-simulations.html?m=0

Thursday, May 15, 2008

Fluent Graphics Display in Remote Desktop Mode

Most of the time, I run my Fluent simulations on remote computers using the windows remote desktop. However, when trying to preview the solution, nothing appears in the graphics window. This is usually the case with 3D simulations. To fix this problem, you have to disable "Hidden Surface Removal" in the "Graphics Options" window
  1. Display->Options
  2. Uncheck "Hidden Surface Removal"
Voila!

In 2D simulations, this option is usually unchecked. On the other hand, In 3D simulations, Fluent defaults to this option because it helps viewing 3D models.

Cite as:
Saad, T. "Fluent Graphics Display in Remote Desktop Mode". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2008/05/fluent-graphics-display-in-remote.html?m=0

Tuesday, May 13, 2008

Enable LES (Large Eddy Simulation) in Fluent 2D

To enable Large Eddy Simulation for Fluent two dimensional models, open the Fluent main console and type the following:
(rpsetvar 'les-2d? #t)
Voila!

This will enable LES in 2D models. Note that turbulence is inherently a 3D phenomenon and using LES for two dimensional flows is not recommended. However, in certain cases such as code benchmarks or debugging, it is useful to run LES in 2D. I would also speculate that LES is a valid model in axisymmetric conditions.

Cite as:
Saad, T. "Enable LES (Large Eddy Simulation) in Fluent 2D". Weblog entry from Please Make A Note. http://pleasemakeanote.blogspot.com/2008/05/enable-les-large-eddy-simulation-in.html?m=0