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

Discussion Locked This discussion was locked by a forum moderator.

Convergence problem in time dependent solver

Please login with a confirmed email address before reporting spam

Hi,

I'm getting this error when running a time dependent simulation of laminar flow in a micro channel. What I want to do is change the input flow on one arm of a y-channel and follow the response in time. Anyway it's this error:

Repeated error test failures. May have reached a singularity.
Time : 0
Last time step is not converged.

Now I've seen people with similar problems where it is due to too large a change in the time dependent parameter but I don't see how this is the case here. I am simulating for t=0 with the stationary solver first which is giving the correct result and at t=0 for the time dependent solver the boundary conditions should be exactly the same. I've tried several different time steps and different arrangements for the step function I'm using to change the flow. If it failed as the flow changed I'd think there was a point to the error but this doesn't make sense to me. Anyone have any ideas?

28 Replies Last Post 11.08.2015, 15:44 GMT-4
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 26.09.2011, 15:03 GMT-4
Hi

have you tried to start your time solving with the saved values of the stationary case for initial conditions, I have noticed that CFD, in particular microfluidics is very senstive to the initial conditions, and converges mostly easily if already prepared with a reasonnable flow and pressure drops

--
Good luck
Ivar
Hi have you tried to start your time solving with the saved values of the stationary case for initial conditions, I have noticed that CFD, in particular microfluidics is very senstive to the initial conditions, and converges mostly easily if already prepared with a reasonnable flow and pressure drops -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 26.09.2011, 17:50 GMT-4
Hi,

Difficult to say without looking at the model, can you post it?

Cheers
Hi, Difficult to say without looking at the model, can you post it? Cheers

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.09.2011, 05:23 GMT-4
Here's the model. Might be in a bit of a mess as this is the one I've been playing around with to see if I can get it to work, for example the step function used to generate the flow change might not be right but I've tried many different versions of that and none of them have really worked.

Regarding using saved results from a stationary solution in the time dependent. Doesn't it do this by default if you create a new study with a stationary solver then add the time dependent study step after it? I got a lot of the ideas for how to do this (bar the time dependent flow) from the tutorial video "Microfluidics Simulation of an H-Cell" and I don't think they had to explicitly set the time dependent step to use the solution from the prior stationary solver. Maybe I should try a courser grid as well?

Cheers
Stewart
Here's the model. Might be in a bit of a mess as this is the one I've been playing around with to see if I can get it to work, for example the step function used to generate the flow change might not be right but I've tried many different versions of that and none of them have really worked. Regarding using saved results from a stationary solution in the time dependent. Doesn't it do this by default if you create a new study with a stationary solver then add the time dependent study step after it? I got a lot of the ideas for how to do this (bar the time dependent flow) from the tutorial video "Microfluidics Simulation of an H-Cell" and I don't think they had to explicitly set the time dependent step to use the solution from the prior stationary solver. Maybe I should try a courser grid as well? Cheers Stewart


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.09.2011, 05:31 GMT-4
Hi,

Sorry, can't open it, it seems an AC/DC licence is required. Can you try to describe the channel and BCs and the fluid more in detail? Is it water? What is the inlet condition and the outlet?

After you solve it statically, you want to impose a change of inflow over how long a time interval?

Cheers
Hi, Sorry, can't open it, it seems an AC/DC licence is required. Can you try to describe the channel and BCs and the fluid more in detail? Is it water? What is the inlet condition and the outlet? After you solve it statically, you want to impose a change of inflow over how long a time interval? Cheers

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.09.2011, 06:00 GMT-4
That's strange, we have a licence for AC/DC but this definitely doesn't use it, it's just 2D laminar flow and diffusion physics. That's a bit stupid if saved models require all of the licensed modules you have rather than just those involved in the model.

It's a simple y-channel with a 3rd, narrower inlet in between the two main inlets, which isn't used in this simulation. Fluid is set as water and there are a few little pillars (particle traps) in the outlet channel, which is twice the width of the inlets. It's a 2D simulation with incompressible flow and the shallow channel set to 5um. Inlets are laminar, volumetric flows in the 10^-12 m^3/s scale and the outlet is pressure of 0. The inlets have long laminar regions leading in, on the cm scale reflecting the design for the real device. The problem we want to look is how long it takes for the boundary between the two laminar flow regions to move when the flow in one inlet is changed sharply. I'm doing this by having different concentrations of "something" on each input as in the H-Channel tutorial example.

