InitializePDECoefficients::femcsp
Details
-
- This message is generated when the PDE is convection dominated and numerical instabilities appear.
- More information can be found in the Finite Element Usage Tips tutorial.
- Off[message] switches off the message; On[message] switches it on. For example: Off[InitializePDECoefficients::femcsp].
Examples
Basic Examples (3)
Load the finite element package:
Needs["NDSolve`FEM`"]In this example, a Péclet number has been computed that indicates that the differential equation may exhibit instabilities. The Péclet number is only computed if an explicit mesh is given:
NDSolveValue[{D[c[t, x], t] + Inactive[Div][{{-0.005}} . Inactive[Grad][c[t, x], {x}], {x}] + Derivative[0, 1][c][t, x] == 0, c[0, x] == 100, DirichletCondition[c[t, x] == 100, x == 0]}, c, {t, 0, 500}, x∈ToElementMesh[Line[{{0}, {1}}]]]The solution is to use a finer mesh:
NDSolveValue[{D[c[t, x], t] + Inactive[Div][{{-0.005}} . Inactive[Grad][c[t, x], {x}], {x}] + Derivative[0, 1][c][t, x] == 0, c[0, x] == 100, DirichletCondition[c[t, x] == 100, x == 0]}, c, {t, 0, 500}, x∈ToElementMesh[Line[{{0}, {1}}], "MaxCellMeasure" -> 0.01]]In this case, the time-dependent PDE is treated as a three-dimensional spatial PDE because an initial condition is missing. The three-dimensional PDE is convection dominated:
NDSolveValue[{D[F[t, tt], t] == Cos[t] - Cos[tt] + 0.1 * Laplacian[F[t, tt], {t, tt}], F[0, tt] == 0}, F, Element[{t, tt}, ToElementMesh[Triangle[{{0, 0}, {50, 0}, {0, 50}}]]]]If the intent is to compute a time-dependent differential equation as a pure spatial solution, then the issue indicated by the message can be avoided by making use of a finer mesh:
NDSolveValue[{D[F[t, tt], t] == Cos[t] - Cos[tt] + 0.1 * Laplacian[F[t, tt], {t, tt}], F[0, tt] == 0}, F, Element[{t, tt}, ToElementMesh[Triangle[{{0, 0}, {50, 0}, {0, 50}}], MaxCellMeasure -> 0.1]]]If the intent is to compute the time-dependent differential equation as a time-dependent equation with a spatial discretization, then the initial condition and the time domain should be separated from the spatial domain:
NDSolveValue[{D[F[t, tt], t] == Cos[t] - Cos[tt] + 0.1 * Laplacian[F[t, tt], {tt}], F[0, tt] == 0}, F, {t, 0, 50}, Element[{tt}, ToElementMesh[Line[{{0}, {50}}]]]]