Boundary forces
This is an example of cs_user_extra_operations which computes boundary forces
Example 1: compute total forces on a boundary zone (subset of boundary faces).
{
const cs_lnum_t n_b_faces = domain->mesh->n_b_faces;
if (b_forces != NULL) {
for (
cs_lnum_t i_elt = 0; i_elt < n_elts; i_elt++) {
for (int ii = 0; ii < 3; ii++)
total_b_forces[ii] += b_forces->
val[3*face_id + ii];
}
}
}
Example 2: compute pressure forces on a boundary zone (subset of boundary faces).
{
const cs_lnum_t n_b_faces = domain->mesh->n_b_faces;
domain->mesh_quantities->b_f_face_normal;
for (
cs_lnum_t i_elt = 0; i_elt < n_elts; i_elt++) {
for (int ii = 0; ii < 3; ii++)
total_b_p_forces[ii] += p_b_val[i_elt]*b_f_face_normal[3*face_id+ii];
}
}