The stationary solver takes seconds and looks very sensible. I've not tried to get the time dependent solver to do something with a sudden step in the input, the 0s condition should be exactly the same as the stationary. If there's something I can do in comsol to save the model without the requirement for AC/DC then let me know and I'll repost it.

Cheers
Stewart
That's strange, we have a licence for AC/DC but this definitely doesn't use it, it's just 2D laminar flow and diffusion physics. That's a bit stupid if saved models require all of the licensed modules you have rather than just those involved in the model. It's a simple y-channel with a 3rd, narrower inlet in between the two main inlets, which isn't used in this simulation. Fluid is set as water and there are a few little pillars (particle traps) in the outlet channel, which is twice the width of the inlets. It's a 2D simulation with incompressible flow and the shallow channel set to 5um. Inlets are laminar, volumetric flows in the 10^-12 m^3/s scale and the outlet is pressure of 0. The inlets have long laminar regions leading in, on the cm scale reflecting the design for the real device. The problem we want to look is how long it takes for the boundary between the two laminar flow regions to move when the flow in one inlet is changed sharply. I'm doing this by having different concentrations of "something" on each input as in the H-Channel tutorial example. The stationary solver takes seconds and looks very sensible. I've not tried to get the time dependent solver to do something with a sudden step in the input, the 0s condition should be exactly the same as the stationary. If there's something I can do in comsol to save the model without the requirement for AC/DC then let me know and I'll repost it. Cheers Stewart

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28.09.2011, 10:32 GMT-4
Hi,

I hope I understood correctly what you are trying to do, I did manage to obtain a dynamic solution starting with a stationary one.

I first solve a statioanry study with a statioanry step, then I create a dynamic study with a dynamic step, I redefine the inlet condition to have the same flow rate as in the stationary case plus a time dependent term with a step function.

I let the default solver be shown in the dynamic study and I set the initial condition for all the variables (solved and not solved for) to be obtained from the previous study (under 'Method' choose 'Solution' and under 'Solution' choose the appropriate Solver).

Having a stationary step followed by a dynamic step in the same solver may cause problems because the stationary step can't udnerstand the variable 't' for time.

Hope it can help, and lookign forward to any suggestion.

Cheers
Hi, I hope I understood correctly what you are trying to do, I did manage to obtain a dynamic solution starting with a stationary one. I first solve a statioanry study with a statioanry step, then I create a dynamic study with a dynamic step, I redefine the inlet condition to have the same flow rate as in the stationary case plus a time dependent term with a step function. I let the default solver be shown in the dynamic study and I set the initial condition for all the variables (solved and not solved for) to be obtained from the previous study (under 'Method' choose 'Solution' and under 'Solution' choose the appropriate Solver). Having a stationary step followed by a dynamic step in the same solver may cause problems because the stationary step can't udnerstand the variable 't' for time. Hope it can help, and lookign forward to any suggestion. Cheers


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 28.09.2011, 11:38 GMT-4
Thanks for the reply Amir, I'll see there's anything I can learn from the model you posted. I don't know if the two step process you describe will improve things as I understand that it's possible to use time as a variable in a stationary study if you define t=0[s] as a parameter which will subsequently be overwritten by the time dependent study. I got that from another discussion on this forum so if it's wrong then maybe someone can tell me. Otherwise I'm not sure how you define a non-time dependent boundary condition for the inlet in the stationary study but a different condition for the time dependent, but that's probably just my ignorance of comsol showing through.

In the mean time, if you can't see my model then perhaps someone can learn something from the convergence plot from the failed study, which is attached.

Thanks for all the help, I beginning to suspect there is something deeper wrong with my model.

Stewart
Thanks for the reply Amir, I'll see there's anything I can learn from the model you posted. I don't know if the two step process you describe will improve things as I understand that it's possible to use time as a variable in a stationary study if you define t=0[s] as a parameter which will subsequently be overwritten by the time dependent study. I got that from another discussion on this forum so if it's wrong then maybe someone can tell me. Otherwise I'm not sure how you define a non-time dependent boundary condition for the inlet in the stationary study but a different condition for the time dependent, but that's probably just my ignorance of comsol showing through. In the mean time, if you can't see my model then perhaps someone can learn something from the convergence plot from the failed study, which is attached. Thanks for all the help, I beginning to suspect there is something deeper wrong with my model. Stewart


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 28.09.2011, 14:54 GMT-4
Hi

