InitializePDECoefficients::femcscd
Details
Examples
Basic Examples
See Also
Related Links
NDSolve`FEM`
InitializePDECoefficients::femcscd
Details
-
- This message is generated when the PDE is convection dominated, and in some cases numerical instabilities may 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::femcscd].
Examples
Basic Examples (2)
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[T[x, y, t], t] - Laplacian[T[x, y, t], {x, y}] == 0, DirichletCondition[T[x, y, t] == 20, x == 100 && t == 0]}, T[x, y, t], {x, 0, 100}, {y, 0, 100}, {t, 0, 100}]The solution is to add an initial condition:
NDSolveValue[{D[T[x, y, t], t] - Laplacian[T[x, y, t], {x, y}] == 0, DirichletCondition[T[x, y, t] == 20, x == 100], T[x, y, 0] == 20}, T[x, y, t], {x, 0, 100}, {y, 0, 100}, {t, 0, 100}]Here is a convection-dominated PDE:
pde = D[1 / r * D[r * g[r, z], r], r] - g[r, z] + 1 / (2 * Pi * r) == 0Solving the PDE with boundary conditions gives a warning:
if = Interpolation[{{0., 0.}, {1., 0.0634}, {2., 0.0573}, {3., 0.0467}, {4., 0.0378}, {5., 0.0312}, {6., 0.0263}, {7., 0.0227}, {8., 0.0199}, {9., 0.0177}, {10., 0.0159}, {11., 0.0145}, {12., 0.0133}, {13., 0.0122}, {14., 0.0114}, {15., 0.0106}, {16., 0.0099}, {17., 0.0094}, {18., 0.0088}, {19., 0.0084}, {20., 0.008}}];
sol = NDSolveValue[{pde, g[0, z] == if[0], g[20, z] == if[20], g[r, 10] == g[r, -10] == if[r]}, g, {r, 0, 20}, {z, -10, 10}];Inspecting the solution reveals a kink in the solution:
Plot[sol[r, 0], {r, 0, 20}]To improve the situation, a finer mesh can be used:
Needs["NDSolve`FEM`"]
mesh = ToElementMesh[Rectangle[{0, -10}, {20, 10}], "MaxBoundaryCellMeasure" -> 0.1, MeshElementType -> TriangleElement];
mesh["Wireframe"]Even though the message is still present, the solution looks much better:
sol2 = NDSolveValue[{pde, g[0, z] == if[0], g[20, z] == if[20], g[r, 10] == g[r, -10] == if[r]}, g, {r, z}∈mesh];
Plot[sol2[r, 0], {r, 0, 20}]