8.3
general documentation
cs_ibm.cpp File Reference
#include "cs_defs.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "fvm_writer.h"
#include "cs_array.h"
#include "cs_cell_to_vertex.h"
#include "cs_field_operator.h"
#include "cs_field_pointer.h"
#include "cs_medcoupling_intersector.h"
#include "cs_meg_prototypes.h"
#include "cs_mesh_adjacencies.h"
#include "cs_parameters.h"
#include "cs_post.h"
#include "cs_prototypes.h"
#include "cs_stl.h"
#include "cs_turbomachinery.h"
#include "cs_velocity_pressure.h"
#include "cs_vertex_to_cell.h"
#include "cs_zone.h"
#include "cs_ibm.h"
+ Include dependency graph for cs_ibm.cpp:

Functions

static cs_real_t _geom_face_fraction (cs_real_t alphai, cs_real_t alphaj, cs_real_t sizei, cs_real_t sizej)
 Compute the face porosity depending on the neighbouring cells porosities based on geometry. More...
 
static cs_real_t _imm_lgth_cutcell (cs_real_3_t x1, cs_real_3_t x2, cs_real_t t, int num_object)
 Compute by dichotomy the length of the immersed part of a line between two points (i.e. the distance between the point in the solid and the immersed boundary) based on the cut-cell method. More...
 
static cs_real_t _imm_lgth_poro (cs_real_3_t x1, cs_real_t por1, cs_real_3_t x2, cs_real_t por2)
 Compute by dichotomy the length of the immersed part of a line between two points (i.e. the distance between the point in the solid and the immersed boundary) based on the input porosities. More...
 
static cs_real_t _tetra_vol (cs_real_3_t x1, cs_real_3_t x2, cs_real_3_t x3, cs_real_3_t x4)
 Compute the volume of a tetrahedron described by its vertices (x1,x2,x3,x4). More...
 
static cs_real_t _pyram_vol (cs_real_3_t x1, cs_real_3_t x2, cs_real_3_t x3, cs_real_3_t x4, cs_real_3_t x5)
 Compute the volume of a pyramid with a quadrangle base (x1,x2,x3,x4) and apex (x5). More...
 
static cs_real_t _prism_vol (cs_real_3_t x1, cs_real_3_t x2, cs_real_3_t x3, cs_real_3_t x4, cs_real_3_t x5, cs_real_3_t x6)
 Compute the volume of a prism with a quadrangle base (x3,x4,x5,x6) and edge (x1 x2). More...
 
static void _tetra_vol_poro (cs_real_t *vol, cs_real_3_t cog, cs_real_3_t x1, cs_real_t por1, cs_real_3_t x2, cs_real_t por2, cs_real_3_t x3, cs_real_t por3, cs_real_3_t x4, cs_real_t por4, int icut)
 Compute the volume and center of gravity of a tetrahedron described by its vertices (x1,x2,x3,x4) but truncated due to solid parts identified with porosities, through a recursive approach. More...
 
static cs_real_t _tri_surf_trunc (cs_real_3_t x1, cs_real_t por1, cs_real_3_t x2, cs_real_t por2, cs_real_3_t x3, cs_real_t por3, int icut)
 Compute by dichotomy the area of the immersed part of a triangle (x1,x2,x3) based on the input porosities at its vertices through a recursive approach. More...
 
static void _tetra_vol_cutcell (cs_real_t *vol, cs_real_3_t x1, cs_real_3_t x2, cs_real_3_t x3, cs_real_3_t x4, cs_real_t t, int icut, int num_object)
 Compute (using bisection) the volume of the immersed part of a tetrahedron described by its vertices (x1,x2,x3,x4) based on the cut-cell method and recursive approach. More...
 
static int _penal_glob (const cs_lnum_t c_id, const cs_real_3_t xyz, const cs_real_t t, const int num_object)
 Call to user function to know whether we are in the solid or not. More...
 
static void _compute_cell_cut_porosity (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, int *comp_cell)
 Compute cell porosity using the cut cell method. More...
 
static void _compute_cell_cog (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *v_poro, cs_real_t *por_init, int *comp_cell)
 Compute cell cog (and cell porosity from porosity at vertices) Cut method into sub-tetras. More...
 
static void _compute_b_fac_porosity (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *c_poro, cs_real_t *v_poro, cs_real_t *bfpro_poro)
 Compute boundary faces porosity. More...
 
static void _compute_i_fac_porosity (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *c_poro, cs_real_t *v_poro, cs_real_t *ifpro_poro)
 Compute internal faces porosity. More...
 
