[Mesa-users] Questions about using other_eos

Jeremy Sakstein sakstein at hawaii.edu
Tue Dec 15 21:09:49 EST 2020


Thanks Rob,

I managed to figure out how to call eosDT_get() without all of these other
modules.

With regards to point 2, I would like to use this with the PPISN test_suite
so I think HELM is the only relevant EOS. Ideally, I just want to be able
to change the entries in res() in the eosDT_get() routine.

One thing I noticed is that other_eos requires me to specify the
eosDT_get_T() routine. Looking at eos_lib.f90, it appears this calls
get_T(), which is defined in /eos/private/eosdt_eval.f90. This in turn
calls do_safe_get_Rho_T(), which calls Get_eosDT_Results(), implying that
this routine would not know about any changes that I make to res(). It then
seems to me that if it is necessary to edit every routine in other_eos, it
wouldn't be possible to simply edit this routine to use the updated values
of res, I would need to make a local copy of the do_safe_get_Rho_T()
routine that calls my new version of  eosDT_get()  in place
of Get_eosDT_Results().

Is this correct?

Cheers,

Jeremy

On Sun, Dec 13, 2020 at 11:26 PM Rob Farmer <r.j.farmer at uva.nl> wrote:
>
> Hi,
> >1) I am currently writing my other_eosDT_get routine in
run_star_extras.f. In order to call the default EOS first, I am just
copying the routine from $MESA_DIR/eos/public/eos_lib.f90 but it appears
that this relies on modules located in $MESA_DIR/eos/make.
>
> No, in your run_star_extras add:
> use eos_lib
> use eos_def
>
> Then inside your other_eosDT routine you can add a call to eosDT_get() to
get mesa's normal eos results (have a look at eos_support.f90 to see how
mesa calls eosDT_get() ). You don't need to copy any files or put anything
in eos_lib.f90 yourself.
>
> >2) My plan was just to modify the other_eosDT_get routine to change the
entries in res(i). Do I need to modify the entire set of routines given in
$MESA_DIR/star/other/other_eos.f90 e.g.
>
> It depends on the problem your solving and your eos options, hopefully an
eos expert can chime in with which ones need setting?
>
> Rob
>
>
>
>
> On Sat, 12 Dec 2020 at 03:34, Jeremy Sakstein <sakstein at hawaii.edu> wrote:
>>
>> Hi everyone,
>>
>> I have two questions about using other_eos. To give some context, I
would like to call the usual MESA EOS routines to find the EOS then change
the values in the entries of res(i).
>>
>> I'm using r-12778.
>>
>> My questions are:
>>
>> 1) I am currently writing my other_eosDT_get routine in
run_star_extras.f. In order to call the default EOS first, I am just
copying the routine from $MESA_DIR/eos/public/eos_lib.f90 but it appears
that this relies on modules located in $MESA_DIR/eos/make.
>>
>> My workaround for this is to just copy these to the make directory and
then my code compiles. I am worried that I may be messing something up when
I do this.
>>
>> Is the correct way to use other_eos to write my routine directly into
$MESA_DIR/eos/public/eos_lib.f90, recompile the entire module, then point
to this from run_star_extras.f?
>>
>> 2) My plan was just to modify the other_eosDT_get routine to change the
entries in res(i). Do I need to modify the entire set of routines given in
$MESA_DIR/star/other/other_eos.f90 e.g.
>>
>>          ! s% other_eosDT_get_T => my_eosDT_get_T

>>          ! s% other_eosDT_get_Rho => my_eosDT_get_Rho

>>          ! s% other_eosPT_get => my_eosPT_get

>>          ! s% other_eosPT_get_T => my_eosPT_get_T

>>          ! s% other_eosPT_get_Pgas => my_eosPT_get_Pgas

>>          ! s% other_eosPT_get_Pgas_for_Rho => my_eosPT_get_Pgas_for_Rho
>>
>> as well? Looking at these routines, it looks like if routines like
my_eosPT_get or my_eosDE_get are called then I need to do this, but I am
not sure if they are called during a normal MESA run or not. The others
seem to find the density, temperature, gas pressure given the EOS so it
looks like I can leave these alone.
>>
>> Is this correct?
>>
>> Thanks for any help you can give.
>>
>> Cheers,
>>
>> Jeremy
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20201215/ccc46244/attachment.htm>


More information about the Mesa-users mailing list