I am trying to simulate Modified Heat Transfer in Fluid Flow (based on Buoyancy-Driven Flow in a Square Cavity ).
The modified heat transfer takes the form:
with the solid volume fraction:
The whole model is defined as:
ClearAll["Global`*"]
Needs["NDSolve`FEM`"]
sizes = {length -> 1, hight -> 1};
\[CapitalOmega] = Rectangle[{0, 0}, {length, hight}] /. sizes;
em = ToElementMesh[\[CapitalOmega] , MaxCellMeasure -> .0001,
"MeshOrder" -> 2];
Pr = 50;
Ra = 2.27*10^5;
timetol = 0.00001;
Th = 1.0;
Tc = -0.01;
ClearAll[\[Nu]]
op = {
\!\(\*SuperscriptBox[\(u\),
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, x, y] +
Inactive[Div][(- Inactive[Grad][u[t, x, y], {x, y}]), {x,
y}] + {u[t, x, y], v[t, x, y]} .
Inactive[Grad][u[t, x, y], {x, y}] +
\!\(\*SuperscriptBox[\(p\),
TagBox[
RowBox[{"(",
RowBox[{"0", ",", "1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, x, y],
\!\(\*SuperscriptBox[\(v\),
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, x, y] +
Inactive[Div][(-Inactive[Grad][v[t, x, y], {x, y}]), {x,
y}] + {u[t, x, y], v[t, x, y]} .
Inactive[Grad][v[t, x, y], {x, y}] +
\!\(\*SuperscriptBox[\(p\),
TagBox[
RowBox[{"(",
RowBox[{"0", ",", "0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, x, y] - Ra/Pr*T[t, x, y],
\!\(\*SuperscriptBox[\(u\),
TagBox[
RowBox[{"(",
RowBox[{"0", ",", "1", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, x, y] +
\!\(\*SuperscriptBox[\(v\),
TagBox[
RowBox[{"(",
RowBox[{"0", ",", "0", ",", "1"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, x, y],
\!\(\*SuperscriptBox[\(T\),
TagBox[
RowBox[{"(",
RowBox[{"1", ",", "0", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[t, x,
y]*(1.0 + 1/0.045*20* Sech[40* (0.01 - T[t, x, y])]^2 ) +
Inactive[Div][(-Inactive[Grad][T[t, x, y], {x, y}]), {x,
y}] + {u[t, x, y], v[t, x, y]} .
Inactive[Grad][T[t, x, y], {x, y}]};
wall = DirichletCondition[{u[t, x, y] == 0, v[t, x, y] == 0}, True];
reference = DirichletCondition[p[t, x, y] == 0, x == 0 && y == 0];
temperatures = {DirichletCondition[T[t, x, y] == Th, x == 0],
DirichletCondition[T[t, x, y] == 0, x == length]};
bcs = {wall, reference, temperatures} /. sizes;
ic = {u[0, x, y] == 0, v[0, x, y] == 0, p[0, x, y] == 0,
T[0, x, y] == 0};
Monitor[AbsoluteTiming[{xVel, yVel, pressure, temperature} =
NDSolveValue[{op == {0, 0, 0, 0}, bcs, ic}, {u, v, p,
T}, {x, y} \[Element] em, {t, 0, timetol},
Method -> {"TimeIntegration" -> {"IDA",
"MaxDifferenceOrder" -> 2},
"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement",
"InterpolationOrder" -> {u -> 2, v -> 2, p -> 1,
T -> 2}}}},
EvaluationMonitor :> (currentTime =
Row[{"t = ", CForm[t]}])];], currentTime]
However, this modified simulation model produces some numerical errors:
How to set the solver parameters that we can fix the bug "Matrix SparseArray[<1395840>, {101404, 101404}] is singular ..."