define "t=0" as a "Definition Parameter" (and not a "Variable") then it should work (for the stationary case) with a "t" dependence in a boundary condition.

Parameters are estimated at initial run time, and only chaged if adressed via a "Parametric Sweep" or "Continuation sweep" solver sequence

--
Good luck
Ivar
Hi define "t=0" as a "Definition Parameter" (and not a "Variable") then it should work (for the stationary case) with a "t" dependence in a boundary condition. Parameters are estimated at initial run time, and only chaged if adressed via a "Parametric Sweep" or "Continuation sweep" solver sequence -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29.09.2011, 02:40 GMT-4
Hi,

I did try to set the t as a parameter as you mentioned and then have it used as a built-in variable by the time -dependent solver but it gave me far too many problems so I simply cut the corner and divided the problem into two studies. When you open the solution of the time dependent one, if you defined everything correctly, you actually start from the steady state solution and you can see how it evolves over time.

If you manage to get the t-parameter work please let me know.

Regarding your convergence plot, it looks perfectly fine.

Cheers
Hi, I did try to set the t as a parameter as you mentioned and then have it used as a built-in variable by the time -dependent solver but it gave me far too many problems so I simply cut the corner and divided the problem into two studies. When you open the solution of the time dependent one, if you defined everything correctly, you actually start from the steady state solution and you can see how it evolves over time. If you manage to get the t-parameter work please let me know. Regarding your convergence plot, it looks perfectly fine. Cheers

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29.09.2011, 02:40 GMT-4
Hi,

I did try to set the t as a parameter as you mentioned and then have it used as a built-in variable by the time -dependent solver but it gave me far too many problems so I simply cut the corner and divided the problem into two studies. When you open the solution of the time dependent one, if you defined everything correctly, you actually start from the steady state solution and you can see how it evolves over time.

If you manage to get the t-parameter work please let me know.

Regarding your convergence plot, it looks perfectly fine.

Cheers
Hi, I did try to set the t as a parameter as you mentioned and then have it used as a built-in variable by the time -dependent solver but it gave me far too many problems so I simply cut the corner and divided the problem into two studies. When you open the solution of the time dependent one, if you defined everything correctly, you actually start from the steady state solution and you can see how it evolves over time. If you manage to get the t-parameter work please let me know. Regarding your convergence plot, it looks perfectly fine. Cheers

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 29.09.2011, 07:50 GMT-4
Hi

does this do the job for you ? (to understand how to use the parameter t and a boundary load depending on "t"

Its a simple model I load it with the stationary solver and then observe the oscillations with the time series, I defined the model in stationary and then added the time series BEFORE I ran the mode so that COMSOL looked after the coupling. To resolve the oscillations I need to use a shorter time step than the default defined one

--
Good luck
Ivar
Hi does this do the job for you ? (to understand how to use the parameter t and a boundary load depending on "t" Its a simple model I load it with the stationary solver and then observe the oscillations with the time series, I defined the model in stationary and then added the time series BEFORE I ran the mode so that COMSOL looked after the coupling. To resolve the oscillations I need to use a shorter time step than the default defined one -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29.09.2011, 08:12 GMT-4
Hi,

Thanks Ivar for the suggestion, it is quite similar to what I did, but instead of having just the time multiplying one term of the inlet I used a step function and I get the error non linear solver did not converge.

Maybe I need to find a better time step, I have been tweaking the solver only a little bit then I just decided to go for the shortcut and renounce to some automatization.

Please find attached the model with the integrated static and dynamic solvers.

Cheers
Hi, Thanks Ivar for the suggestion, it is quite similar to what I did, but instead of having just the time multiplying one term of the inlet I used a step function and I get the error non linear solver did not converge. Maybe I need to find a better time step, I have been tweaking the solver only a little bit then I just decided to go for the shortcut and renounce to some automatization. Please find attached the model with the integrated static and dynamic solvers. Cheers


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 02.10.2011, 10:54 GMT-4
Hi

Some comments:
1) first of all you are in 2D and not 2D-AXI so you are in fact modelling flow between two fixed plates, but this is close to tube fluid model anyhow, always a good start

2) your flow, with non-slip conditions will take a parabolic profile, but you start flat, this is demanding for the solver to get to converge,

