Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

e_filter.c File Reference

Subroutines for filtering and deconvolution. More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "../../util/source/useful.h"
#include "../../util/source/compiler.h"
#include "../../util/source/logfile.h"
#include "../../gas_models/source/gas.h"
#include "../../flux_calc/source/flux_calc.h"
#include "../../mb_cns/source/cns_case_id.h"
#include "../../mb_cns/source/cns_work_vector.h"
#include "../../mb_cns/source/cns_debug_level.h"
#include "../../mb_cns/source/cns_cell.h"
#include "../../mb_cns/source/cns_echo.h"
#include "../../mb_cns/source/cns_bc_defs.h"
#include "../../mb_cns/source/mb_cfg.h"
#include "./e_block.h"
#include "../../mb_cns/source/interpolate.h"
#include "./e_filter.h"

Functions

int initfilter (struct block_data_3D *A)
 Computes the filter coefficients.
int filtcentered (double dmm, double dm, double dp, double dpp, double cutoff, double gew1[], double gew2[], double i3mom)
 Computes the actual filter coefficients based on grid sizes.
int filt1wall (double dm, double dp, double d2, double d3, double cutoff, double gew1[], double gew2[], double i3mom)
 Computes the actual filter coefficients based on grid sizes for cell one away from the wall.
int filter (struct block_data_3D *A)
 Delegates work for filtering to explicit filtering routines.
int yexp3io (struct block_data_3D *A, double ****work2, double ****work)
 Explicit filtering in j direction.
int xexp3io (struct block_data_3D *A, double ****work2, double ****work)
 Explicit filtering in i direction.
int zexp3io (struct block_data_3D *A, double ****work2, double ****work)
 Explicit filtering in k direction.
int A2ijk (struct block_data_3D *A, double ****work)
int ijk2kji (struct block_data_3D *A, double ****work)
int ijk2A (struct block_data_3D *A, double ****work)
int ijk2ijk (struct block_data_3D *A, double ****work)
int deconv (struct block_data_3D *A)
 Deconvolves conserved quantities.
double **** allocate_work (int nnx, int nny, int nnz)
int initialise_filter_memory (int nnx, int nny, int nnz)

Variables

double **** work_deconv
int filter_memory_alloc = 0
double **** work
double **** work2


Detailed Description

Subroutines for filtering and deconvolution.

Author:
AD
Version:
September 2004 ###################################################################### ######################################################################
This file containes the subroutines used for filtering and deconvolution described in

1) Stolz S, Adams NA, Kleiser L An approximate deconvolution model for large-eddy simulation with application to incompressible wall-bounded flows PHYS FLUIDS 13 (4): 997-1015 APR 2001

2) Stolz S, Adams NA An approximate deconvolution procedure for large-eddy simulation PHYS FLUIDS 11 (7): 1699-1701 JUL 1999

The implementation assumes, that the y-direction is perpendicular to the x-z plane => xrechen and zrechen does not depend on j (index in y-direction).

Steffen Stolz, 2003

stolz@ifd.mavt.ethz.ch

Please inform/ask me before handing the subroutines to others. Thanks!

###################################################################### ######################################################################

Translate to C by Andrew Denman, 2004

a.denman@uq.edu.au

###################################################################### ######################################################################

some global flags: * common /steuer/ cyber cyber: logical field*25 cyber(3) = true => periodic bc in x-direction cyber(4) = true => periodic bc in y-direction cyber(5) = true => periodic bc in z-direction * common /cartesianx/ cartesian,equiy cartesian = true => grid is cartesian equiy = true => y-direct. is equi-distant

###################################################################### ######################################################################


Function Documentation

int deconv struct block_data_3D A  ) 
 

Deconvolves conserved quantities.

Parameters:
A : pointer to block data structure ----------------------------------------------------------------------- Name: deconv
Computer:

Revised: 31/7/98

Purpose: computes the deconvolved quantities, according to eq. (6) Stolz&Adams, 1999, PoF, pp 1699ff

Usage:

Arguments: fl=input-field = output

Calls: filter

Storage:

Comments:

Author: St. Stolz

-----------------------------------------------------------------------

int filt1wall double  dm,
double  dp,
double  d2,
double  d3,
double  cutoff,
double  gew1[],
double  gew2[],
double  i3mom
 

Computes the actual filter coefficients based on grid sizes for cell one away from the wall.

Parameters:
dm : distance from cell 1 cell previously
dp : distance from cell 1 cell along
d2 : distance from cell 2 cells along
d3 : distance from cell 3 cells along
cutoff : cutoff frequency
gew1 : pointer to storage of filter coefficients
gew2 : pointer to storage of filter coefficients
-----------------------------------------------------------------------

Name: filtcentered

Computer:

Revised: April 28, 1998

Purpose: computes the coefficient of the explicit part (gew1) and the implicit part (gew2) of the discrete filter. gew1=alpha in eq. (19) and (34) of Stolz et al., 2001 Phys. Fluids, pp. 997ff gew2=beta in eq. (34)

Usage: for centered stencils, NOT used for 1st point off the wall

