Skip to content
Snippets Groups Projects
define_bc_model1.f90 3.92 KiB
Newer Older
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
!                                                                              |
!              ||===\\                                                         | 
!              ||    \\                                                        |
!              ||     ||   //==\\   ||  ||   //==||  ||/==\\                   |
!              ||     ||  ||    ||  ||  ||  ||   ||  ||    ||                  |
!              ||    //   ||    ||  ||  ||  ||   ||  ||                        |
!              ||===//     \\==//    \\==\\  \\==\\  ||                        |
!                                                                              |
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
!                                                                              |
!              DEFINE_BC_MODEL1    May 2008                                    |
!                                                                              |
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|

subroutine define_bc_model1 (nnode,kfix,kfixt,x,y,z,u,v,w,temp,vo) 

!------------------------------------------------------------------------------|
!(((((((((((((((( Purpose of the routine  ))))))))))))))))))))))))))))))))))))))
!------------------------------------------------------------------------------|
! this routine assigns the boundary condition for the Stokes sphere experiment 

!------------------------------------------------------------------------------|
!((((((((((((((((  declaration of the subroutine arguments  ))))))))))))))))))))
!------------------------------------------------------------------------------|

use definitions

implicit none

integer nnode
integer kfix(nnode*3)
integer kfixt(nnode)
double precision x(nnode),y(nnode),z(nnode)
double precision u(nnode),v(nnode),w(nnode)
double precision temp(nnode)
type (void) vo

!------------------------------------------------------------------------------|
!(((((((((((((((( declaration of the subroutine internal variables )))))))))))))
!------------------------------------------------------------------------------|

integer i
double precision eps

!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|

eps=1.d-10

do i=1,nnode

   if (x(i).lt.eps) then
      kfix((i-1)*3+1)=1 ; u(i)=0.d0
   endif

   if (x(i).gt.1.d0-eps) then
      kfix((i-1)*3+1)=1 ; u(i)=0.d0
   endif

   if (y(i).lt.eps) then
      kfix((i-1)*3+1)=1 ; u(i)=0.d0
      kfix((i-1)*3+2)=1 ; v(i)=-1.d0
!      kfix((i-1)*3+3)=1 ; w(i)=0.d0
   endif

   if (y(i).gt.1.d0-eps) then
      kfix((i-1)*3+1)=1 ; u(i)=0.d0
      kfix((i-1)*3+2)=1 ; v(i)=1.d0
!      kfix((i-1)*3+3)=1 ; w(i)=0.d0
   endif

   if (z(i).lt.eps) then
!      kfix((i-1)*3+1)=1 ; u(i)=0.d0
      kfix((i-1)*3+3)=1 ; w(i)=0.d0
!if (x(i)<0.41d0) then
!      if (y(i).lt.0.45d0) then
!         kfix((i-1)*3+2)=1 ; v(i)=-1.d0
!      else
!         kfix((i-1)*3+2)=1 ; v(i)=1.d0
!      end if
!elseif (x(i)>0.59d0) then
!      if (y(i).lt.0.55d0) then
!         kfix((i-1)*3+2)=1 ; v(i)=-1.d0
!      else
!         kfix((i-1)*3+2)=1 ; v(i)=1.d0
!      end if
!end if

      kfixt(i)=1
      temp(i)=1.d0
   endif
   if (z(i).gt.1.d0-eps) then
!      kfix((i-1)*3+1)=1 ; u(i)=0.d0
      kfixt(i)=1
      temp(i)=0.d0
   endif
   if (.not.vo%influid(i)) then
      kfixt(i)=1
      temp(i)=0.d0
   endif

end do

   


return

end subroutine

!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------