[Mesa-users] Questions about using other_eos
Jeremy Sakstein
sakstein at hawaii.edu
Wed Dec 16 14:33:24 EST 2020
Hi Frank,
I am trying to add a new bosonic particle to the EOS. I already have
appropriate fitting functions for the Bose-Einstein integrals for the
regime of [image: T] and [image: \rho] I am interested in. I went through
the routines called by eosDT_get() in eos/private and have come up with a
scheme for taking the MESA EOS computed quantities that don't include this
new particle and modifying them to include the new particle using my
analytic results.
My scheme is very much tied to the fact that [image: \rho] and [image: T] are
the input variables for eosDT_get(), so if I need to modify other routines,
I would likely need to come up with new schemes. This isn't a problem of
course, I would just like to know before I go ahead and do it.
Since I am using eosDT_get() and changing res(i), any routine that
calls eosDT_get() e.g. the example of eosDT_get_T() above won't include my
changes so will likely be inconsistent.
Is there any way of forcing MESA to use eosDT_get() only? I went through
the files in star/private and it looks like the PT form is only used during
create_pre_ms, but the DE form is used in adjust_mesh.
I am interested in the late stages of massive star evolution i.e. M>20[image:
M_\odot], [image: \log(\rho)>2], and [image: \log_{10}(T)>8].
Cheers,
Jeremy
On Wed, Dec 16, 2020 at 4:25 AM Francis Timmes <fxt44 at mac.com> wrote:
> > ... call the usual MESA EOS routines to find the EOS then change the
> values in the entries of res(i).
>
> i'm curious what sort of changes you envision making to the results of
> calling the mesa eos.
>
> fxt
>
>
>
>
>
>
>
>
> > On Dec 15, 2020, at 7:09 PM, Jeremy Sakstein <sakstein at hawaii.edu>
> wrote:
> >
> > 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
> > >>
> > _______________________________________________
> > mesa-users at lists.mesastar.org
> > https://lists.mesastar.org/mailman/listinfo/mesa-users
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20201216/bc825090/attachment.htm>
More information about the Mesa-users
mailing list