8.0
general documentation
cs_ibm.h File Reference
#include "cs_defs.h"
#include "cs_mesh_quantities.h"
#include "cs_medcoupling_intersector.h"
#include "cs_stl.h"
#include "cs_xdef.h"
+ Include dependency graph for cs_ibm.h:

Go to the source code of this file.

Data Structures

struct  cs_porosity_ibm_opt_t
 
struct  cs_ibm_object_t
 
struct  cs_ibm_t
 

Typedefs

typedef int() cs_cutcell_func_t(const cs_lnum_t c_id, const cs_real_3_t xyz, const cs_real_t t, const int num_object)
 

Enumerations

enum  cs_ibm_model_type_t { CS_IBM_OFF = 0 , CS_IBM_FIXED_SOLID = 1 }
 
enum  cs_ibm_prob_dim_type_t { CS_IBM_3D = -1 , CS_IBM_2D_X = 0 , CS_IBM_2D_Y = 1 , CS_IBM_2D_Z = 2 }
 
enum  cs_ibm_algo_type_t {
  CS_IBM_ALGO_NONE , CS_IBM_ALGO_CUT_CELLS , CS_IBM_ALGO_MEDCOUPLING , CS_IBM_ALGO_STL ,
  CS_N_VAR_PORO_ALGO_TYPES
}
 
enum  cs_ibm_wall_cond_type_t { CS_IBM_SLIP_WALL_CONDITION , CS_IBM_NO_SLIP_WALL_CONDITION , CS_IBM_WALL_LAW_WALL_CONDITION }
 
enum  cs_ibm_object_property_type_t {
  CS_IBM_OBJ_PROP_DENSITY , NC_IBM_OBJ_PROP_MASS , NC_IBM_OBJ_PROP_INERTIA_MATRIX , CS_IBM_OBJ_PROP_CP ,
  CS_IBM_OBJ_PROP_LAMBDA , CS_IBM_OBJ_PROP_STIFFNESS , CS_IBM_OBJ_PROP_DAMPING , CS_IBM_OBJ_PROP_YOUNG_MODULE ,
  CS_IBM_OBJ_PROP_INERTIA_MOM , CS_IBM_OBJ_PROP_CROSS_SECTION , CS_IBM_OBJ_PROP_RAYLEIGH_DAMP_A , CS_IBM_OBJ_PROP_RAYLEIGH_DAMP_B ,
  CS_N_IBM_OBJ_PROP_TYPES
}
 
enum  cs_ibm_object_init_param_t {
  CS_IBM_OBJ_INIT_COG_EQ , CS_IBM_OBJ_INIT_COG , CS_IBM_OBJ_INIT_ANGLE , CS_IBM_OBJ_INIT_VELOCITY ,
  CS_IBM_OBJ_INIT_ACCELERATION , CS_IBM_OBJ_INIT_ANGULAR_VEL , CS_IBM_OBJ_INIT_FLUID_FORCE , CS_N_IBM_OBJ_INIT_TYPES
}
 

Functions

cs_ibm_object_tcs_ibm_object_by_id (int obj_id)
 Get an object based on its id. More...
 
cs_ibm_object_tcs_ibm_object_by_name_try (const char *name)
 Try to get an object based on its name. Returns NULL if not found. More...
 
cs_ibm_object_tcs_ibm_object_by_name (const char *name)
 Get an object based on its name. Error if not found. More...
 
cs_ibm_tcs_ibm_create (void)
 
void cs_ibm_finalize (void)
 
