Symmetric boundary conditions

53 views
Skip to first unread message

Erin E Goldstraw

unread,
Jul 3, 2025, 10:12:17 AMJul 3
to Dedalus Users
Hi everyone,

I would like to apply symmetric boundary conditions in a Dedalus v2 code. 
I previously used a Fortran90 code that defined variables with extra points such as A(-1:Nz+2).  Note: I think the first index here is one not zero.

The boundary conditions were then of the form:
A(:,:,-1)=A(:,:,2)
A(:,;,0)=A(:,:,1)
A(:,:,nz+2)=A(:,:,nz)
A(:,:,nz+1)=A(:,:,nz-1)

I have tried to apply this on a 3d domain using Fourier basis in x and y and Chebyshev in z.
Then using problem.add_equation for each condition on each variable but get value errors for the pencils.

What would be the best way to apply these boundary conditions?
Any suggestions are appreciated. Thank you.
Erin Goldstraw

Daniel Lecoanet

unread,
Jul 3, 2025, 2:09:48 PMJul 3
to dedalu...@googlegroups.com
Hi Erin,

I’m not sure exactly what BCs you’re trying to impose. But in Dedalus, it is the coefficients of the spectral expansion which are evolved in time, so the equations are entirely in terms of these coefficients. In fact, the grid points are only used as a trick for efficiently evaluating nonlinear products, and are not mathematically involved in the equations.

That said, if your equations satisfy certain parity conditions, you can expand your functions using the SinCos basis, in which you specify that certain quantities are sine series and other quantities are cosine series. This is a way to impose certain symmetry conditions on your functions.

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/380caa2a-03f9-4653-810c-114bc51a2bb1n%40googlegroups.com.

Erin E Goldstraw

unread,
Jul 3, 2025, 2:45:04 PMJul 3
to dedalu...@googlegroups.com
Hi Daniel,

Thank you for the suggestion.

I want to solve the MHD equations with a solid ( line- tied) boundary in z  as for solar physics in the code LareXd https://github.com/Warwick-Plasma/Lare3d/tree/main/src. The boundary conditions are in boundary.f90.

What basis/ boundary conditions would you suggest in Dedalus for this?

Thank you,
Erin
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Dedalus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dedalus-users/H6RkK7eoiA8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dedalus-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/546CCE69-E8A1-4F50-B859-7D4CC7C8533A%40northwestern.edu.


--
Dr Erin E. Goldstraw

Daniel Lecoanet

unread,
Jul 5, 2025, 9:03:41 AMJul 5
to dedalu...@googlegroups.com
Hi Erin,

Can you specify the BC you want to satisfy using equations?

Thanks,
Daniel

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/CAL5Th1StTDbbz-jn_Z5Oqt895baNBdeB4UkQCFKGC1KUG_R66w%40mail.gmail.com.

Erin E Goldstraw

unread,
Jul 7, 2025, 7:18:26 AMJul 7
to dedalu...@googlegroups.com
Dear Daniel,

The BCs are zero gradient on the z boundary. So dz(Bx)=0 etc.
Here is what I have so far to solve the incompressible MHD equations.

And these are the type of errors at the moment:
ValueError: Pencil (4, 56) has 6 constant equations for 0 constant variables plus 8 differential equations / tau terms. 


Any ideas?

Thanks, 
Erin

Daniel

To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Dedalus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dedalus-users/H6RkK7eoiA8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dedalus-user...@googlegroups.com.


--
Dr Erin E. Goldstraw


--
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/CAL5Th1StTDbbz-jn_Z5Oqt895baNBdeB4UkQCFKGC1KUG_R66w%40mail.gmail.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Dedalus Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dedalus-users/H6RkK7eoiA8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dedalus-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dedalus-users/B08EFE2C-BE1B-4F21-916F-FD16B7CB8BAA%40northwestern.edu.
fmhd-solar-d2.py
Reply all
Reply to author
Forward
0 new messages