Details
GFS_VARIABLE()
#define GFS_VARIABLE(cell, index) ((&GFS_STATE (cell)->div)[index]) |
Evaluates to the value of variable index in cell.
GFS_VELOCITY_COMPONENT()
#define GFS_VELOCITY_COMPONENT(index) ((index) - GFS_U) |
GFS_VELOCITY_INDEX()
#define GFS_VELOCITY_INDEX(component) (GFS_U + (component)) |
GFS_GRADIENT_COMPONENT()
#define GFS_GRADIENT_COMPONENT(index) ((index) - GFS_GX) |
GFS_GRADIENT_INDEX()
#define GFS_GRADIENT_INDEX(component) (GFS_GX + (component)) |
GFS_FACE_NORMAL_VELOCITY_RIGHT()
#define GFS_FACE_NORMAL_VELOCITY_RIGHT(fa) |
GFS_FACE_NORMAL_VELOCITY_LEFT()
#define GFS_FACE_NORMAL_VELOCITY_LEFT(fa) |
GFS_FACE_NORMAL_VELOCITY()
#define GFS_FACE_NORMAL_VELOCITY(fa) |
GFS_IS_SMALL()
#define GFS_IS_SMALL(cell) |
GFS_CELL_IS_BOUNDARY()
#define GFS_CELL_IS_BOUNDARY(cell) (((cell)->flags & GFS_FLAG_BOUNDARY) != 0) |
struct GfsStateVector
struct GfsStateVector {
/* temporary face variables */
GfsFaceStateVector f[FTT_NEIGHBORS];
/* solid boundaries */
GfsSolidVector * solid;
/* centered temporary variables */
gdouble div, dp, res;
gdouble g[FTT_DIMENSION];
/* centered primitive variables */
gdouble p;
gdouble u, v;
#ifndef FTT_2D
gdouble w;
#endif /* FTT_3D */
gdouble c, ch;
}; |
The fluid variables describing the state of the cell.
struct GfsFaceStateVector
struct GfsFaceStateVector {
gdouble un;
gdouble v;
}; |
struct GfsVariable
struct GfsVariable {
guint i;
gchar * name;
GfsVariableDerivedFunc derived;
GfsVariableFineCoarseFunc fine_coarse;
GtsContainer * sources;
GfsVariable * next;
}; |
The fluid variables associated with a fluid cell.
enum GfsPermanentVariable
typedef enum {
/* centered temporary variables */
GFS_DIV = 0,
GFS_DP,
GFS_RES,
GFS_GX,
GFS_GY,
#ifndef FTT_2D
GFS_GZ,
#endif /* FTT_3D */
/* centered primitive variables */
GFS_P,
GFS_U, GFS_V,
#ifndef FTT_2D
GFS_W,
#endif /* FTT_3D */
} GfsPermanentVariable; |
GfsVariableDerivedFunc ()
GfsVariableFineCoarseFunc ()
enum GfsFlags
typedef enum {
GFS_FLAG_USED = 1 << FTT_FLAG_USER,
GFS_FLAG_BOUNDARY = 1 << (FTT_FLAG_USER + 1),
GFS_FLAG_USER = FTT_FLAG_USER + 2 /* user flags start here */
} GfsFlags; |
gfs_cell_init ()
void gfs_cell_init (FttCell *cell); |
Allocates the memory for fluid state data associated to cell.
gfs_cell_reset ()
Sets the value of the variable v of cell to zero.
gfs_cell_cleanup ()
void gfs_cell_cleanup (FttCell *cell); |
Frees the memory allocated for extra data associated with cell.
This function must be used as "cleanup function" when using
ftt_cell_destroy().
gfs_cell_copy ()
Copies the attributes of the fluid cell from to the fluid cell to.
gfs_variable_new ()
GfsVariable* gfs_variable_new (const gchar *name,
guint i); |
gfs_variable_list_copy ()
gfs_variable_list_destroy ()
Free all the memory allocated for the list starting at v.
gfs_variable_from_name ()
gfs_variables_from_list ()
gfs_stats_variable ()
Traverses the cell tree defined by root using ftt_cell_traverse()
and gathers statistics about variable v.
gfs_norm_variable ()
Traverses the cell tree defined by root using ftt_cell_traverse()
and gathers norm statistics about variable v.
gfs_variable_destroy ()
Free all the memory allocated for v.
gfs_get_from_below_intensive ()
Sets the value of the "intensive" variable v of cell by taking
the volume weighted average of the values of its children cells.
This functions fails if cell is a leaf of the cell tree.
gfs_get_from_below_extensive ()
Sets the value of the "extensive" variable v of cell as (half in
3D) the sum of the values of its children cells.
This functions fails if cell is a leaf of the cell tree.
gfs_get_from_above ()
Sets the value of the variable v of cell to the value of this
variable in its parent cell.
This function fails if cell is the root of the cell tree.
gfs_cell_coarse_init ()
Initialises the variables of cell using the values of its children
cells.
gfs_cell_fine_init ()
Initializes the variables of cell using interpolation from its
parent cell.
First-order interpolation (straight injection) is used for boundary
cells and second-order interpolation for the other cells.
gfs_velocity_norm ()
Fills variable v of cell with the norm of the velocity field in
this cell.
gfs_velocity_norm2 ()
Fills variable v of cell with the sqaured norm of the velocity field in
this cell.
gfs_divergence ()
void gfs_divergence (FttCell *cell); |
Fills variable GFS_DIV of cell with the divergence of the
(centered) velocity field in this cell.
gfs_normal_divergence ()
void gfs_normal_divergence (FttCell *cell); |
Fills variable GFS_DIV of cell with the integral of the divergence
of the (MAC) velocity field in this cell.
gfs_vorticity ()
Fills variable v of cell with the vorticity (norm of the
vorticity vector in 3D) of the velocity field in this cell.
gfs_face_interpolated_value ()
gdouble gfs_face_interpolated_value (const FttCellFace *face,
guint v); |
Computes the value of variable v on the face using second-order
interpolation from the cell-centered values.
gfs_interpolate ()
Interpolates the v variable of cell, at location p. Linear
interpolation is used and the boundaries of the domain are treated
as planes of symmetry for all variables.
Note that to work correctly this function needs a domain where the
values of variable v are defined on all levels.
struct GfsGradient
struct GfsGradient {
gdouble a, b;
}; |
Defines the (second-order accurate) gradient of a variable v in a given direction as: a*GFS_VARIABLE (cell, v) + b.
gfs_face_gradient ()
Set the value of g as the gradient of variable v on the
face. The value returned is second order accurate in space and
conservative, in the sense that values at a coarse/fine cell
boundary are consistent.
gfs_face_weighted_gradient ()
Set the value of g as the gradient of variable v on the face
weighted by the value of v field of the face state vector of the
corresponding cell. The value returned is second order accurate in
space and conservative, in the sense that values at a coarse/fine
cell boundary are consistent.
gfs_center_gradient ()
The gradient is normalized by the size of the cell.
gfs_center_van_leer_gradient ()
The gradient is normalized by the size of the cell and is limited
using van Leer's limiter.
gfs_cell_write ()
Writes in fp the fluid data associated with cell and described by
variables. This function is generally used in association with
ftt_cell_write().
gfs_cell_read ()
Reads from fp the fluid data associated with cell and described
by variables. This function is generally used in association with
ftt_cell_read().