Advection scheme

Name

Advection scheme -- 

Synopsis


#include <gfs.h>


struct      GfsAdvectionParams;
void        gfs_advection_params_init       (GfsAdvectionParams *par);
void        gfs_advection_params_read       (GfsAdvectionParams *par,
                                             GtsFile *fp);
void        gfs_advection_params_write      (GfsAdvectionParams *par,
                                             FILE *fp);
void        gfs_cell_advected_face_values   (FttCell *cell,
                                             const GfsAdvectionParams *par);
gdouble     gfs_face_upwinded_value         (const FttCellFace *face,
                                             GfsUpwinding upwinding);
void        gfs_face_advection_flux         (const FttCellFace *face,
                                             const GfsAdvectionParams *par);
void        gfs_face_velocity_advection_flux
                                            (const FttCellFace *face,
                                             const GfsAdvectionParams *par);
void        gfs_face_velocity_convective_flux
                                            (const FttCellFace *face,
                                             const GfsAdvectionParams *par);
void        gfs_face_advected_normal_velocity
                                            (const FttCellFace *face,
                                             GfsUpwinding *upwinding);
void        gfs_face_interpolated_normal_velocity
                                            (const FttCellFace *face);
void        gfs_face_reset_normal_velocity  (const FttCellFace *face);

Description

Details

struct GfsAdvectionParams

struct GfsAdvectionParams {

  gdouble cfl, dt;
  GfsVariable * v, * fv;
  GfsCenterGradient gradient;
  gboolean use_centered_velocity;
  GfsUpwinding upwinding;
  GfsFaceAdvectionFluxFunc flux;
  GfsAdvectionScheme scheme;
  gdouble rho;
  GfsVariable * c;
};


gfs_advection_params_init ()

void        gfs_advection_params_init       (GfsAdvectionParams *par);

par :


gfs_advection_params_read ()

void        gfs_advection_params_read       (GfsAdvectionParams *par,
                                             GtsFile *fp);

par :

fp :


gfs_advection_params_write ()

void        gfs_advection_params_write      (GfsAdvectionParams *par,
                                             FILE *fp);

par :

fp :


gfs_cell_advected_face_values ()

void        gfs_cell_advected_face_values   (FttCell *cell,
                                             const GfsAdvectionParams *par);

Fills the face variable (v field of GfsFaceStateVector) of all the faces of cell with the advected value of variable par->v at time t + dt/2.

cell :

a FttCell.

par :

the advection parameters.


gfs_face_upwinded_value ()

gdouble     gfs_face_upwinded_value         (const FttCellFace *face,
                                             GfsUpwinding upwinding);

This function assumes that the face variable has been previously defined using gfs_cell_advected_face_values().

face :

a FttCellFace.

upwinding :

type of upwinding.

Returns :

the upwinded value of the face variable.


gfs_face_advection_flux ()

void        gfs_face_advection_flux         (const FttCellFace *face,
                                             const GfsAdvectionParams *par);

Adds to variable par->fv, the value of the (conservative) advection flux of the face variable through face.

This function assumes that the face variable has been previously defined using gfs_cell_advected_face_values().

face :

a FttCellFace.

par :

the advection parameters.


gfs_face_velocity_advection_flux ()

void        gfs_face_velocity_advection_flux
                                            (const FttCellFace *face,
                                             const GfsAdvectionParams *par);

Adds to variable par->fv, the value of the (conservative) advection flux through face of variable par->v (a component of the velocity).

This function assumes that the g field of the cells sharing face are filled with the pressure gradient at time t + dt/2.

This function also assumes that the face value of par->v has been previously defined using gfs_cell_advected_face_values().

face :

a FttCellFace.

par :

the advection parameters.


gfs_face_velocity_convective_flux ()

void        gfs_face_velocity_convective_flux
                                            (const FttCellFace *face,
                                             const GfsAdvectionParams *par);

Adds to variable par->fv, the value of the (non-conservative) convective flux through face of variable par->v (a component of the velocity).

This function assumes that the g field of the cells sharing face are filled with the pressure gradient at time t + dt/2.

This function also assumes that the face value of par->v has been previously defined using gfs_cell_advected_face_values().

face :

a FttCellFace.

par :

the advection parameters.


gfs_face_advected_normal_velocity ()

void        gfs_face_advected_normal_velocity
                                            (const FttCellFace *face,
                                             GfsUpwinding *upwinding);

Fills the normal component of the velocity at face with the value advected (to time t + dt/2) from the centered velocities.

This function assumes that the face variable has been previously defined for the correct component of the velocity using gfs_cell_advected_face_values().

face :

a FttCellFace.

upwinding :

the type of upwinding.


gfs_face_interpolated_normal_velocity ()

void        gfs_face_interpolated_normal_velocity
                                            (const FttCellFace *face);

Fills the normal component of the velocity at face with the value interpolated from the centered velocities.

face :

a FttCellFace.


gfs_face_reset_normal_velocity ()

void        gfs_face_reset_normal_velocity  (const FttCellFace *face);

Set velocity normal to face to zero.

face :

a FttCellFace.