static void _compute_iso_vol_porosity (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *c_poro, int *comp_cell)
 Iso-volume porosity check. More...
 
static void _compute_solid_porosity (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *c_poro, int *comp_cell)
 Take into account internal solid porosity. More...
 
static void _compute_cell_list_porosity (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_lnum_t *comp_cell)
 Compute list of cells for porosity computing. More...
 
static void _compute_solid_surface_vector (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *i_poro, cs_real_t *b_poro)
 Compute porosity solid surface. More...
 
static void _compute_solid_surface_cog (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *c_poro, cs_real_t *v_poro, cs_real_t *i_poro, cs_real_t *b_poro)
 Compute porosity solid surface cog (dist and ponderation coeff) More...
 
static cs_ibm_object_t_create_ibm_object (const char *name, cs_ibm_algo_type_t method)
 Create a new immersed boundary object with a given name and method. More...
 
static int _add_ibm_object (const char *name, cs_ibm_algo_type_t method)
 Adds a new immersed boundary object with a given name and method. More...
 
static void _free_ibm_object (cs_ibm_object_t *obj)
 Free a cs_ibm_object_t structure. More...
 
static void _ibm_object_define_property_def (cs_ibm_object_t *obj, cs_ibm_object_property_type_t ppty_id, int n_vals, cs_real_t *vals)
 Define a new property definition for an object. More...
 
static void _ibm_object_define_initial_val_def (cs_ibm_object_t *obj, cs_ibm_object_init_param_t p_id, int n_vals, cs_real_t *vals)
 Set initial value xdef for an object. More...
 
static cs_real_t _get_xdef_val_at_object_elt (const cs_xdef_t *def, const int elt_id)
 Get xdef value at object element. More...
 
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...
 
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_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

static cs_porosity_ibm_opt_t _porosity_ibm_opt
 
cs_porosity_ibm_opt_tcs_glob_porosity_ibm_opt = &(_porosity_ibm_opt)
 
cs_ibm_tcs_ibm = nullptr
 
const char * _ibm_algo_names []
 
const char * _ibm_obj_property_names []
 
const char * _ibm_obj_init_vals_names []
 

Detailed Description

Define immersed boundaries based on user inputs (experimental). Cloud of points are dealt with porosity from scan files.

Function Documentation

◆ _add_ibm_object()

static int _add_ibm_object ( const char *  name,
cs_ibm_algo_type_t  method 
)
static

Adds a new immersed boundary object with a given name and method.

Parameters
[in]namename of the new object
[in]methodmethod used to compute the object porosity
Returns
id of the new object (int)

◆ _compute_b_fac_porosity()

static void _compute_b_fac_porosity ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_real_t c_poro,
cs_real_t v_poro,
cs_real_t bfpro_poro 
)
static

Compute boundary faces porosity.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]c_porocell porosity
[in]v_porovertex porosity
[out]bfpro_poroboundary face porosity

◆ _compute_cell_cog()

static void _compute_cell_cog ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_real_t v_poro,
cs_real_t por_init,
int *  comp_cell 
)
static

Compute cell cog (and cell porosity from porosity at vertices) Cut method into sub-tetras.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]por_vtxvertex porosity
[in]por_initinitialization porosity
[in]comp_celllist of cells to recompute porosity

◆ _compute_cell_cut_porosity()

static void _compute_cell_cut_porosity ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
int *  comp_cell 
)
static

Compute cell porosity using the cut cell method.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]comp_celllist of cells to recompute porosity

◆ _compute_cell_list_porosity()

static void _compute_cell_list_porosity ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_lnum_t comp_cell 
)
static

Compute list of cells for porosity computing.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[out]comp_celllist of cells to recompute porosity

◆ _compute_i_fac_porosity()

static void _compute_i_fac_porosity ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_real_t c_poro,
cs_real_t v_poro,
cs_real_t ifpro_poro 
)
static

Compute internal faces porosity.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]c_porocell porosity
[in]v_porovertex porosity
[out]ifpro_porointernal face porosity

◆ _compute_iso_vol_porosity()

static void _compute_iso_vol_porosity ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_real_t c_poro,
int *  comp_cell 
)
static

Iso-volume porosity check.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]c_porocell porosity
[in]comp_celllist of cells to recompute porosity

◆ _compute_solid_porosity()

static void _compute_solid_porosity ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_real_t c_poro,
int *  comp_cell 
)
static

Take into account internal solid porosity.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]c_porocell porosity
[in]comp_celllist of cells to recompute porosity

◆ _compute_solid_surface_cog()

static void _compute_solid_surface_cog ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_real_t c_poro,
cs_real_t v_poro,
cs_real_t i_poro,
cs_real_t b_poro 
)
static

