Zero flux BC in the RB example

190 views
Skip to first unread message

Adriano Côrtes

unread,
Jul 12, 2024, 10:12:30 AM7/12/24
to Dedalus Users
Dear Dedalus developers and users,

I am a new Dedalus user, coming from the Finite Element Method (using libraries like Fenics). Using the Rayleigh-Benard code from the examples, I implemented the attached code to change the periodic boundary condition on the x-axis to impose zero flux on the lateral sides. This change involved creating new tau variables and adding new boundary condition equations. Despite reading the Tau Method documentation, I am not entirely confident in my implementation.

1. Could an experienced user or developer review the attached code and confirm if it is implemented correctly?

2. I changed the x-basis from RealFourier to ChebyshevT. Is this the appropriate choice? How does it differ from using Chebyshev or ChebyshevU?

3. A problem I encountered is that while the original code (with periodic boundary conditions on the x-axis) works in parallel, my modified code fails when I attempt to run it in parallel. The error occurs at `solver = problem.build_solver(timestepper)` with the message:

raise ValueError(f"Problem is coupled along distributed dimensions: {tuple(np.where(coupled_nonlocal)[0])}")
ValueError: Problem is coupled along distributed dimensions: (0,)


4. Lastly, I would like to know how to evaluate the residuals of the equations. Coming from the FEM community, it's common to use stabilization methods requiring the evaluation of the residual of an equation (e.g., the momentum equation) given an approximate solution (e.g., u^h and p^h). For instance, if I set the field `b` in the Rayleigh-Benard example to `b['g'] = rand(Nx, Nz)` as an approximate solution (very wrong for sure just for example), how can I evaluate the residual of the buoyancy equation for this random field? Additionally, how can I monitor this residual during time integration?

Thank you in advance for your help.

Best regards,  
Adriano Côrtes
rayleigh_benard_neumann.py

张斌

unread,
Jul 22, 2024, 7:32:59 AM7/22/24
to Dedalus Users

This is a very challenging task. You might find some helpful information in this post: https://groups.google.com/g/dedalus-users/c/dhkgW6YF4-I/m/VDsEB3VbAgAJ.

Adriano Côrtes

unread,
Jul 24, 2024, 9:49:20 AM7/24/24
to Dedalus Users
Thank you very much bro! 
Reply all
Reply to author
Forward
0 new messages