apply_bc_FE_film Subroutine

public subroutine apply_bc_FE_film(fe_f, bc)


Arguments

Type IntentOptional AttributesName
type(FE_FILM), intent(inout) :: fe_f

FE film data type

real(kind=R8), intent(in), dimension(MAX_NNC):: bc

boundary conditions at the corners


Called by

proc~~apply_bc_fe_film~~CalledByGraph proc~apply_bc_fe_film apply_bc_FE_film proc~solve_fe_film solve_FE_film proc~solve_fe_film->proc~apply_bc_fe_film proc~elementary_full_domain_fe_film_reynolds elementary_full_domain_FE_film_reynolds proc~elementary_full_domain_fe_film_reynolds->proc~solve_fe_film proc~multi_scale_solve_fe_film multi_scale_solve_fe_film proc~multi_scale_solve_fe_film->proc~solve_fe_film proc~solve_fe_prob solve_fe_prob proc~solve_fe_prob->proc~solve_fe_film proc~solve_ms_prob solve_ms_prob proc~solve_ms_prob->proc~multi_scale_solve_fe_film proc~test_rough_fe test_rough_fe proc~test_rough_fe->proc~solve_fe_prob proc~test_bearing_x_fe test_bearing_x_fe proc~test_bearing_x_fe->proc~solve_fe_prob proc~test_pocket_fe test_pocket_fe proc~test_pocket_fe->proc~solve_fe_prob proc~test_bearing_y_fe test_bearing_y_fe proc~test_bearing_y_fe->proc~solve_fe_prob proc~test_slider_fe test_slider_fe proc~test_slider_fe->proc~solve_fe_prob proc~run_test run_test proc~run_test->proc~test_rough_fe proc~run_test->proc~test_bearing_x_fe proc~run_test->proc~test_pocket_fe proc~run_test->proc~test_bearing_y_fe proc~run_test->proc~test_slider_fe proc~test_slider_ms test_slider_ms proc~run_test->proc~test_slider_ms proc~test_rough_ms test_rough_ms proc~run_test->proc~test_rough_ms proc~test_slider_ms->proc~solve_ms_prob proc~test_rough_ms->proc~solve_ms_prob program~main main program~main->proc~run_test

Contents

Source Code


Source Code

   subroutine apply_bc_FE_film(fe_f, bc)
   implicit none
   type(FE_FILM), intent(inout)                     :: fe_f    !! *FE film data type*
   real(kind=R8), intent(in   ), dimension(MAX_NNC) :: bc      !! *boundary conditions at the corners*

      integer(kind=I4) :: e, i, ind, ind_var
      logical(kind=I4) :: mixture
      real(kind=R8)    :: v, v1, v2, x1, x2, y1, y2, l, d

      mixture = (fe_f%data_f%fl%fluid_type == MIXT)

      ! case of hd problem: unknown is p
      if (fe_f%data_f%pb_type == HD) ind_var = P_N

      ! copy of the bc values on the node values
      do i = 1, fe_f%m%nc
         fe_f%vn(fe_f%m%cor(i),ind_var) = fe_f%vn(fe_f%m%cor(i),ind_var) + bc(i)
      enddo

      ! loop on edges
      if (mixture) then
         v1 = bc(1)/fe_f%vn(fe_f%m%cor(1), ind_var)
      else
         v1 = bc(1)
      endif

      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
         v2 = v1
         x2 = x1
         y2 = y1

         if (mixture) then
            v1 = bc(e)/fe_f%vn(fe_f%m%cor(e),ind_var)
         else
            v1 = bc(e)
         endif

         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
         do i = 2, 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
            v = d * v1 + (1._R8 - d) * v2
            ! linear distribution along the edge
            if (mixture) then
               fe_f%vn(ind, ind_var) = exp( log(fe_f%vn(ind, ind_var)) + v)
            else
               fe_f%vn(ind, ind_var) = fe_f%vn(ind, ind_var) + v
            endif
         enddo

         do i = 1, fe_f%m%ed(e)%n
            ind = fe_f%m%ed(e)%nm(i)
            ! boundary nodes are set as imposed
            fe_f%bc(ind, REY) = 0
         enddo
      enddo

   return
   endsubroutine apply_bc_FE_film