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

cns_bc.c File Reference

Boundary Conditions for mb_cns.c. More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "../../util/source/compiler.h"
#include "../../util/source/useful.h"
#include "../../util/source/logfile.h"
#include "mb_cns.h"
#include "mb_cfg.h"
#include "cns_io.h"
#include "cns_bc.h"
#include "ivdep.h"

Defines

#define MAX_T_SAMPLE   10000
#define RECOVERY   0.9
#define RECOVERY   0.9

Functions

int local_frame (struct flow_state *FS, double cosX, double cosY)
 Change from a global (X,Y) frame of reference to a frame with its x-direction normal to the interface.
int XY_frame (struct flow_state *FS, double cosX, double cosY)
 Change from a frame of reference with its x-direction normal to the interface. to a global (X,Y) frame of reference.
int subsonic_inflow_properties (struct flow_state *stagnation, struct flow_state *inflow_state, double inflow_velocity)
 Given stagnation conditions, estimate the static conditions at the boundary cell.
int apply_inviscid_bc (struct block_data *A, FILE *read_file, int *n_vary, double *t_old, double *ta_old)
 Set up ghost-cell values for the inviscid flux calculations.
int apply_inviscid_bc_east (struct block_data *A, FILE *fp, int *n, double *t_old, double *ta_old)
 Set up ghost-cell values for the inviscid flux calculations EAST boundary.
int apply_inviscid_bc_west (struct block_data *A, FILE *fp, int *n, double *t_old, double *ta_old)
 Set up ghost-cell values for the inviscid flux calculations WEST boundary.
int apply_inviscid_bc_north (struct block_data *A, FILE *fp, int *n, double *t_old, double *ta_old)
 Set up ghost-cell values for the inviscid flux calculations NORTH boundary.
int apply_inviscid_bc_south (struct block_data *A, FILE *fp, int *n, double *t_old, double *ta_old)
 Set up ghost-cell values for the inviscid flux calculations SOUTH boundary.
int apply_viscous_bc (struct block_data *A)
 Apply viscous boundary conditions to the boundary cell interfaces.
int set_MIRELS_free_stream_HeN2 (double r, double t, int iturb, struct flow_state *fs)
 Set the special inflow conditions for the small shock tube using Mirel's boundary layer theory. Helium driving Nitrogen.
int set_MIRELS_free_stream_N2N2 (double r, double t, int iturb, struct flow_state *fs)
 Set the special inflow conditions for the small shock tube using Mirel's boundary layer theory. Nitrogen driving nitrogen.
int set_FRANK_CYL_free_stream (double y_m, struct flow_state *fs)
 Set the special inflow conditions for Frank Houwing's cylinder in the Stanford shock tunnel.
int init_profile_data (int ncell)
 Reads the flow state data from a previously written profile file.
int init_transient_free_stream (void)
 Reads the flow state data from a previously written file.
int set_transient_free_stream (double tt, struct flow_state *gsp)


Detailed Description

Boundary Conditions for mb_cns.c.

Author:
PA Jacobs
Version:
12-Feb-96 : new message-logging functions used

03-Nov-96 : updated multiple-species code

22-Sep-97 : replaced free_str with indexed gas_state[]

12-Oct-97 : moved local_frame() and XY_frame() to cns_bc.c

05-Dec-97 : Mirels' boundary layer as a special-case inflow

09-Dec-97 : Allow an "inviscid" version of the Mirels' simulation.

10-Dec-97 : Laminar/turbulent option for Mirels function

29-Nov-98 : Mirels' model for N2 driving N2

15-Nov-00 : Put the detailed data copying lines into a pair of functions. Modify the SPECIAL boundary condition so that boundary cell data is read from a "profile.dat" file for case_id == 0.

06-Feb-01 : Enhanced copy_cell_to_cell() to copy lengths also.


Function Documentation

int apply_inviscid_bc struct block_data A,
FILE *  read_file,
int *  n_vary,
double *  t_old,
double *  ta_old
 

Set up ghost-cell values for the inviscid flux calculations.

Parameters:
A : pointer to the single-block data structure
read_file,: pointer to the file for reading velocity profiles

int apply_inviscid_bc_east struct block_data A,
FILE *  fp,
int *  n,
double *  t_old,
double *  ta_old
 

Set up ghost-cell values for the inviscid flux calculations EAST boundary.

Parameters:
A : pointer to the single-block data structure
fp : pointer to the file for reading velocity profiles
Version:
22-Sep-97 : replaced free_str with indexed gas_state[] Finally added SUP_IN

16-Nov-00 : tidied up to use copy functions

22-Aug-01 : SUBSONIC_IN condition

int apply_inviscid_bc_north struct block_data A,
FILE *  fp,
int *  n,
double *  t_old,
double *  ta_old
 

