comsol不能收敛的来源分析
A number of people aregetting similar issues relating to COMSOL not converging.This leads to an error message that might look like:Failed to find a solution.The relative residual (0.28) is g...
A number of people are getting similar issues relating to COMSOL not converging. This leads to an error message that might look like:
Failed to find a solution.
The relative residual (0.28) is greater than the relative tolerance.
Returned solution is not converged.
Messages similar to this are returned for nonlinear problems that fail to converge. Here are some possible causes and cures:
- 1,Your model is highly nonlinear. This is often the case in for instance mass transport models with fast reactions. Try to cancel some known nonlinearity in the problem and gently ramp it up with the parametric solver. For example, Stationary models with high reaction rates (high Ri), or more generally, large source terms, may result in convergence problems. You can for instance get error messages such as "No convergence, even when using the minimum damping factor", "NaN repeatedly found in solution", or "Error: Failed to find a solution".
- Try to solve the problem using reduced source terms, and then gradually increase them, using the previous solution when solving, until you reach the solution to your original problem. The following approach uses the parametric solver to gradually increase the source term. COMSOL Multiphysics will now start to solve the problem using the first multiplication factor. Then, if that works, the solution will be used as the initial guess for the next parameter value. This process will continue until the last parameter value is reached. Because you specified the last parameter value to be unity, the last solution will correspond to your original problem fomulation.
- Multiply the reaction (source) term (Ri) by a multiplication factor variable, for example "k".
- Click the Stationary node and select the Continuation check box. Enter k for Continuation parameter.
- In Parameter values, enter a range of increasing values, starting at a low value and increasing to unity, for example "
1e-3 1e-2 1e-1 1
". - Click Compute.
- Use the time dependent solver. By making the problem time dependent, you usually get a smoother convergence. Make sure to solve the problem for large enough times, such that the solution does not vary any longer. This implies that the solution has reached steady-state. Thus, COMSOL Multiphysics has calculated the stationary solution.
- Right-click the Model node and select Add Study. Select Time Dependent and click Finish.
- In Times, enter a range of times to solve for, for example "
0 1e3
". - Click Compute.
- Try to solve the problem using reduced source terms, and then gradually increase them, using the previous solution when solving, until you reach the solution to your original problem. The following approach uses the parametric solver to gradually increase the source term. COMSOL Multiphysics will now start to solve the problem using the first multiplication factor. Then, if that works, the solution will be used as the initial guess for the next parameter value. This process will continue until the last parameter value is reached. Because you specified the last parameter value to be unity, the last solution will correspond to your original problem fomulation.
- 2,Your boundary conditions are inconsistent, either with each other or with your initial guess. Check your equation system and boundary conditions.
- 3,There is no stationary solution to your problem. For example, a constantly positive heat source surrounded by insulating walls results in a temperature field that increases forever, and never reaches a stationary state. Running a time-dependent study can help you understand what is going on.
- 4,Non-unique solutions. For example, a cavity flow problem needs to have the pressure locked in some point or the problem will have an infinite number of solutions. Right-click the physics interface head node and select Pressure Point Constraint under Points. Constrain one point to an arbitrary pressure, for example 0.
- 5,The mesh is too coarse to resolve steep gradients. This is a common scenario, for example, near walls in natural convection problems. Try refining the mesh locally, where you expect spatial variations in the solution.
- 6,For time-dependent nonlinear models
- When a time dependent solver has trouble converging, its default behavior is to slow down. Reducing the time step is a good strategy when convergence problems would otherwise arise due to some fast change in time. However, a failure to converge can also be the result of strong nonlinearities.
- Some settings that might help include: browse down to the Fully Coupled node inside your study. In order to make this node appear, you may need to first right-click the Study node and select Show Default Solver. While in the Fully Coupled node, click the Settings tab and make the settings -> Jacobian update (from Minimal to On every iteration), the Maximum number of iterations (from 4 to 25), and the Tolerance factor (from 1 to 1e-3). Updating the Jacobian on every iteration increases the stability of the nonlinear process. The maximum number of iterations sets a limit to how many iterations can be performed; a process otherwise controlled by the tolerance factor.
- 7,For time-dependent waves models
-
The accuracy in a model solving an equation for electromagnetic, structural, or any other kind of waves is often limited by how well the mesh resolves the waves. Time-dependent wave equations also put constraints on the time steps used by the solver. This article describes how you can control the mesh and the solver settings to get an accurate solution.
Start by deciding what mesh size you want to use. Just like in the frequency domain, you will need at least approximately 5 second-order mesh elements per wavelength. Keep in mind that in a time domain model, your wave does not consist of just one frequency, but can rather be described as a frequency spectrum. For example assume a model that uses Gaussian pulses with a standard deviation of √2/(2πf0). With this expression, most of the energy content in the pulse (95.5%) will be distributed over frequencies lower than f0. If you want to resolve these frequencies, the maximum allowed mesh element size becomes h0 = c/(N*f0), where c is the local speed of light or sound, and N = 5 the number of mesh elements per wavelength.
You should aim for a time step that resolves the wave equally well in time as the mesh does in space. Any longer time steps will not make optimal use of the mesh, and any shorter time steps will lead to longer solution times with no considerable improvements to the results. The relationship between mesh size and time step length is known as the CFL number: CFL = c*Δt/h, where Δt is the time step and h is the mesh size. In practice, with the default second order mesh elements, a CFL number of 0.2 proves to be near optimal.
By default, the time dependent solver will continuously adjust the time step in order to fulfill your specified tolerances. If you already know the time step that you want the solver to take, it is easier and more efficient to set it manually. This is done on the Settings tab of the Time-Dependent Solver node. In order to make this node appear, you may need to right-click the Study node and select Show Default Solver. Note that changing the number of output times in the Step 1: Time Dependent node controls the output times, but has little effect on the time steps actually taken by the solver.
-
The information presented above is from COMSOL and is pretty useful. Make sure to read it carefully and try to apply the techniques to your designs and see if it helps.
相对残差大于相对容差,大概有七个原因:
1:模型高度非线性化
2:边界条件不连续
3:没有稳态解
4:有多解
5:网格划分的过于粗糙
6:非线性时间相关模型
7:时间相关的波模型
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)