3) you could define an initial condition with already a parabolic flow and a pressure drop .e. from Poiseuille, there are many threads on the Forum (try a search) about this and models to study first to get the grasp of fluid modelling, as this is rather complex (and I'm not an expert myself)
OK your stationary solver is getting there so COMSOL managed with the "0" initial conditions, but then you have a strange (for me ;) formula for the velocity . You could also replace the stationary solve now fully by preset initial conditions from the first calculation

4) your laminar inflow set up seems odd, check your doc sure you want the boolean condition *step1(t[1/s]==0) without the ==0 it converges far better but I'm not sure its the solution you are looking for ?

5) your mesh is fine and with boundary layers, that looks good, the "cell Renolds number is low, good to

So in conclusion, try to remove the "==0", then in the time stepping solver use plot while solving to see what is happening, it often helps to debug, and check the solution if it's what you wanted

--
Good luck
Ivar
Hi Some comments: 1) first of all you are in 2D and not 2D-AXI so you are in fact modelling flow between two fixed plates, but this is close to tube fluid model anyhow, always a good start 2) your flow, with non-slip conditions will take a parabolic profile, but you start flat, this is demanding for the solver to get to converge, 3) you could define an initial condition with already a parabolic flow and a pressure drop .e. from Poiseuille, there are many threads on the Forum (try a search) about this and models to study first to get the grasp of fluid modelling, as this is rather complex (and I'm not an expert myself) OK your stationary solver is getting there so COMSOL managed with the "0" initial conditions, but then you have a strange (for me ;) formula for the velocity . You could also replace the stationary solve now fully by preset initial conditions from the first calculation 4) your laminar inflow set up seems odd, check your doc sure you want the boolean condition *step1(t[1/s]==0) without the ==0 it converges far better but I'm not sure its the solution you are looking for ? 5) your mesh is fine and with boundary layers, that looks good, the "cell Renolds number is low, good to So in conclusion, try to remove the "==0", then in the time stepping solver use plot while solving to see what is happening, it often helps to debug, and check the solution if it's what you wanted -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 02.10.2011, 12:34 GMT-4
Hi,

Thank you veru much for your reply Ivar, but I am afraid there is some misunderstanding.

1) This is a hugely oversimplified model due to the topic of the original post: how to get a stationary step at first and then in the same study how to get a time-dependent step using the solution of the stationary step.
The shape of the channel is immaterial: since I could not open the originally attached file because of some weird license issue, I created an oversimplified geometry to show how to get a time-dependent study to use a stationary solution.

2) Given that this is laminar flow, it is immaterial once again whether you start parabolic, flat or blunt, it will converge.

3)-4) The goal is to use a stationary solution into a time-dependent study, which I achieved by having two different studies, I could not couple the stationary step and the time-dependent one in the same study. I am sorry I am not sure about what you mean with the strange formula with the velocity. And, finally, to use the step function without initializing it (i.e. getting rid of the ==0), will simply tell the solver to start solving from scratch without using the previous stationary solution.

All in all I think I will simply stick to the two-studies method of coupling stat. and time-dep.

Cheers
Hi, Thank you veru much for your reply Ivar, but I am afraid there is some misunderstanding. 1) This is a hugely oversimplified model due to the topic of the original post: how to get a stationary step at first and then in the same study how to get a time-dependent step using the solution of the stationary step. The shape of the channel is immaterial: since I could not open the originally attached file because of some weird license issue, I created an oversimplified geometry to show how to get a time-dependent study to use a stationary solution. 2) Given that this is laminar flow, it is immaterial once again whether you start parabolic, flat or blunt, it will converge. 3)-4) The goal is to use a stationary solution into a time-dependent study, which I achieved by having two different studies, I could not couple the stationary step and the time-dependent one in the same study. I am sorry I am not sure about what you mean with the strange formula with the velocity. And, finally, to use the step function without initializing it (i.e. getting rid of the ==0), will simply tell the solver to start solving from scratch without using the previous stationary solution. All in all I think I will simply stick to the two-studies method of coupling stat. and time-dep. Cheers

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 02.10.2011, 17:00 GMT-4
Hi

OK if the ==0 is enough and the solution is as you want then, i'ts solved so far ;)

