12 subroutine bc_phys(iside,idims,time,qdt,s,ixG^L,ixB^L)
20 integer,
intent(in) :: iside, idims, ixg^
l,ixb^
l
21 double precision,
intent(in) :: time,qdt
22 type(state),
intent(inout) :: s
24 double precision :: q(ixg^s),qp(ixg^s)
25 integer :: idir, ixos^
l,hxo^
l,jxo^
l
26 integer :: iw, ib, ix^
d, ixo^
l
28 associate(x=>s%x,w=>s%w,ws=>s%ws)
42 do ix^
d=ixomin^
d,ixomax^
d
43 w(ix^
d^
d%ixO^s,iw) = w(ixomin^
d-1^
d%ixO^s,iw)
53 do ix^
d=ixomin^
d,ixomax^
d
54 w(ix^
d^
d%ixO^s,iw) = max(w(ixomin^
d-1^
d%ixO^s,iw),zero)
57 do ix^
d=ixomin^
d,ixomax^
d
58 w(ix^
d^
d%ixO^s,iw) = w(ixomin^
d-1^
d%ixO^s,iw)
63 w(ixo^s,iw) = - w(ixo^s,iw)
71 write (
unitterm,*)
"Undefined boundarytype found in bc_phys", &
72 "for variable iw=",iw,
" and side iB=",ib
80 ixosmin^dd=ixomin^dd-
kr(^dd,idir);
85 do ix^
d=ixosmin^
d,ixosmax^
d
86 ws(ix^
d^
d%ixOs^s,idir) = ws(ixosmin^
d-1^
d%ixOs^s,idir)
89 ws(ixos^s,idir) = ws(ixosmin^
d-1:ixosmin^
d-
nghostcells:-1^
d%ixOs^s,idir)
91 ws(ixos^s,idir) =-ws(ixosmin^
d-1:ixosmin^
d-
nghostcells:-1^
d%ixOs^s,idir)
94 write (
unitterm,*)
"Undefined boundarytype found in bc_phys", &
95 "for variable iw=",iw,
" and side iB=",ib
113 ws(ixosmin^
d+ix^
d^
d%ixOs^s,idir)=&
114 (q(hxomax^
d^
d%hxO^s)*s%dvolume(hxomax^
d^
d%hxO^s)&
115 -qp(ixomin^
d+ix^
d^
d%ixO^s)*s%dvolume(ixomin^
d+ix^
d^
d%ixO^s))&
116 /s%surfaceC(ixosmin^
d+ix^
d^
d%ixOs^s,^
d)
122 ws(ixos^s,idir)= ws(ixosmin^
d-2:ixosmin^
d-
nghostcells-1:-1^
d%ixOs^s,idir)
127 ws(ixos^s,idir)=-ws(ixosmin^
d-2:ixosmin^
d-
nghostcells-1:-1^
d%ixOs^s,idir)
147 do ix^
d=ixomin^
d,ixomax^
d
148 w(ix^
d^
d%ixO^s,iw) = w(ixomax^
d+1^
d%ixO^s,iw)
158 do ix^
d=ixomin^
d,ixomax^
d
159 w(ix^
d^
d%ixO^s,iw) = min(w(ixomax^
d+1^
d%ixO^s,iw),zero)
162 do ix^
d=ixomin^
d,ixomax^
d
163 w(ix^
d^
d%ixO^s,iw) = w(ixomax^
d+1^
d%ixO^s,iw)
168 w(ixo^s,iw) = - w(ixo^s,iw)
176 write (
unitterm,*)
"Undefined boundarytype found in bc_phys", &
177 "for variable iw=",iw,
" and side iB=",ib
184 ixosmax^dd=ixomax^dd;
185 ixosmin^dd=ixomin^dd-
kr(^dd,idir);
190 do ix^
d=ixosmin^
d,ixosmax^
d
191 ws(ix^
d^
d%ixOs^s,idir) = ws(ixosmax^
d+1^
d%ixOs^s,idir)
194 ws(ixos^s,idir) = ws(ixosmax^
d+
nghostcells:ixosmax^
d+1:-1^
d%ixOs^s,idir)
196 ws(ixos^s,idir) =-ws(ixosmax^
d+
nghostcells:ixosmax^
d+1:-1^
d%ixOs^s,idir)
199 write (
unitterm,*)
"Undefined boundarytype in bc_phys", &
200 "for variable iw=",iw,
" and side iB=",ib
209 ixos^
l=ixo^
l-
kr(^dd,^
d);
218 ws(ixosmax^
d-ix^
d^
d%ixOs^s,idir)=&
219 -(q(jxomin^
d^
d%jxO^s)*s%dvolume(jxomin^
d^
d%jxO^s)&
220 -qp(ixomax^
d-ix^
d^
d%ixO^s)*s%dvolume(ixomax^
d-ix^
d^
d%ixO^s))&
221 /s%surfaceC(ixosmax^
d-ix^
d^
d%ixOs^s,^
d)
227 ws(ixos^s,idir)= ws(ixosmax^
d+
nghostcells+1:ixosmax^
d+2:-1^
d%ixOs^s,idir)
232 ws(ixos^s,idir)=-ws(ixosmax^
d+
nghostcells+1:ixosmax^
d+2:-1^
d%ixOs^s,idir)
247 call mpistop(
"usr_special_bc not defined")
260 call mpistop(
"usr_special_bc not defined")
272 double precision,
intent(in) :: time
273 integer,
intent(in) :: ixg^
l
275 integer :: iigrid, igrid, ixo^
l
277 ixo^
l=ixg^
l^lsubnghostcells;
280 do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
Module to set boundary conditions from user data.
subroutine, public bc_data_set(qt, ixil, ixol, ib, w, x)
Set boundary conditions according to user data.
subroutine, public getintbc(time, ixgl)
fill inner boundary values
subroutine, public bc_phys(iside, idims, time, qdt, s, ixgl, ixbl)
fill ghost cells at a physical boundary
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
subroutine, public get_divb(w, ixil, ixol, divb, nth_in)
Calculate div B within ixO.
This module contains definitions of global parameters and variables and some generic functions/subrou...
type(state), pointer block
Block pointer for using one block and its previous state.
integer, parameter bc_noinflow
integer, parameter bc_asymm
integer, dimension(3, 3) kr
Kronecker delta tensor.
integer, parameter bc_character
integer, dimension(:, :), allocatable typeboundary
Array indicating the type of boundary condition per variable and per physical boundary.
logical stagger_grid
True for using stagger grid.
integer, parameter bc_data
integer, parameter plevel_
double precision, dimension(:), allocatable, parameter d
integer, parameter bc_periodic
integer, parameter bc_special
boundary condition types
integer, parameter unitterm
Unit for standard output.
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
integer, parameter bc_cont
integer, parameter bc_icarus
integer nghostcells
Number of ghost cells surrounding a grid.
integer, parameter bc_symm
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
integer, parameter bc_aperiodic
integer, dimension(:,:), allocatable node
This module defines the procedures of a physics module. It contains function pointers for the various...
procedure(sub_face_to_center), pointer phys_face_to_center
Module with all the methods that users can customize in AMRVAC.
procedure(special_bc), pointer usr_special_bc
procedure(internal_bc), pointer usr_internal_bc