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

flux_calc.h File Reference

Flux calculators for Euler terms. More...

#include "../../gas_models/source/gas.h"
#include "../../geometry/source/geom.h"

Go to the source code of this file.

Data Structures

struct  flow_state
 Flow state on the one side of the interface. More...
struct  flux_data_1D
 Flux of mass, momentum, energy and species through the interface. More...

Defines

#define FLUX_RIEMANN   0
 Type of flux calculation...
#define FLUX_AUSM   1
#define FLUX_EFM   2
#define FLUX_AUSMDV   3
#define FLUX_ADAPTIVE   4
#define FLUX_CALC_HEADER_ALREADY_INCLUDED

Functions

int set_flux_calculator (int iflux)
 Sets a global variable to select the flux calculator.
int get_flux_calculator (void)
 Returns the index of the selected flux calculator.
int copy_gas_state (struct flow_state *from_gs, struct flow_state *to_gs)
 Copy the flow_state data (gas_data plus flow velocities.).
int compute_interface_flux (struct flow_state Lft[], struct flow_state Rght[], struct flux_data_1D IF[], int first, int last)
 Compute the inviscid fluxes (in 2D) across the cell interfaces.
int compute_interface_flux_3D (struct flow_state Lft[], struct flow_state Rght[], struct flux_data_1D IF[], int first, int last)
 Compute the inviscid fluxes (in 3D) across the cell interfaces.
int rivp (struct flow_state QL[], struct flow_state QR[], struct flow_state QIF[], double WSL[], double WSR[], int first, int last)
 Compute flux using a solution to the 1D Riemann problem.
int rivp_stage_3 (struct flow_state QL[], struct flow_state QR[], struct flow_state QLstar[], struct flow_state QRstar[], double WSL[], double WSR[], double geff[], struct flow_state QIF[], int first, int last)
 Interpolate interface state from intermediate states.
int ausm (struct flow_state QL[], struct flow_state QR[], struct flow_state QIF[], double WSL[], double WSR[], int first, int last)
 Compute interface flux of mass, momentum and energy.
int efmflx (struct flow_state Lft[], struct flow_state Rght[], struct flux_data_1D IF[], int first, int last)
 Compute the fluxes across an interface using the Equilibrium Flux Method of Macrossan & Pullin.
int exxef (double sn, double *ex, double *ef)
 Compute exp(-x**2) and erf(x) with a polynomial approximation.
int ausmdv (struct flow_state Lft[], struct flow_state Rght[], struct flux_data_1D IF[], int first, int last)
 Compute the fluxes across an interface.
int adaptive_flux (struct flow_state Lft[], struct flow_state Rght[], struct flux_data_1D IF[], int first, int last)
 Compute the fluxes across an interface.


Detailed Description

Flux calculators for Euler terms.

Author:
PJ
Version:
29-Jun-04, initially extracted from mb_cns.h

Define Documentation

#define FLUX_RIEMANN   0
 

Type of flux calculation...

 * FLUX_RIEMANN  : 3-stage approximate Riemann solver.
 * FLUX_AUSM     : AUSM flux-splitting
 * FLUX_EFM      : Mike Macrossan's EFM flux calculation
 * FLUX_AUSMDV   : Wada and Liou's flux calculator AIAA Paper 94-0083
 * FLUX_ADAPTIVE : EFM near shocks, AUSMDV otherwise
 * 


Function Documentation

int adaptive_flux struct flow_state  Lft[],
struct flow_state  Rght[],
struct flux_data_1D  IF[],
int  first,
int  last
 

Compute the fluxes across an interface.

This adaptive flux calculator uses uses the Equilibrium Flux Method of Macrossan & Pullin near shocks and AUSMDV away from shocks. The actual work is passed off to the original flux calculation functions.

Parameters:
Lft[] : IN : array of Left flow states (with velocities in local frame of reference)
Rght[] : IN : array of Right flow state
IF[] : IN-OUT : array of interface flux data structures
first : IN : index of first interface to compute
last : IN : index of last interface to compute

int ausm struct flow_state  QL[],
struct flow_state  QR[],
struct flow_state  QIF[],
double  WSL[],
double  WSR[],
int  first,
int  last
 

Compute interface flux of mass, momentum and energy.

Given the initial LEFT and RIGHT states (QL and QR) either side of an interface, compute the interface state. This solution is returned as values of the flow quantities at the interface (QIF) and the velocities of the left and right waves.

Parameters:
*QL : IN : pointer to the array of LEFT states see "flux_calc.h" for a definition of the components
*QR : IN : RIGHT states
first : IN : first element to be computed
last : IN : last element to be computed
QIF : OUT : Flow state at the interface
WSL : OUT : Left wave velocity
WSR : OUT : Right wave velocity
Version:
1.0, 20 Aug 91

1.1, 18-Oct-96, second-order polynomial for pressure splitting as per Liou and Steffen's J. Comput. Phys paper

