-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheos.F90
55 lines (39 loc) · 1.34 KB
/
eos.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module eos
#include "definition.h"
use grid_data
use sim_data, only : sim_smallPres
contains
subroutine eos_all()
implicit none
integer :: i,j
real :: eint, ekin,pres,velx,vely
! dens-eint mode:
! This assumes that conservative vars are known
! (but not prim vars yet) to evaluate pres
! == inputs : dens & eint
! == outputs: pres
! This routine fills out pressure also the GC regions
!I think this is deprecated and not needed anymore
!!$ do i = gr_i0(XDIM),gr_imax(XDIM)
!!$ do j = gr_i0(YDIM),gr_imax(YDIM)
!!$ ! updated velx, ekin, eint
!!$ velx = gr_U(MOMX_VAR,i,j)/gr_U(DENS_VAR,i,j)
!!$ vely = gr_U(MOMY_VAR,i,j)/gr_U(DENS_VAR,i,j)
!!$ ekin = 0.5*(velx*velx+vely*vely)*gr_U(DENS_VAR,i,j)
!!$ eint = max(gr_U(ENER_VAR,i,j) - ekin,sim_smallPres)
!!$
!!$ ! now let's get a new pressure
!!$ pres = (gr_V(GAME_VAR,i,j)-1.)*eint
!!$ gr_V(PRES_VAR,i,j) = max(sim_smallPres,pres)
!!$ end do
!!$ end do
end subroutine eos_all
subroutine eos_cell(dens,eint,game,pres)
implicit none
real, intent(IN) :: dens,eint,game
real, intent(OUT):: pres
! ideal gas law
! eint = pres/dens/(game-1)
pres = max((game-1.)*dens*eint,sim_smallPres)
end subroutine eos_cell
end module eos