program test1
implicit none
! include 'mpif.h'
! domain and initial condition
integer,parameter:: N1=100, N2=100
real,parameter :: H0=16E-6, R0=32E-6, hs=10E-3+0, pi=3.1415927
real,parameter :: epsilons=H0/R0
integer, parameter:: N=N1+N2+1
integer, parameter::NCons=N1+1
integer,parameter :: NE=4*N+8*((N-1)+(N-2)+(N-3)+(N-4)+(N-5))-9800
integer,parameter::LINDEX=100000!2*(3*NE+4*N+1)
integer,parameter::LVALUE=100000!2*(2*NE)
real, dimension (1:N) :: hdrop,r,hpores, Ones
real, dimension (1:2*(N)) :: hinits
real, dimension (1:5,1:2*N):: hMatrix
real, dimension (1:NCons):: HCons
real,dimension (1:N-1):: Vhalf, VhalfOld
real, dimension(1:N)::dQt,Wpt,dHt
! Physical Constant
real, parameter:: gammas=28E-3, Ah=1E-20*0, rho=1060, g=9.8, viscosity=0.01
! Evaporation constant
integer, parameter :: EType=19
real, parameter :: EValdummy=0.1*1, K=1, A=250
real,dimension(1:N)::EVal
! Substrate data
real, parameter :: Kp=4E-15, thetaE=60, Rpore=1.05E-8, theta=0.45
real :: Pc=2*gammas/RPore*cos(thetaE/90*pi/2)
! Constant gundul
real :: Su, Bo, An, PmVals
real, dimension(1:N):: Pm,dummy
real, dimension (1:2*N) :: hnew
! Time data
real :: dt=1E-4, TEnd, Time
integer :: Iter,ff,f1,f2,f3
integer :: indices, kk
! real,dimension(1:2*N,1:2*N):: Jacobi
real :: time1,timeinits, CaNumber
time1=0.0
! write(*,*) PmVAls
! do indices=1,2*N
! do kk=1,2*N
! Jacobi(kk,indices)=0
! end do
! end do
! time1=time1+MPI_Wtime()-time2
! write(*,*)time1
! stop
Iter=1000
Time=dt
TEnd=Iter*dt
Su=Pc*R0*R0/gammas/H0
Bo=rho*g*R0*R0/gammas
An=R0*R0*Ah/6/gammas/H0/H0/H0/H0/pi
PmVals=3*Kp*R0*R0/H0/H0/H0/H0*1
write(*,*) PmVAls,'---', Su
do indices=1,N
r(indices) =(indices-1.0)/N1
! Pm(indices)=PmVals
hpores(indices)=hs
if (indices<(N1+1)) then
Ones(indices)=0
hdrop(indices)=(1-r(indices)**2)+hs
Pm(indices)=PmVals
EVal(indices)=EValdummy
HCons(indices)=hdrop(indices)
else
hdrop(indices)=hs
Ones(indices)=1
Pm(indices)=0.0
EVal(indices)=0.0
end if
hinits(indices)=hdrop(indices)
hinits(N+indices)=hpores(indices)
end do
! write(*,*) Ones
HCons(NCons)=hs
! write(*,*) HCons(99:NCons)
! write(*,*) hinits(99:NCons)
r(1)=0
hpores(1)=hs
kk=1
open(unit=1,file='DATA34/resDrop_init.out')
open(unit=2,file='DATA34/resPore_init.out')
open(unit=3,file='DATA34/domain.out')
open(unit=4,file='DATA34/cons_init.out')
do indices=1,N
write(1,9000) hinits(indices)
write(2,9000) hinits(N+indices)
write(3,9000) r(indices)
if (indices
write(4,9000) HCons(indices)
end if
end do
close(1)
close(2)
close(3)
close(4)
call GearsInit(hMatrix,HCons,dt,hinits,N,N1,gammas,Ah,rho,g,H0,R0,r,EType,K,A,EVal
$ ,hs,theta,Pm,Bo,An,Su,PmVals ,NCons,Vhalf,Ones)
VhalfOld=Vhalf
! write(*,*) 'velocity half in the main '
! write(*,*) 'testing'
! stop
open(unit=1,file='DATA34/resDrop_000.out')
open(unit=2,file='DATA34/resPore_000.out')
open(unit=4,file='DATA34/cons_000.out')
open(unit=5,file='DATA34/Vhalf_000.out')
do indices=1,N
write(1,9000) hMatrix(5,indices)
write(2,9000) hMatrix(5,N+indices)
if (indices
write(4,9000) HCons(indices)
if (indices
write(5,9000) Vhalf(indices)
end if
end if
end do
close(1)
close(2)
close(4)
CLOse(5)
do while (Time <= TEnd)
do indices=1,N
if (hinits(indices)<=1.001*hs) then
! hinits(indices)=hs
! Pm(indices)=0
EVal(indices)=0
end if
end do
! timeinits=MPI_Wtime()
call Gears(dt,hMatrix,HCons,N,N1,gammas,Ah,rho,g,H0,R0,r,EType,K,A,EVal
$ ,hs,theta,Pm,Bo,An,Su,PmVals ,NCons,VhalfOld,Ones)
!stop
Time=Time+dt
! time1=time1+MPI_Wtime()-timeinits
! write(*,*) time1/60
if (MOD(kk-1,10)==0) then
call tools(dQt,Wpt,dHt,Bo,PM,An,Su,hMatrix(5,1:2*N),gammas,PmVals,
$ rho,g,theta,r,Ah,N,H0,R0,hs,Ones)
! write(*,*) dQt(1:10)
! write(*,*) time1/60
ff=kk/10!50
f1=ff/100
f2=(ff-f1*100)/10
f3=ff-f1*100-f2*10
open(unit=1,file='DATA34/resDrop_'//char(48+f1)//char(48+f2)//char(48+f3)//'.out')
open(unit=2,file='DATA34/resPore_'//char(48+f1)//char(48+f2)//char(48+f3)//'.out')
open(unit=4,file='DATA34/cons_'//char(48+f1)//char(48+f2)//char(48+f3)//'.out')
open(unit=5,file='DATA34/Vhalf_'//char(48+f1)//char(48+f2)//char(48+f3)//'.out')
open(unit=6,file='DATA34/dQ_'//char(48+f1)//char(48+f2)//char(48+f3)//'.out')
open(unit=7,file='DATA34/WP_'//char(48+f1)//char(48+f2)//char(48+f3)//'.out')
open(unit=8,file='DATA34/dH_'//char(48+f1)//char(48+f2)//char(48+f3)//'.out')
do indices=1,N
write(1,9000) hMatrix(5,indices)
write(2,9000) hMatrix(5,N+indices)
write(6,9000) dQt(indices)
write(7,9000) Wpt(indices)
write(8,9000) dHt(indices)
if (indices
write(4,9000) HCons(indices)
if (indices
write(5,9000) VhalfOld(indices)
end if
end if
end do
CLOSE(1)
close(2)
close(4)
close(5)
close(6)
close(7)
close(8)
write(*,*) Iter-kk
! write(*,*) HCons(1:2)
end if
kk=kk+1
end do
open(unit=1,file='DATA34/resDrop_end.out')
open(unit=2,file='DATA34/resPore_end.out')
open(unit=4,file='DATA34/cons_end.out')
open(unit=5,file='DATA34/Vhalf_end.out')
do indices=1,N
write(1,9000) hMatrix(5,indices)
write(2,9000) hMatrix(5,N+indices)
if (indices
write(4,9000) HCons(indices)
if (indices
write(5,9000) VhalfOld(indices)
end if
end if
end do
close(1)
close(2)
close(4)
close(5)
! write(*,*) viscosity*viscosity/epsilons/epsilons/epsilons/rho/gammas/H0
9000 format(100e14.6)
! contains
end program
Geen opmerkingen:
Een reactie posten