Author:
P.A. Jacobs ICASE Mail Stop 123C NASA Langley Rearch Centre Hampton VA 23665.
 * References ...
 * M. -S. Liou and C. J. Steffen Jr.
 * A new flux splitting scheme.
 * NASA Technical Memorandum 104404
 * 

int ausmdv struct flow_state  Lft[],
struct flow_state  Rght[],
struct flux_data_1D  IF[],
int  first,
int  last
 

Compute the fluxes across an interface.

Parameters:
Lft[] : IN : array Left flow states (with velocities in local frame of reference)
Rght[] : IN : array of Right flow states
IF[] : OUT : array for interface flux data
first : IN : index of first interface to compute
last : IN : index of last interface to compute
 * IF[i].mass      : flux of mass across the interface (kg/s/m**2)
 * IF[i].n_mom     : flux of normal momentum
 * IF[i].p_mom     : flux of tangential momentum
 * IF[i].q_mom
 * IF[i].energy    : flux of energy
 * IF[i].species[] : array of species fluxes
 *       e_vib[]   : vibrational energies
 *       e_e       : free-electron energy 
 * 

int compute_interface_flux struct flow_state  Lft[],
struct flow_state  Rght[],
struct flux_data_1D  IF[],
int  first,
int  last
 

Compute the inviscid fluxes (in 2D) across the cell interfaces.

This is the top-level function that calls the previously selected flux calculator. Much of the detailed work is delegated.

Parameters:
Lft : pointer to the array of LEFT flow states
Rght : pointer to the array of RIGHT flow states
IF : pointer to the array of interfaces where the fluxes are to be stored
first : index of the first interface to be used
last : index of the last interface

int compute_interface_flux_3D struct flow_state  Lft[],
struct flow_state  Rght[],
struct flux_data_1D  IFlux[],
int  first,
int  last
 

Compute the inviscid fluxes (in 3D) across the cell interfaces.

This is the top-level function that calls the previously selected flux calculator. Much of the detailed work is delegated.

Parameters:
Lft : pointer to the array of LEFT flow states
Rght : pointer to the array of RIGHT flow states
IF : pointer to the array of interfaces where the fluxes are to be stored
first : index of the first interface to be used
last : index of the last interface
Todo:
Really don't require npq_mom and xyz_mom to be separately stored. Just keep xyz_mom (and rename to momentum).

int copy_gas_state struct flow_state from_gs,
struct flow_state to_gs
 

Copy the flow_state data (gas_data plus flow velocities.).

Parameters:
from_gs : pointer to source data structure
to_gs : pointer to target data structure

int efmflx struct flow_state  Lft[],
struct flow_state  Rght[],
struct flux_data_1D  IF[],
int  first,
int  last
 

Compute the fluxes across an interface using the Equilibrium Flux Method of Macrossan & Pullin.

Parameters:
Lft[] : IN : array of Left flow states (with velocities in local frame of reference)
Rght[] : IN : array of Right flow state
IF[] : IN/OUT : array of interface flux data structures
first : IN : index of first interface to compute
last : IN : index of last interface to compute
 * interface data -- contains...
 *     flux of mass across the interface (kg/s/m**2)
 *     flux of normal momentum
 *     flux of tangential momentum
 *     flux of energy
 *     array of species fluxes 
 *     vibrational energies
 *     free-electron energy
 * 

int exxef double  sn,
double *  ex,
double *  ef
 

Compute exp(-x**2) and erf(x) with a polynomial approximation.

Parameters:
sn : IN : x
*ex : OUT : exp(x**2)
*ef : OUT : erf(x) error function

int rivp struct flow_state  QL[],
struct flow_state  QR[],
struct flow_state  QIF[],
double  WSL[],
double  WSR[],
int  first,
int  last
 

Compute flux using a solution to the 1D Riemann problem.

Given the initial LEFT and RIGHT states (QL and QR) either side of an interface, compute the solution to the one-dimensional Riemann problem when the interface is removed. This solution is returned as values of the flow quantities at the interface (QIF) and the velocities of the left and right waves.

