marker_set_GetIBForcing Subroutine

private impure subroutine marker_set_GetIBForcing(this, Um, Vm, Wm, rhof, SDF, ibF, dt)

Computes the IB forcing Interpolation are carried out by trilinear interpolations.

Type Bound

marker_set

Arguments

Type IntentOptional Attributes Name
class(marker_set), intent(inout) :: this

A collection of tessellation elements

type(eulerian_obj_r), intent(in) :: Um

Velocity in 1-dir

type(eulerian_obj_r), intent(in) :: Vm

Velocity in 2-dir

type(eulerian_obj_r), intent(in) :: Wm

Velocity in 3-dir

real(kind=wp), intent(in) :: rhof

Fluid density

type(eulerian_obj_r), intent(in) :: SDF

Surface density function

type(eulerian_obj_r), intent(inout) :: ibF(3)

IB forcing

real(kind=wp), intent(in) :: dt

Timestep


Calls

proc~~marker_set_getibforcing~~CallsGraph proc~marker_set_getibforcing marker_set%marker_set_GetIBForcing markers markers proc~marker_set_getibforcing->markers p p proc~marker_set_getibforcing->p proc~eulerian_obj_final eulerian_obj_base%eulerian_obj_Final proc~marker_set_getibforcing->proc~eulerian_obj_final proc~eulerian_obj_init eulerian_obj_base%eulerian_obj_Init proc~marker_set_getibforcing->proc~eulerian_obj_init proc~marker_set_filter marker_set%marker_set_Filter proc~marker_set_getibforcing->proc~marker_set_filter proc~marker_set_filter->markers extrapolate extrapolate proc~marker_set_filter->extrapolate f f proc~marker_set_filter->f n n proc~marker_set_filter->n proc~eulerian_obj_addupghostcells eulerian_obj_base%eulerian_obj_AddUpGhostCells proc~marker_set_filter->proc~eulerian_obj_addupghostcells v v proc~marker_set_filter->v proc~eulerian_obj_addupghostcells_x eulerian_obj_base%eulerian_obj_AddUpGhostCells_x proc~eulerian_obj_addupghostcells->proc~eulerian_obj_addupghostcells_x proc~eulerian_obj_addupghostcells_y eulerian_obj_base%eulerian_obj_AddUpGhostCells_y proc~eulerian_obj_addupghostcells->proc~eulerian_obj_addupghostcells_y proc~eulerian_obj_addupghostcells_z eulerian_obj_base%eulerian_obj_AddUpGhostCells_z proc~eulerian_obj_addupghostcells->proc~eulerian_obj_addupghostcells_z proc~eulerian_obj_updateghostcells eulerian_obj_base%eulerian_obj_UpdateGhostCells proc~eulerian_obj_addupghostcells->proc~eulerian_obj_updateghostcells cell cell proc~eulerian_obj_addupghostcells_x->cell mpi_irecv mpi_irecv proc~eulerian_obj_addupghostcells_x->mpi_irecv mpi_isend mpi_isend proc~eulerian_obj_addupghostcells_x->mpi_isend mpi_waitall mpi_waitall proc~eulerian_obj_addupghostcells_x->mpi_waitall proc~eulerian_obj_addupghostcells_y->cell proc~eulerian_obj_addupghostcells_y->mpi_irecv proc~eulerian_obj_addupghostcells_y->mpi_isend proc~eulerian_obj_addupghostcells_y->mpi_waitall proc~eulerian_obj_addupghostcells_z->cell proc~eulerian_obj_addupghostcells_z->mpi_irecv proc~eulerian_obj_addupghostcells_z->mpi_isend proc~eulerian_obj_addupghostcells_z->mpi_waitall proc~eulerian_obj_updateghostcells_x eulerian_obj_base%eulerian_obj_UpdateGhostCells_x proc~eulerian_obj_updateghostcells->proc~eulerian_obj_updateghostcells_x proc~eulerian_obj_updateghostcells_y eulerian_obj_base%eulerian_obj_UpdateGhostCells_y proc~eulerian_obj_updateghostcells->proc~eulerian_obj_updateghostcells_y proc~eulerian_obj_updateghostcells_z eulerian_obj_base%eulerian_obj_UpdateGhostCells_z proc~eulerian_obj_updateghostcells->proc~eulerian_obj_updateghostcells_z proc~eulerian_obj_updateghostcells_x->cell proc~eulerian_obj_updateghostcells_x->mpi_irecv proc~eulerian_obj_updateghostcells_x->mpi_isend proc~eulerian_obj_updateghostcells_x->mpi_waitall proc~eulerian_obj_updateghostcells_y->cell proc~eulerian_obj_updateghostcells_y->mpi_irecv proc~eulerian_obj_updateghostcells_y->mpi_isend proc~eulerian_obj_updateghostcells_y->mpi_waitall proc~eulerian_obj_updateghostcells_z->cell proc~eulerian_obj_updateghostcells_z->mpi_irecv proc~eulerian_obj_updateghostcells_z->mpi_isend proc~eulerian_obj_updateghostcells_z->mpi_waitall

