[FLASH-BUGS] multigamma EOS Version: FLASH 2.1.20020605

Markus Gross m.s.gross at hw.ac.uk
Tue Dec 3 08:16:29 CST 2002


Hi!

The multigamma equation of state that came with my version of FLASH 
(2.1.20020605) seems to have a bug. I only checked pressure, temperature and 
internal energy so far and found that:

pressure for input=2 is wrong (I presume)
ener     for input=3 is wrong (I presume again)

I attached my "corrected" version to this email.

I am a bit careful about stating that there may be a mistake because I wonder 
why it did not crop up earlier during one of your tests - so it may be my 
fault. Then again you may be more interested in using the Helmoltz eos anyway 
and therefore may not notice ...

In my case the riemann solver bailed out - which may be not surprising if 
there is no thermodynamic correct state to start with...

Please let me know if I was right or wrong.


Regards,

Markus.


-- 
_______________________________________________________________

Markus Gross AMIMechE BEng (Hons.) Mechanical Engineering

Heriot Watt University Edinburgh
Department of Mechanical and Chemical Engineering

Associate member of the Institution of Mechanical Engineers
Member of the SPIE
_______________________________________________________________

further contact:

Phone   : +44 (0) 131 449 5111 etx. 4737

UNiX talk: talk markus at lasersim.mce.hw.ac.uk

_______________________________________________________________

"Plans are a place to begin," Grove said. "They rarely deliver
you to where you expect. Make your plans knowing you are going
to throw them away."

_______________________________________________________________


-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBDt30nARBACUL2XadcLU9YS+3ndnWUUpnrhAD3Ab/TqJP1Obtz7H356+vigu
2m3exw2P9fky08SBdTbjOCV5OTmVcRW5F0SNMTIl8gXtGdIcQHCcZxi1GcRJtTBj
npfRCmZojHr8YgsKDdJ9xupNm+UYWcg1BpFX7xe65kXM4oVwVyuCcUT+VwCg6/Hd
6oVoRHm1eq1NdMbCfsc9x78D/2uGQSMJBKewQ/uSPpdEg+bkAQo5Y7MooEeYpLk9
Iroo4rqxp12k0+bWHWVMdfywI80tivorTIgBTKpCtjLaiKen9E9zECo+2OR4+XRQ
O6cBKXOm+V2lJOpFYOh500tJHPggshD21jksNPKJr9CM1byeZFw38fFJ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O3fSggAKCRBTnmsr4a/0+U/rAJ9o
lOhPGltVnRncYJPzyIk00H0JDQCfWrlnYDh5cRQmhnHilnrVO5Ykr24=i3eC
-----END PGP PUBLIC KEY BLOCK-----

-------------- next part --------------
!!****f* source/materials/eos/helmholtz_threadsafe/multigamma/eos
!!
!! NAME 
!!
!!  eos
!!
!! SYNOPSIS
!!  
!!  subroutine eos(dens, temp, pres, ener, xn, abar, zbar,  
!!                 dpt, dpd, det, ded, c_v, c_p, gammac, pel, ne, eta,  
!!                 input)
!!
!! DESCRIPTION
!!
!!   This is a generic wrapper for the equation of state so the
!!   pressure, energy, etc. can be computed through an argument
!!   call, without requiring the calling routine to share a common
!!   block with the EOS.
!!
!!  This version wraps the Helmholtz equation of state.
!!
!!  ARGUMENTS
!!      dens   : the density of the material
!!      temp   : the temperature 
!!      pres   : pressure
!!      ener   : internal energy
!!      xn()   : mass fraction array
!!      abar   : average mass of the nuclei
!!      zbar   : average proton number
!!      dpt    : d(pres)/d(temp)
!!      dpd    : d(pres)/d(dens)
!!      det    : d(ener)/d(temp)
!!      ded    : d(ener)/d(dens)
!!      c_v    : specific heat at constant volume
!!      c_p    : specific heat at constant pressure
!!      gammac : d(log P)/d(log dens)
!!      pel    : electron pressure
!!      ne     : electron number density
!!      eta    : electron degeneracy parameter (chem pot / k_b*T)
!!      input  : what to do
!!
!!     If input=1, density and temperature are taken as inputs, and
!!     pressure and energy are generated as output.  If input=2,
!!     density and energy are taken as inputs, and pressure and
!!     temperature are generated as output.  Mass fractions are
!!     always taken as input; the remaining parameters are computed
!!     on output.
!!
!!
!! USED BY
!!
!!   init_block
!!   init_1d 
!!   tot_bnd
!!   user_bnd
!!   conductivity
!!   net
!!   perturbLib
!!
!!
!!***

module ModuleEos

  private
  public :: eos

contains

  subroutine eos (dens, temp, pres, ener, xn, abar, zbar, & 
     &                dpt, dpd, det, ded, c_v, c_p, gammac, pel, ne, eta, & 
     &                input)

!=======================================
       use logfile, ONLY: stamp_logfile
       use physical_constants, ONLY: get_constant_from_db
       use multifluid_database, ONLY: get_mfluid_property, & 
     &                                query_mfluid_suminv, & 
     &                                query_mfluid_sumfrc, & 
     &                                mfluid_status_fail,  & 
     &                                mf_prop_a, & 
     &                                mf_prop_z
       use dBase, ONLY: ionmax
       implicit none

!       Parameters

      real              dens, temp, pres, ener, dpt, dpd, det, ded, c_v, c_p,  & 
     &                  gammac, pel, ne, eta, abar, zbar
      real              xn(ionmax)
      integer           input

      integer           FAIL, ierr
      parameter         (FAIL  
      real              gc(ionmax), gammam1j(ionmax), ggprodj(ionmax)
      real              ggprodinvj(ionmax), gam1invj(ionmax)
      real              weight(ionmax), rt
      real              gascon
      logical ::        first_call       save              gascon, first_call
      save              gc, gammam1j,ggprodj,ggprodinvj,gam1invj

!=======================================
!       Initialization

      if (first_call) then

        first_call         call get_constant_from_db ("ideal gas constant", gascon)

        call get_mfluid_property ("adiabatic index", gc, ierr)
        if (ierr = mfluid_status_fail) then
          call abort_flash ("eos1d:  trouble getting gammas")
        endif
 
        gammam1j           ggprodj            ggprodinvj         gam1invj   
      endif

!       Get avg atomic mass

      call query_mfluid_suminv (mf_prop_A, xn(:), abar)
      abar       call query_mfluid_sumfrc (mf_prop_Z, xn(:), zbar)
      zbar 
!       Get weighted gamma

      weight       call query_mfluid_suminv (mf_prop_A, weight, rt)
      gammac 
!=======================================
!               input 
      if (input = 1) then


        pres           ener           dpt            dpd            det            ded            pel            ne             eta    
        c_v         c_p 
!=======================================
!               input 
      elseif (input = 2) then

        pres           temp           dpt            dpd            det            ded            pel            ne             eta    
        c_v         c_p 
!=======================================
!               input 
      elseif (input = 3) then

        ener           temp           dpt            dpd            det            ded            pel            ne             eta    
        c_v         c_p 
!=======================================
!               unrecognized value for input

      else

        call stamp_logfile ("eos:  unrecognized value for input")
        call abort_flash("eos: unrecognized value for input")
        stop

      endif

!=======================================
      return
    end subroutine eos

end module ModuleEos


More information about the flash-bugs mailing list