Local variables to be added for the Fortran examples
integer ifac, ii
integer izone
integer ilelt, nlelt
integer f_id_rough, f_id_t_rough
double precision d2s3
double precision zref, xuref
double precision ustar, rugd, rugt
double precision zent, xuent, xvent
double precision xkent, xeent
integer, allocatable, dimension(:) :: lstelt
double precision, dimension(:), pointer :: bpro_roughness
double precision, dimension(:), pointer :: bpro_roughness_t
Initialization and finalization
Initialization and finalization is similar to that of the base examples
Example 1 (Fortran)
For boundary faces of color 11, assign an inlet boundary condition prescribed from the meteo profile with automatic choice between inlet/ outlet according to the meteo profile.
call getfbr(
'11',nlelt,lstelt)
izone = maxval(izfppp) + 1
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izfppp(ifac) = izone
iprofm(izone) = 1
iprofc(izone) = 1
itypfb(ifac) = ientre
iautom(ifac) = 1
enddo
Example 2 (Fortran)
For boundary faces of color 21, assign an inlet boundary condition prescribed from the meteo profile.
call getfbr(
'21',nlelt,lstelt)
izone = maxval(izfppp) + 1
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
izfppp(ifac) = izone
iprofm(izone) = 1
iprofc(izone) = 1
itypfb(ifac) = ientre
enddo
Example 3
For boundary faces of zone "inlet_3", assign an inlet boundary condition. Here, all other variables prescribed from the meteo profile are assumed to be managed by the GUI, except for dynamic variables which are prescribed with a rough log law.
{
const cs_lnum_t n_b_faces = domain->mesh->n_b_faces;
const cs_real_t zent = b_face_cog[face_id][2];
CS_F_(k)->bc_coeffs->rcodcl1[face_id] = xkent;
CS_F_(
eps)->bc_coeffs->rcodcl1[face_id] = xeent;
}
for (int ii = 0; ii< 3; ii++)
CS_F_(
rij)->bc_coeffs->rcodcl1[n_b_faces*ii + face_id] = d2o3*xkent;
for (int ii = 3; ii< 6; ii++)
CS_F_(
rij)->bc_coeffs->rcodcl1[n_b_faces*ii + face_id] = 0;
CS_F_(
eps)->bc_coeffs->rcodcl1[face_id] = xeent;
}
CS_F_(k)->bc_coeffs->rcodcl1[face_id] = xkent;
CS_F_(
eps)->bc_coeffs->rcodcl1[face_id] = xeent;
CS_F_(
phi)->bc_coeffs->rcodcl1[face_id] = d2o3;
}
CS_F_(k)->bc_coeffs->rcodcl1[face_id] = xkent;
}
}
}
}
Example 4
Define a rough wall at boundary faces of zone 'b_5'.
{
if (bpro_roughness != NULL)
bpro_roughness[face_id] = rugd;
if (bpro_roughness_t != NULL)
bpro_roughness_t[face_id] = 0.01;
}
}