Compute porosity solid surface cog (dist and ponderation coeff)

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]c_porocell porosity
[in]v_porovertex porosity
[in]i_porointernal face porosity
[in]b_poroboundary face porosity

◆ _compute_solid_surface_vector()

static void _compute_solid_surface_vector ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
cs_real_t i_poro,
cs_real_t b_poro 
)
static

Compute porosity solid surface.

Parameters
[in]meshpointer to associated mesh structure
[in]mesh_quantitiespointer to associated mesh quantities
[in]i_porointernal face porosity
[in]b_poroboundary face porosity

◆ _create_ibm_object()

static cs_ibm_object_t * _create_ibm_object ( const char *  name,
cs_ibm_algo_type_t  method 
)
static

Create a new immersed boundary object with a given name and method.

Parameters
[in]namename of the new object
[in]methodmethod used to compute the object porosity
Returns
pointer to new object structure

◆ _free_ibm_object()

static void _free_ibm_object ( cs_ibm_object_t obj)
static

Free a cs_ibm_object_t structure.

Parameters
[in]objpointer to structure to free

◆ _geom_face_fraction()

static cs_real_t _geom_face_fraction ( cs_real_t  alphai,
cs_real_t  alphaj,
cs_real_t  sizei,
cs_real_t  sizej 
)
static

Compute the face porosity depending on the neighbouring cells porosities based on geometry.

Parameters
[in]alphaivalue at neighbouring cell i
[in]alphajvalue at neighbouring cell j
[in]sizeidistance face - center of gravity cell i
[in]sizejdistance face - center of gravity cell j

◆ _get_xdef_val_at_object_elt()

static cs_real_t _get_xdef_val_at_object_elt ( const cs_xdef_t def,
const int  elt_id 
)
inlinestatic

Get xdef value at object element.

Parameters
[in]defPointer to cs_xdef_t definition
[in]elt_idElement id (int)

◆ _ibm_object_define_initial_val_def()

static void _ibm_object_define_initial_val_def ( cs_ibm_object_t obj,
cs_ibm_object_init_param_t  p_id,
int  n_vals,
cs_real_t vals 
)
static

Set initial value xdef for an object.

Parameters
[in]objPointer to object
[in]p_idProperty id (enum)
[in]n_valsNumber of values (array size)
[in]valsValues array (size n_vals)

◆ _ibm_object_define_property_def()

static void _ibm_object_define_property_def ( cs_ibm_object_t obj,
cs_ibm_object_property_type_t  ppty_id,
int  n_vals,
cs_real_t vals 
)
static

Define a new property definition for an object.

Parameters
[in]objpointer to object
[in]ppty_idproperty id (si enum for list)
[in]n_valsnumber of values (array size)
[in]valsarray of values

◆ _imm_lgth_cutcell()

static cs_real_t _imm_lgth_cutcell ( cs_real_3_t  x1,
cs_real_3_t  x2,
cs_real_t  t,
int  num_object 
)
static

Compute by dichotomy the length of the immersed part of a line between two points (i.e. the distance between the point in the solid and the immersed boundary) based on the cut-cell method.

Parameters
[in]x1point 1
[in]x2point 2
[in]ttime value for the current time step
[in]num_objectnum of fsi object (if fsi activated)

◆ _imm_lgth_poro()

static cs_real_t _imm_lgth_poro ( cs_real_3_t  x1,
cs_real_t  por1,
cs_real_3_t  x2,
cs_real_t  por2 
)
inlinestatic

Compute by dichotomy the length of the immersed part of a line between two points (i.e. the distance between the point in the solid and the immersed boundary) based on the input porosities.

Parameters
[in]x1point 1
[in]por1porosity at 1
[in]x2point 2
[in]por2porosity at 2

◆ _penal_glob()

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

Call to user function to know whether we are in the solid or not.

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)

◆ _prism_vol()

static cs_real_t _prism_vol ( cs_real_3_t  x1,
cs_real_3_t  x2,
cs_real_3_t  x3,
cs_real_3_t  x4,
cs_real_3_t  x5,
cs_real_3_t  x6 
)
static

Compute the volume of a prism with a quadrangle base (x3,x4,x5,x6) and edge (x1 x2).

Parameters
[in]x1point 1
[in]x2point 2
[in]x3point 3
[in]x4point 4
[in]x5point 5
[in]x6point 6

◆ _pyram_vol()

static cs_real_t _pyram_vol ( cs_real_3_t  x1,
cs_real_3_t  x2,
cs_real_3_t  x3,
cs_real_3_t  x4,
cs_real_3_t  x5 
)
static

