TUI of ANSYS Fluent

#+SETUPFILE: theme-bigblow.setup

* TUI
keywords:
- Background Execution on Linux Systems, journal file

Programming language : [[https://en.wikibooks.org/wiki/Scheme_Programming][Scheme]], as a Lisp dialect


to exit
> Ctrl + c

to record a journal in win10

> file/write/start-journal

** acoustics

/file/start-transcript job-0.trn yes
/file/set-batch-options yes no no
;
/file/read-case cylinder2d.msh.gz
/mesh/check
/mesh/reorder/domain
/define/models/steady no
(rpsetvar 'les-2d? #t)
/define/models/viscous/les yes
/define/materials/change-create air , no no no no no no no
/define/boundary-conditions/fluid , , , , , , , , , , , ,
/define/boundary-conditions/velocity-inlet inlet no no yes yes no 69.2 no 0 yes
/define/boundary-conditions/pressure-outlet outlet no 0 no yes no no
/solve/set/gradient-scheme no yes
/solve/set/discretization-scheme pressure 14
/solve/set/discretization-scheme mom 7
/define/models/unsteady-2nd-order-bounded yes
/define/models/noniterative-time-advance yes
/solve/set/p-v-coupling 25
/solve/set/relaxation-factor pressure 0.7
/solve/set/relaxation-factor mom 1
/solve/initialize/compute-defaults velocity-inlet inlet
/solve/initialize/init-flow
/solve/set/time-step 5e-6
/file/wcd cylinder2d-t0.00.cas.gz yes
;
/solve/dual-time-iterate 20
;
/solve/monitors/force/set-lift-monitor cl-1 yes wall_cylinder , no yes cl-1-history no no 0 1
/solve/monitors/force/set-drag-monitor cd-1 yes wall_cylinder , no yes cl-1-history no no 1 0
/report/reference-values area 0.019
/report/reference-values velocity 69.2
/report/reference-values length 0.019
;
/solve/dual-time-iterate 40
;
/file/wcd cylinder2d-t0.02.cas.gz yes
;
; FWH Setup
;
/define/models/acoustics ffowcs-williams yes no yes 1.225 340 2e-5 0.095
;
/define/models/acoustics/sources wall_cylinder , , 2 200 cylinder2d-demo yes
/define/models/acoustics/receivers 2 0 -0.665 0 , 0 -2.432 0 ,
;
;
/solve/set/relaxation-factor pressure 1
;
/solve/dual-time-iterate 40
;
/file/wcd cylinder2d-t0.04.cas.gz yes
;
;
; The following command depends heavily on the number of asd files writen
; recommendation:  run it interactively
;
/define/models/acoustics/read-compute-write , yes yes yes yes yes
;
/file/stop-transcript
exit yes



** Examples
| ; | commment |
|   |          |
*** Steady
#+BEGIN_SRC
    rc t-mrf_4.9.cas.gz
    rd t-4000.dat.gz
    it 4000
    wd t-8000.dat.gz
    /write-data
    exit
    yes
#+END_SRC


*** Unsteady
#+BEGIN_SRC
#+END_SRC
    rc t_s_4.9.cas.gz
    rd t_s_4.9.dat.gz
    solve/dual-time-iterate 360 30
    solve/set/time-step 0.00083
    wc t_s_4.9_360.cas.gz
;file/write-data example.dat
    wd t_s_4.9_360.dat.gz
    exit
    yes
#+END_SRC
** discretization schemes
Use the following text commands as appropriate followed by the appropriate number from the list below.
#+BEGIN_SRC
/solve/set/discretization-scheme/pressure
/solve/set/discretization-scheme/flow
/solve/set/discretization-scheme/mom
/solve/set/discretization-scheme/k
/solve/set/discretization-scheme/epsilon
/solve/set/discretization-scheme/temperature
#+END_SRC


Basic discretization schemes:
("First Order Upwind" . 0)
("Second Order Upwind" . 1)
("Power Law" . 2)
("Central Differencing" . 3)
("QUICK" . 4)
Pressure Discretization:
("Standard" . 10)
("Linear" . 11)
("Second Order" . 12)
("Body Force Weighted" . 13)
("PRESTO!" . 14)
("Continuity Based" . 15)
Pressure-Velocity-Coupling:
("SIMPLE" . 20)
("SIMPLEC" . 21)
("PISO" . 22)

Example 1:
To set pressure-velocity coupling to PISO use the TUI

/solve/set/discretization-scheme/flow 22

Example 2:
To set pressure discretization to Body-Force Weighted use the TUI
#+BEGIN_SRC
/solve/set/discretization-scheme/pressure 13
** Turbulence model
define/models/viscous/inviscid yes
/define/models/viscous/ke-standard yes
/define/models/viscous/kw-sst yes          
 #Enable/disable the SST - turbulence model.
/define/models/viscous/kw-standard    yes
#+END_SRC



** Reference

4.2. Running ANSYS Fluent in Batch Mode, [[file:C:\akmkemin\Backup\ANSYS\FLUENT\Getting-Started-Guide.pdf][getting start guide]]
https://web.stanford.edu/class/me469b/download/scheme.pdf
Scripted-CFD-simulations-and-postprocessing-in-Fluent-and-ParaVIEW.pdf
Scheme_fluent_programming_reference.pdf
Chapter 2:Text User Interface (TUI), user guide, fluent
text command list, fluent, file:C:\akmkemin\Backup\ANSYS\FLUENT\TUI\Text-Command-List-Fluent.pdf

** Save residual
#+BEGIN_SRC emacs-lisp
;save residuals
(display "Save the residual in a file") (newline)
(let
 ((writefile (lambda (p)
   (define np (length (residual-history "iteration")))
   (let loop ((i 0))
 (if (not (= i np))
(begin (define j (+ i 1))
(display (list-ref (residual-history "iteration") (- np j)) p) (display " " p)
(display (list-ref (residual-history "continuity") (- np j)) p) (display " " p)
(display (list-ref (residual-history "x-velocity") (- np j)) p) (display " " p)
(display (list-ref (residual-history "y-velocity") (- np j)) p) (display " " p)
(display (list-ref (residual-history "z-velocity") (- np j)) p) (display " " p)
(display (list-ref (residual-history "k") (- np j)) p) (display " " p)
(display (list-ref (residual-history "omega") (- np j)) p)
(newline p)
(loop (+ i 1))
)
)
)
) )
(output-port (open-output-file "residual_2000_e387_udf.dat")))
(writefile output-port)
(close-output-port output-port))
#+END_SRC


** Journal


- journal file :: a sequence of ANSYS Fluent commands

- The purpose of a journal file is to automate a series of commands instead of entering them repeatedly
on the command line.
- the journal file does not contain any response to the confirmation request, ANSYS Fluent cannot
continue to follow the instructions of the journal file.


for more information, refer to Scheme notes file:C:\Users\exw692\Dropbox\Emacs\Scheme.org


The list of instructions can be written within a text editor.
*** record journal GUI
Fluent can also record all what is done during the interactive setup through
    File > Write > Start Journal.

The setup is saved with GUI language in the journal file.
 But it is recommended to create journal file with the TUI

 (using TUI commands or scheme commands) and not through de GUI, as GUI structure may changes from one version to another one.
 Note that in this recorded file, all the lines will start with (cx-gui-do ....) which represents all the click on the GUI.

**** note
Be careful not to change the directory while recording a journal file.
**** reference
>> 4.9 Creating and Reading Journal Files, https://www.sharcnet.ca/Software/Fluent6/html/ug/node94.htm#JournalFile
*** The interactive TUI inside Fluent helps:

type commands in the console window of fluent GUI
~>~ #command prompt
~q~  #quit, back up a level

 ~Enter~ # generate a listing of the submenus and commands in the current menu

**** In batch mode:
[usual fluent starting command] -i journal_file.jou &
For example:
~fluent 3ddp -t4 -i example.jou -g >> transcript.out~
This command will run Fluent in 3d double precision (dp), in parallel on 4 procs (-t4) using the *example.jou* journal file (-i), in batch (-g) and save the output to the transcript.out file (>>).
dual-time-iterate
; Perform unsteady iterations for a specified number of time steps.
#/solve/dual-time-iterate [number-of-timesteps] [max-number-of-iterations-per-time-step]

; Read case file
rc example.cas
; Initialize the solution
/solve/initialize/initialize-flow
; Calculate 50 iterations
it 50
; Write data file
wd example50.dat
; Calculate another 50 iterations
it 50
; Write another data file
wd example100.dat
; Exit Fluentt
exit
yes

here is a working example of a journal files (.jou), when you see a ";", it means i'm asking fluent to skip that command:
#+BEGIN_SRC
/file/read-case-data /home/maghazlani/Analysis/intake_test_3-1-23000.cas
;/define/operating-conditions/operating-pressure 0
;/define/models/solver/density-based yes
;/define/models/energy yes
;/define/models/viscous/kw yes
;/define/boundary-conditions/modify-zones/zone-type 11 pressure-inlet
;/define/materials/change-create air air yes ideal-gas no no no no no no
;/define/boundary-conditions/pressure-inlet inlet yes no 101325 no 27357 no 300 no yes no no no yes 01 0.05268
;/define/boundary-conditions/modify-zones/zone-type 10 pressure-outlet
;/define/operating-conditions/operating-pressure 0
;/adapt/adapt-to-gradients pressure curvature 0 0.7 0.3 yes 100
;/adapt/set/max-number-cells 2000
;/solve/initialize/compute-defaults/pressure-inlet 11
;/solve/initialize/repair-wall-distance yes
;Initialize the flow field with the current default values.
/solve/initialize/initialize-flow
;/adapt/mark-inout-hex yes no 0.000515079 0.205496 0.0156082 0.0451296 -0.000208354 -0.0265887
;/file/auto-save/data-frequency 20000
;/mesh/polyhedra/convert-domain yes yes
;/solve/set/under-relaxation/k 0.5
;/solve/set/under-relaxation/epsilon 0.5
;/solve/set/under-relaxation/turb-viscosity 0.7
;/solve/set/under-relaxation/solid 0.7
#+END_SRC





# journal example
; example.jou
; starting command : fluent 3ddp -i example.jou -g >> output.txt &
/file/read-case-data "tank-flush.gz" ; read the case and data files
/solve/initialize/hyb-initialization ; initialization
/solve/dual-time-iterate 10 10 ; iterate with the transient solver
/file/write-case-data "final.gz" ok
exit yes

 click on the keyboard Enter button to see all the available menus,
click on letter "q" to come back to the previous menu.
This can lead to this kind of journal file

an example
note:
(the semicolon (;) is used to include comments):

; example.jou
; starting command : fluent 3ddp -i example.jou -g >> output.txt &
/file/read-case-data "tank-flush.gz" ; read the case and data files
/solve/initialize/hyb-initialization ; initialization
/solve/dual-time-iterate 10 10 ; iterate with the transient solver
/file/write-case-data "final.gz" ok
exit yes








** define

*** boundary-conditions
 /define/boundary-conditions
bc-settings/                                    set/
copy-bc                                         symmetry
fluid                                           target-mass-flow-rate-settings/
list-zones                                      velocity-inlet
modify-zones/                                   wall
non-reflecting-bc/                              zone-name
periodic                                        zone-type
pressure-outlet
** change rotational velocity of moving reference frame
file:figures/fluent/cell-zone-conditions.png

***  batch model
#+BEGIN_SRC

; fluid zone, 2; axis, 0 0 1; rotational speed, -10 rad/s
/define/boundary-conditions/fluid 2 no no no yes -1 no -10 no 0 no 0 no 0 no 0 no 0 no 0 no 0 no 0 no 1 none no no no no no

/define/boundary-conditions/fluid 5 no no no yes 143 no -10.435 no 0 no 0 no 0 no 0 no 0 no 0 no 0 no 0 no 1 none no no no no no
#+END_SRC
*** interactive console TUI
#+BEGIN_SRC

/define/boundary-conditions> fluid
(fluid)
zone id/name [fluid] 2
material-name [water-liquid]: Change current value? [no] no
Specify source terms? [no] no
Specify fixed values? [no] no
Frame Motion? [yes] yes
; relative to inertial frame
Relative To Cell Zone [-1]
Use Profile for Reference Frame Rotation Speed? [no]
Reference Frame Rotation Speed (rad/s) [-8] -10

Use Profile for Reference Frame X-Velocity Of Zone? [no] no
Reference Frame X-Velocity Of Zone (m/s) [0] 0
Use Profile for Reference Frame Y-Velocity Of Zone? [no] no
Reference Frame Y-Velocity Of Zone (m/s) [0] 0
Use Profile for Reference Frame Z-Velocity Of Zone? [no] no
Reference Frame Z-Velocity Of Zone (m/s) [0]

Use Profile for Reference Frame X-Origin of Rotation-Axis? [no]
Reference Frame X-Origin of Rotation-Axis (m) [0]
Use Profile for Reference Frame Y-Origin of Rotation-Axis? [no]
Reference Frame Y-Origin of Rotation-Axis (m) [0]
Use Profile for Reference Frame Z-Origin of Rotation-Axis? [no]
Reference Frame Z-Origin of Rotation-Axis (m) [0]

Use Profile for Reference Frame X-Component of Rotation-Axis? [no]
Reference Frame X-Component of Rotation-Axis [0]
Use Profile for Reference Frame Y-Component of Rotation-Axis? [no]
Reference Frame Y-Component of Rotation-Axis [0]
Use Profile for Reference Frame Z-Component of Rotation-Axis? [no]
Reference Frame Z-Component of Rotation-Axis [1]

Reference Frame User Defined Zone Motion Function ["none"]
Mesh Motion? [no]
Deactivated Thread [no]
Laminar zone? [no]
Porous zone? [no]
3D Fan Zone? [no]
#+END_SRC
** set background color
#+BEGIN_SRC
display/set/colors/background "white"

> display/set/colors/background "white"
invalid command [background]
#+END_SRC
*** invalid command [background]

The commands to have a white background are:

/display/set/colors/color-scheme classic
/display/set/colors/background "white"

By default color scheme is set to "workbench" with the blue screen which is common to almost all workbench tools.
 And background option is not available with "workbench" option.
** syntax
command 1 argument 1 argument 2


** Batch model
 

~;~  #don't execute the command, comment

1. Save the case settings
~/file/write-settings copy_settings.set~
2. Save Data can be saved using the file interpolate option
~/file/interpolate/write-data copy_data.ip yes yes~
3. read case settings and interpolated data
~/file/read-settings copy_settings.set~
~/file/interpolate/read-data copy_data.ip~
#+BEGIN_SRC
/define/user-defined/
compiled-functions
function-hooks
execute-on-demand /*Execute UDFs on demand.*/
Answer:
#+END_SRC

** Boundary condition
use UDF for inlet velocity for k-omega turbulence model
Turbulent Kinetic Energy,1, (m2/s2)
Specific Dissipation Rate,1, (1/s)
*** Inlet BC
**** sine velocity inlet
#+BEGIN_SRC
> define

/define> boundary-conditions

/define/boundary-conditions> velocity-inlet
(inlet)

zone id/name [inlet] inlet
Velocity Specification Method: Magnitude and Direction [no] no
Velocity Specification Method: Components [yes] yes
Reference Frame: Absolute [yes] yes
Use Profile for Supersonic/Initial Gauge Pressure? [no] no

Supersonic/Initial Gauge Pressure (pascal) [0] 0
Coordinate System: Cartesian (X, Y, Z) [yes] yes
Use Profile for X-Velocity? [no] no
X-Velocity (m/s) [0] 0

Use Profile for Y-Velocity? [yes] yes
Use UDF Profile for Y-Velocity? [yes] yes
profile names list: ("udf")
profile name ["udf"]
data names list: ("x_vel::libudf")
data name ["x_vel::libudf"]
Use Profile for Z-Velocity? [no] no
Z-Velocity (m/s) [0] 0
Turbulent Specification Method: K and Omega [no] no
Turbulent Specification Method: Intensity and Length Scale [no] no
Turbulent Specification Method: Intensity and Viscosity Ratio [yes] yes
Turbulent Intensity (%) [4.999999888241291] 5
Turbulent Viscosity Ratio [5]
define/boundary-conditions/velocity-inlet/inlet no yes yes no 0 yes no 0  yes yes "udf" "x_vel::libudf" no 0 no no yes 5 5
#+END_SRC

**** 2d case
#+BEGIN_SRC
set "inlet_x_veloocity" to x-component of velocity
and  "inlet_y_veloocity" to y-component of velocity

- console interactive
Console TUI
/define boundary-conditions velocity-inlet
(inlet)
zone id/name [inlet] inlet
Velocity Specification Method: Magnitude and Direction [no] no
Velocity Specification Method: Components [yes] yes
Reference Frame: Absolute [yes] yes
Use Profile for Supersonic/Initial Gauge Pressure? [yes] no
Supersonic/Initial Gauge Pressure (pascal) [0] 0
Use Profile for X-Velocity? [yes] yes
Use UDF Profile for X-Velocity? [yes] yes
profile names list: ("udf" "udf")
profile name ["udf"] "udf"
data names list: ("inlet_y_velocity::libudf" "inlet_x_velocity::libudf")
data name ["inlet_x_velocity::libudf"] "inlet_x_velocity::libudf"
Use Profile for Y-Velocity? [yes] yes
Use UDF Profile for Y-Velocity? [yes] yes
profile names list: ("udf" "udf")
profile name ["udf"] "udf"
data names list: ("inlet_y_velocity::libudf" "inlet_x_velocity::libudf")
data name ["inlet_y_velocity::libudf"] "inlet_y_velocity::libudf"
Turbulent Specification Method: K and Omega [no] yes
Use Profile for Turbulent Kinetic Energy? [no] no
Turbulent Kinetic Energy (m2/s2) [1] 1
Use Profile for Specific Dissipation Rate? [no] no
Specific Dissipation Rate (1/s) [1] 1
#+END_SRC

#+BEGIN_SRC
- journal script
/define/boundary-conditions/velocity-inlet inlet no yes  yes yes no 0 yes yes   "udf"  "inlet_x_velocity::libudf"  yes yes "udf" "inlet_y_velocity::libudf" yes no 1 no 1
#+END_SRC


console information

(inlet)
Please answer y[es] or n[o].
profile names list: ("udf" "udf")
data names list: ("inlet_y_velocity::libudf" "inlet_x_velocity::libudf")
profile names list: ("udf" "udf")
data names list: ("inlet_y_velocity::libudf" "inlet_x_velocity::libudf")


**** 3d case
- interactive commands
#+BEGIN_SRC
/define boundary-conditions velocity-inlet
(inlet)
zone id/name [inlet] inlet
Velocity Specification Method: Magnitude and Direction [no] no
Velocity Specification Method: Components [no] yes
Reference Frame: Absolute [yes] yes
Use Profile for Supersonic/Initial Gauge Pressure? [no] no
Supersonic/Initial Gauge Pressure (pascal) [0] 0
Coordinate System: Cartesian (X, Y, Z) [yes] yes
Use Profile for X-Velocity? [no] no
X-Velocity (m/s) [0] 0
Use Profile for Y-Velocity? [no] yes
Use UDF Profile for Y-Velocity? [no] yes
profile names list: ("udf" "udf")
profile name ["udf"] "udf"
data names list: ("y_velocity::libudf" "z_velocity::libudf")
data name ["y_velocity::libudf"] "y_velocity::libudf"
Use Profile for Z-Velocity? [no] yes
Use UDF Profile for Z-Velocity? [no] yes
profile names list: ("udf" "udf")
profile name ["udf"] "udf"
data names list: ("y_velocity::libudf" "z_velocity::libudf")
data name ["y_velocity::libudf"] "z_velocity::lubudf"
``z_velocity::lubudf'' unknown -- enter choice again.
data names list: ("y_velocity::libudf" "z_velocity::libudf")
data name ["y_velocity::libudf"]  "z_velocity::libudf"
#+END_SRC

- journal script

#+BEGIN_SRC
/define boundary-conditions velocity-inlet inlet no yes yes no 0 yes no 0 yes yes "udf" "y_velocity::libudf" yes yes "udf"  "z_velocity::libudf"

define/boundary-conditions/velocity-inlet/inlet no yes yes no 0 yes no 0  yes yes "udf" "x_vel::libudf" no 0 no no yes 5 5  
#+END_SRC


** Animation/residual/monitor on cluster
The cluster cannot run any graphics, so don’t try to plot any figures.
If you do, errors transpire and you’ll have to delete the job (see Section 3.3).
This includes animations, residuals and monitors.
If you want to make animations, write the data files and use TecPlot on your PC.
Your output file is where you will monitor the convergence of your simulation.

Here is a sample journal file for a 2D simulation I ran in batch mode.
#+BEGIN_SRC    
    ;read case and data
    file/read-case single-48cm-2D-batchtest.cas
    ;
    ;initialize domain with air
    /solve/initialize/initialize-flow
    ;
    ;patch water to raceway depth of 3.5 cm
    /adapt/mark-inout-rectangle yes no 0 0.62875 -0.48 0.035
    /solve/patch water () (0) mp 1
    ;
    ;set up image output
    /display/set/contours/filled-contours yes
    /display/set/picture/driver png
    /display/set/picture/landscape yes
    /display/set/picture/x-resolution 960
    /display/set/picture/y-resolution 720
    /display/set/picture/color-mode color
    /views/restore-view front
    ;
    ;print front view of phases and velocity magnitude at t=0
    /display/contour air vof 0 1
    /display/save-picture airvof%t.png
    /display/contour mixture velocity-magnitude 0 0.5
    /display/save-picture velmag%t.png
    ;
    ;set up display commands to print front view of phases and velocity magnitude every 20 time steps
    /solve/execute-commands/add-edit command-2 20 "time-step" "/display/contour air vof 0 1"
    /solve/execute-commands/add-edit command-3 20 "time-step" "/display/save-picture airvof%t.png"
    /solve/execute-commands/add-edit command-4 20 "time-step" "/display/contour mixture velocity-magnitude 0 0.5"
    /solve/execute-commands/add-edit command-5 20 "time-step" "/display/save-picture velmag%t.png"
    ;
    ;set up auto-save
    /file/auto-save data-frequency 500
    /file/auto-save append-file-name-with time-step 6
    ;
    ;iterate over 5000 time steps
    solve/set/time-step 0.001
    solve/dual-time-iterate 5000 50
    file/write-data single-48cm-2D-batchtest.dat
#+END_SRC
    
    From <http://www.cfd-online.com/Forums/fluent/90579-creating-animation-through-tui.html>
     From: http://web2.clarkson.edu/projects/cluster/FLUENT_cluster.pdf
Solution Animation File
If you selected Metafile or PPM Image under Storage Type in the Animation Sequence panel, then FLUENT will save the solution animation file for you automatically. It will be saved in the specified Storage Directory, and its name will be the Name you specified for the sequence, with a .cxa extension (e.g., pressure-contour.cxa). In addition to the .cxa file, FLUENT will also save a metafile with a .hmf extension for each frame (e.g., pressure-contour_0002.hmf). The .cxa file contains a list of the associated .hmf files, and tells FLUENT the order in which to display them.

From <http://jullio.pe.kr/fluent6.1/help/html/ug/node875.htm>




** Solver
/define/models/solver/density-based yes

** Change pressure-velocity-coupling model in batch mode
| index | model   |
|    20 | SIMPLE  |
|    21 | SIMPLEC |
|    22 | PISO    |
|    24 | Coupled |

~/define/models/solver/pressure-based yes~   #pressure based solver
~solve / set p-v-coupling 20~  #SIMPLE
~solve / set p-v-coupling 21~ #SIMPLEC
~solve / set p-v-coupling 22~ #PISO
;Coupled solver, Coupled with Volume Fractions [no]
 /solve/set p-v-coupling 24  no
;change  courant number
;/solve/set/p-v-controls [courant-number] [explicit momentum] [explicit pressure]
/solve/set/p-v-controls  1 0.5 0.5
- where /everything in the brackets including the brackets has to be replaced by a number/.
an wrong example

;Coupled solver, Coupled with Volume Fractions [no]
 /solve/set p-v-coupling 24  no
;/solve/set/p-v-controls [courant-number] [explicit momentum] [explicit pressure]
/solve/set/p-v-controls  1 0.5 0.5

#+BEGIN_SRC

/solve/set/p-v-controls  1

Error: eval: unbound variable
Error Object: courant-number
#+END_SRC

** time step size
syntax:
~/solve/dual-time-iterate [number-of-timesteps] [max-number-of-iterations-per-time-step]~
- where everything in the brackets including the brackets has to be replaced by a number.


> ANSYS Fluent as a Server Users Guide

A command name
consists of phrases separated by hyphens. A command is matched by matching an initial sequence of its phrases. Matching of hyphens is optional

2.2.Text Prompt System
    The following shows some examples of prompts:
        filled-mesh? [no] Enter
        shrink-factor [0.1] Enter
        line-weight [1] Enter
        title [""]Enter
    The default value for a prompt is accepted by pressing Enter on the keyboard or typing a , (comma).
    
    Ctrl+c.#abort a prompt sequence, simply press
    ’() or () #empty list
    terminate the process with an empty list
    "~a" stands for random variable, like % in C language.
    "()" means that we simply press "enter" and do not specify any names.
    "x" at the end of line is the same loop variable and two of "x" correspond to two of "~a".
    q,  take one level above
    windows/
        XY plot window options. For a description of the items in this menu, see display/set/windows/xy.
    Sf
    
** Modifying the View
    
        Select and control the view of the scene that is displayed in the graphics window.
        
        all defined views will be saved in the case file when you write one.
        
        If you plan to use your views with another case file, you can write a “view file” containing just the views.
        
         “/fi/rc” # abbreviations of “/file/read-case”
        
        /solve/dual-time-iterate 500 20 iterate 500 timesteps, 20 iterations/timestep
        
        From <https://www.google.co.uk/search?q=dual-time-iterate&ie=utf-8&oe=utf-8&client=firefox-b-ab&gfe_rd=cr&ei=GxpQWM01iPfwB76JooAP>
        
        
        
        
** initialization
;Initialize the flow field with the current default values.
/solve/initialize/initialize-flow
/solve/initialize/hyb-initialization ; hybrid initialization    
; initialize from the velocity inlet
~/solve/initialize/compute-defaults/pressure-inlet 11~  #11 : id of pressure inlet
/solve/initialize/compute-defaults/velocity-inlet    147
;open channel initialize
/solve/initialize/compute-defaults/pressure-inlet 162 mixture
solve/initialize/open-channel-auto-init 162 yes
solve/initialize

**  discretization schemes
Use the following text commands as appropriate followed by the appropriate number from the list below.

/solve/set/discretization-scheme/pressure
/solve/set/discretization-scheme/flow
/solve/set/discretization-scheme/mom
/solve/set/discretization-scheme/k
/solve/set/discretization-scheme/epsilon
/solve/set/discretization-scheme/temperature

Basic discretization schemes:
("First Order Upwind" . 0)
("Second Order Upwind" . 1)
("Power Law" . 2)
("Central Differencing" . 3)
("QUICK" . 4)
Pressure Discretization:
("Standard" . 10)
("Linear" . 11)
("Second Order" . 12)
("Body Force Weighted" . 13)
("PRESTO!" . 14)
("Continuity Based" . 15)
Pressure-Velocity-Coupling:
("SIMPLE" . 20)
("SIMPLEC" . 21)
("PISO" . 22)

Example 1:
To set pressure-velocity coupling to PISO use the TUI

/solve/set/discretization-scheme/flow 22

Example 2:
To set pressure discretization to Body-Force Weighted use the TUI

/solve/set/discretization-scheme/pressure 13
        
** Set under relaxation

/solve/set/under-relaxation/density 0.5
;turbulent kinetic energy
/solve/set/under-relaxation/k 0.5   
/solve/set/under-relaxation/epsilon  0.5         
;specific dissipation rate
/solve/set/under-relaxation/omega  0.5
/solve/set/under-relaxation/turb-viscosity 0.5

/solve/set/under-relaxation/solid 0.7
/solve/set/under-relaxation/mom 0.5 # momentum
/solve/set/under-relaxation/epsilon 0.5   ; dissipation rate

;Coupled solver, Coupled with Volume Fractions [no]
/solve/set p-v-coupling 24  no
;/solve/set/p-v-controls [courant-number] [explicit momentum] [explicit pressure]
/solve/set/p-v-controls  1 0.5 0.5
/solve/set/under-relaxation/k 0.5           
/solve/set/under-relaxation/epsilon  0.5   

** log of  execute makefile

#+BEMIN_EXAMPLE

[exw692@frontend11 ~]$ cd UDF/libudf
[exw692@frontend11 libudf]$ make "FLUENT_ARCH=lnamd64"
for d in lnamd64/[23]*; do \
  ( \
    cd $d; \
        rm -rf *.{c,h,cpp,hpp}; \
    for f in ../../src/*.{c,h,cpp,hpp} ../../src/makefile ../../src/user.udf; do \
      if [ -f $f -a ! -f `basename $f` ]; then \
        echo "# linking to" $f "in" $d; \
        ln -s $f .; \
      fi; \
    done; \
    echo ""; \
    echo "# building library in" $d; \
    if [ "" = "1" ]; then \
        echo "# using gcc64"; \
        make ARCHC=gcc64 -k>makelog 2>&1; \
    else \
        if [ "" = "1" ]; then \
                echo "# using gcc"; \
                make ARCHC=gcc -k>makelog 2>&1; \
        else \
                make -k>makelog 2>&1; \
        fi; \
    fi;\
    cat makelog; \
  ) \
done
# linking to ../../src/vertical_component_2nd_stokes_wave.c in lnamd64/3ddp_host
# linking to ../../src/x_component_2nd_stokes_wave.c in lnamd64/3ddp_host
# linking to ../../src/udf.h in lnamd64/3ddp_host

# building library in lnamd64/3ddp_host
make[1]: Entering directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_host'
# Generating udf_names.c because of makefile vertical_component_2nd_stokes_wave.c x_component_2nd_stokes_wave.c
make[2]: Entering directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_host'
make libudf.so "CFLAGS=-D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=    " "LDFLAGS=-shared -lm"
make[3]: Entering directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_host'
# Compiling udf_names.o because of udf_names.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=         -I/share/apps/ansys/18.0.0/v180/fluentluent18.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0/src/main -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/addon-wrapper -I/share/apps/ansys/18.0.0/v180/fluentluent18.0.0/src/io -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/species -I/share/apps/ansys/18.0.0/v180/flue/fluent18.0.0/src/pbns -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/numerics -I/share/apps/ansys/18.0.0/v180luent/fluent18.0.0/src/sphysics -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/storage -I/share/apps/ansys/18.0/v180/fluent/fluent18.0.0/src/mphase -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/bc -I/share/apps/ansys/18.0/v180/fluent/fluent18.0.0/src/models -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/material -I/share/apps/ays/18.0.0/v180/fluent/fluent18.0.0/src/amg -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/util -I/share/apps/ays/18.0.0/v180/fluent/fluent18.0.0/src/mesh -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/udf -I/share/apps/ays/18.0.0/v180/fluent/fluent18.0.0/src/ht -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/dx -I/share/apps/ansy18.0.0/v180/fluent/fluent18.0.0/src/turbulence -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/parallel -I/sharapps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/etc -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/ue -I/share/ps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/dpm -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/dbns -I/share/ps/ansys/18.0.0/v180/fluent/fluent18.0.0/cortex/src -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/client/src -I/sre/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/tgrid/src -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/multiport/s -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/multiport/mpi_wrapper/include -I/share/apps/ansys/18.0.0/v180/flue/fluent18.0.0/multiport/mpi_wrapper/src -I. -c udf_names.c
# Linking libudf.so because of udf_names.c udf_names.o
cc -shared -lm udf_names.o vertical_component_2nd_stokes_wave.o x_component_2nd_stokes_wave.o  -o libudf.so
make[3]: Leaving directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_host'
make[2]: Leaving directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_host'
make[1]: Leaving directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_host'
# linking to ../../src/vertical_component_2nd_stokes_wave.c in lnamd64/3ddp_node
# linking to ../../src/x_component_2nd_stokes_wave.c in lnamd64/3ddp_node
# linking to ../../src/udf.h in lnamd64/3ddp_node

# building library in lnamd64/3ddp_node
make[1]: Entering directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_node'
# Generating udf_names.c because of makefile vertical_component_2nd_stokes_wave.c x_component_2nd_stokes_wave.c
make[2]: Entering directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_node'
make libudf.so "CFLAGS=-D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=    " "LDFLAGS=-shared -lm"
make[3]: Entering directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_node'
# Compiling udf_names.o because of udf_names.c
cc -D_lnamd64 -D_GNU_SOURCE -fpic -shared -ansi -Wall -O -DPTR_RESTRICT=         -I/share/apps/ansys/18.0.0/v180/fluentluent18.0.0/`expr "\`pwd\`" : '.*/\(.*\)/[23].*'`/`basename "\`pwd\`"` -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0/src/main -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/addon-wrapper -I/share/apps/ansys/18.0.0/v180/fluentluent18.0.0/src/io -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/species -I/share/apps/ansys/18.0.0/v180/flue/fluent18.0.0/src/pbns -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/numerics -I/share/apps/ansys/18.0.0/v180luent/fluent18.0.0/src/sphysics -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/storage -I/share/apps/ansys/18.0/v180/fluent/fluent18.0.0/src/mphase -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/bc -I/share/apps/ansys/18.0/v180/fluent/fluent18.0.0/src/models -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/material -I/share/apps/ays/18.0.0/v180/fluent/fluent18.0.0/src/amg -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/util -I/share/apps/ays/18.0.0/v180/fluent/fluent18.0.0/src/mesh -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/udf -I/share/apps/ays/18.0.0/v180/fluent/fluent18.0.0/src/ht -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/dx -I/share/apps/ansy18.0.0/v180/fluent/fluent18.0.0/src/turbulence -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/parallel -I/sharapps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/etc -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/ue -I/share/ps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/dpm -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/src/dbns -I/share/ps/ansys/18.0.0/v180/fluent/fluent18.0.0/cortex/src -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/client/src -I/sre/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/tgrid/src -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/multiport/s -I/share/apps/ansys/18.0.0/v180/fluent/fluent18.0.0/multiport/mpi_wrapper/include -I/share/apps/ansys/18.0.0/v180/flue/fluent18.0.0/multiport/mpi_wrapper/src -I. -c udf_names.c
# Linking libudf.so because of udf_names.c udf_names.o
cc -shared -lm udf_names.o vertical_component_2nd_stokes_wave.o x_component_2nd_stokes_wave.o  -o libudf.so
make[3]: Leaving directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_node'
make[2]: Leaving directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_node'
make[1]: Leaving directory `/data1/home/exw692/UDF/libudf/lnamd64/3ddp_node'
#+end-example

posted @ 2021-04-10 15:19  kaiming_ai  阅读(300)  评论(0编辑  收藏  举报