programmer's documentation
Data Structures | Macros | Enumerations | Functions
cs_advection_field.h File Reference
#include "cs_cdo.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_local.h"
#include "cs_cdo_quantities.h"
#include "cs_mesh_location.h"
#include "cs_param.h"
#include "cs_property.h"
#include "cs_time_step.h"
#include "cs_xdef.h"
#include "cs_xdef_eval.h"
Include dependency graph for cs_advection_field.h:

Go to the source code of this file.

Data Structures

struct  cs_adv_field_t
 

Macros

#define CS_ADVECTION_FIELD_POST_COURANT   (1 << 0)
 
#define CS_ADVECTION_FIELD_STEADY   (1 << 1)
 

Enumerations

enum  cs_advection_field_key_t {
  CS_ADVKEY_DEFINE_AT_CELLS, CS_ADVKEY_DEFINE_AT_VERTICES, CS_ADVKEY_POST_COURANT, CS_ADVKEY_STATE_STEADY,
  CS_ADVKEY_N_KEYS
}
 

Functions

void cs_advection_field_set_shared_pointers (const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
 Set shared pointers to main domain members. More...
 
int cs_advection_field_get_n_fields (void)
 Get the number of allocated cs_adv_field_t structures. More...
 
cs_adv_field_tcs_advection_field_by_name (const char *name)
 Search in the array of advection field structures which one has the name given in argument. More...
 
cs_adv_field_tcs_advection_field_by_id (int id)
 Search in the array of advection field structures which one has the id given in argument. More...
 
cs_adv_field_tcs_advection_field_add (const char *name)
 Add and initialize a new advection field structure. More...
 
void cs_advection_field_destroy_all (void)
 Free all alllocated cs_adv_field_t structures and its related array. More...
 
bool cs_advection_field_check_name (const cs_adv_field_t *adv, const char *ref_name)
 Check if the given advection field has the name ref_name. More...
 
bool cs_advection_field_is_uniform (const cs_adv_field_t *adv)
 returns true if the advection field is uniform, otherwise false More...
 
bool cs_advection_field_is_cellwise (const cs_adv_field_t *adv)
 returns true if the advection field is uniform in each cell otherwise false More...
 
const char * cs_advection_field_get_name (const cs_adv_field_t *adv)
 Retrieve the name of an advection field. More...
 
cs_xdef_type_t cs_advection_field_get_deftype (const cs_adv_field_t *adv)
 Retrieve the type of definition used to set the current advection field structure. More...
 
void cs_advection_field_log_setup (void)
 Print all setup information related to cs_adv_field_t structures. More...
 
void cs_advection_field_set_option (cs_adv_field_t *adv, cs_advection_field_key_t key)
 Set optional parameters related to a cs_adv_field_t structure. More...
 
void cs_advection_field_def_by_value (cs_adv_field_t *adv, cs_real_t vector[3])
 Define the value of a cs_adv_field_t structure. More...
 
void cs_advection_field_def_by_analytic (cs_adv_field_t *adv, cs_analytic_func_t *func, void *input)
 Define a cs_adv_field_t structure thanks to an analytic function. More...
 
void cs_advection_field_def_by_array (cs_adv_field_t *adv, cs_flag_t loc, cs_real_t *array, cs_lnum_t *index)
 Define a cs_adv_field_t structure thanks to an array of values. More...
 
void cs_advection_field_def_by_field (cs_adv_field_t *adv, cs_field_t *field)
 Define a cs_adv_field_t structure thanks to an array of values. More...
 
void cs_advection_field_create_fields (void)
 Create all needed cs_field_t structures related to an advection field. More...
 
cs_field_tcs_advection_field_get_field (cs_adv_field_t *adv, cs_mesh_location_type_t ml_type)
 Get a cs_field_t structure related to an advection field and a mesh location. More...
 
void cs_advection_field_in_cell (const cs_cell_mesh_t *cm, const cs_adv_field_t *adv, cs_nvec3_t *vect)
 Compute the value of the advection field at the cell center. More...
 
void cs_advection_field_get_cell_vector (cs_lnum_t c_id, const cs_adv_field_t *adv, cs_nvec3_t *vect)
 Compute the value of the advection field at the cell center. More...
 
void cs_advection_field_get_at_xyz (const cs_adv_field_t *adv, const cs_cell_mesh_t *cm, const cs_real_3_t xyz, cs_nvec3_t *vect)
 Compute the value of the advection field for a given face. More...
 
void cs_advection_field_at_cells (const cs_adv_field_t *adv, cs_real_t *cell_values)
 Compute the value of the advection field at cell centers. More...
 
void cs_advection_field_at_vertices (const cs_adv_field_t *adv, cs_real_t *vtx_values)
 Compute the value of the advection field at vertices. More...
 
void cs_advection_field_get_flux_dfaces (const cs_cell_mesh_t *cm, const cs_adv_field_t *adv, cs_real_t *fluxes)
 Compute the value of the flux of the advection field across the the dual faces of a cell. More...
 
cs_real_t cs_advection_field_get_flux_tef (const cs_adv_field_t *adv, const cs_cell_mesh_t *cm, const cs_real_t tef_meas, short int f, short int e, short int v1, short int v2)
 Compute the value of the flux of the advection field across the triangle defined by the two vertices of an edge and the barycenter of a face. More...
 
void cs_advection_field_update (bool cur2prev)
 For each cs_adv_field_t structures, update the values of the related field(s) More...
 
void cs_advection_get_peclet (const cs_adv_field_t *adv, const cs_property_t *diff, cs_real_t peclet[])
 Compute the Peclet number in each cell. More...
 

Macro Definition Documentation

◆ CS_ADVECTION_FIELD_POST_COURANT

#define CS_ADVECTION_FIELD_POST_COURANT   (1 << 0)

◆ CS_ADVECTION_FIELD_STEADY

#define CS_ADVECTION_FIELD_STEADY   (1 << 1)

Enumeration Type Documentation

◆ cs_advection_field_key_t

Enumerator
CS_ADVKEY_DEFINE_AT_CELLS 
CS_ADVKEY_DEFINE_AT_VERTICES 
CS_ADVKEY_POST_COURANT 
CS_ADVKEY_STATE_STEADY 
CS_ADVKEY_N_KEYS 

Function Documentation

◆ cs_advection_field_add()

cs_adv_field_t* cs_advection_field_add ( const char *  name)

Add and initialize a new advection field structure.

Parameters
[in]namename of the advection field
Returns
a pointer to the new allocated cs_adv_field_t structure

◆ cs_advection_field_at_cells()

void cs_advection_field_at_cells ( const cs_adv_field_t adv,
cs_real_t cell_values 
)

Compute the value of the advection field at cell centers.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in,out]cell_valuesarray of values at cell centers