void cs_immersed_boundaries (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
 Define immersed boundaries in time and space (solid(s) interior part). More...
 
void cs_volumic_zone_porosity (const cs_mesh_quantities_t *mesh_quantities)
 
void cs_user_ibm_modify (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
 User function. Locally modify a given porosity to take into account erosion effect (for instance) More...
 
int cs_ibm_object_compute_cut_porosity (const cs_lnum_t c_id, const cs_real_3_t xyz, const cs_real_t t, const int num_object)
 Check if a point is solid or fluid based on the cut-cell method. More...
 
void cs_ibm_add_object_from_file (const char *name, cs_ibm_algo_type_t method, const char *file_name, bool solve_fsi)
 Define an object from a file using STL or MED formats. More...
 
void cs_ibm_add_object_from_func (const char *name, cs_cutcell_func_t *cutcell_func, bool solve_fsi, int n_nodes)
 Define an object from a function used in the cutcell algorithm. More...
 
void cs_ibm_stl_define_ext_points (const char *name, const int n_pts, cs_real_t *pts_coords)
 Define exterior points for an STL object. More...
 
void cs_ibm_object_rotate (const char *name, cs_real_t angle, cs_real_t axis[3], cs_real_t center[3])
 Rotate an object based on the STL or MED algorithms. More...
 
void cs_ibm_object_set_property_const (cs_ibm_object_t *obj, cs_ibm_object_property_type_t ppty_id, cs_real_t val)
 Define a new constant property definition for an object. More...
 
void cs_ibm_object_translate (const char *name, cs_real_t vector[3])
 Translate an object based on the STL or MED algorithms. More...
 
void cs_ibm_object_scale (const char *name, cs_real_t factor)
 Scale an object based on a factor. More...
 
void cs_ibm_user_parameters (void)
 Apply user parameters. More...
 
void cs_ibm_init_writer (void)
 Init writers for STL or MED objects. More...
 
void cs_ibm_object_transform_from_init (cs_ibm_object_t *obj, cs_real_34_t matrix)
 Transform an object from its initial state using a transformation matrix. More...
 
void cs_ibm_object_compute_intersect_vol (cs_ibm_object_t *obj, const cs_mesh_t *m, const cs_real_t *cell_vol, cs_real_t *obj_frac_tot, int *indic)
 Compute the volume fraction of an object over all cells. More...
 
void cs_user_ibm_define_objects (void)
 User function in which the user defines the objects to model. More...
 
void cs_user_ibm_parameters (void)
 User function to set global parameters for the immersed boundaries module. More...
 
void cs_user_ibm_object_transformations (const cs_real_t time)
 User function where to apply predefined transformations to med/stl based objects. More...
 
void cs_user_ibm_solid_por (const cs_lnum_t c_id, const cs_real_3_t xyz, const cs_real_t t, const int num_object)
 User function which allows the definition of a 'porous' object. More...
 
void cs_ibm_volumic_zone (const cs_mesh_quantities_t *mesh_quantities)
 Define space immersed boundaries on a set of zones defined by the user in the GUI. More...
 

Variables

cs_porosity_ibm_opt_tcs_glob_porosity_ibm_opt
 
cs_ibm_tcs_ibm
 

Typedef Documentation

◆ cs_cutcell_func_t

typedef int() cs_cutcell_func_t(const cs_lnum_t c_id, const cs_real_3_t xyz, const cs_real_t t, const int num_object)

Enumeration Type Documentation

◆ cs_ibm_algo_type_t

Enumerator
CS_IBM_ALGO_NONE 
CS_IBM_ALGO_CUT_CELLS 
CS_IBM_ALGO_MEDCOUPLING 
CS_IBM_ALGO_STL 
CS_N_VAR_PORO_ALGO_TYPES 

◆ cs_ibm_model_type_t

Enumerator
CS_IBM_OFF 
CS_IBM_FIXED_SOLID 

◆ cs_ibm_object_init_param_t

Enumerator
CS_IBM_OBJ_INIT_COG_EQ 
CS_IBM_OBJ_INIT_COG 
CS_IBM_OBJ_INIT_ANGLE 
CS_IBM_OBJ_INIT_VELOCITY 
CS_IBM_OBJ_INIT_ACCELERATION 
CS_IBM_OBJ_INIT_ANGULAR_VEL 
CS_IBM_OBJ_INIT_FLUID_FORCE 
CS_N_IBM_OBJ_INIT_TYPES 

◆ cs_ibm_object_property_type_t

Enumerator
CS_IBM_OBJ_PROP_DENSITY 
NC_IBM_OBJ_PROP_MASS 
NC_IBM_OBJ_PROP_INERTIA_MATRIX 
CS_IBM_OBJ_PROP_CP 
CS_IBM_OBJ_PROP_LAMBDA 
CS_IBM_OBJ_PROP_STIFFNESS 
CS_IBM_OBJ_PROP_DAMPING 
CS_IBM_OBJ_PROP_YOUNG_MODULE 
CS_IBM_OBJ_PROP_INERTIA_MOM 
CS_IBM_OBJ_PROP_CROSS_SECTION 
CS_IBM_OBJ_PROP_RAYLEIGH_DAMP_A 
CS_IBM_OBJ_PROP_RAYLEIGH_DAMP_B 
CS_N_IBM_OBJ_PROP_TYPES 

◆ cs_ibm_prob_dim_type_t

Enumerator
CS_IBM_3D 
CS_IBM_2D_X 
CS_IBM_2D_Y 
CS_IBM_2D_Z 

◆ cs_ibm_wall_cond_type_t

Enumerator
CS_IBM_SLIP_WALL_CONDITION 
CS_IBM_NO_SLIP_WALL_CONDITION 
CS_IBM_WALL_LAW_WALL_CONDITION 

Function Documentation

◆ cs_ibm_add_object_from_file()

void cs_ibm_add_object_from_file ( const char *  name,
cs_ibm_algo_type_t  method,
const char *  file_name,
bool  solve_fsi 
)

Define an object from a file using STL or MED formats.

Parameters
[in]namename of the object
[in]methodPorosity computation method
[in]file_namefile name
[in]solve_fsiIs the object used in the FSI resolution

◆ cs_ibm_add_object_from_func()

void cs_ibm_add_object_from_func ( const char *  name,
cs_cutcell_func_t cutcell_func,
bool  solve_fsi,
int  n_nodes 
)

Define an object from a function used in the cutcell algorithm.

Parameters
[in]namename of the object
[in]cutcell_funcpointer to the cutcell function of the object
[in]solve_fsiIs the object used in the FSI resolution
[in]n_nodesNumber of nodes if the object is deformable

◆ cs_ibm_create()

cs_ibm_t* cs_ibm_create ( void  )

◆ cs_ibm_finalize()

void cs_ibm_finalize ( void  )

◆ cs_ibm_init_writer()

void cs_ibm_init_writer ( void  )

Init writers for STL or MED objects.

◆ cs_ibm_object_by_id()

cs_ibm_object_t* cs_ibm_object_by_id ( int  obj_id)

Get an object based on its id.

Parameters
[in]obj_idid of the object
Returns
pointer to object structure.

◆ cs_ibm_object_by_name()

cs_ibm_object_t* cs_ibm_object_by_name ( const char *  name)

Get an object based on its name. Error if not found.

Parameters
[in]namename of the object to get
Returns
pointer to object structure, NULL if not found

◆ cs_ibm_object_by_name_try()

cs_ibm_object_t* cs_ibm_object_by_name_try ( const char *  name)

Try to get an object based on its name. Returns NULL if not found.

Get an object based on its name.

Parameters
[in]namename of the object to get
Returns
pointer to object structure, NULL if not found
Parameters
[in]namename of the object to get
Returns
pointer to object structure.

Get an object based on its name.

Parameters
[in]namename of the object to get
Returns
pointer to object structure, NULL if not found
Parameters
[in]namename of the object to get
Returns
pointer to object structure.

◆ cs_ibm_object_compute_cut_porosity()

int cs_ibm_object_compute_cut_porosity ( const cs_lnum_t  c_id,
const cs_real_3_t  xyz,
const cs_real_t  t,
const int  num_object 
)

Check if a point is solid or fluid based on the cut-cell method.

Parameters
[in]c_idlocal cell number
[out]ipenalindicator for cut cells algo
[in]xyzx, y, z coordinates of the current position
[in]ttime value for the current time step
[in]num_objectnum of fsi object (if fsi activated)
[in]c_idlocal cell number
[in]xyzx, y, z coordinates of the current position
[in]ttime value for the current time step
[in]num_objectnum of fsi object (if fsi activated)

◆ cs_ibm_object_compute_intersect_vol()

void cs_ibm_object_compute_intersect_vol ( cs_ibm_object_t obj,
const cs_mesh_t m,
const cs_real_t cell_vol,
cs_real_t obj_frac_tot,
int *  indic 
)

Compute the volume fraction of an object over all cells.

Parameters
[in]objpointer to object structure
[in]mpointer to mesh structure
[in]cell_volpointer to cell volume array
[out]obj_frac_totarray containing the total vol fraction of solids
[in]indicindicator array

◆ cs_ibm_object_rotate()

void cs_ibm_object_rotate ( const char *  name,
cs_real_t  angle,
cs_real_t  axis[3],
cs_real_t  center[3] 
)

Rotate an object based on the STL or MED algorithms.

Parameters
[in]namename of the object
[in]angleangle of rotation
[in]axisaxis of rotation
[in]centercenter of rotation

◆ cs_ibm_object_scale()

void cs_ibm_object_scale ( const char *  name,
cs_real_t  factor 
)

Scale an object based on a factor.

Parameters
[in]namename of the object
[in]factorscaling factor

◆ cs_ibm_object_set_property_const()

void cs_ibm_object_set_property_const ( cs_ibm_object_t obj,
cs_ibm_object_property_type_t  ppty_id,
cs_real_t  val 
)

Define a new constant property definition for an object.

Parameters
[in]objpointer to object
[in]ppty_idproperty id (si enum for list)
[in]valproperty constant value

◆ cs_ibm_object_transform_from_init()

void cs_ibm_object_transform_from_init ( cs_ibm_object_t obj,
cs_real_34_t  matrix 
)

Transform an object from its initial state using a transformation matrix.

Parameters
[in]objpointer to object structure
[in]matrixtransformation matrix

◆ cs_ibm_object_translate()

void cs_ibm_object_translate ( const char *  name,
cs_real_t  vector[3] 
)

Translate an object based on the STL or MED algorithms.

Parameters
[in]namename of the object
[in]vectortranslation vector

◆ cs_ibm_stl_define_ext_points()

void cs_ibm_stl_define_ext_points ( const char *  name,
const int  n_pts,
cs_real_t pts_coords 
)

Define exterior points for an STL object.

Parameters
[in]namename of the object
[in]n_ptsnumber of points
[in]pts_coordscoordinates of the points

Define exterior points for an STL object.

Parameters
[in]namename of the object
[in]n_ptsnumber of points
[in]pts_coordscoordinates of the points

◆ cs_ibm_user_parameters()

void cs_ibm_user_parameters ( void  )

Apply user parameters.

◆ cs_ibm_volumic_zone()

void cs_ibm_volumic_zone ( const cs_mesh_quantities_t mesh_quantities)

Define space immersed boundaries on a set of zones defined by the user in the GUI.

Parameters
[in]mesh_quantitiespointer to associated mesh quantities structure

◆ cs_immersed_boundaries()

void cs_immersed_boundaries ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities 
)

Define immersed boundaries in time and space (solid(s) interior part).

This function is called several times during each time step.

Ipenal: 1 means only solid and 0 only fluid.

Warning, porosity values have to be 0 or 1.

The solid(s) velocities and porosity are prescirbed within the user function (cs_user_ibm).

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities

◆ cs_user_ibm_define_objects()

void cs_user_ibm_define_objects ( void  )

User function in which the user defines the objects to model.

◆ cs_user_ibm_modify()

void cs_user_ibm_modify ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities 
)