Parameters:
*QL : IN : pointer to the array of LEFT states see "flux_calc.h" for a definition of the components
*QR : IN : RIGHT states
first : IN : first element to be computed
last : IN : last element to be computed
QIF : OUT : Flow state at the interface
WSL : OUT : Left wave velocity
WSR : OUT : Right wave velocity
Version:
 * 1.0,  20 Dec 90
 * 1.01, 20-Feb-91: include "compilers.h"
 * 1.10, 17-Mar-91: installed quick and dirty power routine
 * 1.2,  25-Apr-91: vacuum case installed, WSL and WSR added
 * 1.3,  26-Apr-91: vector version
 * 1.4,  27-May-91: strong shock solution added.
 * 1.4.1 28-May-91: Newton steps added as a second stage
 * 1.4.2 05-Jun-91: changed the way intermediate variables are
 *                  backed out
 * 2.0   18-Nov-92: Split the interpolation section off into
 *                  the new function rivp_stage_3().
 *                  Made the stage numbering consistent with
 *                  the AIAA Journal paper.
 * 3.0   04-Mar-93: Split the main loop into smaller parts
 *                  for the Fujitsu compiler
 *                  Promote scalar temporaries to vectors.
 * 3.01  10-Mar-93: Have removed the 4 Newton-step code but
 *                  have left the two step code.
 *                  Have introduced a new temporary variable
 *                  into the calculation of the wave speeds.
 * 4.0   17-Mar-93: Added Toro's linearized Riemann solver.
 * 5.0   13-Aug-93: Added general-strength shock expressions 
 *                  to stage 2.
 * 5.01  16-Aug-93: Finally got the signs right in the Newton steps.
 * 5.1   29-Oct-93: Fixed a couple of problems for cases where
 *                  the Newton steps run into trouble.  Also
 *                  put the number of Newton steps back to 4.
 * 6.0   29-Jan-96: Thermo properties now come via service functions.
 * 6.01  29-Apr-96: Promoted DEBUG output to level 4 so that not so much
 *                  is written.
 * 6.02  03-Nov-96: Removed Toro's linearised solver and
 *                  the strong-shock code which hasn't been
 *                  used for ages.
 * --------------------------------------------------------------------------
 * 08-Sep-2002 : Started to remove the e = C_v * T dependency from the
 *               code here but it is deeply embedded in the later stages
 *               of the calculations.  Maybe it just isn't worth bothering
 *               to keep it up-to-date.  Consider these functions deprecated!
 * --------------------------------------------------------------------------
 *
Author:
P.A. Jacobs ICASE Mail Stop 123C NASA Langley Rearch Centre Hampton VA 23665.

PJ Department of Mechanical Engineering The University of Queensland Brisbane 4072

 * References ...
 * ----------
 *
 * Most of this solver is now documented in
 * P. A. Jacobs "An approximate Riemann solver for hypervelocity
 * flows."  AIAA Journal vol. 30(10) 1992.
 *
 * S.R. Chakravarthy "Development of upwind schemes for the
 * Euler equations"
 * NASA Contractor Report 4043, 1987.
 *
 * P. Colella "Glimm's method for gas dynamics"
 * SIAM J. Sci. Stat. Comput. vol.3, 76-110, 1982.
 *
 * T. A. Edwards (1988)
 * "The effect of exhaust plume/afterbody interaction on
 * installed scramjet performance."
 * NASA Technical Memorandum 101033
 *
 * H.M. Glaz & A.B. Wardlaw "A high-order Godunov scheme for
 * steady supersonic gas dynamics" J. Comput. Phys. vol.58,
 * pp157-187, 1985.
 *
 * J.J. Gottlieb & C.P.T. Groth "Assessment of Riemann solvers
 * for unsteady one-dimensional inviscid flows of perfect gases"
 * J. Comput. Phys. vol.78(2), 437-458, 1988.
 *
 * B. van Leer "On the relation between the upwind-differencing
 * schemes of Godunov, Engquist-Osher & Roe"
 * SIAM J. Sci. Stat. Comput. vol.5(1), 1-20, 1984.
 *
 * B. van Leer, W-T. Lee & K.G. Powell "Sonic point capturing"
 * AIAA-89-1945-CP (AIAA 9th CFD conference), 1989.
 *
 * H.W. Liepmann & A.Roshko "Elements of Gas Dynamics"
 * Wiley, 1957.
 *
 * S. Osher & F. Solomon "Upwind difference schemes for
 * hyperbolic systems of conservation laws"
 * Mathematics of Computation, vol.38, 339-, 1982.
 *
 * P.L. Roe "Some contributions to the modelling of
 * discontinuous flows" Lectures in Applied Mathematics,
 * Vol. 22 (part 2), 163-193, 1985
 * 
 * E. F. Toro "A linearized Riemann solver for the time-
 * dependent Euler equations of gas-dynamics"
 * Proc. R. Soc. Lond. A Vol. 434, 683-693 (1991)
 *
 * M. Vinokur & Y. Liu (1988)
 * "Equilibrium gas flow computations II: An analysis of
 * numerical formulations of conservation laws."
 * AIAA Paper 88-0127
 * 

int rivp_stage_3 struct flow_state  QL[],
struct flow_state  QR[],
struct flow_state  QLstar[],
struct flow_state  QRstar[],
double  WSL[],
double  WSR[],
double  geff[],
struct flow_state  QIF[],
int  first,
int  last
 

Interpolate interface state from intermediate states.

Given the initial LEFT and RIGHT states (QL and QR) either side of an interface and the intermediate states, interpolate (or select) the interface state.

Parameters:
*QL : IN : pointer to the array of LEFT states see "flux_calc.h" for a definition of the components
*QR : IN : RIGHT states
*QLstar,*QRstar : IN : the intermediate states
*geff : IN : the array of effective gammas
WSL : IN : Left wave velocity
WSR : IN : Right wave velocity
first : IN : first element to be computed
last : IN : last element to be computed
QIF : OUT : Flow state at the interface
Version:
1.0, 18-Nov-92: Split off from rivp()

1.01, 03-Nov-96: Update multiple-species code.


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