◆ cs_advection_field_at_vertices()

void cs_advection_field_at_vertices ( const cs_adv_field_t adv,
cs_real_t vtx_values 
)

Compute the value of the advection field at vertices.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in,out]vtx_valuesarray storing the results

◆ cs_advection_field_by_id()

cs_adv_field_t* cs_advection_field_by_id ( int  id)

Search in the array of advection field structures which one has the id given in argument.

Parameters
[in]ididentification number
Returns
a pointer to a cs_adv_field_t structure or NULL if not found

◆ cs_advection_field_by_name()

cs_adv_field_t* cs_advection_field_by_name ( const char *  name)

Search in the array of advection field structures which one has the name given in argument.

Parameters
[in]namename of the advection field
Returns
a pointer to a cs_adv_field_t structure or NULL if not found

◆ cs_advection_field_check_name()

bool cs_advection_field_check_name ( const cs_adv_field_t adv,
const char *  ref_name 
)

Check if the given advection field has the name ref_name.

Parameters
[in]advpointer to a cs_adv_field_t structure to test
[in]ref_namename of the advection field to find
Returns
true if the name of the advection field is ref_name otherwise false

◆ cs_advection_field_create_fields()

void cs_advection_field_create_fields ( void  )

Create all needed cs_field_t structures related to an advection field.

◆ cs_advection_field_def_by_analytic()

void cs_advection_field_def_by_analytic ( cs_adv_field_t adv,
cs_analytic_func_t func,
void *  input 
)

Define a cs_adv_field_t structure thanks to an analytic function.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]funcpointer to a function
[in]inputNULL or pointer to a structure cast on-the-fly

◆ cs_advection_field_def_by_array()

void cs_advection_field_def_by_array ( cs_adv_field_t adv,
cs_flag_t  loc,
cs_real_t array,
cs_lnum_t index 
)

Define a cs_adv_field_t structure thanks to an array of values.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]locinformation to know where are located values
[in]arraypointer to an array
[in]indexoptional pointer to the array index

◆ cs_advection_field_def_by_field()

void cs_advection_field_def_by_field ( cs_adv_field_t adv,
cs_field_t field 
)

Define a cs_adv_field_t structure thanks to an array of values.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]fieldpointer to a cs_field_t structure

◆ cs_advection_field_def_by_value()

void cs_advection_field_def_by_value ( cs_adv_field_t adv,
cs_real_t  vector[3] 
)

Define the value of a cs_adv_field_t structure.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]vectorvalues to set

◆ cs_advection_field_destroy_all()

void cs_advection_field_destroy_all ( void  )

Free all alllocated cs_adv_field_t structures and its related array.

Returns
a NULL pointer

◆ cs_advection_field_get_at_xyz()

void cs_advection_field_get_at_xyz ( const cs_adv_field_t adv,
const cs_cell_mesh_t cm,
const cs_real_3_t  xyz,
cs_nvec3_t vect 
)

Compute the value of the advection field for a given face.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]xyzcoordinates where to evaluate the advection field
[in,out]vectpointer to a cs_nvec3_t structure (meas + unitv)

◆ cs_advection_field_get_cell_vector()