I agree too that usig a steady state solution first to set good initial conditions is often worth the work, but I have also noted that starting with reasonnable initial conditions, mostly allows me to skip the first stationary case, and a parabolic profile + a presure drop à la Poiseuille have often resolved the issue for me, so far

--
Good luck
Ivar
Hi OK if the ==0 is enough and the solution is as you want then, i'ts solved so far ;) I agree too that usig a steady state solution first to set good initial conditions is often worth the work, but I have also noted that starting with reasonnable initial conditions, mostly allows me to skip the first stationary case, and a parabolic profile + a presure drop à la Poiseuille have often resolved the issue for me, so far -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 03.10.2011, 09:34 GMT-4
Ivar, although your posts have been helpful to my understanding of the time dependent solver issues I'm not sure I'm any further ahead in finding a practical solution to my problems. Could you possibly take a look a that the original model file I posted and see if you can see any problems? I managed to run your mechanical simulation without any problem but the models that Amir posted with the changing flow at a channel input seemed to take a very long time for the initial time step. Usually it would start with time steps of 10^-12 and after 20 minutes still be at 0% with time steps around 10^-9. I'm afraid I lost patience at that point because I wanted to look at another file. I'm not sure if that was how they were supposed to run or not. Anyway, I simplified my design to a t-junction with similar dimensions but without the little pillars in my first design. This gave me similar singularity errors or occasionally something about the non-linear solver failing. I shall attach that file to this post. It might be in a bit of a mess as I was playing around with meshing but I've got something running at the moment so I can't reopen it to change it just now.

Regards
Stewart
Ivar, although your posts have been helpful to my understanding of the time dependent solver issues I'm not sure I'm any further ahead in finding a practical solution to my problems. Could you possibly take a look a that the original model file I posted and see if you can see any problems? I managed to run your mechanical simulation without any problem but the models that Amir posted with the changing flow at a channel input seemed to take a very long time for the initial time step. Usually it would start with time steps of 10^-12 and after 20 minutes still be at 0% with time steps around 10^-9. I'm afraid I lost patience at that point because I wanted to look at another file. I'm not sure if that was how they were supposed to run or not. Anyway, I simplified my design to a t-junction with similar dimensions but without the little pillars in my first design. This gave me similar singularity errors or occasionally something about the non-linear solver failing. I shall attach that file to this post. It might be in a bit of a mess as I was playing around with meshing but I've got something running at the moment so I can't reopen it to change it just now. Regards Stewart


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 03.10.2011, 09:57 GMT-4
Oh yes, I tried something else which I should have mentioned. I took the time dependence of the boundary condition out of my t-juncton model (seeing as how the t=0 condition should be the same as the stationary solver anyway before the input switches) and it still failed with a similar error. I'm guessing that shouldn't happen right? I've currently got an adaption of Amirs channel running with the time dependent solver stagnating with a convergence oscillating between 2.49e8 and 4.98e8 with a time value of 2.28e-6 and no sign of it ever getting to the first time point. What am I doing wrong?
Oh yes, I tried something else which I should have mentioned. I took the time dependence of the boundary condition out of my t-juncton model (seeing as how the t=0 condition should be the same as the stationary solver anyway before the input switches) and it still failed with a similar error. I'm guessing that shouldn't happen right? I've currently got an adaption of Amirs channel running with the time dependent solver stagnating with a convergence oscillating between 2.49e8 and 4.98e8 with a time value of 2.28e-6 and no sign of it ever getting to the first time point. What am I doing wrong?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 03.10.2011, 11:42 GMT-4
Okay, so I somehow managed to get the t-junction model to run time dependent and not fail at the first time point. I've really no idea how I managed to do it. I was very surprised when the solution with no-change to the input boundary conditions worked. Maybe because I got rid of the concentration physics to see if that helped, maybe because I rebuilt the structure and regridded. I'm very unsure of how changing things in the model definition filters through the solver as it doesn't seem very consistent or intuitive to me. Anyway. I then put back in a step and tried running it again. This time it did something similar to Amir's after nearly 0.15s (which is just as the step completes) the time step size shot down to the 10e-13 range then after a further 10 minutes or so of slowly falling it got stuck oscillating between 6.5e-9 and 1.3e-9. I'm afraid I'm running this remotely so I can't wait for this to take weeks to solve so I stopped it at that point and I'm attaching the file saved at that point. Help would be gratefully received. Otherwise I will just have to give up I think.

