src
所属分类:数学计算
开发工具:Fortran
文件大小:203KB
下载次数:80
上传日期:2011-10-19 12:35:54
上 传 者:
lgdindon
说明: 逆风格式欧拉方程求解naca0012二维翼型流场程序,内附网格文件和输入参数。
(Wind Euler equations naca0012 format two-dimensional airfoil flow field procedures, containing the grid files and input parameters.)
文件列表:
src (0, 2011-09-24)
src\bcfarf.f (5803, 2001-01-05)
src\bcinflo.f (3399, 2001-01-05)
src\bcond.f (3234, 2001-01-05)
src\bcoutflo.f (2967, 2001-01-05)
src\bnodes.f (4447, 2001-01-05)
src\checkmet.f (4080, 2001-01-05)
src\control.inc (1484, 2001-01-05)
src\conver.f (3299, 2001-01-05)
src\depvars.f (3785, 2001-01-05)
src\edgesfin.f (3168, 2001-01-05)
src\edgesini.f (3502, 2001-01-05)
src\files.inc (1537, 2001-01-05)
src\fluxc1.f (4087, 2001-01-05)
src\fluxc2.f (4984, 2001-01-05)
src\fluxroe1.f (4702, 2001-01-05)
src\fluxroe2.f (5383, 2001-01-05)
src\forces.f (3105, 2001-01-05)
src\fvecsymm.f (2628, 2001-01-05)
src\geometry.inc (1121, 2001-01-05)
src\gradient.f (7143, 2001-01-05)
src\initcon.f (2107, 2001-01-05)
src\initflow.f (3900, 2001-01-05)
src\initmet.f (4028, 2001-01-05)
src\initmetb.f (6081, 2001-01-05)
src\input_n (2982, 2001-01-05)
src\irsmoo.f (4650, 2001-01-05)
src\length.f (1635, 2001-01-05)
src\license (18349, 2001-01-05)
src\limiter.f (6520, 2001-01-05)
src\limitini.f (4378, 2001-01-05)
src\limitref.f (2458, 2001-01-05)
src\main.f (11760, 2001-01-05)
src\Makefile (1660, 2010-10-13)
src\massflo.f (2857, 2001-01-05)
src\n0012.ugr (557062, 2001-01-05)
src\numerics.inc (1448, 2001-01-05)
src\periodic.f (2162, 2001-01-05)
src\physics.inc (1517, 2001-01-05)
src\pltflow.f (5770, 2001-01-05)
... ...
********************************************************************************
E U L 2 D U
(c) Jiri Blazek, September 1997
********************************************************************************
Program for the solution of 2-D Euler equations on unstructured triangular
grids. Median-dual finite-volume scheme is employed for the spatial
discretisation. The equations are integrated in time using an explicit
multistage time-stepping scheme. Further details are provided in Subsection
12.7 of the book.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
--------------------------------------------------------------------------------
Files
--------------------------------------------------------------------------------
LICENSE - terms and conditions
Makefile - compilation options
README - what you read now
*.f - source files ("main.f" contains the main program)
*.inc - include files
The grid files stored in the directory "../run" are:
channel.ugr - grid file for channel with 10% circular bump
n0012.ugr - grid file for NACA 0012 airfoil
vki1.ugr - grid file for VKI-1 transonic turbine cascade
There are the following input and result files in the directory "../run":
input_c - input file for transonic channel flow
input_n - input file for transonic flow past NACA 0012 airfoil
input_v - input file for flow past VKI-1 turbine cascade
conver_c - convergence history for channel flow
conver_n - convergence history for airfoil flow
conver_v - convergence history for cascade flow
iso_c - data for isoplots of channel flow
iso_n - data for isoplots of airfoil flow
iso_v - data for isoplots of cascade flow
output_c - screen dump for channel flow
output_n - screen dump for airfoil flow
output_v - screen dump for cascade flow
plot_c.ps - PostScript file with results for channel flow
plot_n.ps - PostScript file with results for airfoil flow
plot_v.ps - PostScript file with results for cascade flow
surf_c - flow quantities at wall surface of the channel
surf_n - flow quantities at wall surface of the airfoil
surf_v - flow quantities at wall surface of the cascade
The grids were generated by triangulation of the corresponding structured grids
in the subdirectory "struct2d/run" using the program from "grid2du". The files
"plot_", "surf_", "output_" and "conver_" were generated using the correspon-
ding "input_" files.
--------------------------------------------------------------------------------
How to compile "eul2du"
--------------------------------------------------------------------------------
Edit first the flags (SRC, EXEC, O, LD, FC, FFLAGS, and LDFLAGS) in "Makefile"
as appropriate for your computer, compiler and/or operating system. There are
examples of settings for GNU g77, IBM, SGI and SUN f77 compilers. Type "make"
at the prompt to compile the program.
--------------------------------------------------------------------------------
How to run "eul2du"
--------------------------------------------------------------------------------
The program reads a number of user parameters from the standard input. The user
parameters are stored in a plain ASCII file. An example is provided in the file
"input". In order to run "eul2du", you have to type at the prompt:
% eul2du < [input file]
where [input file] is the path and name of the file with parameters (e.g.,
"input_c"). The program generates four output files - convergence history, data
for isoplots, distribution of flow quantities at wall(s) and a restart file (in
binary format).
In the case of external flows, the file with convergence history contains the
quantities:
step - iteration number
resid - density based convergence measure (see Eq. (12.1))
resmax - maximum difference between new and old density [kg/m^3]
i-res - index of the grid node where resmax is found
cl - lift coefficient
cd - drag coefficient
cm - moment coefficient
Lift, drag and moment coefficients are replaced by:
m_flow - average mass flow rate [kg/s]
m_ratio - ratio of mass flow at outlet to mass flow at inlet
for internal flows.
The file for the generation of isoplots always contains the grid coordinates
(denoted as x, y). Additionally, the following quantities are written out for
each grid point if specified in the input file:
rho - density [kg/m^3]
u - x-component of the velocity [m/s]
v - y-component of the velocity [m/s]
p - static pressure [Pa]
p-tot - total pressure [Pa]
T - static temperature [K]
T-tot - total temperature [K]
M - Mach number
M-isen - isentropic Mach number
pt-loss - total pressure loss
The file with the surface distribution contains the same quantities. The
variables in the convergence and in the plot files are stored column-wise. The
file for the isoplots contains in addition the indices of the nodes of the
triangles. Please note that all physical quantities are defined in SI units.
In order to run "eul2du", a grid file must be provided. The grid file contains
the dimensions of the grid, the description of the boundary faces, the Carte-
sian coordinates of the nodes and the nodes of the triangles. The format of the
grid file is as follows:
(1) dimensions (one line):
- number of grid nodes (NO dummy nodes)
- number of triangular cells,
- number of boundary conditions
(2) for each boundary condition (two lines):
- type
100-199 = inflow
200-299 = outflow
300-399 = viscous wall (treated here as inviscid wall)
400-499 = inviscid wall
500-599 = symmetry line
600-699 = farfield
700-799 = periodic boundary
- index of the last boundary face (NOT used for periodic boundaries)
- index of the last boundary point
- name (on new line)
(3) list of boundary faces (2 nodes of a face, arbitrary oriented) for all
boundary conditions; if the corresponding boundary is periodic, the list
contains the two related periodic nodes instead
(4) Cartesian coordinates of the nodes (first column is x, second is y)
(5) indices of three nodes defining a triangle; the orientation is arbitrary.
Only ONE of the two related periodic boundaries has to be included in the
boundary conditions (point 2 above). The nodes of the "shadow" periodic
boundary are obtained from the list of boundary nodes (point 3). The program
contained in "grid2du" provides a good example of how the grid file can be
generated.
--------------------------------------------------------------------------------
Main variables
--------------------------------------------------------------------------------
Grid dimensions:
~~~~~~~~~~~~~~~~
mxnodes = max. number of grid nodes (including dummy nodes)
mxcells = max. number of grid cells
mxedges = max. number of edges (including edges between boundary and dummy
nodes)
nnodes = no. of grid nodes (including dummy nodes)
nndint = no. of physical grid nodes (nnodes - dummy nodes)
nedges = no. of edges (including edges between boundary and dummy nodes)
nedint = no. of edges excluding those to dummy nodes
Dummy nodes are defined for inlet, outlet and farfield boundaries only. The
variables cv(), dv(), x(), y(), edge() and sij() are divided into two parts.
The first part is related to the physical grid (dimensions nndint, nedint). The
second part refers to the dummy nodes. This approach makes it easier to loop
either over the physical grid nodes (edges) only or over all nodes (edges)
using the same variable vector.
Conservative & dependent variables:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cv() = conservative variables:
cv(in,1) = density
cv(in,2) = density * u
cv(in,3) = density * v
cv(in,4) = density * E
...
dv() = dependent variables:
dv(in,1) = static pressure
dv(in,2) = static temperature
dv(in,3) = speed of sound
dv(in,4) = ratio of specific heats
dv(in,5) = specific heat coefficient at constant pressure
...
mxcv = max. no. of conservative variables (4 + additional ones)
mxdv = max. no. of dependent variables (5 + additional ones)
nconv = number of conservative variables
ndepv = number of dependent variables
Geometrical quantities:
~~~~~~~~~~~~~~~~~~~~~~~
x() = x-coordinate of a grid point
y() = y-coordinate of a grid point
tria() = node indices of a triangle
sij() = x-, y-component of the face vector (n*dS);
sij(ie,_) represents for ie > nedint an average face vector for a
boundary node (face between boundary and dummy node);
sij() always points from node i to node j (see Fig. 5.9)
vol() = control volume (shaded area in Fig. 5.8)
cref = reference body length (airfoil chord)
xref = x-coordinate of a reference point (used in "bcfarf.f", "forces.f")
yref = y-coordinate of a reference point
Other global variables:
~~~~~~~~~~~~~~~~~~~~~~~
cvold() = conservative variables from previous time step
diss() = dissipation term of Roe's upwind scheme
edge() = edge list (node i, node j);
edge(ie,_) represents for ie > nedint an edge from a boundary node
(i) to a dummy node (inlet, outlet, farfield)
gradx() = gradient of density, u, v, and pressure wrp. to x-coordinate
grady() = gradient of density, u, v, and pressure wrp. to y-coordinate
lim() = value of the limiter function (density, u, v, pressure)
rhs() = residual (right-hand side)
tstep() = time step (without the CFL-number)
Variables related to boundary conditions:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mxbfaces = max. number of boundary faces
mxbnodes = max. number of boundary nodes
mxbounds = max. number of boundary conditions (set in "control.inc")
nbfaces = no. of boundary faces
nbnodes = no. of boundary nodes
nbounds = no. of boundary conditions
bface() = indices of two nodes defining a face (NOT for periodic boundaries)
bname() = name of boundary condition (used for plot data)
bnode() = boundary node related data:
(_,1) = index of the node itself
(_,2) = index of the related dummy node (inlet, outlet, farfield)
or the second periodic node, otherwise = -99
(_,3) = index of edge to dummy node (edge(ie,_), ie > nedint);
bnode() is set in "bnodes.f", "edgesfin.f", and "rbfaces.f"
btype() = type of boundary condition:
100-199 = inflow
200-299 = outflow
300-399 = viscous wall (treated here as inviscid wall)
400-499 = inviscid wall
500-599 = symmetry line
600-699 = farfield
700-799 = periodic boundary
ibound() = pointer from boundary condition to boundary faces and nodes:
(_,1) = last index in bface()
(_,2) = last index in bnode()
sbf() = normal vector of boundary face (outward pointing, size equal to
edge length); defined for all boundaries except periodic ones
External flow:
machinf = Mach-number at infinity
alpha = angle of attack
pinf = static pressure at infinity
tinf = static temperature at infinity
rhoinf = density at infinity
uinf = u-component of velocity vector at infinity
vinf = v-component of velocity vector at infinity
qinf = total velocity (=SQRT(uinf**2+vinf**2))
Internal flow:
ptinl = total pressure at inlet
ttinl = total temperature at inlet
betainl = flow angle at inlet (with x-axis, positive in clock-wise direction)
pout = static pressure at outlet
betaout = approximate outlet angle (needed for initial guess)
p12rat = ratio of inlet to outlet static pressure (needed for initial guess)
User input parameters & related quantities:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if_grid, fn_grid = grid data
if_gtop, fn_gtop = grid topology & boundary conditions
if_flow, fn_flow = flow field
if_surf, fn_surf = quantities along wall surface(s)
if_conv, fn_conv = convergence history
if_rsti, fn_rsti = restart solution - input
if_rsto, fn_rsto = restart solution - output
kflow = type of flow ("E"=external, "I"=internal)
gamma = ratio of specific heat coefficients
gam1 = gamma - 1
ggm1 = gamma/gam1
cpgas = specific heat coefficient at constant pressure
rgas = gas constant
maxiter = max. number of iterations
iter = actual iteration count
lrest = use previous solution for restart ("Y"=yes, "N"=no)
convtol = convergence criterion (2-norm of density change for which
the iteration process is stopped)
cfl = CFL-number
epsirs = coefficient of implicit residual smoothing
nitirs = no. of Jacobi iterations (implicit residual smoothing)
iorder = order of spatial discretisation (1 or 2)
ktimst = switch between local (="L") / global (="G") time-stepping
limfac = limiter coefficient (used only for 2nd-order Roe scheme, i.e.,
iorder=2)
epsentr = entropy correction coefficient (Harten's correction, Eq. (4.92))
lvort = far field vortex correction ("Y"=yes, "N"=no)
nrk = number of stages (Runge-Kutta) - max. 5
ark() = stage coefficients
betrk() = dissipation blending coefficients
ldiss() = dissipation evaluation (0=no, 1=yes)
pi = 3.14...
rad = 180./pi
Generation of edge list:
~~~~~~~~~~~~~~~~~~~~~~~~
The edge list is generated in two steps. First, two temporary lists are
generated in "edgesini.f". In a second step, the final edge list (edge()) is
constructed, and edges to dummy points are included (subroutine "edgesfin.f").
The temporary lists are defined as follows:
niedge(i) = pointer from node i to iedge()
iedge() = linked list of edge endpoints:
(_,1) = point j of edge (i,j)
(_,2) = next point j which is also connected to i; if =0 - no
further connection
(_,3) = pointer to edge() - used in "initmet.f" to tie the face
vector sij() to the correct edge
Common blocks:
~~~~~~~~~~~~~~
"control.inc"
/contr_c/ lrest,bname
/contr_i/ maxiter,iter,nbounds,btype,ibound
/contr_r/ convtol
"files.inc"
/files_c/ fn_grid,fn_gtop,fn_flow,fn_surf,fn_conv,
fn_rsti,fn_rsto
"geometry.inc"
/geom_r/ xref,yref,cref
"numerics.inc"
/numer_c/ ktimst,lvort
/numer_i/ nitirs,iorder,nrk,ldiss
/numer_r/ cfl,epsirs,limfac,epsentr,ark,betrk,pi,rad,
volref,limref
"physics.inc"
/phys_c/ kflow
/phys_r/ gamma,cpgas,
machinf,alpha,pinf,tinf,rhoinf,uinf,vinf,qinf,
ptinl,ttinl,betainl,betaout,p12rat,pout
"pltquant.inc"
/pltq_c/ title,lquant,cquant
/pltq_r/ drho,drho1,cl,cd,cm,mflow,mfrate
Please note that all physical quantities are defined in SI units.
--------------------------------------------------------------------------------
Program structure
--------------------------------------------------------------------------------
Tree of subprogram calls:
EUL2DU - main program (main.f)
BCOND
BC_FARF
DEP_VARS_ONE
FORCES
BC_INFLOW
DEP_VARS_ONE
BC_OUTFLOW
DEP_VARS_ONE
BOUND_NODES
CHECK_MET
CONVER
FORCES
MASSFLOW
DEP_VARS_ALL
EDGES_FIN
EDGES_INI
FACEVEC_SYMM
INIT_CONST
INIT_FLOW
INIT_MET
INIT_METB
PERIODIC
LENGTH
LIMITER_REF
PLT_FLOW
DEP_VARS_ALL
LENGTH
PLT_SURF
DEP_VARS_ALL
LENGTH
READ_BFACES
READ_DIMENS
READ_GRID
READ_PARAM
READ_CHAR
READ_SOLUT
SOLVER
BCOND (see above)
DEP_VARS_ALL
FLUXC1
FLUXC2
FLUX_ROE1
ENTROPY_CORR1
FLUX_ROE2
ENTROPY_CORR2
GRADIENT
PERIODIC
IRSMOO
PERIODIC
LIMITER
VENKAT
LIMITER_INIT
PERIODIC
TIME_STEP
PERIODIC
ZERO_RES
WRITE_PARAM
LENGTH
WRITE_SOLUT
Subroutines:
BCOND - invokes application of boundary conditions (bcond.f)
BC_FARF - sets farfield boundary conditions (bcfarf.f)
BC_INFLOW - sets inflow boundary conditions (bcinflo.f)
BC_OUTFLOW - sets outflow boundary conditions (bcoutflo.f)
BOUND_NODES - stores indices of dummy nodes in bnode() (bnodes.f)
CHECK_MET - checks metrics by computing min. and max. volume, and the sum
of face vectors for each control volume (checkmet.f)
CONVER - writes out convergence history (conver.f)
DEP_VARS_ALL - values of dependent variables over whole domain (depvars.f)
DEP_VARS_ONE - values of dependent variables at a point (depvars.f)
EDGES_FIN - generates final edge list (edgesfin.f)
EDGES_INI - generates temporary lists with nodes of an edge (edgesini.f)
ENTROPY_CORR1- entropy correction for 1st-order scheme (fluxroe1.f)
ENTROPY_CORR2- entropy correction for 2nd-order scheme (fluxroe2.f)
FACEVEC_SYMM - corrects face vectors of edges which represent symmetry boundary
(fvecsymm.f)
FLUXC1 - calculates convective fluxes for 1st-order scheme (fluxc1.f)
FLUXC2 - calculates convective fluxes for 2nd-order scheme (fluxc2.f)
FLUX_ROE1 - upwind dissipation for 1st-order Roe scheme (fluxroe1.f)
FLUX_ROE2 - upwind dissipation for 2nd-order Roe scheme (fluxroe2.f)
FORCES - calculates pressure forces acting on the body (forces.f)
GRADIENT - gradients of density, u, v, and pressure wrp. to x- and
y-direction (gradient.f)
INIT_CONST - initialises some important constants (initcon.f)
INIT_FLOW - initialises flow variables and reference values (initflow.f)
INIT_MET - calculates face vectors and control volumes (initmet.f)
INIT_METB - duplicates control volumes at periodic boundaries and generates
face vectors at boundaries (initmetb.f)
IRSMOO - smoothes residuals (irsmoo.f)
LENGTH - returns length of a string without trailing blanks (length.f)
LIMITER - evaluates limiter functions (limiter.f)
LIMITER_INIT - initialises limiter functions (limitini.f)
LIMITER_REF - calculates reference values for the limiter (limitref.f)
MASSFLOW - calculates mass flow at inlet and mass flow ratio (massflo.f)
PERIODIC - adds variables at periodic nodes (periodic.f)
PLT_FLOW - writes out selected quantities for the whole domain (pltflow.f)
PLT_SURF - writes out selected quantities for all walls (pltsurf.f)
READ_BFACES - reads in definition of boundary faces/periodic nodes (rbfaces.f)
READ_CHAR - reads first ... ...
近期下载者:
相关文件:
收藏者: