Attribution Non-Commercial (BY-NC)

35 views

Attribution Non-Commercial (BY-NC)

- Chapter 4 PDE
- Mathematical Model for Narcissistic Personality Disorder (NPD)
- CSIR UGC NET Mathematical Sciences Syllabus
- Phương trình đạo hàm riêng tựa tuyến tính
- Chan Vese Algorithm
- V 1
- Option Pricing Trees
- Actr Ppt Matlab
- 9709_s11_qp_33
- 2012 Spring Schedule of Classes - Online and Web-Blended
- 08aa301 Engineering Mathematics - III
- Problem 2.108
- Hikers Notes
- number strings day 2
- fdpaper
- Application Guidelines
- day 9 3
- Age Problem and Mixed Problem
- OpenModelica2016 Talk12 JanSilar PartialDifferentialEquationsinModelica
- MDV3-VVUQ-v0.5

You are on page 1of 7

t to do when your problem isnt solving correctly Background: Why does COMSOL hate me? In all of the previous example problems the instructions have been written such that when you solve the problem it will converge! But except for relatively simple problems (or sample problems that have been tested already by your very nice professor!), getting a model you have created to converge to a solution that looks correct may take a lot of time and effort. This can be a tedious, slow process and much like debugging code can lead to a lot of frustration. It is the hope of the author that the tips and tricks below will help to minimize these annoyances. If all of the below suggestions fail

relax, go get a cup of tea, and take a break from staring at your model!

this is often the best advice of all. What causes errors? A problem that will not run, will not converge, or gives an incorrectlooking solution may be caused by many different types of problems. When trying to debug a code or a model, it often helps to have a very structured approach for finding the error. With this in mind, lets divide the type of errors that may occur into several key areas. They are, in rough order of probability : User Error o General syntax errors o Boundary conditions or Subdomain settings not correctly defined o Direction of elevation not specified (and hence no gravity) o Multiphysics equations not linked correctly o Unreasonable initial conditions Solver Errors o Solver Tolerance not set low enough o Maximum # of Iterations reached

o Problem is Highly Nonlinear o Problem cannot be solved by the selected algorithm o Mesh is not fine enough in important areas COMSOL Error o Bug in COMSOL module or material definitions o Formula used by COMSOL is not correct or not general enough

Common User Errors (& how to fix them) Simple Typos The easiest-to-correct (and most common) errors are those that simply involve a typing mistake on the part of the user. If youve defined constants or variables in your problem, make sure you have entered these constants / variables correctly in any field where you use them. Errors relating to simple typos generally look something like those in Figure 1.

Figure 1: Common error window messages resulting from typos in variable or constant names.

A good way to check for this type of error is to look for the above error messages. Other Syntax Errors

A slightly more difficult-to-detect error set is when you have typed in an incorrect formula. In this case, you may have all of your constants and variable names correct but the formula itself does not make sense. For example, suppose we have the following code entered in a text box: Linspace(xmin,xmax,ymin,ymax) As long as xmin, xmax, ymin, and ymax are defined we do not have any variable or function name problems. HOWEVER, the function linspace only accepts 2 or 3 arguments, and we have supplied it with 4. Fortunately, MATLAB and COMSOL share a nearly identical language when it comes to defining formulas so: A good way to check for this type of error is to copy and paste any formula code into MATLAB and see if it gives you any unexpected errors. Boundary Conditions or Subdomain Settings not correctly defined Usually, its fairly easy to remember to enter all of your boundary conditions as youre going through a problem, but its often easy to forget subdomain conditions. Subdomain conditions are where you set properties of the medium itself, such as hydraulic conductivity, porosity, etc. In addition, when youve incorporated Multiphysics (for example, Darcys Law mixed with Solute Transport), its even easier to forget which menus you have visited, since they change each time you change physics. NEVER ASSUME that COMSOL has given you a reasonable value for all of your parameters. For example, if you start a new Richards Equation model for groundwater flow, the default value for Density of Fluid is 1 kg/m3. A good way to AVOID this type of error is to make sure you visit both boundary conditions and subdomain settings within each set of physics. Also, verify that physical constants chosen by COMSOL are reasonable. A good way to check for this type of error is to print out a COMSOL report using File Generate Report Direction of elevation not specified

This sort of error really falls into the category above, but it should be mentioned explicitly since this setting is easier to forget. In Physics Scalar Variables, most equations you are dealing with will have a value called D_. This variable corresponds to the direction of elevation and by default is set to 0 (i.e., you are dealing with a map-view problem). If you are dealing with a 2-D cross-sectional problem or a 3-D problem in which gravity is important, make sure to set your direction of elevation within this menu. A good way to check for this type of error is to print out a COMSOL report using File Generate Report NOTE: D_ is the direction of elevation, not gravity, so in most 2-D problems you should set it to y Multiphysics equations not linked correctly If you are dealing with a problem that has more than one set of physics, then linkages between these physics are an important part of your model. For example, if you are solving a problem that involves solute transport and Darcys Law, then you would at the very least want to make sure that solute advection is linked to the velocities obtained by solving the Darcy part of the problem. A good way to check for this sort of problem is to generate a report using File Generate Report. To make sure you are linking the correct variables, go to Physics Equation System Subdomain Settings Variables tab, and make sure you are using the correct variables to link your PDE equations. Unreasonable initial conditions Even on problems that are not being solved in a time-dependent fashion, the value given to COMSOL for initial conditions is quite important. This is because the initial condition values are used to evaluate the initial guess (or iteration) even for stationary solutions to PDEs. For example, say you are solving a problem that involves flow through an earthen dam in steady-state. Since you are not trying to model the transient flow of water through the dam, it would probably make sense to assume that the dam is pre-saturated with water. However, by

default COMSOL assumes that any modeled values are initial 0. Assuming that the head in the dam is initially 0 in this situation might mean that it takes a long time for the problem to converge to the steady-state solution, or it may not converge at all. A good way to make sure you have reasonable initial conditions is to go to Physics Subdomain Settings in ALL physics modes and make sure that the Init tab is set to reasonable values. Reasonable values implies that your final solution will bear some resemblance to your initial conditions in stationary (steady-state) problems. Solver Errors (and some tips) The distinction between User Errors and Solver Errors is somewhat arbitrary indeed you could put all blame on the user for not properly choosing a type of solver or the correct solver parameters. In general, by Solver Errors, I mean those errors that may arise even when the problem is correctly defined but convergence or a correct solution is not obtained. We will not go into each type of solver error in-depth, since they can almost all be corrected by visiting the Solver Parameter screen.

Figure 2: The Solver Parameters Screen (top) general tab and (bottom) Nonlinear tab

The Solver Parameters screen (Figure 2) can be found by either clicking on the icon that looks like an equal sign with a question mark in front of it, or by going to SolveSolver Parameters. On the general tab, you may choose the type of solver to use and can specify constants relating to that specific solver. Fortunately, COMSOL by default chooses the best (i.e., most adaptive) solver. However, if you have a large problem that has special properties (such as a symmetric matrix solve) than you may exploit these properties on this General tab. The second tab of the Solver Parameters window should be your first stop if your problem does not converge and you have verified there are no User Errors. On this screen, lowering the Relative Tolerance, raising the Maximum Number of Iterations or clicking the Highly Nonlinear Problem button can all help the problem to converge.

Aside: Meshing In general, you should also check to make sure that the solution to your problem (once obtained) is not mesh-dependent. Options relating to Meshing can be edited through the Mesh menu in COMSOL. The MeshMesh Parameters screen is especially important in that it allows you to refine the mesh near important features or suspected singularities. Also, using the MeshMap Mesh option you may define a rectangular grid by mapping the 4 sides of a quadrilateral to the boundaries in your

problem. Verifying that your solution does not change when using a rectangular grid is another good check on your solution. Also note that you may store and test your different meshes using MeshMesh Cases. For further guidance on these features see the COMSOL documentation

COMSOL Errors While the PDE-based solvers built into COMSOL (and its parent FEMLAB) are quite robust and well tested, the built-in equation systems, multi-physics linkages and physics Modules in COMSOL are quite new. As with any computer program, newer features tend to be buggier features. This is not to say that COMSOL has released a sub-par product, indeed many of the new features have been proven to be quite reliable and are great time-savers. Still, as with using any new scientific tool, it helps to maintain a healthy level of doubt about the validity or correctness of COMSOLs built-in physical formulations. In general, there are two areas where the most care should be taken. Firstly, when using pre-defined physical PDEs, be sure that the equations COMSOL provides are general enough. For instance, you would not want to blindly use COMSOLs Incompressible Navier-Stokes equation system for a problem that involves compressible flow. Secondly, when using formulas for material properties that change with temperature / pressure, etc., make sure that the formulas COMSOL gives are reasonable. It has been shown, for example, that the formula COMSOL gives currently for the viscosity of water at different temperatures is incorrect and it may be better in many cases to define the properties of the material you are dealing with yourself.

