IPIM
 All Classes Files Functions Variables Pages
Functions/Subroutines
lcpfct.f90 File Reference

Functions/Subroutines

subroutine lcpfct (RHOO, RHON, I1, IN, SOURCE)
 Originated: J.P. Boris Code 4400, NRL Feb 1987 Modified: Laboratory for Computational Physics & Fluid Dynamics Contact: J.P. Boris, J.H. Gardner, A.M. Landsberg, or E.S. Oran. More...
 
subroutine makegrid (RADHO, RADHN, I1, INP, mode, RLN_OUT, VOLO, VOLN, SURFO, SURFN, coef_geom, mat_filtre)
 Description: This Subroutine initializes geometry variables and coefficients. It should be called first to initialize the grid. The grid must be defined for all of the grid interfaces from I1 to INP. Subsequent calls to VELOCITY and LCPFCT can work on only portions of the grid, however, to perform restricted integrations on separate line segments. More...
 
subroutine velocity (UH, I1, INP, DT, ADVEC)
 Description: This subroutine calculates all velocity-dependent coefficients for the LCPFCT and CNVFCT routines. This routine must be called before either LCPFCT or CNVFCT is called. MAKEGRID must be called earlier to set grid and geometry data used here. More...
 
subroutine sources (I1, IN, DT, MODE, C, D, SOURCE)
 Description: This subroutine computes different source terms. More...
 
real *8 function, dimension(size(var_cell)+1) grid (itp, var_cell, pos2grid, sigma)
 Compute var_grid on grid cell interface from a variable given at cell (var_cell). More...
 
real *8 function, dimension(i1:in) limite_gradln (I1, IN, D, G, Tp)
 Gradient grad(D) computation and limitation with Lo and given G and Tp. More...
 
real *8 function, dimension(size(src_in)) limite_src (I1, IN, SRC_in, G, Tp, Cij)
 

Detailed Description

Author
Date
01.01.2011

Function/Subroutine Documentation

real*8 function, dimension(size(var_cell)+1) grid ( integer, intent(in)  itp,
real*8, dimension(:), intent(in)  var_cell,
real*8, dimension(:), intent(in)  pos2grid,
real*8, optional  sigma 
)

Compute var_grid on grid cell interface from a variable given at cell (var_cell).

Author
For i=2..N:

\begin{equation}vgrid_i = pos2grid_i*vcell_i+(1-pos2grid_i)*vcell_{i-1}\end{equation}

For i=1 or N+1:

  • Mode itp=1: for all variable except N and ln(N).

    \begin{eqnarray*} vgrid_1 &=& vcell_1 + \alpha (vcell_1 - vgrid_2)\\\ vgrid_{N+1} &=& vcell_N + \alpha (vcell_N - vgrid_N)\\\ vgrid_1.vcell_1 \ge 0 && vgrid_{N+1}.vcell_N \ge 0 \end{eqnarray*}

  • Mode itp=2: for N.

    \begin{eqnarray*} vgrid_1 &=& vcell_1 + \alpha.max(0,(vcell_1 - vgrid_2))\\\ vgrid_{N+1} &=& coefrho.vcell_N \end{eqnarray*}

  • Mode itp=3: for ln(N).

    \begin{eqnarray*} vgrid_1 &=& vcell_1 + \alpha.max(0,(vcell_1 - vgrid_2))\\\ vgrid_{N+1} &=& ln(coefrho) + vcell_N \end{eqnarray*}

Here is the caller graph for this function:

subroutine lcpfct ( real*8, dimension(:)  RHOO,
real*8, dimension(:)  RHON,
integer  I1,
integer  IN,
real*8, dimension(:)  SOURCE 
)

Originated: J.P. Boris Code 4400, NRL Feb 1987 Modified: Laboratory for Computational Physics & Fluid Dynamics Contact: J.P. Boris, J.H. Gardner, A.M. Landsberg, or E.S. Oran.

Author
Description: This routine solves generalized continuity equations of the form dRHO/dt = -div (RHO*V) + SOURCES in the user's choice of Cartesian, cylindrical, or spherical coordinate systems. A facility is included to allow definition of other coordinates. The grid can be Eulerian, sliding rezone, or Lagrangian and can be arbitrarily spaced. The algorithm is a low-phase-error FCT algorithm, vectorized and optimized for a combination of speed and flexibility. A complete description appears in the NRL Memorandum Report (1992), "LCPFCT - A Flux-Corrected Transport Algorithm For Solving Generalized Continuity Equations".

Arguments: RHOO Real Array grid point densities at start of step I RHON Real Array grid point densities at end of step O I1 Integer first grid point of integration I IN Integer last grid point of intergration I SRHO1 Real Array boundary guard cell factor at cell I1+1 I VRHO1 Real Array boundary value added to guard cell I1-1 I SRHON Real Array boundary guard cell factor at cell IN+1 I VRHON Real Array boundary value added to guard cell IN+1 I PBC Logical periodic boundaries if PBC = .true. I

In this routine the last interface at RADHN(INP) is the outer boundary of the last cell indexed IN. The first interface at RADHN(I1) is the outer boundary of the integration domain before the first cell indexed I1.

Language and Limitations: LCPFCT is a package of FORTRAN 77 sub- routines written in single precision (64 bits CRAY). The parameter NPT is used to establish the internal FCT array dimensions at the maximum size expected. Thus NPT = 500 means that continuity equa- tions for systems up to 200 cells long in one direction can be integrated. Underflows can occur when the function being trans- ported has a region of zeroes. The calculations misconserve by one or two bits per cycle. Relative phase and amplitude errors (for smooth functions) are typically a few percent for character- istic lengths of 1 - 2 cells (wavelengths of order 10 cells). The jump conditions for shocks are generally accurate to better than 1 percent. Common blocks are used to transmit all data between the subroutines in the LCPFCT package.

