Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Dec 3, 2018
2 parents 93ef828 + d86dcb3 commit 0c11c23
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 37 deletions.
8 changes: 8 additions & 0 deletions CHANGES
@@ -1,10 +1,18 @@
changes since last release:

* Minor changes

-- simplified conductivity interface to match the eos interface by
storing the conductivity in the eos type.

18.08

* Major changes

-- We fixed a corner coupling bug when advecting conservative
scalars (predicting rho, rhoh, or rhoX)


18.07

* Major changes
Expand Down
2 changes: 2 additions & 0 deletions Microphysics/EOS/eos_type.f90
Expand Up @@ -145,6 +145,8 @@ module eos_type_module
real(dp_t) :: dedA
real(dp_t) :: dedZ

real(dp_t) :: conductivity

end type eos_t

contains
Expand Down
5 changes: 2 additions & 3 deletions Microphysics/conductivity/conductivity.f90
Expand Up @@ -26,7 +26,7 @@ end subroutine conductivity_init

! a generic wrapper that calls the EOS and then the conductivity

subroutine conducteos(input, state, cond)
subroutine conducteos(input, state)

use actual_conductivity_module
use eos_type_module, only : eos_t
Expand All @@ -36,12 +36,11 @@ subroutine conducteos(input, state, cond)

integer , intent(in ) :: input
type (eos_t) , intent(inout) :: state
real (kind=dp_t), intent(inout) :: cond

! call the EOS, passing through the arguments we called conducteos with
call eos(input, state)

call actual_conductivity(state, cond)
call actual_conductivity(state)

end subroutine conducteos

Expand Down
5 changes: 2 additions & 3 deletions Microphysics/conductivity/constant/conducteos.f90
Expand Up @@ -9,16 +9,15 @@ subroutine actual_conductivity_init()
implicit none
end subroutine actual_conductivity_init

subroutine actual_conductivity(eos_state, conductivity)
subroutine actual_conductivity(eos_state)

use eos_type_module
use extern_probin_module, only: conductivity_constant

type (eos_t) , intent(inout) :: eos_state
real (kind=dp_t), intent(inout) :: conductivity

! fill the conductivity
conductivity = conductivity_constant
eos_state % conductivity = conductivity_constant

end subroutine actual_conductivity

Expand Down
35 changes: 16 additions & 19 deletions Source/make_explicit_thermal.f90
Expand Up @@ -307,7 +307,6 @@ subroutine make_thermal_coeffs_1d(lo,hi,s,ng_s,Tcoeff,ng_T,hcoeff,ng_h, &
! local
integer :: i,comp
type (eos_t) :: eos_state
real (kind=dp_t) :: conductivity


do i=lo(1)-1,hi(1)+1
Expand All @@ -328,17 +327,17 @@ subroutine make_thermal_coeffs_1d(lo,hi,s,ng_s,Tcoeff,ng_T,hcoeff,ng_h, &
eos_state%xn(:) = s(i,spec_comp:spec_comp+nspec-1)/eos_state%rho

! dens, temp, and xmass are inputs
call conducteos(eos_input_rt, eos_state, conductivity)
call conducteos(eos_input_rt, eos_state)

Tcoeff(i) = -conductivity
hcoeff(i) = -conductivity/eos_state%cp
pcoeff(i) = (conductivity/eos_state%cp)* &
Tcoeff(i) = -eos_state % conductivity
hcoeff(i) = -eos_state % conductivity/eos_state%cp
pcoeff(i) = (eos_state % conductivity/eos_state%cp)* &
((1.0d0/eos_state%rho)* &
(1.0d0-eos_state%p/(eos_state%rho*eos_state%dpdr))+ &
eos_state%dedr/eos_state%dpdr)

do comp=1,nspec
Xkcoeff(i,comp) = (conductivity/eos_state%cp)*eos_state%dhdX(comp)
Xkcoeff(i,comp) = (eos_state % conductivity/eos_state%cp)*eos_state%dhdX(comp)
enddo

endif
Expand Down Expand Up @@ -374,7 +373,6 @@ subroutine make_thermal_coeffs_2d(lo,hi,s,ng_s,Tcoeff,ng_T,hcoeff,ng_h, &
! local
integer :: i,j,comp
type (eos_t) :: eos_state
real (kind=dp_t) :: conductivity

do j=lo(2)-1,hi(2)+1
do i=lo(1)-1,hi(1)+1
Expand All @@ -395,17 +393,17 @@ subroutine make_thermal_coeffs_2d(lo,hi,s,ng_s,Tcoeff,ng_T,hcoeff,ng_h, &
eos_state%xn(:) = s(i,j,spec_comp:spec_comp+nspec-1)/eos_state%rho

! dens, temp, and xmass are inputs
call conducteos(eos_input_rt, eos_state, conductivity)
call conducteos(eos_input_rt, eos_state)

Tcoeff(i,j) = -conductivity
hcoeff(i,j) = -conductivity/eos_state%cp
pcoeff(i,j) = (conductivity/eos_state%cp)* &
Tcoeff(i,j) = -eos_state % conductivity
hcoeff(i,j) = -eos_state % conductivity/eos_state%cp
pcoeff(i,j) = (eos_state % conductivity/eos_state%cp)* &
((1.0d0/eos_state%rho)* &
(1.0d0-eos_state%p/(eos_state%rho*eos_state%dpdr))+ &
eos_state%dedr/eos_state%dpdr)

do comp=1,nspec
Xkcoeff(i,j,comp) = (conductivity/eos_state%cp)*eos_state%dhdX(comp)
Xkcoeff(i,j,comp) = (eos_state % conductivity/eos_state%cp)*eos_state%dhdX(comp)
enddo

endif
Expand Down Expand Up @@ -442,9 +440,8 @@ subroutine make_thermal_coeffs_3d(lo,hi,s,ng_s,Tcoeff,ng_T,hcoeff,ng_h, &
! local
integer :: i,j,k,comp
type (eos_t) :: eos_state
real (kind=dp_t) :: conductivity

!$OMP PARALLEL DO PRIVATE(i,j,k,comp,eos_state,conductivity)
!$OMP PARALLEL DO PRIVATE(i,j,k,comp,eos_state)
do k=lo(3)-1,hi(3)+1
do j=lo(2)-1,hi(2)+1
do i=lo(1)-1,hi(1)+1
Expand All @@ -466,17 +463,17 @@ subroutine make_thermal_coeffs_3d(lo,hi,s,ng_s,Tcoeff,ng_T,hcoeff,ng_h, &
eos_state%xn(:) = s(i,j,k,spec_comp:spec_comp+nspec-1)/eos_state%rho

! dens, temp, and xmass are inputs
call conducteos(eos_input_rt, eos_state, conductivity)
call conducteos(eos_input_rt, eos_state)

Tcoeff(i,j,k) = -conductivity
hcoeff(i,j,k) = -conductivity/eos_state%cp
pcoeff(i,j,k) = (conductivity/eos_state%cp)* &
Tcoeff(i,j,k) = -eos_state % conductivity
hcoeff(i,j,k) = -eos_state % conductivity/eos_state%cp
pcoeff(i,j,k) = (eos_state % conductivity/eos_state%cp)* &
((1.0d0/eos_state%rho)* &
(1.0d0-eos_state%p/(eos_state%rho*eos_state%dpdr))+ &
eos_state%dedr/eos_state%dpdr)

do comp=1,nspec
Xkcoeff(i,j,k,comp) = (conductivity/eos_state%cp)*eos_state%dhdX(comp)
Xkcoeff(i,j,k,comp) = (eos_state % conductivity/eos_state%cp)*eos_state%dhdX(comp)
enddo

endif
Expand Down
17 changes: 7 additions & 10 deletions Source/make_plot_variables.f90
Expand Up @@ -482,17 +482,16 @@ subroutine make_conductivity_1d(cond,ng_c,state,ng_s,lo,hi)
integer :: i

type (eos_t) :: eos_state
real (kind=dp_t) :: conductivity

do i = lo(1), hi(1)

eos_state%rho = state(i,rho_comp)
eos_state%T = state(i,temp_comp)
eos_state%xn(:) = state(i,spec_comp:spec_comp+nspec-1) / eos_state%rho

call conducteos(eos_input_rt, eos_state, conductivity)
call conducteos(eos_input_rt, eos_state)

cond(i) = conductivity
cond(i) = eos_state % conductivity

enddo

Expand All @@ -514,7 +513,6 @@ subroutine make_conductivity_2d(cond,ng_c,state,ng_s,lo,hi)
integer :: i, j

type (eos_t) :: eos_state
real (kind=dp_t) :: conductivity

do j = lo(2), hi(2)
do i = lo(1), hi(1)
Expand All @@ -523,9 +521,9 @@ subroutine make_conductivity_2d(cond,ng_c,state,ng_s,lo,hi)
eos_state%T = state(i,j,temp_comp)
eos_state%xn(:) = state(i,j,spec_comp:spec_comp+nspec-1) / eos_state%rho

call conducteos(eos_input_rt, eos_state, conductivity)
call conducteos(eos_input_rt, eos_state)

cond(i,j) = conductivity
cond(i,j) = eos_state % conductivity

enddo
enddo
Expand All @@ -548,9 +546,8 @@ subroutine make_conductivity_3d(cond,ng_c,state,ng_s,lo,hi)
integer :: i, j, k

type (eos_t) :: eos_state
real (kind=dp_t) :: conductivity

!$OMP PARALLEL DO PRIVATE(i,j,k,eos_state,conductivity)
!$OMP PARALLEL DO PRIVATE(i,j,k,eos_state)
do k = lo(3), hi(3)
do j = lo(2), hi(2)
do i = lo(1), hi(1)
Expand All @@ -560,9 +557,9 @@ subroutine make_conductivity_3d(cond,ng_c,state,ng_s,lo,hi)
eos_state%xn(:) = state(i,j,k,spec_comp:spec_comp+nspec-1) / &
eos_state%rho

call conducteos(eos_input_rt, eos_state, conductivity)
call conducteos(eos_input_rt, eos_state)

cond(i,j,k) = conductivity
cond(i,j,k) = eos_state % conductivity

enddo
enddo
Expand Down
4 changes: 2 additions & 2 deletions Util/postprocessing/urca-tools/plot_fconv_slopes.py
Expand Up @@ -62,8 +62,8 @@ def plot(self, fmt=None, rup=None, outname=None, show=False):
ax.plot(self.r[:idxup], dledoux, color='red', linestyle='-.', label='ledoux $\mathrm{\\nabla_{conv}}$')
mx = max(np.amax(dadiabatic), np.amax(dledoux))
mn = min(np.amin(dadiabatic), np.amin(dledoux))
mx = max(abs(mx), abs(mn))
plt.yscale('symlog', linthreshy=0.1*mx)
mlin = min(abs(mx), abs(mn))
plt.yscale('symlog', linthreshy=0.5*mlin)
ax.set_ylabel('$\mathrm{\\nabla_{actual} - \\nabla_{conv}}$')
plt.legend()
if fmt=='png':
Expand Down

0 comments on commit 0c11c23

Please sign in to comment.