Starting from this question: Couple a PDE and ODE in NDSolve
I would like to modify the fluid from static to a flowing one in the y direction.
that's the original code that I modified a little bit:
Clear["Global`*"]
len = 1(*length of domain*)
wid = 1(*width of domain*)
end = 3(*end time*)
h = 2(*convection coefficient*)
cpmR = 9(*heat capacity/mass ratio*)
Tinit = 1(*initial temperature of the bar*)
T0init = 1;(*initial temperature of the fluid*)
(*Note:Constants,such as thermal conductivity,heat \
capacity,mass,cross-section,etc are all omitted for simplicity \
(assumed to be 1)*)
{Tsol2D, T0sol2D} =
NDSolveValue[{D[T[t, x, y],t] - (D[T[t, x, y], x, x] + D[T[t, x, y],y,y]) ==
NeumannValue[-h (T[t, x, y] - T0[t, x, y]), x == 0] +
NeumannValue[0, x == len] +
NeumannValue[0, y == wid],
DirichletCondition[T[t, x, y] == Tinit + 2*Sin[4 t], y == 0],
\
\
\
\
cpmR D[T0[t, x, y], t] == -h (T0[t, x, y] - T[t, x, y]),
(* SETTING INITIAL CONDITIONS*)
T[0, x, y] == Tinit,
T0[0, x, y] == T0init},
{T, T0}, {t, 0, end}, {x, 0, len}, {y, 0, wid},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement"}}];
The problem is that I have no idea how to "let the fluid flow".
My first idea was to re iteratively compute the solutions with some time interval dt, than couple the PDEs solution Tsol2D at time "t" and couple it with the ODEs solution T0sold2D translated by some amount "y+v dt" where "v" is the speed of the fluid. The problem is that this method seems to me extremely time expensive so I was wondering if anybody have a better idea or know some Mathematica functionality that could help me.
EDIT 23/08/2016 I think that i solved the problem using the advection equation. So
cpmR D[T0[t, x, y], t] == -h (T0[t, x, y] - T[t, x, y]),
Become
cpmR D[T0[t, x, y], t] == -vD[T0[t, x, y], y] -h (T0[t, x, y] - T[t, x, y]),