Evaluates the velocity vector at a boundary face.
Implements standard FV boundary evaluations: - Wall/Dirichlet: Returns the specified patch velocity. - Symmetry: Subtracts the normal component from the interior velocity. - Neumann/Periodic: Extrapolates the interior velocity to the face.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh |
Mesh data structure. |
||
| type(bc_set_t), | intent(in) | :: | bc |
Boundary condition set. |
||
| integer, | intent(in) | :: | face_id |
ID of the boundary face. |
||
| real(kind=rk), | intent(in) | :: | interior_velocity(3) | |||
| real(kind=rk), | intent(out) | :: | value(3) |
subroutine boundary_velocity(mesh, bc, face_id, interior_velocity, value) type(mesh_t), intent(in) :: mesh type(bc_set_t), intent(in) :: bc integer, intent(in) :: face_id real(rk), intent(in) :: interior_velocity(3) real(rk), intent(out) :: value(3) integer :: patch_id real(rk) :: nhat(3), un patch_id = mesh%faces(face_id)%patch if (patch_id <= 0) then value = interior_velocity return end if select case (bc%patches(patch_id)%velocity_type_id) case (bc_wall, bc_dirichlet) value = bc%patches(patch_id)%velocity case (bc_symmetry) nhat = mesh%faces(face_id)%normal un = dot_product(interior_velocity, nhat) value = interior_velocity - un * nhat case default value = interior_velocity end select end subroutine boundary_velocity