Stewart
Okay, so I somehow managed to get the t-junction model to run time dependent and not fail at the first time point. I've really no idea how I managed to do it. I was very surprised when the solution with no-change to the input boundary conditions worked. Maybe because I got rid of the concentration physics to see if that helped, maybe because I rebuilt the structure and regridded. I'm very unsure of how changing things in the model definition filters through the solver as it doesn't seem very consistent or intuitive to me. Anyway. I then put back in a step and tried running it again. This time it did something similar to Amir's after nearly 0.15s (which is just as the step completes) the time step size shot down to the 10e-13 range then after a further 10 minutes or so of slowly falling it got stuck oscillating between 6.5e-9 and 1.3e-9. I'm afraid I'm running this remotely so I can't wait for this to take weeks to solve so I stopped it at that point and I'm attaching the file saved at that point. Help would be gratefully received. Otherwise I will just have to give up I think. Stewart


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 04.10.2011, 01:54 GMT-4
Hi

you have initial conditions = 0 (study1) then you apply a non zero flow and ask COMSOL to find directly the good starting point, this is always delicate, you could use a short ramp to get the flow going, or add a reasonable initial flow velocity and pressure drop

In study 2 you use a stationary case, which is indeed another method I can only recommend, to get a starting point for t=0

One thing are you sure your Inlet 2 flow function is OK ?
Often its better to make an analytical function and plot it to check the shape then use the analytical function in the BC call, because if you wanted fl2 to turn "on" after 0.1 seconds I believe you have missed sign in there, you can also define a step "from 1 to 0" check the definition

When you have convergence issues, try to get COMSOL to plot a useful value during its solving, this helps to see what is going wrong and might give a clue how to handle it

you seem to get a convergence issue when the flow has fully stopped in the inlet2 if you keep a very small flow it seems to work better i.e Fl1/1000 or even 1000 times less ;)

--
Good luck
Ivar
Hi you have initial conditions = 0 (study1) then you apply a non zero flow and ask COMSOL to find directly the good starting point, this is always delicate, you could use a short ramp to get the flow going, or add a reasonable initial flow velocity and pressure drop In study 2 you use a stationary case, which is indeed another method I can only recommend, to get a starting point for t=0 One thing are you sure your Inlet 2 flow function is OK ? Often its better to make an analytical function and plot it to check the shape then use the analytical function in the BC call, because if you wanted fl2 to turn "on" after 0.1 seconds I believe you have missed sign in there, you can also define a step "from 1 to 0" check the definition When you have convergence issues, try to get COMSOL to plot a useful value during its solving, this helps to see what is going wrong and might give a clue how to handle it you seem to get a convergence issue when the flow has fully stopped in the inlet2 if you keep a very small flow it seems to work better i.e Fl1/1000 or even 1000 times less ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.10.2011, 02:32 GMT-4
Hi,

I am a bit lost with everything was written lately but I did manage to have your t-junction to work properly.

First of all I coul dopen the file this time, I don't know why.

Second, I got rid of the t-parameter.

Third, I set two independent studies, first the steady state then the time dependent.

Fourth, I defined a new parameter Lentr= entrance length, which is given by Reynolds*0.06*diameter and gives the entrance length along which the flow profile develops.

Fifth, I enabled the Stokes approximation, since Re=0.38<1

Sixth, I disabled the distributed species analysis and I got a steady state solution.

Seventh, again without the diluted species analysis I got a time dependent solution starting with the stationary one.

In conclusion, I fine tuend a couple of parameters and I got rid of the diltued species to get a solution. I think you may want to have a look at that analysis because it seems to be the cause of the failrue of your simulations.

I will try to have a look at it.

Please find attached the modified model.

