Description/Structure:
The task of this routine is to initialize.
structure:
The subroutine starts with setting the name of the routine and the variable names (chvar()) for the debug output in 'sipsol'.
Then if clicking grids are enabled then the output is created (omega, ...) and if the number of total processors is greater than one then the information of time step size (variable: dtime) has to be broadcasted (routine brcasti8).
After that the reciprocal values of turbulent prandtl numbers (global variable: rtinv()) are initialized and the molar mass is corrected to SI-units.
Then a huge section follows where the differnt constants dependend on the current
Afterwards important constants (i.e. for Eddy-Break-up model, for time discretization, stefan-boltzmann constant, ... ) are also initialized.
The initialization continues with the corner arrays, corner point array for flow, corner point array for temperature, corner lines array for flow, corner lines array for temperature, corner lines and corner point arrays for concentration, corner lines and corner point arrays for combustion. The first huge section of initialization finishes with initialize some geometric variables (metric normal to the planes, variable: ar1x(inp), ...) which are set to 0.
Then metrices, jacobian, stretching factors as well as normal distances from wall for low-Re-model are computed and the filterwidth for LES is calculated. Also the ASCII debug output for geometry is done and the roughness are setted on the patches.
After that another huge section of initialization starts with opening and initializeing the GRISSLi coupling interface for FSI. Then it continues with initialize
If it is necessary the properties (density, viscosity, ...) have to be setted again and have to be checked if they have reached the limits (routine checkprop). Then a first estimate for the fluxes is computed. This is all done over all grids (loop: ngr=1,ngend).
The last but one step is the check if the restart-file should be read or not. If it is read then
Then the last step follows which contains the initialization and reset the arrays (for all directions) which store values of the coefficients of the neighbours, according to the suitable directions, of node P in the discretization equations (variable: aw(i), ae(i), an(i), as(i), at(i), ab(i)).
Description/Structure:
Description:
This subroutine reads the list of file names used in the program.
To determine whether the list is in the old or new format the first line is read. If it starts with a hash mark character the parser for the new file format is called, else the parser for the old format. After reading the file the remaining debug file names are constructed and a list of all file names is printed.
Structure:
After a list of variables and parameter definitions the variable name llflag is initialized for exception handling and is set to 0. If it is set to values which are not 0 then an error is allways printed out.
Then it starts with the query if the number of the current processors (variable: iproc) is equal to 1. If not nothing happens. This query is necessary when you want to write something out because this can only be done if the number of current processors is 1.
If iproc is one then the logicals for the co-visualization file names are initialized. The co-visualization file names are optional, so we have to remember if they have been set or not.
After that the first line of the list of file names is read (variable: oneline, type character) and then a decision takes place if the file is written in new or old format. Whether it is old or new the suitable subroutine, named fparserold or fparsernew, is called. For more information about the structure and what is happening there have a look below.
Afterwards the length of the file names is computed by calling subroutine sflstb (extra file named sflstb.F), the derived debug file names are built and the plot file names are splitted into base names and extension whose length is also computed.
The splitting of the different output files into base name and extension is done in by the extra subroutine named splitfilename.
Beyond this the particle tracing, surface grid and isosurface output files are also splitted into base names and extensions and a list of all input and output file name are printed out on the standard output.
Last but not least if the total number of processors (nproc) is greater than one the broadcasting takes place (routine brcasti contained in the files commpi.F, comparix.F, compvm.F, comsp.F).
Description/Structure:
The main task of the subroutine readin is to read the restart file.
structure:
The subroutine starts with the query, if the current processor (variable iproc) you are working on right now is equal to one. If this is so, the header of the restart is read and the version string is checked.
If the number of processors (Variable nproc) is greater than one then the information is broadcasted by the subroutine brcastl. (This subroutine is found in the files commpi.F, comparix.F,compvm.F, comspm.F)
Then an attempt follows which tries to read the Fortran format. If the file is written in the old format the subroutine readinf77 is called which reads the restart file in f77 format.
Afterwards and if the current number of processors (iproc) is one then
If errors appear during the reading warningserrors are written out on the standard output and the variable for exception handling (variable llflag) is set to values which are not equal to 0. This means, when ever the llflag is not 0 then an error string is composed and the suitable error message is retrieved and printed (done by calling the subroutine sderr (file sderr.F)).
Then if the total number of processors (nproc) is greater than 1 then the subroutines brcasti and brcasti8 are called for broadcasting. (The subroutines can be found in the files commpi.F, comparix.F,compvm.F, comspm.F).
Afterwards the block dimensions and the block id-s are read by calling the subroutine rddim and if it is necessary the subroutine sends the block dimensions to other processors. If errors occur, they are printed out on the standard output (by subroutine sderr which is found in the file sderr.F).
For all the readings, it is checked, if the current processor is equal to 1.
After this is finished the remaining information (for combustion, mixvar, combustion, time steps, moving grids, fluid structure interaction is read.
This is generated by calling the subroutine rddat and for the fluid structure interaction rddat_fls. If it is necessary this subroutine also sends the data to other processors.
The subroutine readin finishes with the initialization of pressure (pp(inp), kinetic energy(te(inp)), dissipation (ed(inp)) and stresses (tauij(inp)) for all blocks (loop) and with setting the indices of the current block by calling subroutine setind, which is contained in the file setind.F
Description/Structure:
The task of this subroutine is to read the id-file. The routine should
be only called on processor 1.
When the simulation starts (lstart, typ logical) first the header information and the default values for arrays and variables used for reading input or reread from id-file are set.
Then a query of the existence of the input file (id-file) follows. If
the id-file exists then the version strings are checked if they are
supported or not and after that the program starts with searching for
section headers ('###') in the id-file.
If no header is found it continues searching for the next section header.
Always if the query has the "wrong" value and the initialized variable for exception handling (llflag) is not equal to 0 the subroutine sderr (contained in the file sderr.F) is called which composes an error string and the suitable error message is retrieved and printed.
Afterwards the length of the input line (variable for input line is oneline) is computed, the name of section header is extracted by subroutine sflstb and if it is necessary the upper case characters are replaced by the corresponding lower case characters.This is done by the subroutine strlwr which is contained in the file strlwr.F.
After the check that the header appears not twice, the section which was found is marked.
Then the query starts with searching for the "right names" behind the section header ('###') (variable isec=idx ___ where ___ stands for the "right names" you are looking for, i.e. idxtitle means that it is searched for the word title).
The search starts with finding the word 'title'. If it is found it is read if not it continues with searching for the next word which is the word read. This word stands for read restart and if it is found variable oneline is also read.
If the section header is not found in the oneline then either the subroutine splitline1 (contained in file splitline.F) is calling which looks for flags like T, t, F, f, 0, 1, N, n, Y, y in a string or the subroutine splitline2 (contained in file splitline.F) which looks for special strings in a string.
The order of searching for the "right names" is the same as in the id-file which is in the following listed:
After the input file is read a message is printed and the last step is to set additional values.
Description/Structure:
The main task of the subroutine readmap is to read the map file.
structure:
The subroutine starts with opening the readbin-file, where all the necessary grid-data should be saved. This is done by calling the routine
openreadbin(filmap)
where filmap is file map/myproject.map.
The functions
readbi(array,n), readbd(...), and readba(...)
read the data out of filmap and save it in array wich has length n. These functions are defined in src/fhp/csrc/binfile.c.
The reading starts with the grid data for the "ngit" grid level which is assigned by the global variable ngit (number of grids on the multi-grid-method). Then the general information is read and a comparison between the map-file and the parp3d.inc-file is done. If they differ from each other than a warning is written to the standard output. The comparison is done for several different parameters (??? evtl. auflisten). The reading and the comparison are only done, if the number of the current processor is equal to one (global variable: iproc).
Afterwards the data are broadcasted if the total number of processors (global variable: nproc) is greater than one. This is done by calling the routine brcasti or brcastl (which are contained in the files commpi.F, comparix.F, compvm.F, comsp.F).
The next step (step 2) is to prove if the number of the current processor (global variable: iproc) is one. If this condition is fulfilled this processor reads and sends data to other processors. Then the following data are read for all processors (variable: ipro= nproc,1, -1):
After this is finished and if the current number of processors (global variable ipro=nproc,1,-1) is greater than one the data are sent to other processors. The sending is done by the routine sendi, sendr8 (contained in the files commpi.F, comparix.F, compvm.F, comsp.F).
If this is all done successfully the readbin-file is closed.
If the condition of step 2, namely, that the number of the current processor is more than one, then the processors 2 till nproc wil only receive data (done by routines recvi, recvr8, which are contained in the files commpi.F, comparix.F, compvm.F, comsp.F).
If either the readbin-file is closed or if the receiving is done then the second step is finished.
The broadcasting of the global number of geometric blocks (global variable ngbglob) is done if the total number of processors is greater than one (by brcasti).
hen if the number of grids (in the multi-grid method) (global variable ngit)is greater than one then coarsening of the grid takes place. The mapper always generates only the finest grid.
======================AUFRUF VON SETCON==================
After calling subroutine setcon the grid data for grid ngit is read from filin and safed in arrays x,y,z.
Structur of patches and communication tables
The faces of the different blocks are subdivided into patches (e.g. if different boundary condition occure on one face). So patches are two-dimensional and have local index directions (see documentation for map3d). Patches may be bc-patches or con-patches, i.e. they lie on a physical boundary or they are situated on the interface of two adjacent blocks.
The communication (transfer) tables give information about the connection of the patches (on the interface of two adjacent blocks). They are needed for the data transfer between the different blocks.
The patches and communication tables for flow and temperature are stored in ipat (respectively ipatt for temperature) and itratabu (itratabt). Length of ipat is npat/npatt (number of patches) and length of itratabx is ntrau/ntrat (number of transfers).
patches (look also dimdivers.h)
Description/Structure:
This file reads the prop-file which contains property-values that are used for the beginning of the simulation.
structure:
The subroutine starts with setting the name of the routine and the exception handling variable llflag. The value 0 is allocated to the variable llflag.
Then a query follows wich checks if the number of current processors is equal to one. If this is so then it is tested if the property-file exists or not. If there is no existence an error message is printed (and routine sderr is called). The way how it works is pretty well known from the other subroutines.
If the search was successful the data for all flowregions are read.
After reading the data it is necessary to broadcast the properties of flow regions to other processors if the total number of processors (gloabal variabel nproc) is greater than one. The broadcast is done by the routines brcastr8, brcasti which are contained in the files commpi.F, comparix.F, compvm.F, comsp.F.
Description/Structure:
This file reads the input file for visualization.
structure:
The subroutine starts with setting the name of the routine and the exception handling variable llflag. Furthermore some global co-visualization variables are initialized. If surface grid data output is set via id-file, the general variable swritevisu, which starts time step for output of visualization results (explained in cbvisual.h) and the general variable iwritevisu, which governs the output of visualization results (this takes place in all time steps with it = swritevisu + n*iwritevisu, n=0,1,2,3,...) must be set via code since no results output information is read from file in this case. Apart from this, in any case iwritevisu must be set to a non-zero value for the modulo operations in fmg3d.
All the following work which is described below is only done if the current number of processor (variable iproc) is equal to one.
If the file name has been defined and if the input file exists some preparations for reading the input file are necessary. The preparatory work contains setting the header information, computing the length of strings and the length of each header name (routine sflstb) and looking for id-strings.
After this is done each line of the input-visualization file is read (variable oneline) until a section header (###) is found. Then the name of the section header is extracted and the uppercase characters are changed to lowercase characters (routine strlwr). Afterwards a search for section headers in section header list starts and if the search was successfully and if a section header matches with any header from the list the header is checked if it appears twice.
The way how this is all done is the same as it is done and desribed in subroutine readinp.
If the header fulfills all the condition the following data are read:
in brackets there are the variable for the special header
All these headers could be found in the file .vis.
Always when an error occurs warnings are printed out on the standard output.
If the reading of the visualization input data is done then a check follows if all necessary headers were found.
After the check the co-visualization master flag (variable lvisu), co-visualization master flags for time-dependent and time-independent visualization (variable ltimevisu, lstatvisu) are set and data are checked for consistency.
The consistency-check can only take place after the corresponding logicals have been set. If the data don`t fulfill lthe consistency-check always warnings are printed out on the standard output.
After the successfully consistency-check and if the exception handling variable llflag is equal to 0 some useful information are printed out.
Always if the exception handling variable llflag is not equal to 0 then an error message is printed (done by the subroutine sderr).
When the reading of the input data for visualization is ready it is necessary to broadcast this information if the total number of processors is greater than one (done by routine brcasti which is contained in the files commpi.F, comparix.F, compvm.F, comsp.F). If there are more than one processor then the data must be sent to the other processors which is done by the routines sendi, sendr8 (contained in the files commpi.F, comparix.F, compvm.F, comsp.F) and the current processor must receive the data from the other processors which are fulfilled by routine recvi and recvr8 (contained in the files commpi.F, comparix.F, compvm.F, comsp.F).