I am trying to impose boundary conditions by using c-functions, but not so many examples with that. So the question is:
How to set "z0" value for rough wall? I was trying to do it similarly to a fortran code:
Code: Select all
const int keyvar = cs_field_key_id("variable_id");
//botom
cs_selector_get_b_face_list("bottom", &nelts, lstelt);
for (cs_lnum_t ilelt = 0; ilelt < nelts; ilelt++) {
cs_lnum_t face_id = lstelt[ilelt];
bc_type[face_id] = CS_ROUGHWALL;
f = CS_F_(u);
int ivar = cs_field_get_key_int(f, keyvar) - 1 + 0; // access to U_x
icodcl[ivar * n_b_faces + face_id] = 6; //3??
rcodcl[ivar * n_b_faces + face_id] = 0.001; //roughness value z0
}
Code: Select all
First face with boundary condition definition error
(out of 1)
has boundary condition type 6, center (0.25, 0, 0.25)
cs_boundary_conditions.c:363: Fatal error.