Called by

proc~~marker_set_getibforcing~~CalledByGraph proc~marker_set_getibforcing marker_set%marker_set_GetIBForcing proc~respart_set_getibforcing ResPart_set%ResPart_set_GetIBForcing proc~respart_set_getibforcing->proc~marker_set_getibforcing proc~cdifs_obj_advancesolutionib cdifs_obj_AdvanceSolutionIB proc~cdifs_obj_advancesolutionib->proc~respart_set_getibforcing proc~cdifs_obj_advancesolution cdifs_obj_AdvanceSolution proc~cdifs_obj_advancesolution->proc~cdifs_obj_advancesolutionib interface~cdifs_obj_advancesolution cdifs_obj%cdifs_obj_AdvanceSolution interface~cdifs_obj_advancesolution->proc~cdifs_obj_advancesolution

Source Code

    impure subroutine marker_set_GetIBForcing(this,Um,Vm,Wm,rhof,SDF,ibF,dt)
      !> Computes the IB forcing
      ! Interpolation are carried out by trilinear interpolations.
      implicit none
      class(marker_set),    intent(inout) :: this                              !! A collection of tessellation elements
      type(Eulerian_obj_r), intent(in)    :: Um                                !! Velocity in 1-dir
      type(Eulerian_obj_r), intent(in)    :: Vm                                !! Velocity in 2-dir
      type(Eulerian_obj_r), intent(in)    :: Wm                                !! Velocity in 3-dir
      real(wp),             intent(in)    :: rhof                              !! Fluid density
      type(Eulerian_obj_r), intent(in)    :: SDF                               !! Surface density function
      type(Eulerian_obj_r), intent(inout) :: ibF(3)                            !! IB forcing
      real(wp),             intent(in)    :: dt                                !! Timestep
      ! work variable
      type(eulerian_obj_r):: tmp
      real(wp):: uf(3)
      integer :: shi(3), slo(3), sx(3)                                         !! Stencil extents
      real(wp):: SDFm
      real(wp):: w1D(2,3)
      real(wp):: w3D(2,2,2)
      integer :: m,dir,i,j,k
      logical :: is_active

      select type (markers=>this%p)
      type is (marker_obj)
        do m=1,this%count_

          is_active =.true.
          do dir=1,3
            if (markers(m)%p(dir).lt.this%block%pmin(dir).or. &
                markers(m)%p(dir).gt.this%block%pmax(dir)) then
                is_active=.false.
            end if
          end do

          if (is_active) then

            ! Locate centroid w/r to mesh
            ! -------------------------- !
            slo = markers(m)%c

            do dir=1,3
              sx(dir) = -1; if (markers(m)%p(dir).ge.this%block%axis(dir)%xm(slo(dir))) sx(dir) = 0
            end do
            slo = slo + sx
            shi = slo + 1

            ! - Build interpolator
            do dir=1,3
              w1D(1,dir) = (this%block%axis(dir)%xm(shi(dir)) - markers(m)%p(dir))/(this%block%axis(dir)%xm(shi(dir))-this%block%axis(dir)%xm(slo(dir)))
              w1D(2,dir) = 1.0_wp - w1D(1,dir)
            end do

            do k=1,2
              do j=1,2
                do i=1,2
                  w3D(i,j,k) = w1D(i,1)*w1D(j,2)*w1D(k,3)
                end do
              end do
            end do
            ! - Interpolate
            uf(1)    = sum(w3D*Um%cell(slo(1):shi(1),slo(2):shi(2),slo(3):shi(3)))
            uf(2)    = sum(w3D*Vm%cell(slo(1):shi(1),slo(2):shi(2),slo(3):shi(3)))
            uf(3)    = sum(w3D*Wm%cell(slo(1):shi(1),slo(2):shi(2),slo(3):shi(3)))
            SDFm     = sum(w3D*SDF%cell(slo(1):shi(1),slo(2):shi(2),slo(3):shi(3)))

            markers(m)%f = (1.0_wp/SDFm)*rhof*(markers(m)%v-uf)/dt

          else
            markers(m)%f = 0.0_wp
          end if
        end do
      end select

      ! Compute forcing on mid points
      call tmp%Initialize('tmp',this%block,this%parallel,0)

      call this%Filter('F1',tmp); ibF(1) = tmp + ibF(1)
      call this%Filter('F2',tmp); ibF(2) = tmp + ibF(2)
      call this%Filter('F3',tmp); ibF(3) = tmp + ibF(3)

      call tmp%Finalize()

      return
    end subroutine marker_set_GetIBForcing