Cheers
Hi, I am a bit lost with everything was written lately but I did manage to have your t-junction to work properly. First of all I coul dopen the file this time, I don't know why. Second, I got rid of the t-parameter. Third, I set two independent studies, first the steady state then the time dependent. Fourth, I defined a new parameter Lentr= entrance length, which is given by Reynolds*0.06*diameter and gives the entrance length along which the flow profile develops. Fifth, I enabled the Stokes approximation, since Re=0.38


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 05.10.2011, 10:46 GMT-4
Thanks, you were right about the flow function being incorrect, it shouldn't have been going to zero but to Fl2. I managed to get it running fine but it still acts a little weird at times. For example all I did was change the end time in the time dependent study from 1 second to a 0.2 seconds and that made it fail to converge at the first time point with the "may have reached singularity" error. Anyway, I think apart my problem has been sorted out. I wish I knew exactly at what point it started to work and I hope it will continue to do so once I put back in the diffusion physics. Thanks to everyone who's attempted to help at some point.
Thanks, you were right about the flow function being incorrect, it shouldn't have been going to zero but to Fl2. I managed to get it running fine but it still acts a little weird at times. For example all I did was change the end time in the time dependent study from 1 second to a 0.2 seconds and that made it fail to converge at the first time point with the "may have reached singularity" error. Anyway, I think apart my problem has been sorted out. I wish I knew exactly at what point it started to work and I hope it will continue to do so once I put back in the diffusion physics. Thanks to everyone who's attempted to help at some point.

Muhammad Mohsin Rehman

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 07.11.2011, 09:39 GMT-5
Hi Stewart,

I have s similar problem too.I am coupling the Microwaves Heating with Darcy's flow and heating the fluid by microwaves for one year.After one year I am trying to get an information about the Darcy flow for further two years.
If I run both of them alone they work fine but when I try to couple them, the solution does not converge and the convergence factor switches between 1.39e8 and 2.79e8 without giving any error or results.

Initially it gave the same error of convergence and singularity as you mentioned then I changed the timing to microwaves heating for one day and Darcy flow for another day following microwaves heating. Results were obtained from both the models in coupled form but when I again tried to change the microwaves heating time to one year and Darcy Flow time to two years following Microwaves heating it started switching between two high values in the convergence section and did neither give any error nor results.

Can you suggest some thing?

Regards,
Hi Stewart, I have s similar problem too.I am coupling the Microwaves Heating with Darcy's flow and heating the fluid by microwaves for one year.After one year I am trying to get an information about the Darcy flow for further two years. If I run both of them alone they work fine but when I try to couple them, the solution does not converge and the convergence factor switches between 1.39e8 and 2.79e8 without giving any error or results. Initially it gave the same error of convergence and singularity as you mentioned then I changed the timing to microwaves heating for one day and Darcy flow for another day following microwaves heating. Results were obtained from both the models in coupled form but when I again tried to change the microwaves heating time to one year and Darcy Flow time to two years following Microwaves heating it started switching between two high values in the convergence section and did neither give any error nor results. Can you suggest some thing? Regards,

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 07.11.2011, 11:56 GMT-5
I'm not sure I can offer any help but it's worth looking back at some of the other replies in this thread. I think that fundamentally my model was wrong and there were problems with the way that the boundary conditions were setup. There may also be issues with linked physics in a transient model like this as removing the diffusion physics often solved the problems with the solver convergence.
I'm not sure I can offer any help but it's worth looking back at some of the other replies in this thread. I think that fundamentally my model was wrong and there were problems with the way that the boundary conditions were setup. There may also be issues with linked physics in a transient model like this as removing the diffusion physics often solved the problems with the solver convergence.

Muhammad Mohsin Rehman

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 07.11.2011, 21:43 GMT-5
But if the problem is in physics or BCs then how is it running smoothly for the coupled model and a simulation time of up to a day or two?

Was your model running for small time and giving convergence error for large time?
But if the problem is in physics or BCs then how is it running smoothly for the coupled model and a simulation time of up to a day or two? Was your model running for small time and giving convergence error for large time?

Muhammad Mohsin Rehman

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 08.11.2011, 08:17 GMT-5
Assalam o alaykum Amir,

I have s similar problem too.I am coupling the Microwaves Heating with Darcy's flow and heating the fluid by microwaves for one year.After one year I am trying to get an information about the Darcy flow for further two years.
If I run both of them alone they work fine but when I try to couple them, the solution does not converge and the convergence factor switches between 1.39e8 and 2.79e8 without giving any error or results.

Initially it gave the error of convergence and singularity mentioning

Repeated error test failures. May have reached a singularity.
Time : 0
Last time step is not converged.

Then I changed the timing to microwaves heating for one day and Darcy flow for another day following microwaves heating. Results were obtained from both the models in coupled form but when I again tried to change the microwaves heating time to one year and Darcy Flow time to two years following Microwaves heating it started switching between two high values in the convergence section and did neither give any error nor results.

Can you suggest some thing?

