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.

Reg Initial Condition in Transient solver

Please login with a confirmed email address before reporting spam

Hi All,

I am getting trouble with my transient model in which I have defined all initial conditions to be zero in the subdomain settings and in the solver manager I am selecting "Initial Value Expression" as 'Initial value' and "Use setting from Initial Value frame" as the 'Values of variables not solved for and linearization point' in the Initial Value tab.

Then I am just running the model. After simulation, when I am plotting flux density, current density at time 0 (initial time) , the plots are showing non zero value ..not only that current density has huge value at initial time!!

I have also tried few other configurations in the solver manager but no luck yet.

I am not getting why this is happening.

Can anyone help me with this?

S. Paul

4 Replies Last Post Mar 9, 2011, 5:07 a.m. EST
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 Jun 30, 2010, 1:42 a.m. EDT
Hi

I'm not sure what can be happening, but I often check my initial conditions (before a full solver sequence) by using the "get initial conditions" in V3.5a, that now is called "compute to Selected" in V4 (right click in the study tree sub levels) this helps often to debug such issues.

Hope it will hep for you too
Ivar
Hi I'm not sure what can be happening, but I often check my initial conditions (before a full solver sequence) by using the "get initial conditions" in V3.5a, that now is called "compute to Selected" in V4 (right click in the study tree sub levels) this helps often to debug such issues. Hope it will hep for you too Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 30, 2010, 1:13 p.m. EDT
Thanks for your reply.

I tried what you have suggested.
After setting all initial conditions zero, I got initial value from "Solve" tab and I can see evrything sitting at zero value at time t=0 (initial time) as expected.

But then I go to solver manager, store the current solution at time t=0. Next, I choose "Stored Solution" at time '0' as my initial condition. Then I go to Solver Parameters and chose my simulation time as 0:1e-4:2e-2.

After simulation, I try to plot e.g flux density at time 0 by choosing it from the list of stored output times and I can see non zero flux density!

so before my simulation, flux density was zero at time 0 and after it is not zero for the same time t=0

I guess I am not understanding how COMSOL interprets initial condition and uses it for transient solver.

One more point, if I choose simulation time as 1e-4:1e-4:2e-2 instead of 0:1e-4:2e-2, then after simulation I can see the same data, plot evrything for time 1e-4 (start time of simulation) as what I got before for time t=0 (same non zero flux and current ).
Thanks for your reply. I tried what you have suggested. After setting all initial conditions zero, I got initial value from "Solve" tab and I can see evrything sitting at zero value at time t=0 (initial time) as expected. But then I go to solver manager, store the current solution at time t=0. Next, I choose "Stored Solution" at time '0' as my initial condition. Then I go to Solver Parameters and chose my simulation time as 0:1e-4:2e-2. After simulation, I try to plot e.g flux density at time 0 by choosing it from the list of stored output times and I can see non zero flux density! so before my simulation, flux density was zero at time 0 and after it is not zero for the same time t=0 I guess I am not understanding how COMSOL interprets initial condition and uses it for transient solver. One more point, if I choose simulation time as 1e-4:1e-4:2e-2 instead of 0:1e-4:2e-2, then after simulation I can see the same data, plot evrything for time 1e-4 (start time of simulation) as what I got before for time t=0 (same non zero flux and current ).

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 Jun 30, 2010, 4:28 p.m. EDT
Hi

I would then propose that you ask support directly. I'm not sure what to propose, and your remark seems logical for me, but not the results

And if possible, keep us informed here too, there are always something to learn

Good luck
Ivar
Hi I would then propose that you ask support directly. I'm not sure what to propose, and your remark seems logical for me, but not the results And if possible, keep us informed here too, there are always something to learn Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 9, 2011, 5:07 a.m. EST
Maybe the reason is because you have a DAE system with inconsistent initial values.

Time stepping, then look at the "Consistent initilization of DAE systems" default setting is "Backward Euler",
that's why the plot at time t = 0 is not zero any more, the solver modify the initial values in order to have a
consistent initial values for the problem.

If you have an exactly consistent initial values with with the boundaries, after solving, you will see the solution at time t = 0 will be exactly the same as your prescribed initial conditions.

A simple example could be tested if you use a 1D heat problem, giving initial condition temperature = 1000, boundary condition at two ends temperature = 0, then you will see this solution at t = 0.
But if you give a initial value as the analytical solution to the problem at t = 0, will be solution at t = 0 will be exactly the same as you prescribed.

Does this make sense?
XLi
Maybe the reason is because you have a DAE system with inconsistent initial values. Time stepping, then look at the "Consistent initilization of DAE systems" default setting is "Backward Euler", that's why the plot at time t = 0 is not zero any more, the solver modify the initial values in order to have a consistent initial values for the problem. If you have an exactly consistent initial values with with the boundaries, after solving, you will see the solution at time t = 0 will be exactly the same as your prescribed initial conditions. A simple example could be tested if you use a 1D heat problem, giving initial condition temperature = 1000, boundary condition at two ends temperature = 0, then you will see this solution at t = 0. But if you give a initial value as the analytical solution to the problem at t = 0, will be solution at t = 0 will be exactly the same as you prescribed. Does this make sense? XLi

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.