Advection scheme

Name

Advection scheme -- 

Synopsis


#include <gfs.h>


            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,
                                             GfsVariable **u);
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,
                                             const GfsAdvectionParams *par);
void        gfs_face_interpolated_normal_velocity
                                            (const FttCellFace *face,
                                             GfsVariable **v);
void        gfs_face_reset_normal_velocity  (const FttCellFace *face);

Description

Details

GfsAdvectionParams

typedef struct {
  gdouble cfl, dt;
  GfsVariable * v, * fv, ** u, ** g;
  GfsCenterGradient gradient;
  gboolean use_centered_velocity;
  GfsUpwinding upwinding;
  GfsFaceAdvectionFluxFunc flux;
  GfsAdvectionScheme scheme;
} GfsAdvectionParams;


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,
                                             GfsVariable **u);

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

face :

a FttCellFace.

upwinding :

type of upwinding.

u :

the cell-centered velocity.

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,
                                             const GfsAdvectionParams *par);

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.

par :

the GfsAdvectionParams.


gfs_face_interpolated_normal_velocity ()

void        gfs_face_interpolated_normal_velocity
                                            (const FttCellFace *face,
                                             GfsVariable **v);

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

face :

a FttCellFace.

v :

the velocity.


gfs_face_reset_normal_velocity ()

void        gfs_face_reset_normal_velocity  (const FttCellFace *face);

Set velocity normal to face to zero.

face :

a FttCellFace.