- Chapter 4 PDEUploaded byHui Jing
- Mathematical Model for Narcissistic Personality Disorder (NPD)Uploaded byRaj N Gaonkar
- CSIR UGC NET Mathematical Sciences SyllabusUploaded byaglasem
- Phương trình đạo hàm riêng tựa tuyến tínhUploaded byTiểu Minh Thái
- Chan Vese AlgorithmUploaded bynikesharai
- V 1Uploaded bychaithra580
- Option Pricing TreesUploaded byerereretzutzutzu
- Actr Ppt MatlabUploaded bymaulik
- 9709_s11_qp_33Uploaded byAbrar Jahin
- 2012 Spring Schedule of Classes - Online and Web-BlendedUploaded byLewis and Clark Community College
- 08aa301 Engineering Mathematics - IIIUploaded byVIGNESH L R
- Problem 2.108Uploaded byEric Castillo Martínez
- Hikers NotesUploaded bymanik1280
- number strings day 2Uploaded byapi-270541136
- fdpaperUploaded bygileper
- Application GuidelinesUploaded byMelissa Marie Hernandez
- day 9 3Uploaded byapi-245016022
- Age Problem and Mixed ProblemUploaded byPRINTDESK by Dan
- OpenModelica2016 Talk12 JanSilar PartialDifferentialEquationsinModelicaUploaded byAnkit Kumar
- MDV3-VVUQ-v0.5Uploaded byDawei Wang
- FEA Spring 2008 IntroUploaded byRajat Verma
- 20.pdfUploaded byRevanKumarBattu
- lec5_notes.pdfUploaded byHenrique Mariano Amaral
- Numerical Methods FinanceUploaded byIsbar Pratama
- algebra 1 1st 9 weeks calenderUploaded byapi-293229664
- MorsePaper.pdfUploaded byTezcatlipoca Acopiltaczet
- PhD Advertisement Aug_2016 UploadUploaded byAdv Sunil Kumar
- Lab1Uploaded byHakan Durmuş
- EES_Intro.pdfUploaded byAnonymous 4Gk3p5
- 2012_MAS201MidtermUploaded bys4ngw0n

- RESULT SHEETUploaded byERSHAD AHAMED. C
- Short Math Guide for LaTeXUploaded byJeff Pratt
- Behind the Arabic NameUploaded byERSHAD AHAMED. C
- Tips and TricksUploaded byERSHAD AHAMED. C
- dUploaded byERSHAD AHAMED. C
- InternationalGuide_20102011Uploaded byERSHAD AHAMED. C
- Review of Basic Finite Volume MethodeUploaded bysehenda
- Linear AlgebraUploaded byalterock07
- Poem NaomiUploaded byERSHAD AHAMED. C
- CAT SAMPLE PAPERUploaded byERSHAD AHAMED. C

- MHM Wp MsrmntTypesUploaded bydemostenes69
- The Building Blocks of GeometryUploaded byTweetie
- Chapter 09Uploaded byvschein333
- Net Positive Suction Head or NPSHUploaded bySathish Lingam
- clickerUploaded byecd4282003
- JournalNX- Measuring Floe ResistivityUploaded byJournalNX - a Multidisciplinary Peer Reviewed Journal
- Mechanical Properties 2Uploaded bySanjay P Nambiar
- Print - The Force Produced by a Magnetic FieldUploaded byjadidf
- DESIGN OF TOROIDAL TRANSFORMERSUploaded bynaxo128
- Forging and ForgeabilityUploaded byjestin
- Locking System-FULL REPORTUploaded byMurali Vannappan
- 364-419Uploaded byErnest Navarro
- TorqueUploaded byChristopher Morris
- Chapter 3 AerofoilsUploaded bytopgun320
- 1-D motionUploaded byIbadul Qadeer
- Five Level Cascaded H-Bridge Multilevel Inverter Using Multicarrier Pulse Width Modulation TechniquesUploaded bySanthosh Guduru
- DC Machines Lab ManualsUploaded byHazoorAhmad
- Turbulent flowUploaded bycrisjrogers
- Excellent Review on Lum MaterialsUploaded byShreyas Pitale
- Graneau Paper on Water ExplosionsUploaded bybisquick_anonymous
- ExcitonUploaded byUdoy Paul
- Static and Dynamic Balancing of RotorsUploaded bypaul1tto
- - Particle Physics Gauge And Higgs Bosons (2006).pdfUploaded byturbina55
- electricalinterviewquestionsfromac-140605022425-phpapp01Uploaded byDebajyoti Ghosh
- Tecnica_150 152 170 168GE Inverter SmUploaded byIsrael B Chavez
- Nota Padat ForceUploaded byjesunathan44@yahoo.com
- Amino Acids for WebUploaded byBrenda Trevino
- Data Sheet SP 30-10Uploaded byAkbar Alif
- Enrico Rodrigo- Wormholes, Void Bubbles and Vacuum Energy SuppressionUploaded byGijke3
- chemical reaction 2Uploaded byapi-296824694