Defines boundary conditions.
subroutine SetUpCaseBCS() !> Defines boundary conditions. use leapBC implicit none ! Work variables type(bc_set) :: bcs real(wp) :: xhi(3),xlo(3) real(wp) :: Vin real(wp), pointer :: BCVal(:,:,:) ! Get info from parser call parser%Get("Inflow velocity", Vin, 0.0_wp ) ! Initialize utility that handles boundary conditions call bcs%Initialize(block,parallel) ! Setup regions where boundary conditions apply associate (pmin => block%pmin, pmax => block%pmax) xlo = [pmin(1),pmin(2),pmin(3)] xhi = [pmin(1),pmax(2),pmax(3)] call bcs%Add('xL', xlo, xhi, normal = '+x1') xlo = [pmax(1),pmin(2),pmin(3)] xhi = [pmax(1),pmax(2),pmax(3)] call bcs%Add('xR', xlo, xhi, normal = '-x1') xlo = [pmin(1),pmin(2),pmin(3)] xhi = [pmax(1),pmin(2),pmax(3)] call bcs%Add('yL', xlo, xhi, normal = '+x2') xlo = [pmin(1),pmax(2),pmin(3)] xhi = [pmax(1),pmax(2),pmax(3)] call bcs%Add('yR', xlo, xhi, normal = '-x2') end associate ! Flow boundary conditions call bcs%SetBC('yL', BC_OUTFLOW) call bcs%SetBC('yR', BC_OUTFLOW) call bcs%SetBC('xR', BC_OUTFLOW) call bcs%SetBC('xL', BC_INFLOW ) call bcs%GetBCPointer('xL','V1',BCVal); BCVal=Vin call bcs%GetBCPointer('xL','V2',BCVal); BCVal=0.0_wp call bcs%GetBCPointer('xL','V3',BCVal); BCVal=0.0_wp ! Solid volume fraction boundary conditions call bcs%SetBC('xL', BC_DIRICHLET,'ibVF') call bcs%SetBC('xR', BC_DIRICHLET,'ibVF') call bcs%SetBC('yL', BC_DIRICHLET,'ibVF') call bcs%SetBC('yR', BC_DIRICHLET,'ibVF') call bcs%GetBCPointer('xL','ibVF',BCVal); BCVal=0.0_wp call bcs%GetBCPointer('xR','ibVF',BCVal); BCVal=0.0_wp call bcs%GetBCPointer('yL','ibVF',BCVal); BCVal=0.0_wp call bcs%GetBCPointer('yR','ibVF',BCVal); BCVal=0.0_wp ! Write boundary conditions call bcs%Write(0,0.0_wp) ! Clear data call bcs%Finalize() return end subroutine SetUpCaseBCS