Internal wall not detected in code saturne 4.2
Posted: Mon Nov 07, 2016 12:04 pm
Hello,
I am trying to model internal wall as baffle using Code Saturne 4.2. During mesh creation I have created an internal face with name baffle. Also I have used subroutine cs_user_mesh.c as attached below. But baffle is not being detected in preprocessor listing so I am unable to provide wall boundary condition to baffle. Code saturne compiles user subroutine without error and run goes well but it do not take internal wall into account. Since flow is not affected by baffle streamlines are straight as shown below.

Instead I am expecting flow to go like shown in picture below after detecting baffle

User subroutine is as below:
Please tell me what I am doing wrong.
Thanks and Regards,
Sagar
I am trying to model internal wall as baffle using Code Saturne 4.2. During mesh creation I have created an internal face with name baffle. Also I have used subroutine cs_user_mesh.c as attached below. But baffle is not being detected in preprocessor listing so I am unable to provide wall boundary condition to baffle. Code saturne compiles user subroutine without error and run goes well but it do not take internal wall into account. Since flow is not affected by baffle streamlines are straight as shown below.
Instead I am expecting flow to go like shown in picture below after detecting baffle
User subroutine is as below:
Code: Select all
/*----------------------------------------------------------------------------
* Insert thin wall into a mesh.
*----------------------------------------------------------------------------*/
cs_user_mesh_thinwall(cs_mesh_t *mesh)
{
/* Example: thin wall along a plane */
/*----------------------------------*/
if (true) {
cs_lnum_t n_selected_faces = 1;
cs_lnum_t *selected_faces = 1;
cs_real_t *i_face_cog = 1, *i_face_normal = 1;
/* example of multi-line character string */
const char criteria[] = "baffle";
cs_mesh_init_group_classes(mesh);
cs_mesh_quantities_i_faces(mesh, &i_face_cog, &i_face_normal);
cs_glob_mesh->select_i_faces = fvm_selector_create(mesh->dim,
mesh->n_i_faces,
mesh->class_defs,
mesh->i_face_family,
1,
i_face_cog,
i_face_normal);
BFT_MALLOC(selected_faces, mesh->n_i_faces, cs_lnum_t);
cs_selector_get_i_face_list(criteria,
&n_selected_faces,
selected_faces);
BFT_FREE(i_face_cog);
BFT_FREE(i_face_normal);
mesh->class_defs = fvm_group_class_set_destroy(mesh->class_defs);
mesh->select_i_faces = fvm_selector_destroy(mesh->select_i_faces);
cs_create_thinwall(mesh,
selected_faces,
n_selected_faces);
BFT_FREE(selected_faces);
}
}
Thanks and Regards,
Sagar