void cs_advection_field_get_cell_vector ( cs_lnum_t  c_id,
const cs_adv_field_t adv,
cs_nvec3_t vect 
)

Compute the value of the advection field at the cell center.

Parameters
[in]c_idid of the current cell
[in]advpointer to a cs_adv_field_t structure
[in,out]vectpointer to a cs_nvec3_t structure (meas + unitv)

◆ cs_advection_field_get_deftype()

cs_xdef_type_t cs_advection_field_get_deftype ( const cs_adv_field_t adv)

Retrieve the type of definition used to set the current advection field structure.

Parameters
[in]advpointer to an advection field structure
Returns
the type of definition

◆ cs_advection_field_get_field()

cs_field_t* cs_advection_field_get_field ( cs_adv_field_t adv,
cs_mesh_location_type_t  ml_type 
)

Get a cs_field_t structure related to an advection field and a mesh location.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in]ml_typetype of mesh location (cells or vertices)
Returns
a pointer to a cs_field_t structure

◆ cs_advection_field_get_flux_dfaces()

void cs_advection_field_get_flux_dfaces ( const cs_cell_mesh_t cm,
const cs_adv_field_t adv,
cs_real_t fluxes 
)

Compute the value of the flux of the advection field across the the dual faces of a cell.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]advpointer to a cs_adv_field_t structure
[in,out]fluxesarray of values attached to dual faces of a cell

◆ cs_advection_field_get_flux_tef()

cs_real_t cs_advection_field_get_flux_tef ( const cs_adv_field_t adv,
const cs_cell_mesh_t cm,
const cs_real_t  tef_meas,
short int  f,
short int  e,
short int  v1,
short int  v2 
)

Compute the value of the flux of the advection field across the triangle defined by the two vertices of an edge and the barycenter of a face.

Parameters
[in]advpointer to a cs_adv_field_t structure
[in]cmpointer to a cs_cell_mesh_t structure
[in]tef_measarea of the triangle tef
[in]fid of the face in the current cell
[in]eid of the edge in the current cell
[in]v1id of the first vertex in the current cell
[in]v2id of the second vertex in the current cell
Returns
the value of the flux across tef

◆ cs_advection_field_get_n_fields()

int cs_advection_field_get_n_fields ( void  )

Get the number of allocated cs_adv_field_t structures.

Returns
the number of advection fields

◆ cs_advection_field_get_name()

const char* cs_advection_field_get_name ( const cs_adv_field_t adv)

Retrieve the name of an advection field.

Parameters
[in]advpointer to an advection field structure
Returns
the name of the related advection field

◆ cs_advection_field_in_cell()

void cs_advection_field_in_cell ( const cs_cell_mesh_t cm,
const cs_adv_field_t adv,
cs_nvec3_t vect 
)

Compute the value of the advection field at the cell center.

Parameters
[in]cmpointer to a cs_cell_mesh_t structure
[in]advpointer to a cs_adv_field_t structure
[in,out]vectpointer to a cs_nvec3_t structure (meas + unitv)

◆ cs_advection_field_is_cellwise()

bool cs_advection_field_is_cellwise ( const cs_adv_field_t adv)

returns true if the advection field is uniform in each cell otherwise false

Parameters
[in]advpointer to a property to test
Returns
true or false

◆ cs_advection_field_is_uniform()

bool cs_advection_field_is_uniform ( const cs_adv_field_t adv)

returns true if the advection field is uniform, otherwise false

Parameters
[in]advpointer to a property to test
Returns
true or false

◆ cs_advection_field_log_setup()

void cs_advection_field_log_setup ( void  )

Print all setup information related to cs_adv_field_t structures.

◆ cs_advection_field_set_option()

void cs_advection_field_set_option ( cs_adv_field_t adv,
cs_advection_field_key_t  key 
)

Set optional parameters related to a cs_adv_field_t structure.

Parameters
[in,out]advpointer to a cs_adv_field_t structure
[in]keykey related to the member of adv to set

◆ cs_advection_field_set_shared_pointers()

void cs_advection_field_set_shared_pointers ( const cs_cdo_quantities_t quant,
const cs_cdo_connect_t connect,
const cs_time_step_t time_step 
)

Set shared pointers to main domain members.

Parameters
[in]quantadditional mesh quantities struct.
[in]connectpointer to a cs_cdo_connect_t struct.
[in]time_steppointer to a time step structure

◆ cs_advection_field_update()

void cs_advection_field_update ( bool  cur2prev)

For each cs_adv_field_t structures, update the values of the related field(s)

Parameters
[in]cur2prevtrue or false

◆ cs_advection_get_peclet()

void cs_advection_get_peclet ( const cs_adv_field_t adv,
const cs_property_t diff,
cs_real_t  peclet[] 
)

Compute the Peclet number in each cell.

Parameters
[in]advpointer to the advection field struct.
[in]diffpointer to the diffusion property struct.
[in,out]pecletpointer to an array storing Peclet number