Set up ghost-cell values for the inviscid flux calculations NORTH boundary.

Parameters:
A : pointer to the single-block data structure
fp : pointer to the file for reading velocity profiles
Version:
22-Sep-97 : replaced free_str with indexed gas_state[]

16-Nov-00 : tidied up to use copy functions

22-Aug-01 : SUBSONIC_IN condition

int apply_inviscid_bc_south struct block_data A,
FILE *  fp,
int *  n,
double *  t_old,
double *  ta_old
 

Set up ghost-cell values for the inviscid flux calculations SOUTH boundary.

Input... ----- A : pointer to the single-block data structure fp : pointer to the file for reading velocity profiles

Revisions... --------- 22-Sep-97 : replaced free_str with indexed gas_state[] 16-Nov-00 : tidied up to use copy functions 22-Aug-01 : SUBSONIC_IN condition

int apply_inviscid_bc_west struct block_data A,
FILE *  fp,
int *  n,
double *  t_old,
double *  ta_old
 

Set up ghost-cell values for the inviscid flux calculations WEST boundary.

Parameters:
A : pointer to the single-block data structure
fp : pointer to the file for reading velocity profiles
Version:
22-Sep-97 : replaced free_str with indexed gas_state[]

10-Dec-97 : Mirels inflow as SUP_IN condition

20-Dec-97 : Mirels inflow moved to SPECIAL condition

16-Nov-00 : tidied up to use copy functions

22-Aug-01 : SUBSONIC_IN condition

int apply_viscous_bc struct block_data A  ) 
 

Apply viscous boundary conditions to the boundary cell interfaces.

NOTE, we will assume that the inviscid flux calculation has already computed values relevant to inviscid boundary conditions.

Parameters:
A : pointer to the single-block data structure

int init_profile_data int  ncell  ) 
 

Reads the flow state data from a previously written profile file.

The format expected of this file is that space-separated values are expected for

p, u, v, T, f0, f1 ...

for each cell with an extra line at the top to specify the number of cells in the profile. If there is only one species, just supplying values for p, u, v, T is adequate.

int init_transient_free_stream void   ) 
 

Reads the flow state data from a previously written file.

The format expected of this file is space-separated values for

t, p, u, v, T, f0, f1 ...

for each cell with an extra line at the top to specify the number of time samples. If there is only one species, it is sufficient to supply values for p, u, v, T only.

int local_frame struct flow_state FS,
double  cosX,
double  cosY
 

Change from a global (X,Y) frame of reference to a frame with its x-direction normal to the interface.

The Riemann solver works in this local frame of reference.

Parameters:
FS : pointer to a structure containing the local flow state
cosX,cosY : direction cosines for the interface.

int set_MIRELS_free_stream_HeN2 double  r,
double  t,
int  iturb,
struct flow_state fs
 

Set the special inflow conditions for the small shock tube using Mirel's boundary layer theory. Helium driving Nitrogen.

This function is a bit wasteful of CPU time, but it is applied along one small boundary only.

Parameters:
r : radial coordinate
t : simulation time (time after shock arrival at inflow boundary)
iturb : ==1 indicates turbulent boundary layer, else laminar
fs : pointer to the flow_state
Version:
05-Dec-97 : initial coding using Drummond shock tube condition

08-Dec-97 : change the conditions to an ideal shock tube problem which approximates the Drummond tube condition

10-Dec-97 : turbulent/laminar option

int set_MIRELS_free_stream_N2N2 double  r,
double  t,
int  iturb,
struct flow_state fs
 

Set the special inflow conditions for the small shock tube using Mirel's boundary layer theory. Nitrogen driving nitrogen.

This function is a bit wasteful of CPU time, but it is applied along one small boundary only.

Parameters:
r : radial coordinate
t : simulation time (time after shock arrival at inflow boundary)
iturb : ==1 indicates turbulent boundary layer, else laminar
fs : pointer to the flow_state
Version:
29-Nov-98: Adapted from the Helium driving Nitrogen version.

int subsonic_inflow_properties struct flow_state stagnation,
struct flow_state inflow_state,
double  inflow_velocity
 

Given stagnation conditions, estimate the static conditions at the boundary cell.

It is assumed that the velocity passed to this function is the inflow velocity (magnitude) of the cell just inside the boundary.

Boundary condition developed by Rowan Gollan, 2001. These calculations are appropriate for a perfect gas, only.

int XY_frame struct flow_state FS,
double  cosX,
double  cosY
 

Change from a frame of reference with its x-direction normal to the interface. to a global (X,Y) frame of reference.

Parameters:
FS : pointer to a structure containing the local flow state
cosX,cosY : direction cosines for the interface.


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