Solid/boundary walls inside fluid domain

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
mhassab

Solid/boundary walls inside fluid domain

Post by mhassab »

Hello ,

I am looking to simulate a solid partially blocking a flow in a pipe and I was wondering what is the best way to do this.

I have created the solid's bounding surfaces group in the geometry and I defined them as WALL boundary condition. But the simulation results doesn't show the results or any effect showing the solid in the domain.

I was reading the tutorials and I saw the 3 discs example, I am wondering if I need SYRTHES for this? I am not simulating any conduction in the solid. I just want to simulate this volume inside the domain as walls.

Thanks,
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Solid/boundary walls inside fluid domain

Post by Yvan Fournier »

Hello,

The "thin wall" fucntionnality of Code_Saturne is probably a better option.

Check the cs_user_mesh_thinwall() function in the cs_user_mesh.c user file
(this is where you can tell the code that faces of the group you defined should be boundary, not interior faces).

Regards,

Yvan
mhassab

Re: Solid/boundary walls inside fluid domain

Post by mhassab »

The thin wall function in my cs_user mesh is as follows



/*----------------------------------------------------------------------------
* Insert thin wall into a mesh.
*----------------------------------------------------------------------------*/

void
cs_user_mesh_thinwall(cs_mesh_t *mesh)
{

/* Example: thin wall along a plane */
/*----------------------------------*/

if (false) {
cs_lnum_t n_selected_faces = 0;
cs_lnum_t *selected_faces = NULL;

cs_real_t *i_face_cog = NULL, *i_face_normal = NULL;

/* example of multi-line character string */

const char criteria[] = "plane[0, -1, 0, 0.5, epsilon = 0.0001]"
" or plane[-1, 0, 0, 0.5, epsilon = 0.0001]";

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);
cs_create_thinwall(mesh,
selected_faces,
n_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);
}
}



So I removed the ''void'' and the if changed to be ''true''.

But I had no idea what is n_selected_faces or *selected_faces or *i_face_cog or *i_face_normal , even after checking documentation and Doxgyn.

It seems that along a plane those parameters above are to change, so I changed it to the follows, not sure if I see much difference in the answer.

Does this code pull the selected faces from the list in the GUI ? could you please clarify. If I have a faces group called X inside the volume, what should I do to make it a thin wall ?



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[] = "plane[0, -1, 0, 0.5, epsilon = 0.0001]"
" or plane[-1, 0, 0, 0.5, epsilon = 0.0001]";

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);
cs_create_thinwall(mesh,
selected_faces,
n_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);
}
}
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: Solid/boundary walls inside fluid domain

Post by Yvan Fournier »

Hello,

If you have a faces group names "X" inside the volume, you should simply set the criterria in the example to "x":

replace:
const char criteria[] = "plane[0, -1, 0, 0.5, epsilon = 0.0001]"
" or plane[-1, 0, 0, 0.5, epsilon = 0.0001]";

with:
const char criteria[] = "X";

This should be enough.

Regards,

Yvan
Post Reply