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

e_invs.c File Reference

Functions to compute inviscid fluxes for Elmer. More...

#include <stdio.h>
#include <stdlib.h>
#include "../../util/source/useful.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_invs.h"

Defines

#define COPY_OVER_I_FROM_CELLS(ARRAY, QUANTITY, FIRST, LAST)
#define COPY_OVER_I_TO_STATES(STATE, ARRAY, QUANTITY, FIRST, LAST)
#define COPY_OVER_I_FROM_CELLS_TO_STATES(LEFT, RIGHT, QUANTITY, FIRST, LAST)
#define SET_STATE_I_QUANTITY_ZERO(STATE, QUANTITY, FIRST, LAST)
#define COPY_OVER_J_FROM_CELLS(ARRAY, QUANTITY, FIRST, LAST)
#define COPY_OVER_J_TO_STATES(STATE, ARRAY, QUANTITY, FIRST, LAST)
#define COPY_OVER_J_FROM_CELLS_TO_STATES(LEFT, RIGHT, QUANTITY, FIRST, LAST)
#define SET_STATE_J_QUANTITY_ZERO(STATE, QUANTITY, FIRST, LAST)
#define COPY_OVER_K_FROM_CELLS(ARRAY, QUANTITY, FIRST, LAST)
#define COPY_OVER_K_TO_STATES(STATE, ARRAY, QUANTITY, FIRST, LAST)
#define COPY_OVER_K_FROM_CELLS_TO_STATES(LEFT, RIGHT, QUANTITY, FIRST, LAST)
#define SET_STATE_K_QUANTITY_ZERO(STATE, QUANTITY, FIRST, LAST)
#define COPY_OVER_J_FROM_CELLS_TO_STATES_GHOST(LEFT, RIGHT, QUANTITY, BOTTOM, TOP)
#define COPY_OVER_K_FROM_CELLS_TO_STATES_GHOST(LEFT, RIGHT, QUANTITY, BOTTOM, TOP)

Functions

int inviscid_flux_3D (struct block_data_3D *bp)
int interp_I_face (struct block_data_3D *bp, int j, int k, struct flow_state Lft[], struct flow_state Rght[])
 Given the cell-center values, interpolate to get LEFT and RIGHT interface states (in the X,Y-frame of reference) for a set of I-interfaces.
int interp_J_face (struct block_data_3D *bp, int i, int k, struct flow_state Lft[], struct flow_state Rght[])
 Given the cell-center values, interpolate to get LEFT and RIGHT interface states (in the X,Y-frame of reference) for a set of J-interfaces.
int interp_K_face (struct block_data_3D *bp, int i, int j, struct flow_state Lft[], struct flow_state Rght[])
 Given the cell-center values, interpolate to get LEFT and RIGHT interface states (in the X,Y-frame of reference) for a set of K-interfaces.


Detailed Description

Functions to compute inviscid fluxes for Elmer.

Author:
PJ
Version:
August 2004 bring code over from mb_cns.

Define Documentation

#define COPY_OVER_I_FROM_CELLS ARRAY,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( i = FIRST; i <= LAST; ++i ) {                         \
      ARRAY[i] = bp->ctr[i][j][k].QUANTITY ;                   \
   }

#define COPY_OVER_I_FROM_CELLS_TO_STATES LEFT,
RIGHT,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( i = FIRST; i <= LAST; ++i ) {                                         \
      LEFT[i].QUANTITY = bp->ctr[i-1][j][k].QUANTITY ;                         \
      RIGHT[i].QUANTITY = bp->ctr[i][j][k].QUANTITY ;                          \
   }

#define COPY_OVER_I_TO_STATES STATE,
ARRAY,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( i = FIRST; i <= LAST; ++i ) {                               \
      STATE[i].QUANTITY = ARRAY[i] ;                                 \
   }

#define COPY_OVER_J_FROM_CELLS ARRAY,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( j = FIRST; j <= LAST; ++j ) {                         \
      ARRAY[j] = bp->ctr[i][j][k].QUANTITY ;                   \
   }

#define COPY_OVER_J_FROM_CELLS_TO_STATES LEFT,
RIGHT,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( j = FIRST; j <= LAST; ++j ) {                                         \
      LEFT[j].QUANTITY = bp->ctr[i][j-1][k].QUANTITY ;                         \
      RIGHT[j].QUANTITY = bp->ctr[i][j][k].QUANTITY ;                          \
   }

#define COPY_OVER_J_FROM_CELLS_TO_STATES_GHOST LEFT,
RIGHT,
QUANTITY,
BOTTOM,
TOP   ) 
 

Value:

j = BOTTOM;                                                                 \
      LEFT[j].QUANTITY = bp->ctr[i-1][j-1][k].QUANTITY ;                         \
      RIGHT[j].QUANTITY = bp->ctr[i][j][k].QUANTITY ;                          \
      LEFT[j+1].QUANTITY = bp->ctr[i][j][k].QUANTITY ;                         \
      RIGHT[j+1].QUANTITY = bp->ctr[i][j+1][k].QUANTITY ;                          \
      j = TOP;                                                                    \
      LEFT[j].QUANTITY = bp->ctr[i][j-1][k].QUANTITY ;                         \
      RIGHT[j].QUANTITY = bp->ctr[i-1][j][k].QUANTITY ;                          \
      LEFT[j-1].QUANTITY = bp->ctr[i][j-2][k].QUANTITY ;                         \
      RIGHT[j-1].QUANTITY = bp->ctr[i][j-1][k].QUANTITY ;                          \

#define COPY_OVER_J_TO_STATES STATE,
ARRAY,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( j = FIRST; j <= LAST; ++j ) {                               \
      STATE[j].QUANTITY = ARRAY[j] ;                                 \
   }

#define COPY_OVER_K_FROM_CELLS ARRAY,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( k = FIRST; k <= LAST; ++k ) {                         \
      ARRAY[k] = bp->ctr[i][j][k].QUANTITY ;                   \
   }

#define COPY_OVER_K_FROM_CELLS_TO_STATES LEFT,
RIGHT,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( k = FIRST; k <= LAST; ++k ) {                                         \
      LEFT[k].QUANTITY = bp->ctr[i][j][k-1].QUANTITY ;                         \
      RIGHT[k].QUANTITY = bp->ctr[i][j][k].QUANTITY ;                          \
   }

#define COPY_OVER_K_FROM_CELLS_TO_STATES_GHOST LEFT,
RIGHT,
QUANTITY,
BOTTOM,
TOP   ) 
 

Value:

k = BOTTOM;                                                                 \
      LEFT[k].QUANTITY = bp->ctr[i-1][j][k-1].QUANTITY ;                         \
      RIGHT[k].QUANTITY = bp->ctr[i][j][k].QUANTITY ;                          \
      LEFT[k+1].QUANTITY = bp->ctr[i][j][k].QUANTITY ;                         \
      RIGHT[k+1].QUANTITY = bp->ctr[i][j][k+1].QUANTITY ;                          \
      k = TOP;                                                                    \
      LEFT[k].QUANTITY = bp->ctr[i][j][k-1].QUANTITY ;                         \
      RIGHT[k].QUANTITY = bp->ctr[i-1][j][k].QUANTITY ;                          \
      LEFT[k-1].QUANTITY = bp->ctr[i][j][k-2].QUANTITY ;                         \
      RIGHT[k-1].QUANTITY = bp->ctr[i][j][k-1].QUANTITY ;                          \

#define COPY_OVER_K_TO_STATES STATE,
ARRAY,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( k = FIRST; k <= LAST; ++k ) {                               \
      STATE[k].QUANTITY = ARRAY[k] ;                                 \
   }

#define SET_STATE_I_QUANTITY_ZERO STATE,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( i = FIRST; i <= LAST; ++i ) {                            \
      STATE[i].QUANTITY = 0.0 ;                                   \
   }

#define SET_STATE_J_QUANTITY_ZERO STATE,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( j = FIRST; j <= LAST; ++j ) {                            \
      STATE[j].QUANTITY = 0.0 ;                                   \
   }

#define SET_STATE_K_QUANTITY_ZERO STATE,
QUANTITY,
FIRST,
LAST   ) 
 

Value:

for ( k = FIRST; k <= LAST; ++k ) {                            \
      STATE[k].QUANTITY = 0.0 ;                                   \
   }


Function Documentation

int interp_I_face struct block_data_3D bp,
int  j,
int  k,
struct flow_state  Lft[],
struct flow_state  Rght[]
 

Given the cell-center values, interpolate to get LEFT and RIGHT interface states (in the X,Y-frame of reference) for a set of I-interfaces.

We assume that ghost cells have been set up with appropriate values. The approach taken is to ignore grid distortions and perform one dimensional projection/interpolation in the i-index direction.

bp : pointer to a block_data_3D structure. j, k : fixed indices Lft,Rght : arrays of LEFT and RIGHT flow states

int interp_J_face struct block_data_3D bp,
int  i,
int  k,
struct flow_state  Lft[],
struct flow_state  Rght[]
 

Given the cell-center values, interpolate to get LEFT and RIGHT interface states (in the X,Y-frame of reference) for a set of J-interfaces.

We assume that ghost cells have been set up with appropriate values. The approach taken is to ignore grid distortions and perform one dimensional projection/interpolation in the i-index direction.

bp : pointer to a block_data_3D structure. i, k : fixed indices Lft,Rght : arrays of LEFT and RIGHT flow states

int interp_K_face struct block_data_3D bp,
int  i,
int  j,
struct flow_state  Lft[],
struct flow_state  Rght[]
 

Given the cell-center values, interpolate to get LEFT and RIGHT interface states (in the X,Y-frame of reference) for a set of K-interfaces.

We assume that ghost cells have been set up with appropriate values. The approach taken is to ignore grid distortions and perform one dimensional projection/interpolation in the i-index direction.

bp : pointer to a block_data_3D structure. i, j : fixed indices Lft,Rght : arrays of LEFT and RIGHT flow states


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