My domain is a rectangular channel. I want to insert a circular patch of cells as boundary faces on each of the spanwise faces of the domain and I have included this function in cs_user_mesh-boundary.c
Code: Select all
void
cs_user_mesh_boundary(cs_mesh_t *mesh)
{
{
cs_lnum_t n_selected_faces = 0;
cs_lnum_t *selected_faces = NULL;
/* example of multi-line character string */
const char criteria[] = "cylinder[0.010,0.005,0.0,0.010,0.005,0.0,0.0009]"
" or cylinder[0.010,0.005,0.03,0.010,0.005,0.03,0.0009]";
BFT_MALLOC(selected_faces, mesh->n_i_faces, cs_lnum_t);
cs_selector_get_i_face_list(criteria,
&n_selected_faces,
selected_faces);
cs_mesh_boundary_insert(mesh,
n_selected_faces,
selected_faces);
BFT_FREE(selected_faces);
}
}
I usually specify boundary conditions in the fortran subroutine and so I use
Code: Select all
call getfac("cylinder[0.010,0.005,0.03,0.010,0.005,0.03,0.0009]", nlelt, lstelt)
In the listing file it shows
but the newly created boundary faces don't show up as boundary faces in the Groups list and also it's not visible in the post-processing output.Before insertion of user-defined boundary
Number of cells: 270000
Number of interior faces: 897750
Number of boundary faces: 4500
Number of vertices: 363004
After insertion of user-defined boundary
Number of cells: 270000
Number of interior faces: 807750
Number of boundary faces: 4500
Number of vertices: 363004
I alternatively tried to specify the boundary condition in the c-code function cs_user_boundary_conditions_setup
Code: Select all
void
cs_user_boundary_conditions_setup(cs_domain_t *domain)
{
CS_UNUSED(domain);
const char criteria[] = "cylinder[0.010,0.005,0.0,0.010,0.005,0.0,0.0009]"
" or cylinder[0.010,0.005,0.03,0.010,0.005,0.03,0.0009]";
{
cs_equation_param_t *eqp = cs_equation_param_by_name("velocity");
cs_real_t inlet_velocity[] = {0.0, 0.0, 0.0};
cs_equation_add_bc_by_value(eqp,
CS_PARAM_BC_DIRICHLET,
criteria, // zone name
inlet_velocity);
}
Please could you advise the correct method of inserting boundary faces in the interior of the domain and specifying boundary condition on this. Is it possible to group the newly inserted faces and give it a name?
Many thanks