Skip to content

Commit

Permalink
Bug fix: incorrect gas midplane density
Browse files Browse the repository at this point in the history
  • Loading branch information
cpinte committed Oct 2, 2024
1 parent 7f2fce0 commit fc8e55b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/density.f90
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,21 @@ subroutine define_gas_density()
! Normalisation
if (mass > 0.0) then ! pour le cas ou gas_to_dust = 0.
facteur = dz%diskmass * dz%gas_to_dust / mass
! write(*,*) "VERIF gas mass: zone ", izone, dz%diskmass * dz%gas_to_dust, mass, facteur
write(*,*) "VERIF gas mass: zone ", izone, dz%diskmass * dz%gas_to_dust, mass, facteur

! Somme sur les zones pour densite finale
do i=1,n_rad
bz_gas_mass2 : do j=min(1,j_start),nz
if (j==0) cycle
do k=1, n_az
do k=1, n_az
bz_gas_mass2 : do j=min(1,j_start),nz
if (j==0) cycle bz_gas_mass2
icell = cell_map(i,j,k)
densite_gaz(icell) = densite_gaz(icell) + densite_gaz_tmp(icell) * facteur
densite_gaz_midplane(i,k) = densite_gaz_midplane(i,k) + densite_gaz_midplane_tmp(i,k) * facteur
enddo !k
enddo bz_gas_mass2
enddo bz_gas_mass2

densite_gaz_midplane(i,k) = densite_gaz_midplane(i,k) + densite_gaz_midplane_tmp(i,k) * facteur
enddo !k
enddo ! i

endif
enddo ! n_zones

Expand Down Expand Up @@ -1819,7 +1821,7 @@ subroutine normalize_dust_density(disk_dust_mass)
do l=1,n_grains_tot
somme=0.0_dp
do icell=1,n_cells
if (densite_pouss(l,icell) <= 0.0_dp) densite_pouss(l,icell) = 0.0_dp
if (densite_pouss(l,icell) <= 0.0_dp) densite_pouss(l,icell) = tiny_real
somme=somme+densite_pouss(l,icell)*volume(icell)
enddo !icell
if (somme > tiny_dp) densite_pouss(l,:) = densite_pouss(l,:) / somme * nbre_grains(l) ! nbre_grains pour avoir Sum densite_pouss = 1 dans le disque
Expand Down
2 changes: 1 addition & 1 deletion src/mcfost_env.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module mcfost_env
implicit none

real, parameter :: mcfost_version = 4.1
character(8), parameter :: mcfost_release = "4.1.06"
character(8), parameter :: mcfost_release = "4.1.07"
real, parameter :: required_utils_version = 4.0

!character(len=128) :: web_server = "https://ipag.osug.fr/public/pintec/"
Expand Down

0 comments on commit fc8e55b

Please sign in to comment.