Re: Convective diffusion equation in 2D
- To: mathgroup at smc.vnet.net
- Subject: [mg79857] Re: Convective diffusion equation in 2D
- From: "Dr. Wolfgang Hintze" <weh at snafu.de>
- Date: Tue, 7 Aug 2007 01:27:44 -0400 (EDT)
- References: <f8v09f$cbk$1@smc.vnet.net><f91i6t$5hi$1@smc.vnet.net> <f943hn$m56$1@smc.vnet.net>
- Reply-to: "Dr. Wolfgang Hintze" <weh at snafu.de>
Sorry for interfering, but I had a similar question before. Using the procedure of Jens in the form s = First[With[{\[ScriptCapitalD] = 1/8, v = 1/4}, sol = NDSolve[{D[u[x, y, t], t] == \[ScriptCapitalD]*(D[u[x, y, t], {x, 2}] + D[u[x, y, t], {y, 2}]) - v*D[u[x, y, t], x], u[-1, y, t] == 0, u[1, y, t] == 0, u[x, -1, t] == 0, u[x, 1, t] == 0, u[x, y, 0] == Piecewise[ {{1, Sqrt[x^2 + y^2] <= 0.5}}, 0]}, u[x, y, t], {x, -1, 1}, {y, -1, 1}, {t, 0, 2}]]] {u[x, y, t] -> InterpolatingFunction[][x, y, t]} extractiing the solution into a function h h[x_, y_, t_] = u[x, y, t] /. s InterpolatingFunction[][x, y, t] and finally plotting the result using t = 1; Plot3D[h[x, y, t], {x, -1, 1}, {y, -1, 1}] or the sequence For[t = 1, t <= 2, t = t + 0.1, Plot3D[h[x, y, t], {x, -1, 1}, {y, -1, 1}, PlotRange -> {0, 0.45}]] looks very nice. Best regards, Wolfgang "dantimatter" <dantimatter at gmail.com> schrieb im Newsbeitrag news:f943hn$m56$1 at smc.vnet.net... > >> With[{\[ScriptCapitalD] = 1/8, v = 1/4}, >> sol = NDSolve[{ >> D[u[x, y, t], >> t] == \[ScriptCapitalD] (D[u[x, y, t], {x, 2}] + >> D[u[x, y, t], {y, 2}]) - v*D[u[x, y, t], x], >> u[-1, y, t] == 0, u[1, y, t] == 0, >> u[x, -1, t] == 0, u[x, 1, t] == 0, >> u[x, y, 0] == Piecewise[{{1, Sqrt[x^2 + y^2] <= 0.5}}, 0]}, >> u[x, y, t], {x, -1, 1}, {y, -1, 1}, {t, 0, 2} >> ] >> ] >> >> may do that .. Ignore the warnings you get with the >> statement above, the reason are the initial conditions >> and you may have other. > > Hi Jens, > > I wasn't able to plot the result. Have you tried this and > successfully plotted it? > > Cheers, > Dan > >