================================================================================= CBSFlow (2d) Incompressible ------------------------------ Written by Rhodri Bevan Zeta Computational Resources Ltd www.zetacomp.com Uses Characteristic Based Split Scheme for Convection Stabilisation ================================================================================= Source codes - General information ------------------------------------ Please read this information before using the codes. No guarantee is given on any of the source codes provided. All the source codes are copyrighted and no part of the code should be reproduced without the written permission of the author. The code is for personal use only. Improved and updated versions of the codes will be available via our website in due course. If you wish to be kept up to date, then please use the contact form to provide an email address. Full 3d (serial and parallel) codes are also available via the website. User Guide: Semi-implicit (2d) incompressible code ===================================================== The CBSFlow (2d) executable requires a CASENAME to be provided during runtime. This CASENAME defines the input files. CBSFlow requires 3 input files. A mesh file (.plt extension), a boundary definition file (.bco extension) and a parameters file (.par extension). Using the lid-driven cavity example files (re100), the CASENAME would be 5000NUcav and the input files would be: 1. 5000NUcav.plt 2. 5000NUcav.bco 3. 5000NUcav.par Mesh File Layout ----------------- The 1st line defines the size of the mesh: Number of elements (NELEM), Number of Points (NPOIN), Number of Boundary Sides (NBOUN). Then follows the element connectivity table (INTMA) for each element. The element number is first, followed by 3 nodes within the triangle. Afterwards comes the coordinates for each node (COORD), again with the node number first, followed by the x and y coordinates. Finally, information on the boundary sides (ISIDE). The first two numbers in each line denote the 2 nodes within the side. The third number is the element number to which the side belongs. The final number is the boundary side number. This boundary side number is replaced during run-time with information from the boundary condition file. Boundary Condition File ------------------------- The 1st line defines how many boundary side types are present in the mesh (NFLAG). Following this will then be NFLAG entries in the FLAG_LIST array. This array replaces boundary side numbers in the PLT file with boundary flag codes. This procedure is to avoid regenerating the mesh each time you change the boundary conditions. Currently, The available flag codes are: ! 500 - adiabatic with prescribed velocity ! 501 - constant temperature with no-slip (T = 1) ! 502 - constant temperature with no-slip(T = 0) ! 503 - constant temperature (T = 0) prescribed velocity (u=1,v=0) ! 504 - pressure boundary ! 506 - velocity symmetry, no-flux energy ! 507 - Backward Facing Step (Re=229) Parabolic Boundary (with v=0) Parameters File ----------------- The parameters file is comprised of text outlining what parameters come next in the file, and the parameters themselves. The layout of the file cannot be changed, or CBSFlow will not function correctly, if at all. The first parameter (line 2) defines which solver is used to solve the pressure field (Step 2). If SOLVER_TYPE is 1, then Conjugate Gradient is used, if 2 then Banded Gaussian Elimination is used. Please note, if the banded solver is used, then the 1st line of the PLT file must contain the bandwidth (as a 4th number in the line). The 2nd parameter (line 4) controls whether freestream conditions are used as an initial solution, or whether a previous solution is used. If RESTART_OPT is 0, then freestream is used. If 1 is chosen, then a previous solution is used, unless no previous solution exists. If this is the case, then the program defaults to freestream conditions. A warning will be printed to screen to inform the user which condition is used. The 3rd parameter (line 6) deals with the energy equation. In forced convection problems, the energy equation is not required - but can still be used to model transport if desired. Again, if the energy equation is required, it will be activated. A value of 1 is ON, 0 is OFF. The 8th line of the file contains the freestream conditions. 4 values are required (Ux, Uy, P and T). The 10th line contains information on number of iterations/steps (NTIME), Transient or steady state simulation (TRANSIENT_ON). A value of 1 is ON, 0 is OFF. The local time-step can be fixed to a constant value (using DTFIXED, ON = 1, 0 = local, -1 = Global minimum of local values). The next variable in the line is DTFIX, the variable defines the fixed value if appropriate. Even if not used, this entry (like others) must be present. The final entry in the line (IWRITE) denotes how often the convergence check/screen output is undertaken. The 12th line denotes a safety factor (CSAFM), and THETA1. The safety factor is used during the local time-stepping calculation to reduce the used local time-step below the critical value. THETA1 is the value used in the continuity equation. Theta(2) is hard-coded as 1, as Step 2 is solved implicitly in this version of CBSFlow. Line 14 contains the problem's Reynolds Number, Prandtl Number, Rayleigh Number and Richardson Number. Line 16 defines the CONVECTION_TYPE, whether Forced/Mixed (0) or Natural (1) Convection. If no pressure boundary conditions are specified, then a single node must have a pressure condition imposed. The node number is specified in line 18, but ignored if boundary conditions are present. Line 20 contains some output controls, to ensure your calculation is regularly backed-up. Output can be via Iteration Control, Time Interval (seconds), Simulation Time Interval (transient only). The final entry is for transient problems, it defines the end simulation time. Line 22 controls the Conjugate Gradient tolerances for the residual (relative and absolute). Line 24 controls the steady state tolerances (L2 norm - velocity and energy). First entry (0 - OFF, 1 - ON) for Velocity, followed by tolerance value itself. Third entry is ON (1)/ OFF (0) for Energy, followed by tolerance. If energy is not solved, then energy tolerance is ignored. Output type is controlled by line 26. First entry enables (1) or disables (0) Paraview Output, second entry enables (1) or disables (0) tecplot output. The third entry controls local Nusselt profile output (ON - 1, OFF - 0) and the fourth entry is the boundary flag code for the Nusselt profile generator. If energy is off, then Nusselt is not calculated. Line 28 contains a single option for Run Time Control. 1 is ON, 0 is OFF. If on, then CBSFlow will update the simulation with new values whenever the Parameters file is modified (and saved). Only certain values can be changed during run-time however, to avoid calculation issues. If the wrong value is changed, this will not have an effect on the simulation and the simulation will need to be stopped and restarted for it to be updated. Running CBSFlow ------------------ After compiling the program, for example using gfortran, then the program can be run from the command line with one argument in the command. e.g. prompt:> cbsflow2d 5000NUcav This would require the CASE 5000NUcav to be located in the current directory. Otherwise , if located in a subdirectory the command would be: prompt:> cbsflow2d ./a_subdirectory/5000NUcav During run-time, some output to screen occurs. This information is intended to inform the user as to the progress of the iterative scheme. Both L2 Norm information and residual information is presented. It is advised that the user consult the example benchmark files provided on www.zetacomp.com If any bugs are detected, then the authors would like to be informed (via email/the contact form located on the website). Feedback is also welcomed. However, only limited complementary support may be provided, and on a case-by-case basis. Additional software will be added to the website in due course.