Compute the volume of a pyramid with a quadrangle base (x1,x2,x3,x4) and apex (x5).

Parameters
[in]x1point 1
[in]x2point 2
[in]x3point 3
[in]x4point 4
[in]x5point 5 (apex)

◆ _tetra_vol()

static cs_real_t _tetra_vol ( cs_real_3_t  x1,
cs_real_3_t  x2,
cs_real_3_t  x3,
cs_real_3_t  x4 
)
inlinestatic

Compute the volume of a tetrahedron described by its vertices (x1,x2,x3,x4).

Parameters
[in]x1point 1
[in]x2point 2
[in]x3point 3
[in]x4point 4

◆ _tetra_vol_cutcell()

static void _tetra_vol_cutcell ( cs_real_t vol,
cs_real_3_t  x1,
cs_real_3_t  x2,
cs_real_3_t  x3,
cs_real_3_t  x4,
cs_real_t  t,
int  icut,
int  num_object 
)
static

Compute (using bisection) the volume of the immersed part of a tetrahedron described by its vertices (x1,x2,x3,x4) based on the cut-cell method and recursive approach.

Parameters
[out]volvolume
[in]x1point 1
[in]x2point 2
[in]x3point 3
[in]x4point 4
[in]ttime value for the current time step
[in]icutnumber of bisections
[in]num_objectnum of fsi object (if fsi activated)

◆ _tetra_vol_poro()

static void _tetra_vol_poro ( cs_real_t vol,
cs_real_3_t  cog,
cs_real_3_t  x1,
cs_real_t  por1,
cs_real_3_t  x2,
cs_real_t  por2,
cs_real_3_t  x3,
cs_real_t  por3,
cs_real_3_t  x4,
cs_real_t  por4,
int  icut 
)
static

Compute the volume and center of gravity of a tetrahedron described by its vertices (x1,x2,x3,x4) but truncated due to solid parts identified with porosities, through a recursive approach.

Parameters
[out]volvolume
[out]cogcenter of gravity
[in]x1point 1
[in]por1porosity at point 1
[in]x2point 2
[in]por2porosity at point 2
[in]x3point 3
[in]por3porosity at point 3
[in]x4point 4
[in]por4porosity at point 4
[in]icutnumber of sub-cut for cells in cut-cells algorithm

◆ _tri_surf_trunc()

static cs_real_t _tri_surf_trunc ( cs_real_3_t  x1,
cs_real_t  por1,
cs_real_3_t  x2,
cs_real_t  por2,
cs_real_3_t  x3,
cs_real_t  por3,
int  icut 
)
static

Compute by dichotomy the area of the immersed part of a triangle (x1,x2,x3) based on the input porosities at its vertices through a recursive approach.

Parameters
[in]x1point 1
[in]por1porosity at 1
[in]x2point 2
[in]por2porosity at 2
[in]x3point 3
[in]por3porosity at 3
[in]icutnumber of sub-cut for cells in cut-cells algorithm

◆ 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 ? (currently ignored)

◆ 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 ? (currently ignored)
[in]n_nodesNumber of nodes if the object is deformable (currently ignored)

◆ 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.

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.

◆ 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
[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 (currently ignored)

◆ 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.

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

Variable Documentation

◆ _ibm_algo_names

const char* _ibm_algo_names[]
Initial value:
= {"CS_IBM_ALGO_NONE",
"CS_IBM_ALGO_CUT_CELLS",
"CS_IBM_ALGO_MEDCOUPLING",
"CS_IBM_ALGO_STL"}

◆ _ibm_obj_init_vals_names

const char* _ibm_obj_init_vals_names[]
Initial value:
= {"Equilibrium Center of gravity",
"Center of gravity",
"Angle",
"Velocity",
"Acceleration",
"Angular velocity",
"Fluid force"}

◆ _ibm_obj_property_names

const char* _ibm_obj_property_names[]
Initial value:
= {"density",
"mass",
"inertia matrix",
"cp",
"lambda",
"stiffness",
"damping",
"Young module",
"Inertia momentum",
"cross section",
"rayleigh_coeff_a",
"rayleigh_coeff_b"}

◆ _porosity_ibm_opt

cs_porosity_ibm_opt_t _porosity_ibm_opt
static
Initial value:
= {
.porosity_mode = 0
}

◆ cs_glob_porosity_ibm_opt

cs_porosity_ibm_opt_t* cs_glob_porosity_ibm_opt = &(_porosity_ibm_opt)

◆ cs_ibm

cs_ibm_t* cs_ibm = nullptr