[FLASH-USERS] Modified ideal gas EOS implementation

Klaus Weide klaus at flash.uchicago.edu
Mon Apr 27 13:01:25 EDT 2020


On Mon, 27 Apr 2020, Acharya, Nitish wrote:

> I am working on implementing a slightly modified version of ideal-gas EOS for laserslab problem. I have been able to implement the default ideal-gas EOS. The way i want it to modify is :
> 
> 1) P_ion = rho_ion*R*T_ion/A - P_correction
>     e_ion = R*T/(A*(gam-1)) + e_correction
>    where P_correction and e_correction are some correction constants
>    I would want to do similar correction to electron part as well.
> 
> 2) I would want to compute sound speed using the pressure P = P_ion+ P_ele+P_rad + P_correction
> 
> My par file has :
>                         eosMode : dens_ie_recal_gather
>                         eosInitMode : dens_temp_gather
> 
> I am having hard time finding the locations within the eos routines where I make all these modifications. I would really appreciate any help.


It looks like you are working with the right file, (a copy of) 
physics/Eos/EosMain/multiTemp/Gamma/Ye/eos_idealGamma3T.F90 .

I will point to the code in that file that should be of most importance 
for you.  (There are many other places in that file that should be 
modified for consistency, but they should not be reached in the courser of 
execution, as long as you stick with using 3T Multitype Eos and the eos 
modes quoted above.)

Note that all code I will point to is AFTER the LAST occurrence of

|  select case (mode)
(about l. 635)


1. the section after
|  case (MODE_DENS_TEMP_ION)
(about l. 648)

2. the section after
|  case (MODE_DENS_TEMP_ELE)
(about l. 663)
(Maybe not, if your offset only applies to ions.)

3. the following sections will probably also need modifications, after  about l. 1121:
|     if(mask(EOS_DET))then
  ...

|     if(mask(EOS_CV))then
  ...

|     if(mask(EOS_CVION))then
  ...

|     if(mask(EOS_CVELE))then
(Maybe not, if your offset only applies to ions.)
  ...


This should get you started. There may be other places that need changes.
I make no claims that this will actually work.


The above basically only addresses part 1) of your question.
For part 2), 
 1. You need to make sure the Eos returns the GAMC you need
    (Testing and maybe further Eos code changes will be needed), and
 2. you need a customized Hydro_computeDt.F90 .


If either one of your pressures or one of your energies goes down to
zero or below anywhere, you may be in trouble anyway. Various places
in the implementation of Hydro, in particular, may fail when that
happens.


Klaus



More information about the flash-users mailing list