Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fangjian authored and fangjian committed Jan 31, 2024
1 parent 8221437 commit fc1c7d1
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 4 deletions.
60 changes: 60 additions & 0 deletions examples/Taylor_Green_Vortex/datin/input.tgv2d
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
########################################################################
# input file of ASTR code #
########################################################################

# flowtype : The type of flow problem
tgv

# im,jm,km : The size of grid.
128,128,0

# lihomo,ljhomo,lkhomo : The homogeneous directions
t,t,t

# nondimen,diffterm,lfilter,lreadgrid,lfftz,limmbou,ltimrpt,lcomb : Parameters
t,t,t,f,f,f,t,f

# lrestar : start mode
f

# alfa_filter, kcutoff : Filter parameters
0.49d0, 48

# ref_t,reynolds,mach : Reference variables
273.15d0, 1600.d0, 0.1d0

# conschm,difschm,rkscheme,odetype : Numerical scheme
642c, 642c, rk3, rk3

# recon_schem, lchardecomp,bfacmpld,shkcrt : Parameters for upwind-biased scheme
5, t, 0.3d0, 0.05d0

# num_species : number of species
0

# turbmode,iomode : turbulence model
none,h

# bctype : Boundary condition definition
1
1
1
1
1
1

# ninit : Initial method
0

# spg_imin,spg_imax,spg_jmin,spg_jmax,spg_kmin,spg_kmax : Sponge layer range
0, 0, 0, 0, 0, 0

# gridfile
datin/grid.h5


########################################################################
# bctype #
# 1 : periodic bc, nothing will be done. #
# 41 : isothermal wall, wall temperature input. #
########################################################################
11 changes: 11 additions & 0 deletions script/setup_a_case.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# this is a bash script to setup a ASTR case

ASTR_DIR="$(dirname "$(readlink -f "$0")")"

echo "ASTR directory: $ASTR_DIR"

cp -v $ASTR_DIR/Makefile ./
cp -vr $ASTR_DIR//examples/Taylor_Green_Vortex/datin ./

mkdir "./user_define_module"
cp -v $ASTR_DIR/user_define_module/userdefine.F90 ./user_define_module/
13 changes: 9 additions & 4 deletions src/statistic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ subroutine turbstats
type(tsta) :: stas
!
integer :: i,j,k,ns
real(8) :: s11,s12,s13,s22,s23,s33,div,miu,dissa
real(8) :: s11,s12,s13,s22,s23,s33,div,miu,dissa,rhoavg
real(8) :: rsamples,miudrho,dudx2,csavg,v2,cs,ufluc
!
logical :: fex
Expand All @@ -490,6 +490,7 @@ subroutine turbstats
dudx2=0.d0
csavg=0.d0
dissa=0.d0
rhoavg=0.d0
do k=1,km
do j=1,jm
do i=1,im
Expand Down Expand Up @@ -519,6 +520,8 @@ subroutine turbstats
!
miudrho=miudrho+miu/rho(i,j,k)
!
rhoavg=rhoavg+rho(i,j,k)
!
csavg=csavg+cs
!
stas%machrms=stas%machrms+v2/(cs*cs)
Expand All @@ -533,6 +536,7 @@ subroutine turbstats
stas%urms = sqrt(psum(stas%urms)/rsamples)
dudx2 = num1d3*psum(dudx2)/rsamples
miudrho = psum(miudrho)/rsamples
rhoavg = psum(rhoavg)/rsamples
csavg = psum(csavg)/rsamples
dissa = psum(dissa)/rsamples
!
Expand All @@ -545,12 +549,13 @@ subroutine turbstats
stas%macht = stas%urms/csavg
stas%taylorlength = ufluc/sqrt(dudx2)
stas%retaylor = ufluc*stas%taylorlength/miudrho
stas%kolmoglength = sqrt(sqrt(miudrho**3/dissa))
stas%kolmoglength = sqrt(sqrt(miudrho**3/dissa/rhoavg))
! stas%kolmogvelocity= sqrt(sqrt(dissipation*miudrho))
! stas%kolmogtime = sqrt(miudrho/dissipation)
!
if(lio) call listwrite(hand_fs,stas%urms,stas%taylorlength, &
stas%kolmoglength,stas%Retaylor,stas%machrms,stas%macht,stas%rhoe)
if(lio) call listwrite(hand_fs,stas%urms,stas%taylorlength, &
stas%kolmoglength,stas%Retaylor,stas%machrms, &
stas%macht,stas%rhoe)
!
end subroutine turbstats
!+-------------------------------------------------------------------+
Expand Down

0 comments on commit fc1c7d1

Please sign in to comment.