A collection of notes and tips that may be of use while working with Fluent.
Contents: Setting an initial condition | Creating an animation.
It is often desired to start with a certain initial condition, like an initial wave in a tank. This can be done in several ways. As it took me quite a while to find it out, here is documented how it can be done. Most methods start with initializing the solution (Solve->Initialize->Initialize..., Init) and then patching a certain area (Solve->Initialize->Patch..., select the phase under Phase, choose Variable as Volume Fraction, put either 0 or 1 in the Value box, select what to patch (depends on method), and press the button Patch).
One can create different zones in Gambit. When patching in Fluent, select the desired zone in Zones to Patch.
One can easily mark a rectangular or circular area using Adapt->Region.... Choose either Quad or Circle for 2D. Enter the Input Coordinates, and press Mark. In the Patch window, a new item just appeared. You can use that area to patch.
It is often convenient to start with a sinusoidal wave as initial condition. That can be done using a custom field function (Define->Custom Field Functions...). Use the Grid X and Y coordinates to make function that is dependent on location. Make sure the function is smaller than zero where you want to patch the solution. Then use Adapt->Iso Value... to select the area. choose Custom Field Functions under Iso-Values of, and select the desired function in the box below (You can use the button Compute to see if you really get values below and above zero). Enter a positive number (higher than Max, when you pressed Compute) in the Iso-Max box, and keep Iso-Min on zero. Press the button Mark, and you'll have a new patch register in the Patch window.
You can use an external program for initial conditions. I don't know how though.
Fluent has a built-in method for creating simulations. This is very inconvenient, as it has to be setup everytime before running a simulation. It is mentioned below for completeness. We used another method with a scheme program.
To simplify movie creation, a scheme program (see automation) was made that makes a movie out of a simulation. This file is called create-movie.scm and can be found in most fluent directories. It was designed for unix/linux, see portability notes inside the file for details on how to adapt it to your platform.
See complete-simulation.scm for an example on how to use it. Shortly:
(define timestep 0.01) ;; time step for iterations (define iterations (/ 60 timestep)) ;; how many iterations to do (60 seconds real time) (define frame_every (/ 0.02 timestep)) ;; how many time steps per frame (50 frames per second) (define outputmovie "/tmp/output.avi") (load "create-movie.scm")
Then run the simulation, and finally run to obtain the movie:
(movie-finish)