Skip to content
Snippets Groups Projects
Commit c88fafb8 authored by HartmutBorth's avatar HartmutBorth
Browse files

indroduced new simulations

parent ce32d6cb
No related branches found
No related tags found
No related merge requests found
...@@ -263,10 +263,12 @@ complex(8) :: phi ...@@ -263,10 +263,12 @@ complex(8) :: phi
integer :: nforc = 0 ! forcing switch integer :: nforc = 0 ! forcing switch
! 0 = no forcing ! 0 = no forcing
! 1 = constant forcing with !
! spectral forcing ring ! 1 = constant frocing defined by external field
! 2 = markov chain ! 2 = spectral forcing with constant amplitudes
! 3 = forcing with constant wave numbers ! forcing ring and random phases
! 3 = markov chain
! 4 = forcing with constant wave numbers
! but random uncorrelated phases (white noise) ! but random uncorrelated phases (white noise)
integer :: kfmin = 0 ! min radius = sqrt(kfmin) of spectr. forcing integer :: kfmin = 0 ! min radius = sqrt(kfmin) of spectr. forcing
...@@ -387,8 +389,17 @@ integer :: ndatim(6) = 1 ! date/time display ...@@ -387,8 +389,17 @@ integer :: ndatim(6) = 1 ! date/time display
real(4) :: parc(5) = 0.0 ! timeseries display real(4) :: parc(5) = 0.0 ! timeseries display
!--- predefined simulations (simmod) !--- code of predefined simulations (simmod)
integer :: nsim = 0 ! 1/0 predefined simulations on/off. integer :: nsim = 0 ! 0 no predefined simulation is specified
! nsim > 0 predefined simulation is run
!
! available predefined simulations (experiments):
! -----------------------------------------------
! code name
!
! 1 decaying_jet01
! -----------------------------------------------
!
! Predefined simulations are specified in ! Predefined simulations are specified in
! <sim_namelist> of simmod. ! <sim_namelist> of simmod.
...@@ -1614,6 +1625,9 @@ enf=0.d0 ...@@ -1614,6 +1625,9 @@ enf=0.d0
select case (nforc) select case (nforc)
case (1) case (1)
cq = cq + cqfrc
case (2)
do ifk = 1,nk do ifk = 1,nk
i = in(ifk,1) i = in(ifk,1)
j = in(ifk,2) j = in(ifk,2)
...@@ -1625,7 +1639,7 @@ select case (nforc) ...@@ -1625,7 +1639,7 @@ select case (nforc)
enf = enf+(cq(i,j)*cq(i,j))/k2 enf = enf+(cq(i,j)*cq(i,j))/k2
enddo enddo
case (2) case (3)
ic=tstep+1 ic=tstep+1
if (mod(ic,itau).eq.0.) then if (mod(ic,itau).eq.0.) then
call random_number(ran4) call random_number(ran4)
...@@ -1642,7 +1656,7 @@ select case (nforc) ...@@ -1642,7 +1656,7 @@ select case (nforc)
enf=enf+(cq(i,j)*cq(i,j))/k2 enf=enf+(cq(i,j)*cq(i,j))/k2
enddo enddo
case (3) case (4)
do ifk=1,nk do ifk=1,nk
i = in(ifk,1) i = in(ifk,1)
j = in(ifk,2) j = in(ifk,2)
...@@ -1654,9 +1668,6 @@ select case (nforc) ...@@ -1654,9 +1668,6 @@ select case (nforc)
enf=enf+(cq(i,j)*cq(i,j))/k2 enf=enf+(cq(i,j)*cq(i,j))/k2
enddo enddo
case (4)
cq = cq + cqfrc
end select end select
return return
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
dt = 1.0d-3 dt = 1.0d-3
myseed = 1,2,3,4,5,6,7,8 myseed = 1,2,3,4,5,6,7,8
outsp = 138 outsp = 138
nsteps = 200000 nsteps = 2000000
ngp = 250 ngp = 250
nstdout = 10000 nstdout = 10000
ncfl = 500 ncfl = 10000
npert = 2 npert = 3
apert = 0.00001 apert = 0.00001
nforc = 0 nforc = 4
kfmin = 5 kfmin = 5
kfmax = 7 kfmax = 7
aforc = 0.0001 aforc = 0.0001
......
...@@ -16,7 +16,7 @@ integer, parameter :: nusimsp = 130 ! spectral fields ...@@ -16,7 +16,7 @@ integer, parameter :: nusimsp = 130 ! spectral fields
character (256) :: sim_namelist = "sim_namelist" character (256) :: sim_namelist = "sim_namelist"
!--- predefined experimets !--- predefined experimets
character (256) :: sim = "iv00" ! type of predefined simulation character (256) :: ysim = "djet01" ! type of predefined simulation
! options are: ! options are:
!----------------------------------! !----------------------------------!
...@@ -24,27 +24,34 @@ character (256) :: sim = "iv00" ! type of predefined simulation ...@@ -24,27 +24,34 @@ character (256) :: sim = "iv00" ! type of predefined simulation
! flows) ! ! flows) !
!----------------------------------! !----------------------------------!
! "iv00" top hat jet ! "djet01" decaying top hat jet
!-----------------------! !-----------------------!
! Forced decaying Flows ! ! Forced decaying Flows !
!-----------------------! !-----------------------!
! "fd00" top hat wind forcing ! "fjet01" forced top hat jet
!--- parameters of djet01 (initial top hat jet)
integer :: w1 = 8 ! half width of jet center (in grid points)
integer :: w2 = 4 ! width of vortex sheet (in grid points)
integer :: scl = 1 ! horizontal scale of jet
real(8) :: qmax = 1.0 ! amplitude of vortex sheets
!--- parameters of iv01 (initial top hat jet)
integer :: iv00w1 = 8 ! half width of jet center (in grid points)
integer :: iv00w2 = 4 ! width of vortex sheet (in grid points)
integer :: iv00scl = 1 ! horizontal scale of jet
real(8) :: iv00qmax = 1.0 ! amplitude of vortex sheets
!--- parameters of fd01 (forced decaying top hat jet) !--- sim_namelist parameters to overwrite cat_namelist parameters
integer :: fd00w1 = 8 ! half width of jet center (in grid points)
integer :: fd00w2 = 4 ! width of vortex sheet (in grid points) !---------------------------------------------------------------!
integer :: fd00scl = 1 ! horizontal scale of jet ! A sim_namelist parameter sXXXXX corresponds to a cat_namelist !
real(8) :: fd00qmax = 1.0d-4 ! amplitude of vortex sheets ! parameter XXXXX. The sim_namelist parameters sXXXXX can only !
! take the same values as the corresponding cat_namelist !
! parameter. !
!---------------------------------------------------------------!
integer :: snforc = -1 ! type of forcing
integer :: snpert = -1 ! type of perturbation
integer :: snpost = -1 ! type of post processing
end module simmod end module simmod
...@@ -71,9 +78,9 @@ use simmod ...@@ -71,9 +78,9 @@ use simmod
implicit none implicit none
!--- define sim_namelist !--- define sim_namelist
namelist /sim_nl/ sim , & namelist /sim_nl/ ysim , &
iv00qmax ,iv00w1 ,iv00w2 ,iv00scl, & qmax ,w1 ,w2 ,scl ,&
fd00qmax ,fd00w1 ,fd00w2 ,fd00scl snpert ,snforc ,snpost
!--- check if sim_namelist is present !--- check if sim_namelist is present
inquire(file=sim_namelist,exist=lsimnl) inquire(file=sim_namelist,exist=lsimnl)
...@@ -86,6 +93,10 @@ else ...@@ -86,6 +93,10 @@ else
return return
endif endif
!--- overwrite cat_namelist parameters
if (snpert .ge. 0) npert = snpert
if (snforc .ge. 0) nforc = snforc
if (snpost .ge. 0) npost = snpost
return return
end subroutine sim_readnl end subroutine sim_readnl
...@@ -103,40 +114,41 @@ integer :: jy ...@@ -103,40 +114,41 @@ integer :: jy
real(8) :: gpvar(1:ngx,1:ngy) real(8) :: gpvar(1:ngx,1:ngy)
select case(sim) select case(ysim)
!------------------------! !------------------------!
! initial value problems ! ! initial value problems !
!------------------------! !------------------------!
!--- top-hat jet !--- top-hat jet
case("iv00") case("djet01")
gpvar(:,:) = 0.0 gpvar(:,:) = 0.0
do jy = 1, ngy do jy = 1, ngy
if ( jy .ge. ngy/2+1-iv00scl*(iv00w1+iv00w2) .and. & if ( jy .ge. ngy/2+1-scl*(w1+w2) .and. &
jy .le. ngy/2-iv00scl*iv00w1 ) then jy .le. ngy/2-scl*w1 ) then
gpvar(:,jy) = -iv00qmax gpvar(:,jy) = -qmax
endif endif
if ( jy .ge. ngy/2+1+iv00scl*iv00w1 .and. & if ( jy .ge. ngy/2+1+scl*w1 .and. &
jy .le. ngy/2+iv00scl*(iv00w1+iv00w2) ) then jy .le. ngy/2+scl*(w1+w2) ) then
gpvar(:,jy) = iv00qmax gpvar(:,jy) = qmax
endif endif
enddo enddo
call sim_wrtgp(gpvar,qcde,1) call sim_wrtgp(gpvar,qcde,1)
!-------------------! !-------------------!
! forced turbulence ! ! forced turbulence !
!-------------------! !-------------------!
!--- top-hat jet !--- top-hat jet
case("fd00") case("fjet01")
gpvar(:,:) = 0.0 gpvar(:,:) = 0.0
do jy = 1, ngy do jy = 1, ngy
if ( jy .ge. ngy/2+1-fd00scl*(fd00w1+fd00w2) .and. & if ( jy .ge. ngy/2+1-scl*(w1+w2) .and. &
jy .le. ngy/2-fd00scl*fd00w1 ) then jy .le. ngy/2-scl*w1 ) then
gpvar(:,jy) = -fd00qmax gpvar(:,jy) = -qmax
endif endif
if ( jy .ge. ngy/2+1+fd00scl*fd00w1 .and. & if ( jy .ge. ngy/2+1+scl*w1 .and. &
jy .le. ngy/2+fd00scl*(fd00w1+fd00w2) ) then jy .le. ngy/2+scl*(w1+w2) ) then
gpvar(:,jy) = fd00qmax gpvar(:,jy) = qmax
endif endif
enddo enddo
call sim_wrtgp(gpvar,qfrccde,1) call sim_wrtgp(gpvar,qfrccde,1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment