How to use UnStructured PHOENICS (referred to below as USP)
Contents
How to activate USP
Activation of USP is almost the same as for structured PHOENICS (referred to below as SP).
- To start, the user should write a Q1 file, or create one by use of the VR-Editor, bearing in mind however that:
- the file should contain the statement: USP=T, together with other statements which can be seen in the library input files mentioned below;
- the grid-related data groups of the standard Q1 are not used;
- FINE_GRID_EMBEDDING objects (referred to below as FGE) are used for indication of unstructured-grid creation, even when the grid is in fact to be coarsened (see below);
- USP does not yet possess all the physical-modeling capabilities of SP.
- After writing the Q1 file, the user should run satexe.exe to create an eardat file in the usual way.
- The satexe.exe automatically runs the utility program
uspgrid.exe; this creates
the necessary unstructured grid and prepares other data for USP.
- Thereafter the user runs earexe.exe to make flow-simulating calculations.
- The results are printed in the RESULT file; with some differences from the standard SP format.
- USP-EARTH does not produces a phi file. USP-EARTH produced files phi001.vtk and phi001.dat which can be read by ParaView and Tecplot accordingly.
The file phi001.dat contains outcomes for Tecplot for steady cases and the files phi001.dat, phi002.dat ... phi00N.dat for transient cases.
- USP-EARTH also produces a phi file similar to that of SP (if automatic grid generation is not used), which can be read by PHOTON or the VR Viewer in the usual way. However, graphical display via Tecplot is preferable because Photon and Viewer can display regular grids only. The file phi001.dat contains result in a format suitable for display via Tecplot.
- The user can employ the PHOENICS Commander for running USP cases; or he or she can run script usp_run.bat
from the inplib-folder.
Current capabilities of USP
- USP can solve hydrodynamics equations (see cases U006,
U007, U008,
U009, U010, U011)
- USP can calculate fields of scalars on 'divided' grids both without
(see cases U002, U003)
and with fluid flow
(see case U016)
- When some cells in the domain contain no material, USP detects and avoids them, thus saving computer time.
(See cases U001,
U006,
U007).
- Similar economy is effected when the domain contains non-participating solids.
(see cases U008, U009)
- USP operates with non-uniform properties specified by initial patches.
(see cases U003 U011)
- USP can calculate transient cases (see case U005)
- USP can solve tasks with conjugate heat transfer with various materials
using file PROP (see case U009,U032)
- USP can solve tasks with potential flows (see cases U012,
U013)
- USP can solve tasks with diffusion of several components (see case U014)
- USP can solve tasks with conjugate heat transfer using enthalpy or temperature (see case
U015)
- USP can solve hydrodynamics tasks with divided grid (see cases U017,
U018, U710, U711)
- USP can solve solid-stress tasks with simple cartesian and divided grid (see cases U501,
U502,U503,U504,U505,U506,U507,U508)
- USP can solve coupled solid-stress tasks with hydrodynamics flows
- USP can solve tasks with turbulent flow using divided grid (see cases
U019,U022,U027,U029,U030,
U031,U033)
- USP can process VR-Objects of types BLOCKAGE, INLET, OUTLET, PLATE (see cases
U020, U021,
U022, U023).
- USP can process cases with VR-Objects of complicated form.
- USP can use the grid-coarsening process and handle BLOCKAGE VR-Objects on non-uniform grid (see cases U025,U026).
- USP can use automatic grid generation for any task using process of refinement (see cases U030,U701, U710, U711)
- User can set PIL command RESTRT(ALL) for restart.
- USP can generate grid for terrain objects automatically using process of refinement (see case U027,U033).
Current limitations of USP
At present the USP has some restrictions because several physical and numerical models, which SP contains, are not implemented fully in USP yet.
Therefore at present user should be aware of the following restrictions:
- USP cannot solve cases with two-phase flows.
- USP cannot solve cases with porosity.
- USP cannot use same of model which SP solves successful. List of implemented model see below.
- USP can not use dependences of properties on temperature or other variables if this dependence is set via GROUND (GRND1 ans so on). But user can activate the same functionality by InForm.
- RESFAC should be less (or equal) 1.E-6 because RESFAC is used for checking of convergence in a different way from SP.
- File Q1 should set the FINEST grid for manual method of grid generation and COARSEST for automatic grid generation.
- Users should not introduce PIL statements such as:
NAME(H1)='TEM1'
or
NAME(14)='TEM1'
or perform any other renaming of variables.
- All variables should have the index number which is standard for PHOENICS,
namely:
P1 = 1, U1 = 3 and so on.
Creation of unstructured grids for USP
USP has two modes of grid generation: automatic and manual.
Manual grid generation
The manual mode of grid generation uses coarsening as its grid-generation process. To set manual grid generation mode user should set UAUTO=F in Q1 or switch-off parameter in VR-Editor.
When creating a grid by means of the manual mode, the user should remember to employ the finest grid. It can be made easy using VR-Editor.
After creation of this grid, the user can create FGE-objects to indicate rectangular volumes (zones) where grid is to be coarsened.
Note that the FG in FGE stands for 'fine-grid'; this seeming anomaly arises because a facility created originally for fine-grid-embedding only is now being used for grid-coarsening also.
Coarsening joins some cells by 2 or 4 in user-selected directions. Coarsening is more flexible than refining, because the user can set the direction of coarsening, for example, in X only or Y and Z as desired.
During creation of FGE-objects the user should observe the following rules:
- Several levels of coarsening may be employed.
- Each object can can lead to coarsening INSIDE the object or OUTSIDE the object.
- Zones with low level of coarsening should be contained wholly in zones with
high level (crossing of zones with various levels are not allowed).
- The user should make sure that adjacent cells have nearest levels of coarsening.
- Levels of coarsening of adjacent cells can not be differed more than one level.
For example, the next lines in a Q1 create object B1, which will cause grid coarsening outside object on the first level. Coarsening will be made in all three directions:
> OBJ, NAME, B1
> OBJ, POSITION, 0.468750E+00, 0.468750E+00, 0.468750E+00
> OBJ, SIZE, 6.250000E-02, 6.250000E-02, 6.250000E-02
> OBJ, GEOMETRY, fine
> OBJ, ROTATION24, 1
> OBJ, TYPE, FINE_GRID_VOL
> OBJ, LEVELS, 0.000000E+00, 0.000000E+00, 0.000000E+00
> OBJ, AXES, OXYZ
The next lines of Q1 creates object B2, which will cause of grid coarsening inside the object on the second level. Coarsening will be made on the all three directions:
> OBJ, NAME, B2
> OBJ, POSITION, 0.468750E+00, 0.468750E+00, 0.468750E+00
> OBJ, SIZE, 6.250000E-02, 6.250000E-02, 6.250000E-02
> OBJ, GEOMETRY, fine
> OBJ, ROTATION24, 1
> OBJ, TYPE, FINE_GRID_VOL
> OBJ, LEVELS, 1.000000E+00, 1.000000E+00, 1.000000E+00
> OBJ, AXES, IXYZ
Sometimes it is desirable that the FGE-object should not affected the structured grid. Then the user should add the line
> OBJ, GRID, NO
and the full specification of the object will be:
> OBJ, NAME, B2
> OBJ, POSITION, 0.468750E+00, 0.468750E+00, 0.468750E+00
> OBJ, SIZE, 6.250000E-02, 6.250000E-02, 6.250000E-02
> OBJ, GEOMETRY, fine
> OBJ, ROTATION24, 1
> OBJ, GRID, NO
> OBJ, TYPE, FINE_GRID_VOL
> OBJ, LEVELS, 1.000000E+00, 1.000000E+00, 1.000000E+00
> OBJ, AXES, IXYZ
The grid-generation process employs the utility uspgrid.exe, which uses as
input files eardat and facetdat generated by satexe.exe. These files contain:
- information about FGE-objects where the coarsening as made,
- other input data for USP and
- instructions for output.
Automatic grid generation
See also this document.
Automatic grid generation is used in two modes. First mode is used for terrain objects which are set by xyz file (USPTER=T). Second mode is used for any other cases. Automatic grid generation uses the process of refinement; therefore, if UAUTO=T, the Q1 should specify a coarse-structured grid.
The refinement process splits cells into four equal cells in 2-dimensional and into eight in 3-dimensional tasks. The maximum level of refinement (UMXLEV) is achived at bounds of BLOCKAGE objects. User can specify levels of refinement near PLATE objects using parameter UWALEV and near INLET&OUTLET object via parameter UIOLEV. Besides user can specify the number of layers of finest grid near objects using parameter UNOLAY.
The utility uspgrid.exe generates files (in any mode):
- usp_grid.dat (to enable Tecplot to display the grid),
- usp_cells.vtk (to enable ParaView to display the grid),
- obj_faces.vtk (to enable ParaView to display objects on grid),
- usp_grid_log (ASCII log-file),
- usp_objects (binary file with information about objects),
- usp_vertices (binary file with information about vertices),
- usp_faces (binary file with information about faces),
- usp_cells (binary file with information about cells).
Several new PIL variables are introduced for USP:
- USP, logical variable, for USP cases variable USP = T.
- USPDBG, logical variable, default USPDBG = F.
- UAUTO, logical variable, for automatic grid generation variable UAUTO = T, for manual mode UAUTO = F.
- USPTER, logical variable, for automaticgrid generation with terrain objects which set via xyz file USPTER = T, for other cases USPTER = F.
- UGTGRD, logical variable for automatic mode with USPTER=T only which indicates if =T that uspgrid.exe get grid from structured grid as coarser grid. If UGTGRD=F the coarser grid is calculated as uniform grid.
- UTCPLT, logical variable, default UTCPLT = T. If parameter UTCPLT=T then the USP will store outcomes in format Tecplot to file phi001.dat for ASCII format. All variables are stored in vertices of control volumes by default.
- USPVTK, logical variable, default USPVTK = T. If parameter USPVTK=T then the USP will store outcomes in format VTK to file phi001.vtk for ASCII format. All variables are stored in vertices of control volumes by default.
- USPIMB, logical variable, default USPIMB = F. If parameter USPIMB=T then the imbalances for all solved variables will be calculated and printed-out in file result. (Comment. Only mass balance is implemented now).
- USCANX, USCANY, USCANZ, logical variables, which are used at UAUTO = T and USPTER=F only. If variable=T then it allows scanning for detection of objects in indicated direction at automatic grid generation process.
- MXLEV, MYLEV, MZLEV, integer variables, which denote the maximum level of coarsening in each direction.
If all MXLEV=MYLEV=MZLEV=0 then coarsening does not allow and FGE-objects don't give any effect on grid generation. Theses parameters should be set if UAUTO=F.
- DOMAT, integer variable, PRPS for domain material.
- CELLST, FACEST, integer variables, the step over cells and faces for print-out into result file.
- MINPRP, MAXPRP, integer variables, these parameters indicates that the outcomes in Tecplot format
will be stored for this interval only.
- UMXLEV, integer variable, the maximum level of refinement at automatic grid generation (UAUTO=T).
- UMXCLS, integer variable, the maximum cells in refinement process at automatic grid generation for terrain objects (UAUTO=T and USPTER=T).
- UNOLAY, integer variable, the number of layers of finest grid near the BLOCKAGE objects at automatic grid generation (UAUTO=T and USPTER=F).
- UIOLEV, integer variable, the maximum level of refinement near the INLET&OUTLET objects at automatic grid generation (UAUTO=T and USPTER=F).
- UWALEV, integer variable, the maximum level of refinement near the PLATE objects at automatic grid generation (UAUTO=T and USPTER=F).
- UMXCRS, integer variable, the maximum number of crosses of objects bounds at automatic grid generation (UAUTO=T and USPTER=F). Default value is 16.
- UGRITR, integer variable, the number of iteration at calculation of gradients of PHI-variables.
- USPREL, real parameter, it is hidden relaxation factor for hydrodynamics task. By default USPREL=0.7. But sometimes convergence will better for interval of USPREL from 0.4 to 0.75.
- UDVREL, real parameter, it allows to use linear relaxation for DUDP,DVDP,DWDP.
- UMNCEL, real variable for automatic mode with terrain objects only which set minimum size of cells at automatic grid generation process (UAUTO=T and USPTER=T).
Besides USP uses some relaxation parameters as old variables RSG11 and RSG12:
Note, parameters
UCOARS and
GETPRP are removed now. Use of these parameters will create an error.
PRPS is stored for USP always therefore the user need not set the PIL commands
NAME(140)='PRPS' and
STORE(PRPS)
USP INFORM
InForm statements
User can to use next kinds of statements in USP:
- initialisation of field, for example
INITIAL of Var is Formula [with Options])
- calculation of properties, for example
(PROPERTY of PropVar is Formula [with Options])
- to set sources terms, for example
(SOURCE of Var at ObjName is Formula [with Options])
- calculation of stored fields, for example
(STORED of Var is Formula [with Options])
Statements INFOB will be implemented in the nearest future. It will be processed by grid generation utility uspgrid.exe
Statements MAKE and STORE1 isn't implemented yet but they will be implemented in future.
Notes:
1) During processing of statements PROPERTY, STORED and INITIAL the structures feature
[at PatchName] is ignored. For choice of cells set it is necessary to use condition statements (see below).
2) It is necessary to use name of VR-object in statement SOURCE instead of name of patch linked to object. If there is usual patch then user should use name of this patch.
InForm options
Most of post-formula options can be used in USP InForm:
1) Statements IMAT > value, .... (where value is PRPS);
2) Statements !IF with set of logical conditions. Conditions can contains any variables which is not connected with structured means.
For example, variable XG,YG,ZG (coordinates of cell centers) can be used, but it is not allowed to use structured indices IX,IY,IZ, NX,NY,NZ.
3) To set places for calculation of STORED variables the next option can be used as usual:
SWPSTR - at start of sweep (default),
SWPFIN - at end of sweep,
TSTSTR - at start of timestep,
TSTFIN - at end of timestep,
options ZSLFIN, ZSLSTR are the same as SWPSTR, SWPFIN.
4) At setting of SOURCE the next options can be used:
FIXFLU (by default) - fixed source,
FIXV - fixed value,
ONLYMS - value convected in by associated mass source,
VOLU - formula set source on the unit of volume.
Formulas
At the writing of formulas user can write the same statements, variables and functions as for SP. But there is single restriction: it is not allowed to use any elements which can be connected with structured grid.
For example, it is not allowed to use structured indexes:
IX, IY,IZ, NX, NY, NZ
fixed indexes- [];
fixed coordinates- {};
variables
XU, YV, ZW;
next functions - SUM, SSUM, NORTH, SOUTH, EAST, WEST, HIGHT, LOW, ARR,AECO, ANCO, AHCO, AWCO, ASCO, ALCO,POS, VEL, ACC, MOFOR,EBOU, WBOU, NBOU, SBOU, LBOU, HBOU, ALL,FACET.
Samples of statements:
(SOURCE of TEM1 at MAT_2 is COVAL(:AlfVol:,10)!VOLU!IF(YG.GE.0.045))
(SOURCE of P1 at HOTIN is COVAL(FIXFLU,150)!VOLU)
(INITIAL of TEM1 is 66*MAX(EXP(YG),EXP(XG)) with IMAT=120)
RRR=SQRT(XG^2+YG^2)
(STORED VAR V1TH IS :AA:*:RRR: + BB/:RRR: WITH IMAT>100)
To run any case from the USP input-file library, users can copy script usp_run.bat to any suitable directory, select the case number and run this script with that number. For example, line
USP_run.bat 001
will run case 1 from inplib.
Please make sure that the case number has three digits.
Another way to see results obtained by USP is to activate the PHOENICS Commander, Section "Ready-to-run", then "Special features", then "USP".
Input file library
Description of cases (in \phoenics\d_earth\d_opt\d_usp\inplib).
- U001 - case with calculation of temperature field in body with vacuum cavity.
Case does not contain divided grid.
- U002 - analog of standard case 100 with divided grid near the sources.
- U003 - case for calculation of temperature with divided grid to 4th level
of refinement. The user can change distribution of conductivity.
- U004 - 2D heat conduction with space dependent source
Case does not contain divided grid.
- U005 - transient 2D heat conductivity with sources
Case does not contain divided grid.
- U006 - steady hydrodynamics flow in porous media
- U007 - steady 2D hydrodynamics flow in labyrinth without divided grid
Structured PHOENICS requires significant more time to solve this sample.
- U008 - steady 2D hydrodynamics flow in labyrinth with divided grid but
grid is the same as in case usp_6
Structured PHOENICS requires significant more time to solve this sample.
- U009 - steady 2D hydrodynamics flow in labyrinth with conjugate heat transfer
and various materials of solid bodies.
- U010 - steady 2D hydrodynamics flow in plane channel for comparison with
exact Poiseuille's law. (Comment. During last tests the divergence of sweeps have found for this case. It requires detailed investigation. Therefore this case is not presented in root directory of USP inplib)
- U011 - steady 2D hydrodynamics flow in plane channel with non-uniformly
viscosity which is specified by patches. (Comment. During last tests the divergence of sweeps have found for this case. It requires detailed investigation. Therefore this case is not presented in root directory of USP inplib)
- U012 - 2D potential flow, this case is similar to 115 of core inplib.
- U013 - 2D potential flow, this case is similar to 116 of core inplib.
- U014 - 2D flow in duct with several components with diffusion, this case
is similar to 121 of core inplib.
- U015 - 2D flow in duct with conjugate heat transfer using enthalpy.
- U016 - distribution of temperature on the divided grid in uniform flow. Note, if you want to see outcomes using Tecplot then you will see mistakes of Tecplot's interpolation. The WinPhoton gives correct picture because it uses interpolated values from file phi.
- U017 - hydrodynamics flow over step with divided grid.
- U018 - hydrodynamics flow in cavity with divided grid.
- U019 - turbulent flow over step with divided grid. Standard K-E model of turbulence is used. At present (11.07.08) the some bugs is known, for example, there is mistake in source code which arise divergence of sweeps in the case. This bug will be fixed in future.
- U020 - laminar flow around large cylinder on the coarse grid without divided cells. Cylinder is set as BLOCKAGE VR-object. USP run faster than SP on this sample.
- U021 - laminar flow around large cylinder on the fine grid without divided cells. Cylinder is set as BLOCKAGE
VR-object.
- U022 - laminar flow around car.
- U023 - laminar flow around small cylinder.
- U024 - laminar flow around object which set as InForm object.
- U025 - laminar flow around small cylinder with divided grid.
- U026 - laminar flow around small sphere with divided grid.
- U027 - laminar flow around pyramid as terrain object.
- U028 - laminar flow around two cylinders with divided grid.
- U029 - turbulent flow near the wall. Effective viscosity model.
- U030 - turbulent flow in pipe.
Effective viscosity model. Automatic and manual methods of grid generation.
- U031 - turbulent flow around of building. K-E model.
- U032 - laminar flow in T channel.
- U033 - turbulent flow around of pyramid. K-E model.
- U501 - solid-stress case. 2D xy one-material plate in tension.
- U502 - solid-stress case. 2D xy Hot Bi-metallic plate.
- U503 - solid-stress case. 2D Plate in tension with FY=var
- U504 - solid-stress case. A rectangular plate with a centrally-placed CIRCULAR hole.
- U505 - solid-stress case. 2D xy Plate with square hole.
- U506 -
solid-stress case.
Cooled long cylinder.
- U507 -
solid-stress case.
Pressurised long cylinder.
- U508 -
solid-stress case.
Stress in a 2D rotating disk.
- U550 -
solid-stress case with hydrodynamics flow.
3D Thermal Stress In BLADE.
- U701 - heat conductivity in complex geometry. Automatic Grid Generation.
- U702 -
laminar flow around small body. Automatic Grid Generation.
- U703 -
heat conductivity in complex geometry. Automatic Grid Generation.
- U704 -
heat conductivity in 3D burner. Automatic Grid Generation.
- U705 -
turbulent flow around of building. Model effective viscosity. Automatic Grid Generation.
- U706 -
turbulent flow around of building. K-E model . Automatic Grid Generation.
- U707 -
heat conductivity into in complex Body. Automatic Grid Generation.
- U708 -
laminar flow into complex body. Automatic Grid Generation.
- U709 -
laminar flow in Faucet for mixing hot and cold water. Automatic Grid Generation.
- U710 -
laminar flow in Turn-around duct. Automatic Grid Generation.
- U711 -
laminar flow around 2D Cylinder. Automatic Grid Generation.
Possibilities of USP
- USP can effectively calculate fields of variables with vacuum cavities. The vacuum cavities are not included in calculations therefore USP has high performance for these cases. (See cases U001, U006, U007).
- USP can calculate fields of scalars on 'divided' grid. (see cases U002, U003)
- USP can calculate fields of scalars with uniform flow on 'divided' grid. (see case U016)
- USP operates with non-uniformed properties specified by initial patches.(see cases U003, U011)
- USP can calculate transient cases (see case U005)
- USP can solve hydrodynamics equations (see cases U006, U007, U008, U009, U010, U011)
- USP calculates hydrodynamics task more effectively than SP if domain contains much of solid (see cases U008, U009)
- USP can solve tasks with conjugate heat transfer with various materials using file PROP (see case U009)
- USP can solve tasks with potential flows (see cases U012, U013)
- USP can solve tasks with diffusion of several components (see case U014)
- USP can solve tasks with conjugate heat transfer using enthalpy (see case U015)
- USP can solve hydrodynamics tasks with divided grid (see cases U017, U018)
- USP can solve tasks with turbulent flow using divided grid (see case U019,U029-U031,U033,U705,U706)
- USP can process the BLOCKAGE VR-Objects (see cases U020, U021, U022, U023, U028).
- USP can use BLOCKAGE VR-Objects on non-uniform grid (see cases U025, U026).
- USP can solve task with automatic grid generation for terrain objects (see case U027,U033).
- USP can solve tasks with automatic grid generation with VR-objects (see cases U701-U711)
- USP can solve tasks for Solid-Stress problem (see cases U501-U508,U550).