Prepares the boundary conditions used by GRANS. Note that the only boundary conditions required by GRANS are those in connection with the volume fraction Poisson equations. This subroutine reads pre-existing BCS file on disk. It adds additional boundary conditions for ibF, ibN, and ibS based on the specified boundary conditions for ibVF. If no Dirichlet conditions are given for ibVF, it marks the volume fraction Poisson equation as singular.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(grans_obj), | intent(inout) | :: | this |
GRANS solver |
subroutine grans_obj_PrepareSolverBCS(this) !> Prepares the boundary conditions used by GRANS. ! Note that the only boundary conditions required by GRANS ! are those in connection with the volume fraction Poisson equations. ! This subroutine reads pre-existing BCS file on disk. ! It adds additional boundary conditions for ibF, ibN, and ibS based ! on the specified boundary conditions for ibVF. If no Dirichlet ! conditions are given for ibVF, it marks the volume fraction Poisson ! equation as singular. implicit none class(grans_obj), intent(inout) :: this !! GRANS solver ! Work variables real(wp) :: time integer :: iter integer :: n real(wp), pointer :: BCVal(:,:,:) character(len=str64):: filename logical :: ibVFDirichlet logical :: buffL call this%parser%Get('BC file ', filename, default= 'bcs' ) ! Initialize and read boundary conditions call this%bcs%Initialize(this%block,this%parallel) call this%bcs%Read(iter,time,filename) associate (bcs => this%bcs) if (this%use_RP .or. this%use_IB) then ! Check boundary conditions for ibVF ibVFDirichlet = .false. do n=1,bcs%count ! Check Whether we have a BC for this variable on this region if (.not.bcs%CheckBCExists(bcs%region(n)%name,'ibVF')) cycle select case (bcs%GetBCType(bcs%region(n)%name,'ibVF')) case (BC_DIRICHLET) ! Found Dirichlet condition ibVFDirichlet = .true. call bcs%SetBC(bcs%region(n)%name,BC_DIRICHLET,'ibS' ) call bcs%SetBC(bcs%region(n)%name,BC_DIRICHLET,'ibN1') call bcs%SetBC(bcs%region(n)%name,BC_DIRICHLET,'ibN2') call bcs%SetBC(bcs%region(n)%name,BC_DIRICHLET,'ibN3') call bcs%SetBC(bcs%region(n)%name,BC_DIRICHLET,'ibF1') call bcs%SetBC(bcs%region(n)%name,BC_DIRICHLET,'ibF2') call bcs%SetBC(bcs%region(n)%name,BC_DIRICHLET,'ibF3') call bcs%GetBCPointer(bcs%region(n)%name,'ibS', BCVal); BCVal = 0.0_wp call bcs%GetBCPointer(bcs%region(n)%name,'ibN1', BCVal); BCVal = 0.0_wp call bcs%GetBCPointer(bcs%region(n)%name,'ibN2', BCVal); BCVal = 0.0_wp call bcs%GetBCPointer(bcs%region(n)%name,'ibN3', BCVal); BCVal = 0.0_wp call bcs%GetBCPointer(bcs%region(n)%name,'ibF1', BCVal); BCVal = 0.0_wp call bcs%GetBCPointer(bcs%region(n)%name,'ibF2', BCVal); BCVal = 0.0_wp call bcs%GetBCPointer(bcs%region(n)%name,'ibF3', BCVal); BCVal = 0.0_wp case (BC_NEUMANN) case (BC_SYMMETRY) call bcs%SetBC(bcs%region(n)%name,BC_SYMMETRY,'ibS' ) call bcs%SetBC(bcs%region(n)%name,BC_SYMMETRY,'ibN1') call bcs%SetBC(bcs%region(n)%name,BC_SYMMETRY,'ibN2') call bcs%SetBC(bcs%region(n)%name,BC_SYMMETRY,'ibN3') call bcs%SetBC(bcs%region(n)%name,BC_SYMMETRY,'ibF1') call bcs%SetBC(bcs%region(n)%name,BC_SYMMETRY,'ibF2') call bcs%SetBC(bcs%region(n)%name,BC_SYMMETRY,'ibF3') end select end do call this%parallel%Lor(ibVFDirichlet,buffL); ibVFDirichlet=buffL ! Determine if we need to apply volume fraction corrections if (.not.ibVFDirichlet) this%singularVF = .true. end if end associate return end subroutine grans_obj_PrepareSolverBCS