Calculate the elementary matrices on a full 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, MAX_NNC) | :: | ke_ij | elementary matrix |
|
real(kind=R8), | intent(inout), | dimension(MAX_NNC ) | :: | be_i | elementary rhs member |
|
integer(kind=I4), | intent(out), | dimension(MAX_NNC ) | :: | ind_e | elementary index member |
subroutine elementary_full_domain_FE_film_reynolds(fe_f, mat, ke_ij, be_i, ind_e)
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, MAX_NNC) :: ke_ij !! *elementary matrix*
real(kind=R8), intent(inout), dimension(MAX_NNC ) :: be_i !! *elementary rhs member*
integer(kind=I4), intent(out ), dimension(MAX_NNC ) :: ind_e !! *elementary index member*
integer(kind=I4) :: e, ee, i, j, ii, nbc, nc
logical(kind=I4) :: flag
integer(kind=I4), dimension(MAX_NBS) :: ind_n
real(kind=R8), dimension(MAX_NBS) :: sav_vn
real(kind=R8), dimension(MAX_NNC) :: bc, dp
nc = fe_f%m%nc
! check of precomputed tables allocation
if (.not.allocated(fe_f%prc%vcal)) call init_prc_tab(fe_f)
! boundary condition initialization
if (BC_SPLINE) then
bc(1:nc) = 0
else
bc(1:nc) = be_i(1:nc)
endif
j = 1
do e = 1, fe_f%m%ned
do ee = 1, fe_f%m%ed(e)%n
ind_n(j) = fe_f%m%ed(e)%nm(ee)
sav_vn(j) = fe_f%vn(ind_n(j), P_N)
j = j +1
enddo
enddo
nbc = j -1
! matrices
ke_ij = 0._R8
ind_e = 0
be_i = 0._R8
! calculation of the elementary matrix
do i = 1, nc ! number of corners
ii = fe_f%m%cor(i)
ind_e(i) = ii
dp(i) = fe_f%vn(ii, P_N)/1000
if (BC_SPLINE) then
bc(i) = dp(i)
else
bc(i) = bc(i) + dp(i)
endif
if (i==1) flag = .true.
call solve_FE_film(fe_f = fe_f, & !
mat = mat, & !
bc = bc, & ! in
flag_ass = flag) !
flag = .false.
call compute_corner_fluxes(fe_f = fe_f, & !
mat = mat, & !
bf = be_i) ! out
ke_ij(1:nc, i) = - be_i(1:nc) / dp(i)
if (BC_SPLINE) then
bc(i) = 0
else
bc(i) = bc(i) -dp(i)
endif
do j = 1, nbc
fe_f%vn(ind_n(j), P_N) = sav_vn(j)
enddo
enddo
! calculation of the RHS table
call solve_FE_film(fe_f = fe_f, & !
mat = mat, & !
bc = bc, & !
flag_ass = .false.) !
call compute_corner_fluxes(fe_f = fe_f, & !
mat = mat, & !
bf = be_i) ! out
! update of the matrix: the derivative is the difference
! between the residuals divided by the delta p
do i = 1, nc
ke_ij(1:nc, i) = ke_ij(1:nc, i) + be_i(1:nc)/dp(i)
enddo
return
endsubroutine elementary_full_domain_FE_film_reynolds