Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Solving a boundary value problem in comsol

Please login with a confirmed email address before reporting spam

Hello,

I am relatively new to COMSOL. I am trying to solve a system of non-linear stationary PDEs. I know that the equations work because I have tested them in MATLAB. I tried a simple test run in the attached example.

d(theta)/dx=constant. theta(0)=0

I expect theta to linearly increase with x. Instead I get oscillatory behavior. What am I missing in the set up?

All help is appreciated.

Thanks,
Padmini


3 Replies Last Post 07.12.2011, 13:07 GMT-5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23.11.2011, 02:37 GMT-5
Hi

yes and if you change the mesh the oscillations will become denser, just as if you turn on the discretisation and use linear elements it will become triangular: oscillating between two stable conditions ...

Then check the first and the last value (at the two boundaries) and compare two your TWO active boundary conditions

Try a search of on the FORUM, there are several discussion about this earlier (2-3 years ago (with v3.5a at that time)

--
Good luck
Ivar
Hi yes and if you change the mesh the oscillations will become denser, just as if you turn on the discretisation and use linear elements it will become triangular: oscillating between two stable conditions ... Then check the first and the last value (at the two boundaries) and compare two your TWO active boundary conditions Try a search of on the FORUM, there are several discussion about this earlier (2-3 years ago (with v3.5a at that time) -- Good luck Ivar

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23.11.2011, 07:42 GMT-5
Hi,

When using the general form PDE interface, the model is inconsistent with the default boundary condition at x = 10, because you have a nonzero flux n*Gamma at the boundary but the default boundary condition specifies a zero flux. This is the reason why the solution oscillates. You can use one of the following approaches to solve this differential equation using COMSOL:

1. Add a Flux/Source node to the general form PDE interface to specify the boundary flux at the end boundary.

2. Specify the equation with a coefficient form PDE interface using the convection coefficient beta to specify the equation. Then the flux as defined by Gamma becomes zero, and the default boundary condition becomes fulfilled as it is essentially 0 = 0.

3. Use a Global ODEs and DAEs interface to solve the equation as an ODE d(theta)/dt = constant using the time t as the independent variable.

Best regards,
Magnus Ringh, COMSOL
Hi, When using the general form PDE interface, the model is inconsistent with the default boundary condition at x = 10, because you have a nonzero flux n*Gamma at the boundary but the default boundary condition specifies a zero flux. This is the reason why the solution oscillates. You can use one of the following approaches to solve this differential equation using COMSOL: 1. Add a Flux/Source node to the general form PDE interface to specify the boundary flux at the end boundary. 2. Specify the equation with a coefficient form PDE interface using the convection coefficient beta to specify the equation. Then the flux as defined by Gamma becomes zero, and the default boundary condition becomes fulfilled as it is essentially 0 = 0. 3. Use a Global ODEs and DAEs interface to solve the equation as an ODE d(theta)/dt = constant using the time t as the independent variable. Best regards, Magnus Ringh, COMSOL

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 07.12.2011, 13:07 GMT-5
Thank you both for your comments. It helped immensely.

Padmini
Thank you both for your comments. It helped immensely. Padmini

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.