Daniel Price
unread,Jun 22, 2017, 12:46:42 AM6/22/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Matias Blana Diaz, phantoms...@googlegroups.com
Hi Matias,
> sorry to bother you again. I have some N-body models of barred galaxies
> where I want to put gas. From the E-mails I understand that there were
> some problems of mom. conservations for models with particles with
> different masses?, and so I have been testing analytical potentials for
> the stellar structures and putting gas.
From what we understand so far, this is just that the default tree opening criterion is not tight enough when there are unequal mass particles. The workaround until we implement a better opening criterion is to decrease the tree opening criterion (to 0.3 or 0.2 from 0.5 which is the default). This makes the runtime slower but does fix the problem.
> Actually, I dont need my N-body model to evolve, and so is it possible to
> use it in phantom as a static system where the gravitation potential is
> calculated just once, and I rotate it according to the pattern speed that
> the barred model has? I have been studying the code, to use my N-body
> model as some sort of "external" potential. Is there an option I could do
> this?
This should be straightforward to implement in externalforces.f90, you obviously have to decide how to interpolate the acceleration from your “fixed” potential, or do a sum over your “N-body” particles each time.
You should just add a module called extern_nbody.f90 which returns the potential (phi) and acceleration (fxi, fyi, fyi) at a given position from your N-body model (also at a given time, t). There are plenty of examples of similar modules, e.g. extern_binary.f90 is a simple time-dependent external potential from a binary. Yours is the same but with N > 2. Obviously you have to decide how you want to soften the interaction.
Might be easier to let your N-body model evolve…
Cheers,
Daniel