User function. Locally modify a given porosity to take into account erosion effect (for instance)

This function is called for each time step. Porosity will be modified if cs_ibm->porosity_user_source_term_modification = true

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities

◆ cs_user_ibm_object_transformations()

void cs_user_ibm_object_transformations ( const cs_real_t  time)

User function where to apply predefined transformations to med/stl based objects.

Parameters
[in]ttime value for the current time step

◆ cs_user_ibm_parameters()

void cs_user_ibm_parameters ( void  )

User function to set global parameters for the immersed boundaries module.

◆ cs_user_ibm_solid_por()

void cs_user_ibm_solid_por ( const cs_lnum_t  c_id,
const cs_real_3_t  xyz,
const cs_real_t  t,
const int  num_object 
)

User function which allows the definition of a 'porous' object.

Parameters
[in]c_idlocal cell number
[in]xyzx, y, z coordinates of the current position
[in]ttime value for the current time step
[in]num_objectnum of fsi object (if fsi activated)

◆ cs_volumic_zone_porosity()

void cs_volumic_zone_porosity ( const cs_mesh_quantities_t mesh_quantities)

Variable Documentation

◆ cs_glob_porosity_ibm_opt

cs_porosity_ibm_opt_t* cs_glob_porosity_ibm_opt
extern

◆ cs_ibm

cs_ibm_t* cs_ibm
extern