32 $
'module ['//trim(spnb_name)//
'] already registered')
41 $
'Parent module ['//
'FRAME'//
'] not registered')
46 $
'Sponge/fringe for rectangular domain')
51 $
'spnb_INI',
'Sponge calculation initialisation time',.false.)
54 call rprm_sec_reg(spnb_sec_id,spnb_id,
'_'//adjustl(spnb_name),
55 $
'Runtime paramere section for sponge box module')
59 call rprm_rp_reg(spnb_str_id,spnb_sec_id,
'STRENGTH',
60 $
'Sponge strength',rpar_real,0,0.0,.false.,
' ')
62 call rprm_rp_reg(spnb_wl_id(1),spnb_sec_id,
'WIDTHLX',
63 $
'Sponge left section width; dimension X ',
64 $ rpar_real,0,0.0,.false.,
' ')
66 call rprm_rp_reg(spnb_wl_id(2),spnb_sec_id,
'WIDTHLY',
67 $
'Sponge left section width; dimension Y ',
68 $ rpar_real,0,0.0,.false.,
' ')
70 if (if3d)
call rprm_rp_reg(spnb_wl_id(ndim),spnb_sec_id,
71 $
'WIDTHLZ',
'Sponge left section width; dimension Z ',
72 $ rpar_real,0,0.0,.false.,
' ')
74 call rprm_rp_reg(spnb_wr_id(1),spnb_sec_id,
'WIDTHRX',
75 $
'Sponge right section width; dimension X ',
76 $ rpar_real,0,0.0,.false.,
' ')
78 call rprm_rp_reg(spnb_wr_id(2),spnb_sec_id,
'WIDTHRY',
79 $
'Sponge right section width; dimension Y ',
80 $ rpar_real,0,0.0,.false.,
' ')
82 if (if3d)
call rprm_rp_reg(spnb_wr_id(ndim),spnb_sec_id,
83 $
'WIDTHRZ',
'Sponge right section width; dimension Z ',
84 $ rpar_real,0,0.0,.false.,
' ')
86 call rprm_rp_reg(spnb_dl_id(1),spnb_sec_id,
'DROPLX',
87 $
'Sponge left drop/rise section width; dimension X ',
88 $ rpar_real,0,0.0,.false.,
' ')
90 call rprm_rp_reg(spnb_dl_id(2),spnb_sec_id,
'DROPLY',
91 $
'Sponge left drop/rise section width; dimension Y ',
92 $ rpar_real,0,0.0,.false.,
' ')
94 if (if3d)
call rprm_rp_reg(spnb_dl_id(ndim),spnb_sec_id,
95 $
'DROPLZ',
'Sponge left drop/rise section width; dimension Z ',
96 $ rpar_real,0,0.0,.false.,
' ')
98 call rprm_rp_reg(spnb_dr_id(1),spnb_sec_id,
'DROPRX',
99 $
'Sponge right drop/rise section width; dimension X ',
100 $ rpar_real,0,0.0,.false.,
' ')
102 call rprm_rp_reg(spnb_dr_id(2),spnb_sec_id,
'DROPRY',
103 $
'Sponge right drop/rise section width; dimension Y ',
104 $ rpar_real,0,0.0,.false.,
' ')
106 if (if3d)
call rprm_rp_reg(spnb_dr_id(ndim),spnb_sec_id,
107 $
'DROPRZ',
'Sponge right drop/rise section width; dimension Z ',
108 $ rpar_real,0,0.0,.false.,
' ')
111 ltim = dnekclock() - ltim
132 real lvx(LX1*LY1*LZ1*LELV),lvy(LX1*LY1*LZ1*LELV),
133 $ lvz(LX1*LY1*LZ1*LELV)
136 integer ierr, nhour, nmin
143 real bmin(LDIM), bmax(LDIM)
145 real xxmax, xxmax_c, xxmin, xxmin_c, arg
146 real lcoord(LX1*LY1*LZ1*LELV)
147 common /scruz/ lcoord
150 real dnekclock, glmin, glmax, math_stepf
153 if (spnb_ifinit)
then
155 $
'module ['//trim(spnb_name)//
'] already initiaised.')
163 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_str_id,rpar_real)
166 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_wl_id(1),rpar_real)
169 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_wl_id(2),rpar_real)
173 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_wl_id(ndim),
178 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_wr_id(1),rpar_real)
181 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_wr_id(2),rpar_real)
185 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_wr_id(ndim),
190 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_dl_id(1),rpar_real)
193 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_dl_id(2),rpar_real)
197 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_dl_id(ndim),
202 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_dr_id(1),rpar_real)
205 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_dr_id(2),rpar_real)
209 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,spnb_dr_id(ndim),
217 ntot = nx1*ny1*nz1*nelv
218 bmin(1) = glmin(xm1,ntot)
219 bmax(1) = glmax(xm1,ntot)
220 bmin(2) = glmin(ym1,ntot)
221 bmax(2) = glmax(ym1,ntot)
223 bmin(ndim) = glmin(zm1,ntot)
224 bmax(ndim) = glmax(zm1,ntot)
228 call rzero(spnb_fun,ntot)
246 if(spnb_str.gt.0.0)
then
247 call mntr_log(spnb_id,lp_inf,
"Sponge turned on")
250 call copy(spnb_vr(1,1),lvx, ntot)
251 call copy(spnb_vr(1,2),lvy, ntot)
252 if (if3d)
call copy(spnb_vr(1,ndim),lvz, ntot)
257 if (spnb_wl(il).gt.0.0.or.spnb_wr(il).gt.0.0)
then
258 if (spnb_wl(il).lt.spnb_dl(il).or.
259 $ spnb_wr(il).lt.spnb_dr(il))
then
260 call mntr_abort(spnb_id,
"Wrong sponge parameters")
264 xxmax = bmax(il) - spnb_wr(il)
266 xxmin = bmin(il) + spnb_wl(il)
268 xxmax_c = xxmax + spnb_dr(il)
270 xxmin_c = xxmin - spnb_dl(il)
273 if (xxmax.le.xxmin)
then
278 call copy(lcoord,xm1, ntot)
279 elseif (il.eq.2)
then
280 call copy(lcoord,ym1, ntot)
281 elseif (il.eq.3)
then
282 call copy(lcoord,zm1, ntot)
287 if(rtmp.lt.xxmin_c)
then
289 elseif(rtmp.lt.xxmin)
then
290 arg = (xxmin-rtmp)/spnb_dl(il)
291 rtmp = spnb_str*math_stepf(arg)
292 elseif (rtmp.le.xxmax)
then
294 elseif (rtmp.lt.xxmax_c)
then
295 arg = (rtmp-xxmax)/spnb_dr(il)
296 rtmp = spnb_str*math_stepf(arg)
300 spnb_fun(jl)=max(spnb_fun(jl),rtmp)
315 call outpost2(spnb_vr,spnb_vr(1,2),spnb_vr(1,ndim),spnb_fun,
324 ltim = dnekclock() - ltim
366 if (spnb_str.gt.0.0)
then
367 ip=ix+nx1*(iy-1+ny1*(iz-1+nz1*(iel-1)))
371 ffx = ffx + spnb_fun(ip)*(spnb_vr(ip,1) - vx(ix,iy,iz,iel))
372 ffy = ffy + spnb_fun(ip)*(spnb_vr(ip,2) - vy(ix,iy,iz,iel))
373 if (if3d) ffz = ffz + spnb_fun(ip)*
374 $ (spnb_vr(ip,ndim) - vz(ix,iy,iz,iel))
377 ffx = ffx - spnb_fun(ip)*vxp(ip,jp)
378 ffy = ffy - spnb_fun(ip)*vyp(ip,jp)
379 if(if3d) ffz = ffz - spnb_fun(ip)*vzp(ip,jp)
integer function gllel(ieg)
subroutine mntr_tmr_is_name_reg(mid, mname)
Check if timer name is registered and return its id.
subroutine mntr_warn(mid, logs)
Write warning message.
subroutine mntr_tmr_add(mid, icount, time)
Check if timer id is registered. This operation is performed locally.
subroutine mntr_mod_is_name_reg(mid, mname)
Check if module name is registered and return its id.
subroutine mntr_abort(mid, logs)
Abort simulation.
subroutine mntr_log(mid, priority, logs)
Write log message.
subroutine mntr_mod_reg(mid, pmid, mname, mdscr)
Register new module.
subroutine mntr_tmr_reg(mid, pmid, modid, mname, mdscr, ifsum)
Register new timer.
subroutine rprm_rp_get(ipval, rpval, lpval, cpval, rpid, ptype)
Get runtime parameter form active section. This operation is performed locally.
subroutine rprm_rp_reg(rpid, mid, pname, pdscr, ptype, ipval, rpval, lpval, cpval)
Register new runtime parameter.
subroutine rprm_sec_set_act(ifact, rpid)
Set section's activation flag. Master value is broadcasted.
subroutine rprm_sec_reg(rpid, mid, pname, pdscr)
Register new parameter section.
subroutine spnb_init(lvx, lvy, lvz)
Initilise sponge box module.
subroutine spnb_forcing(ffx, ffy, ffz, ix, iy, iz, ieg)
Get sponge forcing.
subroutine spnb_register()
Register sponge box module.
logical function spnb_is_initialised()
Check if module was initialised.
subroutine outpost2(v1, v2, v3, vp, vt, nfldt, name3)