Subroutine to calculate the fluxes at the corner of the domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(FE_FILM), | intent(inout) | :: | fe_f | FE film |
||
type(MAT_SOLV), | intent(inout) | :: | mat | solver type matrices |
||
real(kind=R8), | intent(out), | dimension(MAX_NNC) | :: | bf | table of fluxes at the corner |
subroutine compute_corner_fluxes(fe_f, mat, bf)
implicit none
type(FE_FILM), intent(inout) :: fe_f !! *FE film*
type(MAT_SOLV), intent(inout) :: mat !! *solver type matrices*
real(kind=R8), intent(out ), dimension(MAX_NNC) :: bf !! *table of fluxes at the corner*
integer(kind=I4) :: ind2, ind1, ind, e, i
real(kind=R8) :: x1, x2, y1, y2, d, l
! calculation of the fluxes on the boundaries by assembly ass_c = no_bc
call assembly_FE_film_reynolds(fe_f = fe_f, & !
mat = mat, & !
ass_c = NO_BC) !
! projection of the fluxes on the corners
! loop on edges
bf = 0.0_R8
ind1 = 1
x1 = fe_f%m%x(fe_f%m%cor(1))
y1 = fe_f%m%y(fe_f%m%cor(1))
do e = fe_f%m%ned, 1, -1
ind2 = ind1
x2 = x1
y2 = y1
ind1 = e
x1 = fe_f%m%x(fe_f%m%cor(e))
y1 = fe_f%m%y(fe_f%m%cor(e))
! length of the edge
l = ((x2 - x1)**2 + (y2 - y1) ** 2) ** 0.5_R8
! loop on all the nodes - 1 on the edge
! without -1, the corner contribution is counted two times
do i = 1, fe_f%m%ed(e)%n - 1
ind = fe_f%m%ed(e)%nm(i)
! distance to point 2
d = ((x2 - fe_f%m%x(ind))**2 + (y2 - fe_f%m%y(ind)) ** 2) ** 0.5_R8
d = d / l
! linear projection along the edge of the local flux
bf(ind1) = bf(ind1) + d * mat%b(ind)
bf(ind2) = bf(ind2) + (1._R8 - d) * mat%b(ind)
enddo
enddo
return
endsubroutine compute_corner_fluxes