On October 24, 2016 at 2:36:20 AM, M.R.Datta Prasad (madura...@gmail.com) wrote:
I am just interested to know if fn(x,y) or fn(x,z) can be put in Dedalus as a non constant coefficient of a derivative. Whether it can be put in the right hand side of the equation and it will still work for the IVP?
--
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 post to this group, send email to dedalu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/a6d4c928-1621-4d0f-a3ab-090a0ec6b5de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On November 6, 2016 at 6:34:33 AM, pvg...@gmail.com (pvg...@gmail.com) wrote:
Hello Keaton,
I came across this post while searching for NCC.
I also have a NCC in my problem.
I create my f as:
f = domain.new_field()
f.set_scales(domain.dealias,keep_data=False)
f['g'] = x**2 + x**2*y**3
Now to create 'g', should I do like the following ?
g = domain.new_field()
g.set_scales(domain.dealias,keep_data=False)
g['g'] = 1./Lx * integ_x(f)
and then put (f-g) * dz(u) ... in the right hand side & g*dz(u) ... in the left hand side ?
cheers,
Prasanna
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/1c5a3410-e783-4d78-b91b-af2fb9d6478f%40googlegroups.com.
Hi Keaton,
I managed to analytically integrate and put my 'g' function.
So I created two fields like this:
f = domain.new_field()
f.set_scales(domain.dealias,keep_data=False)
g = domain.new_field()
g.set_scales(domain.dealias,keep_data=False)
However, when I put this : g(y)*dz(u) = (g-f)*dz(u)
The code tells: " NameError: name 'g' is not defined. Should 'g' be a parameter ? Only if the fields are in the right hand side, the code accepts them. So is there a way to treat such NCCs ?
On Monday, November 7, 2016 at 12:51:50 AM UTC+1, Keaton Burns wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/a7490b58-d7be-4d05-a801-7307ff96cf62%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/CAJoYf%3DjHGNC2JSCgeKHfLGNYrZ1AfN-H4449tGgjS7NkjZdfvA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/b9c3c530-3ad7-47e9-a046-32678ea5c9b3%40googlegroups.com.
As you have mentioned LHS NCCs must only be functions of z. My function is f(x,y) * dz(u). Its not f(x,z), so I don't need a g(z) do I ?
Prasanna
Hi Keaton,
As you have mentioned LHS NCCs must only be functions of z. My function is f(x,y) * dz(u). Its not f(x,z), so I don't need a g(z) do I ?
Prasanna
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to dedalu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/c83510f9-f2a2-402f-8a32-a41f83080863%40googlegroups.com.
Prasanna
A part of my code with the functions and the NCC is shown below:
x_basis = de.Fourier('x', 16, interval=(0, Lx), dealias=3/2)
y_basis = de.Fourier('y', 16, interval=(0, Ly), dealias=3/2)
z_basis = de.Chebyshev('z', 12, interval=(0, Lz), dealias=3/2)
domain = de.Domain([x_basis, y_basis, z_basis], grid_dtype=np.float64)
x,y,z = domain.grids(scales=domain.dealias)
# Applied Field - Bz and By
Bz = domain.new_field()
Bz.set_scales(domain.dealias,keep_data=False)
dxBz = domain.new_field()
dxBz.set_scales(domain.dealias,keep_data=False)
#gc = domain.new_field()
#gc.set_scales(domain.dealias,keep_data=False)
Bz['g']=0.85*np.exp(-(((x-cc)**2)/(2*deltax**2)))+0.15 #Bz is a function of 'x'
dxBz['g']=(0.425*np.exp(-(((cc-x)**2)/(2*deltax**2)))*(2*cc-2*x))/(deltax**2) #dxBz is a function of 'x'
# 2D Boussinesq hydrodynamics
problem = de.IVP(domain, variables=['p','tt','u','v','w','ttz','uz','vz','wz','b1z','b2z','b3z'], time='t')
problem.parameters['Pr'] = 1
problem.parameters['R'] = R
problem.parameters['F'] = F = 1
problem.parameters['Els'] = Els
problem.parameters['Bz'] = Bz
problem.parameters['dxBz'] = dxBz
problem.parameters['gc'] = 1.622672726
problem.add_equation("dx(u) + dy(v) + wz = 0")
problem.add_equation("dt(tt) - Pr*(dx(dx(tt)) + dy(dy(tt)) + dz(ttz)) - w = 0")
problem.add_equation("dt(u) - 1*v - (dx(dx(u)) + dy(dy(u)) + dz(uz)) + dx(p) -1*PAR* gc*dz(b1) = -1*PAR*(1*gc*dz(b1)-(Bz*dz(b1)))") #NCC TERMS HERE
Prasanna
please take a look at this one line which has the NCC,
"Bz(x)*dz(b1) is my NCC term"
Here is the line :
problem.add_equation("dt(u) - 1*v - (dx(dx(u)) + dy(dy(u)) + dz(uz)) + dx(p) -1*PAR* gc*dz(b1) = -1*PAR*(1*gc*dz(b1)-(Bz*dz(b1)))") #NCC TERMS HERE
Please let me know if it is ok.
Also if there is a term f(x)*(u) on the left hand side, should I also treat it like you have previously mentioned ? g=integ_x(f) and put g*(u) = (g*(u) - f*(u)) ??
Prasanna
In case the previous post with code is clumsy,
please take a look at this one line which has the NCC,
"Bz(x)*dz(b1) is my NCC term"
Here is the line :
problem.add_equation("dt(u) - 1*v - (dx(dx(u)) + dy(dy(u)) + dz(uz)) + dx(p) -1*PAR* gc*dz(b1) = -1*PAR*(1*gc*dz(b1)-(Bz*dz(b1)))") #NCC TERMS HERE
Please let me know if it is ok.
Also if there is a term f(x)*(u) on the left hand side, should I also treat it like you have previously mentioned ? g=integ_x(f) and put g*(u) = (g*(u) - f*(u)) ??
Prasanna
--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to dedalu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/17ae37ca-82b5-45bf-b0a8-4e0ce149e581%40googlegroups.com.
Prasanna