Regards,
Assalam o alaykum Amir, I have s similar problem too.I am coupling the Microwaves Heating with Darcy's flow and heating the fluid by microwaves for one year.After one year I am trying to get an information about the Darcy flow for further two years. If I run both of them alone they work fine but when I try to couple them, the solution does not converge and the convergence factor switches between 1.39e8 and 2.79e8 without giving any error or results. Initially it gave the error of convergence and singularity mentioning Repeated error test failures. May have reached a singularity. Time : 0 Last time step is not converged. Then I changed the timing to microwaves heating for one day and Darcy flow for another day following microwaves heating. Results were obtained from both the models in coupled form but when I again tried to change the microwaves heating time to one year and Darcy Flow time to two years following Microwaves heating it started switching between two high values in the convergence section and did neither give any error nor results. Can you suggest some thing? Regards,

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 10.08.2015, 08:41 GMT-4

Hi

does this do the job for you ? (to understand how to use the parameter t and a boundary load depending on "t"

Its a simple model I load it with the stationary solver and then observe the oscillations with the time series, I defined the model in stationary and then added the time series BEFORE I ran the mode so that COMSOL looked after the coupling. To resolve the oscillations I need to use a shorter time step than the default defined one

--
Good luck
Ivar


Dear Mr. Ivar Kjelberg,

I've read your file: Use_of_t_stat_time_1.mph.
What is the exact meaning of the boolean t[1/s]==0?

Thank you very much.
Have a good day.

Trieu.
[QUOTE] Hi does this do the job for you ? (to understand how to use the parameter t and a boundary load depending on "t" Its a simple model I load it with the stationary solver and then observe the oscillations with the time series, I defined the model in stationary and then added the time series BEFORE I ran the mode so that COMSOL looked after the coupling. To resolve the oscillations I need to use a shorter time step than the default defined one -- Good luck Ivar [/QUOTE] Dear Mr. Ivar Kjelberg, I've read your file: Use_of_t_stat_time_1.mph. What is the exact meaning of the boolean t[1/s]==0? Thank you very much. Have a good day. Trieu.

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: 9 years ago 11.08.2015, 14:14 GMT-4
Hi

back in v4.2 days we could not disable certain BCs for different studies, so I used there the trick to set the forces for the BC to "-100*1" for the stationary solver, since when the stationary solver runs, "t" is not defined yet by the time dependent solver, and my parameter "t" is used to set the Force to "-100" via the Boolean expression. Thereafter for the time dependent study, the force disappears from the first step t>0.

In v5.1 you would simply disable the boundary load for the time dependent solver and remove fully the Boolean expression the *(t[1/s]==0) means equal to "1" if t transformed to a number expressed in units of seconds "equal" to "0"
--
Good luck
Ivar
Hi back in v4.2 days we could not disable certain BCs for different studies, so I used there the trick to set the forces for the BC to "-100*1" for the stationary solver, since when the stationary solver runs, "t" is not defined yet by the time dependent solver, and my parameter "t" is used to set the Force to "-100" via the Boolean expression. Thereafter for the time dependent study, the force disappears from the first step t>0. In v5.1 you would simply disable the boundary load for the time dependent solver and remove fully the Boolean expression the *(t[1/s]==0) means equal to "1" if t transformed to a number expressed in units of seconds "equal" to "0" -- Good luck Ivar

Walter Frei COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 11.08.2015, 15:44 GMT-4
Dear Ivar,

Thank you for posting the clarification. Since the original discussion is from 2011 and is regarding COMSOL version 4.0a, we will close this thread for further discussions.

As Ivar correctly notes, it is (as of several versions now) possible to activate and delete boundary conditions in different study steps.

Since the issue of inconsistent boundary conditions for transient fluid flow problems does come up quite often, there is now also this KnowledgeBase Article which will address such questions:
www.comsol.com/support/knowledgebase/1172/

Best Regards,
Dear Ivar, Thank you for posting the clarification. Since the original discussion is from 2011 and is regarding COMSOL version 4.0a, we will close this thread for further discussions. As Ivar correctly notes, it is (as of several versions now) possible to activate and delete boundary conditions in different study steps. Since the issue of inconsistent boundary conditions for transient fluid flow problems does come up quite often, there is now also this KnowledgeBase Article which will address such questions: http://www.comsol.com/support/knowledgebase/1172/ Best Regards,

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.