81 REAL :: velocity_offset
82 REAL,
DIMENSION(:),
POINTER :: velocity_shift
98 CLASS(boundary_shearing),
INTENT(INOUT) :: this
99 CLASS(mesh_base),
INTENT(IN) :: Mesh
100 CLASS(physics_base),
INTENT(IN) :: Physics
101 TYPE(Dict_TYP),
POINTER :: config
102 INTEGER,
INTENT(IN) :: dir
106 CALL this%InitBoundary(mesh,physics,shearing,
boundcond_name,dir,config)
109 this%velocity_shift(physics%VNUM+physics%PNUM), &
112 CALL this%Error(
"InitBoundary_shearing",
"Unable to allocate memory.")
115 DO l=1,physics%VNUM + physics%PNUM
117 IF (mesh%shear_dir.EQ.2)
THEN 118 IF (l.EQ.physics%YVELOCITY)
THEN 119 IF (mesh%FARGO.EQ.0)
THEN 120 this%velocity_shift(l) = mesh%Q*mesh%OMEGA*(mesh%xmax-mesh%xmin)
121 ELSE IF (mesh%FARGO.EQ.3)
THEN 122 this%velocity_shift(l) = 0.0
124 CALL this%Error(
"InitTimedisc", &
125 "Shearing boundaries are only compatible without Fargo or Fargo type 3 (shearing box).")
128 this%velocity_shift(l) = 0.0
131 ELSE IF (mesh%shear_dir.EQ.1)
THEN 132 IF (l.EQ.physics%XVELOCITY)
THEN 133 IF (mesh%FARGO.EQ.0)
THEN 134 this%velocity_shift(l) = mesh%Q*mesh%OMEGA*(mesh%ymax-mesh%ymin)
135 ELSE IF (mesh%FARGO.EQ.3)
THEN 136 this%velocity_shift(l) = 0.0
138 CALL this%Error(
"InitTimedisc", &
139 "Shearing boundaries are only compatible without Fargo or Fargo type 3 (shearing box).")
142 this%velocity_shift(l) = 0.0
145 CALL this%Error(
"InitBoundary", &
146 "Shearing boundaries in top/south direction not allowed, yet.")
149 this%velocity_offset = mesh%Q*mesh%OMEGA*(mesh%xmax-mesh%xmin)/mesh%dy
196 REAL,
INTENT(IN) :: time
199 INTEGER :: i,j,k,l,intshift
200 REAL :: offremain,offset,offset_tmp
202 INTEGER :: status(mpi_status_size)
203 INTEGER :: ierror,req(4)
204 CHARACTER(LEN=80) :: str
205 REAL :: mpi_buf(2*mesh%gnum)
210 CALL this%boundary_periodic%SetBoundaryData(mesh,physics,time,pvar)
215 offset = -
this%velocity_offset*time
217 offset = offset + mesh%JNUM
220 DO l=1,physics%VNUM+physics%PNUM
222 SELECT CASE(
this%GetDirection())
225 intshift = floor(offset_tmp)
226 offremain = offset_tmp - intshift
229 pvar%data4d(mesh%IMIN-i,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,l) = &
230 cshift(pvar%data4d(mesh%IMIN-i,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,l),intshift)
232 pvar%data4d(mesh%IMIN-i,mesh%JMAX+1,:,l) = pvar%data4d(mesh%IMIN-i,mesh%JMIN,:,l)
233 DO k=mesh%KMIN,mesh%KMAX
234 DO j=mesh%JMIN,mesh%JMAX
235 pvar%data4d(mesh%IMIN-i,j,k,l) = (1.0 - offremain)*pvar%data4d(mesh%IMIN-i,j,k,l) + &
236 offremain*pvar%data4d(mesh%IMIN-i,j+1,k,l) +
this%velocity_shift(l)
242 intshift = floor(offset_tmp)
243 offremain = offset_tmp - intshift
246 pvar%data4d(mesh%IMAX+i,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,l) = &
247 cshift(pvar%data4d(mesh%IMAX+i,mesh%JMIN:mesh%JMAX,mesh%KMIN:mesh%KMAX,l),intshift)
249 pvar%data4d(mesh%IMAX+i,mesh%JMAX+1,:,l) = pvar%data4d(mesh%IMAX+i,mesh%JMIN,:,l)
250 DO k=mesh%KMIN,mesh%KMAX
251 DO j=mesh%JMIN,mesh%JMAX
252 pvar%data4d(mesh%IMAX+i,j,k,l) = (1.0 - offremain)*pvar%data4d(mesh%IMAX+i,j,k,l) + &
253 offremain*pvar%data4d(mesh%IMAX+i,j+1,k,l) -
this%velocity_shift(l)
259 intshift = floor(offset_tmp)
260 offremain = offset_tmp - intshift
263 pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN-j,mesh%KMIN:mesh%KMAX,l) = &
264 cshift(pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMIN-j,mesh%KMIN:mesh%KMAX,l),intshift)
266 pvar%data4d(mesh%IMAX+1,mesh%JMIN-j,:,l) = pvar%data4d(mesh%IMIN,mesh%JMIN-j,:,l)
267 DO k=mesh%KMIN,mesh%KMAX
268 DO i=mesh%IMIN,mesh%IMAX
269 pvar%data4d(i,mesh%JMIN-j,k,l) = (1.0 - offremain)*pvar%data4d(i,mesh%JMIN-j,k,l) + &
270 offremain*pvar%data4d(i+1,mesh%JMIN-j,k,l) -
this%velocity_shift(l)
276 intshift = floor(offset_tmp)
277 offremain = offset_tmp - intshift
280 pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMAX+j,mesh%KMIN:mesh%KMAX,l) = &
281 cshift(pvar%data4d(mesh%IMIN:mesh%IMAX,mesh%JMAX+j,mesh%KMIN:mesh%KMAX,l),intshift)
283 pvar%data4d(mesh%IMAX+1,mesh%JMAX+j,:,l) = pvar%data4d(mesh%IMIN,mesh%JMAX+j,:,l)
284 DO k=mesh%KMIN,mesh%KMAX
285 DO i=mesh%IMIN,mesh%IMAX
286 pvar%data4d(i,mesh%JMAX+j,k,l) = (1.0 - offremain)*pvar%data4d(i,mesh%JMAX+j,k,l) + &
287 offremain*pvar%data4d(i+1,mesh%JMAX+j,k,l) +
this%velocity_shift(l)
304 CLASS(boundary_shearing),
INTENT(INOUT) :: this
306 DEALLOCATE(this%velocity_shift)
307 CALL this%Finalize_base()
type(logging_base), save this
derived class for compound of mesh arrays
subroutine finalize(this)
Destructor for periodic boundary conditions.
pure subroutine setboundarydata(this, Mesh, Physics, time, pvar)
Applies the periodic boundary condition.
character(len=32), parameter boundcond_name
subroutine initboundary_shearing(this, Mesh, Physics, dir, config)
Constructor for shearing boundary conditions.
named integer constants for flavour of state vectors
Dictionary for generic data types.
Boundary module for periodic boundary conditions.
Boundary module for a shearingsheet/shearingbox. (see e.g. the standard run )