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!