Auxiliary Subroutines: CNVFCT, CONSERVE, COPYGRID, MAKEGRID, NEW_GRID, RESIDIFF, SET_GRID, SOURCES, VELOCITY, ZERODIFF, and ZEROFLUX. The detailed documentation report provided (or the listing below) explains the definitions and use of the arguments to these other subroutines making up the LCPFCT package. These routines are not called from LCPFCT itself but are controlled by calls from the user. Subroutines MAKEGRID, VELOCITY and SOURCES in this package must first be called to set the grid geometry, velocity-dependent flux and diffusion coefficients, and external source arrays used by LCPFCT. The other subroutines may be called to perform other functions such as to modify boundary conditions, to perform special grid operations, or compute conservation sums.

Here is the caller graph for this function:

real*8 function, dimension(i1:in) limite_gradln ( integer, intent(in)  I1,
integer, intent(in)  IN,
real*8, dimension(:), intent(in)  D,
real*8, dimension(:), intent(in)  G,
real*8, dimension(:), intent(in)  Tp 
)

Gradient grad(D) computation and limitation with Lo and given G and Tp.

Author
Parameters
I1.Integer. First cell of the grid
IN.Integer. Last cell of the grid
D.Real Array(NPT). Array of variable to be derived.
G.Real Array(NPT). Array of gravity value.
D.Real Array(NPT). Array of parallel temperature.
Returns
GRD. Real Array(I1:IN). Limited gradient of D.

\begin{equation} \nabla D^i = AR^i(D^{i+1}-D^i) \end{equation}

\begin{eqnarray*} \nabla D &<& \left| \frac{Lo.G}{T_p} \right| \hspace{10mm} if \hspace{1mm} G.\nabla D < 0\\ \nabla D &<& 10\left| \frac{Lo.G}{T_p} \right| \hspace{10mm} if \hspace{1mm} G.\nabla D > 0 \end{eqnarray*}

Here is the caller graph for this function:

real*8 function, dimension(size(src_in)) limite_src ( integer  I1,
integer  IN,
real*8, dimension(:)  SRC_in,
real*8, dimension(:)  G,
real*8, dimension(:)  Tp,
real*8  Cij 
)
Author
subroutine makegrid ( real*8, dimension(:)  RADHO,
real*8, dimension(:)  RADHN,
integer  I1,
integer  INP,
integer  mode,
real*8, dimension(:)  RLN_OUT,
real*8, dimension(:), optional  VOLO,
real*8, dimension(:), optional  VOLN,
real*8, dimension(:), optional  SURFO,
real*8, dimension(:), optional  SURFN,
real*8, dimension(:), optional  coef_geom,
real*8, dimension(:,:), optional  mat_filtre 
)

Description: This Subroutine initializes geometry variables and coefficients. It should be called first to initialize the grid. The grid must be defined for all of the grid interfaces from I1 to INP. Subsequent calls to VELOCITY and LCPFCT can work on only portions of the grid, however, to perform restricted integrations on separate line segments.

Author
Arguments: RADHO Real Array(INP) old cell interface positions I RADHN Real Array(INP) new cell interface positions I I1 Integer first cell interface I INP Integer last cell interface I ALPHA Integer = 1 for cartesian geometry I = 2 for cylindrical geometry I = 3 for spherical geometry I = 4 general geometry (user supplied) I

Here is the caller graph for this function:

subroutine sources ( integer, intent(in)  I1,
integer, intent(in)  IN,
real*8, intent(in)  DT,
integer, intent(in)  MODE,
real*8, dimension(:), intent(in)  C,
real*8, dimension(:), intent(in)  D,
real*8, dimension(:), intent(out)  SOURCE 
)

Description: This subroutine computes different source terms.

Author
Parameters
I1.Integer. First cell to be integrated
IN.Integer. Last cell to be integrated
DT.Real. Stepsize for the time integration
MODE.Integer.
  • 1. Adds +DIV(D)
  • 2. Adds +C*GRAD(D)
  • 3. Adds +D to the sources. $SOURCE^i =+ dt.LO^i.D^i$
  • 4. Adds +DIV(D) from interface data
  • 5. Adds +C*GRAD(D) from interface data. $SOURCE^i =+ C^i.dt.AR^i\left(D^{i+1}-D^i\right)$
  • 6. Adds +C*DIV(D) conservatively from interface data. $SOURCE^i =+ C^i.dt\left(AH^{i+1}D^{i+1}-AH^iD^i\right)$
  • 7. Adds +C*GRAD(D) using limited GRAD(D) expression. $SOURCE^i =+ C^i.dt.D^i$
C.Real Array(NPT). Array of source variables
D.Real Array(NPT). Array of source variables
Returns
SOURCE. Real Array(NPT). Array of sources.

Here is the caller graph for this function:

subroutine velocity ( real*8, dimension(:)  UH,
integer  I1,
integer  INP,
real*8  DT,
integer, optional  ADVEC 
)

Description: This subroutine calculates all velocity-dependent coefficients for the LCPFCT and CNVFCT routines. This routine must be called before either LCPFCT or CNVFCT is called. MAKEGRID must be called earlier to set grid and geometry data used here.

Author
Arguments: UH Real Array(NPT) flow velocity at cell interfaces I I1 Integer first cell interface of integration I INP Integer last cell interface = N + 1 I DT Real stepsize for the time integration I

Here is the caller graph for this function: