49 REAL,
DIMENSION(:,:,:),
ALLOCATABLE :: xvar, & !< characteristic variables for absorbing bc
71 CLASS(Boundary_absorbing),
INTENT(INOUT) :: this
72 CLASS(Mesh_base),
INTENT(IN) :: Mesh
73 CLASS(Physics_base),
INTENT(IN) :: Physics
74 TYPE(Dict_TYP),
POINTER,
INTENT(IN) :: config
75 INTEGER,
INTENT(IN) :: dir
79 CALL this%InitBoundary(mesh,physics,absorbing,
boundcond_name,dir,config)
81 IF (.NOT.physics%supports_absorbing) &
82 CALL this%Error(
"InitBoundary_absorbing", &
83 "boundary condition not supported for this type of physics")
84 SELECT CASE(this%direction%GetType())
86 ALLOCATE(this%xvar(mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,physics%VNUM), &
87 this%lambda(mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,physics%VNUM), &
90 ALLOCATE(this%xvar(mesh%IMIN:mesh%IMAX,mesh%KMIN:mesh%KMAX,physics%VNUM), &
91 this%lambda(mesh%IMIN:mesh%IMAX,mesh%KMIN:mesh%KMAX,physics%VNUM), &
94 ALLOCATE(this%xvar(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,physics%VNUM), &
95 this%lambda(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,physics%VNUM), &
99 CALL this%Error(
"InitBoundary_absorbing",
"Unable to allocate memory.")
101 this%xvar(:,:,:) = 0.0
102 this%lambda(:,:,:) = 0.0
120 REAL,
INTENT(IN) :: time
125 SELECT CASE(
this%direction%GetType())
128 CALL physics%CalculateCharSystemX(mesh,mesh%IMIN,mesh%IMIN+1,pvar,
this%lambda,
this%xvar)
130 WHERE (
this%lambda(:,:,:).GE.0.0)
131 this%xvar(:,:,:) = 0.0
134 CALL physics%CalculateBoundaryDataX(mesh,mesh%IMIN,mesh%IMIN-1,
this%xvar,pvar)
137 pvar%data4d(mesh%IMIN-i,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,:) &
138 = pvar%data4d(mesh%IMIN-1,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,:)
142 CALL physics%CalculateCharSystemX(mesh,mesh%IMAX,mesh%IMAX-1,pvar,
this%lambda,
this%xvar)
144 WHERE (
this%lambda(:,:,:).LE.0.0)
145 this%xvar(:,:,:) = 0.0
148 CALL physics%CalculateBoundaryDataX(mesh,mesh%IMAX,mesh%IMAX+1,
this%xvar,pvar)
151 pvar%data4d(mesh%IMAX+i,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,:) &
152 = pvar%data4d(mesh%IMAX+1,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,:)
156 CALL physics%CalculateCharSystemY(mesh,mesh%JMIN,mesh%JMIN+1,pvar,
this%lambda,
this%xvar)
158 WHERE (
this%lambda(:,:,:).GE.0.0)
159 this%xvar(:,:,:) = 0.0
162 CALL physics%CalculateBoundaryDataY(mesh,mesh%JMIN,mesh%JMIN-1,
this%xvar,pvar)
165 pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN-j,mesh%KMIN:mesh%KMAX,:) &
166 = pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN-1,mesh%KMIN:mesh%KMAX,:)
170 CALL physics%CalculateCharSystemY(mesh,mesh%JMAX,mesh%JMAX-1,pvar,
this%lambda,
this%xvar)
172 WHERE (
this%lambda(:,:,:).LE.0.0)
173 this%xvar(:,:,:) = 0.0
176 CALL physics%CalculateBoundaryDataY(mesh,mesh%JMAX,mesh%JMAX+1,
this%xvar,pvar)
179 pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMAX+j,mesh%KMIN:mesh%KMAX,:) &
180 = pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMAX+1,mesh%KMIN:mesh%KMAX,:)
184 CALL physics%CalculateCharSystemZ(mesh,mesh%KMIN,mesh%KMIN+1,pvar,
this%lambda,
this%xvar)
186 WHERE (
this%lambda(:,:,:).GE.0.0)
187 this%xvar(:,:,:) = 0.0
190 CALL physics%CalculateBoundaryDataZ(mesh,mesh%KMIN,mesh%KMIN-1,
this%xvar,pvar)
193 pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMIN-k,:) &
194 = pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMIN-1,:)
198 CALL physics%CalculateCharSystemZ(mesh,mesh%KMAX,mesh%KMAX-1,pvar,
this%lambda,
this%xvar)
200 WHERE (
this%lambda(:,:,:).LE.0.0)
201 this%xvar(:,:,:) = 0.0
204 CALL physics%CalculateBoundaryDataZ(mesh,mesh%KMAX,mesh%KMAX+1,
this%xvar,pvar)
207 pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMAX+k,:) &
208 = pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN:mesh%JMAX,mesh%KMAX+1,:)
218 CLASS(Boundary_absorbing),
INTENT(INOUT) :: this
220 DEALLOCATE(this%xvar,this%lambda)
221 CALL this%Finalize_base()
subroutine finalize(this)
Destructor for absorbing boundary conditions.
type(logging_base), save this
derived class for compound of mesh arrays
pure subroutine setboundarydata(this, Mesh, Physics, time, pvar)
Applies the absorbing boundary condition.
character(len=32), parameter boundcond_name
subroutine initboundary_absorbing(this, Mesh, Physics, dir, config)
Constructor for absorbing boundary conditions.
Boundary module for absorbing (non-reflecting) conditions.
named integer constants for flavour of state vectors
Dictionary for generic data types.