Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Help with tau constraints

63 views
Skip to first unread message

qucchia

unread,
Dec 7, 2024, 1:28:47 PM12/7/24
to Dedalus Users
Hi,
I am new to Dedalus and spectral methods and don't quite get how to impose boundary conditions using Tau methods. For example, for a 2D viscous fluid with equations:
Screenshot 2024-12-07 190947.png
I want to impose that u is zero at the borders in the x axis.
Implementation so far:
problem = d3.IVP([v, rho], namespace=locals())

#Substitutions
dx = lambda A: d3.Differentiate(A, coords['x'])
dy = lambda A: d3.Differentiate(A, coords['y'])
lap =lambda A: d3.Laplacian(A)
idn = dist.TensorField((coords, coords), name='idn')
idn['g'][0,0] = 1
idn['g'][0,1] = 0
idn['g'][1,0] = 0
idn['g'][1,1] = 1
P = (u1**2)*(rho-rho0)
grad_v = d3.Gradient(v)
grad_vt = d3.TransposeComponents(grad_v)
Dn = 1/2 * (grad_v + grad_vt)

#Equations
problem.add_equation('dt(rho)  = - v@grad(rho) -rho*div(v) ')
problem.add_equation('dt(v) = -v@grad(v) -(1/rho)*div(rho*v*v + idn*P ) + 2*mu/rho*div(Dn)')

What I want to add:
ex, ey = coords.unit_vector_fields(dist)
problem.add_equation("dt(v(x='left')) @ ey = 0")
problem.add_equation("dt(v(x='right')) @ ey = 0")

I've tried imitating examples by using a lift_basis and putting them in the equations but
it hasn't worked out (I get Factor is exactly singular)

Any advice / help is greatly appreciated!

Daniel Lecoanet

unread,
Dec 7, 2024, 2:57:04 PM12/7/24
to dedalu...@googlegroups.com
Hi,

You need to write your equations in a way such that the diffusion term is linear and on the LHS of the equation. This can be done by changing the definition of your variables, e.g., here: https://ui.adsabs.harvard.edu/abs/2014ApJ...797...94L. There was a more recent example of this on this users list a few weeks ago.

Daniel

On Dec 7, 2024, at 12:17 PM, qucchia <yij...@gmail.com> wrote:

Hi,
I am new to Dedalus and spectral methods and don't quite get how to impose boundary conditions using Tau methods. For example, for a 2D viscous fluid with equations:
--
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/f41d994b-4b6d-44a0-90cd-7c8d336f800en%40googlegroups.com.
<Screenshot 2024-12-07 190947.png>

Reply all
Reply to author
Forward
0 new messages