Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 70 additions & 1 deletion common/ModIO.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module ModIO
ReadRestart, &
ReadRestart_NoWalls, &
ExportWriteRBC, &
ImportReadRBC
ImportReadRBC, &
WriteManyRBCsByType

contains

Expand Down Expand Up @@ -94,6 +95,13 @@ subroutine WriteAll(lt, time)
call WriteManyRBCs(fn, nrbc, rbcs)
write(fn, FMT=fn_FMT) 'D/', 'xe', lt, '.dat'
call WriteExactPts(fn, nrbc, rbcs)

! Write out only type-1 cells (healthy RBC cells)
write(fn, FMT=fn_FMT) 'D/', '1x', lt, '.dat'
call WriteManyRBCsByType(fn, nrbc, rbcs, 1)
! Write out only type-3 cells (sickle cells)
write(fn, FMT=fn_FMT) 'D/', '3x', lt, '.dat'
call WriteManyRBCsByType(fn, nrbc, rbcs, 3)
end if

if (wall_out > 0 .and. mod(lt,wall_out) == 0) then
Expand Down Expand Up @@ -213,6 +221,67 @@ subroutine WriteManyRBCs(fn, nrbc, rbcs)

end subroutine WriteManyRBCs

!*********************************************************************
! Write the shape of blood cells of specified type to file
! Arguments:
! fn -- file suffix name
! nrbc -- nubmer of cells
! rbcs -- blood cells
! type -- type filter (1: rbc, 2: leukocyte, 3: sickle cell)
subroutine WriteManyRBCsByType(fn, nrbc, rbcs, type)
character(*) :: fn
integer :: nrbc
type(t_rbc),target :: rbcs(:)
integer :: type

type(t_Rbc),pointer :: rbc
real(WP),dimension(:,:,:),allocatable :: x, xa, xb
integer :: irbc, nlat, nlon, ilat, ilon

! Argument check
if (nrbc <= 0) return

! Write file head
open(cell_unit, file=trim(fn), action='write')
write(cell_unit, '(A)') 'VARIABLES = X, Y, Z'

! Write the record of every cell
do irbc = 1, nrbc
rbc => rbcs(irbc)
nlat = rbc%nlat; nlon = rbc%nlon

if (rbc%celltype .ne. type) then
cycle
end if

! Allocate working arrays
allocate(x(0:nlat,nlon,3), xa(nlon/2+1,nlat+1,3), xb(nlon/2+1,nlat+1,3) )

call ShAnalGau(nlat, nlon, 3, rbc%x, size(rbc%x,1), size(rbc%x,2), &
xa, xb, size(xa,1), size(xa,2), rbc%wshags )
call ShFilter(nlat, nlon, 3, xa, xb, size(xa,1), size(xa,2), rbc%nlat0, rbc%nlon0 )
call ShSynthEqu(nlat+1, nlon, 3, x, size(x,1), size(x,2), &
xa, xb, size(xa,1), size(xa,2), rbc%wshses )

write(cell_unit, '(A,I9,A,I9,A)') 'ZONE I=', nlat+1, ' J=', nlon+1, ' F=POINT'

do ilon = 1, nlon
do ilat = 0, nlat
write(cell_unit, '(3F20.10)') x(ilat,ilon,:)
end do ! ilat
end do ! ilon
do ilat = 0, nlat
write(cell_unit, '(3F20.10)') x(ilat,1,:)
end do ! ilat

! Deallocate working arrays
deallocate(x, xa, xb )
end do ! irbc

close(cell_unit)

end subroutine WriteManyRBCsByType

subroutine WriteManyRBCsNoFilt(fn, nrbc, rbcs)
character(*) :: fn
integer :: nrbc
Expand Down
Empty file added randomized_case/D/.gittouch
Empty file.
Binary file added randomized_case/Input/new_cyl_D6_L13_33_hires.e
Binary file not shown.
30 changes: 30 additions & 0 deletions randomized_case/Input/tube.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
0.44 !0.04 ! alpha_Ewld !changed for big tube
1.E-3 ! eps_Ewld
8 ! PBspln_Ewld

1 ! nCellTypes
1 ! viscRat
1. ! refRad
.false. ! Deflate

0.0 !
0.0 !
0.0 !

10000 ! Nt
0.0014 ! Ts

100 ! cell_out
-10000 ! wall_out
-10 ! pGrad_out
-10 ! flow_out
-1 ! ftotout
100 ! restart_out

'D/restart.LATEST.dat'

0.0000000001 ! epsDist
10. ! forceCoef
10. ! viscRatThresh
.false. ! rigidsep
0. 0. 0. 0. ! fmags
22 changes: 22 additions & 0 deletions randomized_case/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
include ../Makefile.in

LIB = $(COMMON_LIB) $(SPHPK_LIB) $(FFTW_LIB) $(LAPACK95_LIB) $(PETSC_LIB) $(NETCDF_LIB) $(MKL_LIB) $(STATIC)
EXECUTABLES = initcond_random tube

all : $(EXECUTABLES)

lib : $(wildcard $(WORK_DIR)/common/*.F90)
make -C $(WORK_DIR)/common

$(EXECUTABLES) : % : %.o $(wildcard $(COMMON_DIR)/*.F90)
make lib
$(FC) $(LDFLAGS) -o $@ $< $(LIB)

clean :
-rm -f $(EXECUTABLES) *.o *.mod *.a core

# Dependency
.depend : $(wildcard *.F90)
$(MAKEDEPEND_BIN) $^ > .depend

include .depend
Loading