Arguments: * dmm,dm,dp,dpp are the distances of the grid point i-2, i-1 i+1 and i+2 from grid point i, respectively. * cutoff [0..1] is the desired cutoff wavenumber e.g. cutoff=0.5 => omega_c=pi/2 * gew1 & gew2 output, see above * i3mom is a switch if 5th condition is

  • i3mom=1 a third vanishing moment, eq. (24)
  • irmom=0 a minimized imaginary part, eq. (25) (default option, except for near-wall)

Calls:

Storage:

Comments:

Author: St.Stolz

-----------------------------------------------------------------------

int filtcentered double  dmm,
double  dm,
double  dp,
double  dpp,
double  cutoff,
double  gew1[],
double  gew2[],
double  i3mom
 

Computes the actual filter coefficients based on grid sizes.

Parameters:
dmm : distance from cell 2 cells previously
dm : distance from cell 1 cell previously
dp : distance from cell 1 cell along
dpp : distance from cell 2 cells along
cutoff : cutoff frequency
gew1 : pointer to storage of filter coefficients
gew2 : pointer to storage of filter coefficients
-----------------------------------------------------------------------

Name: filtcentered

Computer:

Revised: April 28, 1998

Purpose: computes the coefficient of the explicit part (gew1) and the implicit part (gew2) of the discrete filter. gew1=alpha in eq. (19) and (34) of Stolz et al., 2001 Phys. Fluids, pp. 997ff gew2=beta in eq. (34)

Usage: for centered stencils, NOT used for 1st point off the wall

Arguments: * dmm,dm,dp,dpp are the distances of the grid point i-2, i-1 i+1 and i+2 from grid point i, respectively. * cutoff [0..1] is the desired cutoff wavenumber e.g. cutoff=0.5 => omega_c=pi/2 * gew1 & gew2 output, see above * i3mom is a switch if 5th condition is

  • i3mom=1 a third vanishing moment, eq. (24)
  • irmom=0 a minimized imaginary part, eq. (25) (default option, except for near-wall)

Calls:

Storage:

Comments:

Author: St.Stolz

-----------------------------------------------------------------------

int filter struct block_data_3D A  ) 
 

Delegates work for filtering to explicit filtering routines.

Parameters:
A : pinter to the block data structure -----------------------------------------------------------------------
Name: filter

Computer:

Revised: April 28, 1998

Purpose: discrete filter, eq. (19) in Stolz et al, 2001, PoF, pp 997ff

Usage: call filter (work)

Arguments: A: block data structure

Calls:

Storage:

Comments:

Author: St.Stolz

-----------------------------------------------------------------------

int initfilter struct block_data_3D A  ) 
 

Computes the filter coefficients.

Parameters:
A,: : pointer to the single-block data structure -----------------------------------------------------------------------
Name: initfilter

Computer:

Revised: April 28, 1998

Purpose: discrete filter

Usage: call initfilter

Arguments: block data structure, --output in commonblocks: gewx1, gewx2 - filter weights for x filtering gewy1, gewy2 - filter weights for y filtering gewz1, gewz2 - filter weights for z filtering gewy1_ne, gewy2_ne - filter weights for non-equidistant y filtering * gew1 = alpha of eq. (19), (34) * gew2 = beta of eq. (34) (Stolz et al., 2001, pof, pp 997ff) * for x,y,z direction. y_ne for non-equidistant y-direct. --input in common blocks: xrechen, yrechen, zrechen (,,1) contains the x-, y- and z- coordinate of the grid points

Calls: filtcentered, filtl1r3, filtl1r2

Storage:

Comments:

Author: St.Stolz

-----------------------------------------------------------------------

int xexp3io struct block_data_3D A,
double ****  work2,
double ****  work
 

Explicit filtering in i direction.

Parameters:
A : pointer to block data structure
work2 : array for storage of filtered data
work : array for data to be filtered -----------------------------------------------------------------------
Name: xexp3io

Computer:

Revised: April 28, 1998

Purpose: explicit filter, computes eq. (19) for x-direct.

Usage: call xexp3io (work)

Arguments: work/work2: input/output data

Calls:

Storage:

Comments:

-----------------------------------------------------------------------

int yexp3io struct block_data_3D A,
double ****  work2,
double ****  work
 

Explicit filtering in j direction.

Parameters:
A : pointer to block data structure
work2 : array for storage of filtered data
work : array for data to be filtered -----------------------------------------------------------------------
Name: yexp3io

Computer:

Revised: April 28, 1998

Purpose: explicit filter, computes eq. (19) for y-direct. ONLY FOR EQUIDISTANT MESHES!!!

THIS IS THE SPANWISE DIRECTION!!!

Usage: call yexp3io (work)

Arguments: work/work2: input/output data

Calls:

Storage:

Comments:

int zexp3io struct block_data_3D A,
double ****  work2,
double ****  work
 

Explicit filtering in k direction.

Parameters:
A : pointer to block data structure
work2 : array for storage of filtered data
work : array for data to be filtered -----------------------------------------------------------------------
Name: zexp3io

Computer:

Revised: April 28, 1998

Purpose: explicit filter, computes eq. (19) for z-direct.

Usage: call zexp3io (work)

Arguments: work/work2: input/output data

Calls:

Storage:

Comments:

-----------------------------------------------------------------------


Generated on Tue Oct 25 10:24:12 2005 for CFCFD by  doxygen 1.4.4