General function implentation in equation has no effect

45 views
Skip to first unread message

Andrey Kononov

unread,
Jul 13, 2025, 7:39:31 AMJul 13
to Dedalus Users

Hi!

I am solving hydrostatic equations for a spherically symmetric neutron star. The problem I've encountered is that when I try to include a rather complicated EOS (pressure=EOS(density)) function in problem formulation via GeneralFunction, it seems like it returns a field that is identically zero. 

It happens even if I encode a more simpler EOS such as a polytropic P=rho**(gamma)  in this GeneralFunction object (however, stating simply x**(gamma) in equation formulation works fine).

Please excuse if I'm missing something obvious! I tried reading related discussions but frankly could not deduce solution. Thank you!

Code attached.

hydro_eq1.py

Daniel Lecoanet

unread,
Jul 17, 2025, 10:48:52 AMJul 17
to dedalu...@googlegroups.com
Hi,

I think your GeneralFunction is being evaluated correctly — you can try evaluating it and it seems to work. I believe the problem is that the NLBVP uses some operator methods that are not implemented for GeneralFunction’s, in particular “replace" and “sym_diff”. If you implement these for your GeneralFunction I think it might work.

Daniel

--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/589c970e-83fb-40b2-a029-78b375ae800en%40googlegroups.com.
<hydro_eq1.py>

Reply all
Reply to author
Forward
0 new messages