Solution not converging - point sink implementation

Please login with a confirmed email address before reporting spam

I've implemented point sinks along the length of the pipe using Transport of Dilute Species module and Weak Form PDE physics.

But I get the following error

Failed to find consistent initial values. Singular matrix.

There are 40 void equations (empty rows in matrix) for the variable comp1.u. at coordinates: (3.1e-06), (6.2e-06), (9.3e-06), (1.24e-05), (1.55e-05), ...

and similarly for the degrees of freedom (empty columns in matrix). Last time step is not converged

Could someone please have a look at the file attached and help me in resolving the error?



8 Replies Last Post 17/06/2021, 12:39 GMT-4
Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 month ago 14/06/2021, 09:22 GMT-4

Hi Deepa,

The problem is in the Weak Form PDE. Firstly, its dependent variable is u and not c, which is used in the weak expression. Even so, the weak expression that you have entered is only equivalent to a source term, so it's not unexpected that u is not well defined. You would need to add a term such as test(ux)*ux to make it into a Poisson's equation, for example. The Transport of Diluted Species interface solves fine when you solve it on its own.

Best regards,

Magnus Ringh

Hi Deepa, The problem is in the Weak Form PDE. Firstly, its dependent variable is `u` and not `c`, which is used in the weak expression. Even so, the weak expression that you have entered is only equivalent to a source term, so it's not unexpected that `u` is not well defined. You would need to add a term such as `test(ux)*ux` to make it into a Poisson's equation, for example. The Transport of Diluted Species interface solves fine when you solve it on its own. Best regards, Magnus Ringh

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 month ago 14/06/2021, 12:18 GMT-4

Hello Deepa,

If I am correctly guessing what you are trying to accomplish, you don't need the Weak Form PDE physics interface at all. Instead, I suspect you should be looking at adding a Weak Contribution node (if you genuinely need point sinks), or more probably a Reactions node (if you want a distributed sink, which seems more physical to me), to the tds physics interface.

Best,

Jeff

-------------------
Jeff Hiller
Hello Deepa, If I am correctly guessing what you are trying to accomplish, you don't need the Weak Form PDE physics interface at all. Instead, I suspect you should be looking at adding a Weak Contribution node (if you genuinely need point sinks), or more probably a Reactions node (if you want a distributed sink, which seems more physical to me), to the tds physics interface. Best, Jeff

Please login with a confirmed email address before reporting spam

Posted: 1 month ago 14/06/2021, 12:42 GMT-4
Updated: 1 month ago 14/06/2021, 13:02 GMT-4

Hi Magnus and Jeff,

Thank you for the explanation.

The Transport of Diluted Species interface solves fine when you solve it on its own.

I could simulate the convection diffusion dynamics without any issue. But I am not sure how to define Ri , the reaction term in the RHS of the equation diaplyed in tds node, as point source term.

The issue that I am facing while trying to use the reaction node is the following: In the reaction node > Domain selection tab : I am only able to select the line segment/ interval as the domain. But I actually want to select the points (added in the geometry, please check the geometry in my mph file) and define Ri as a point source. Due to this reason, I tried using the Weak contribution node to select the points in the geometry and use the dirac delat function to define point source term. Since concentration, c, is the dependent varialble in the convection-diffusion physics I defined test(c)*S for the point source term . Here, S is the magnitude of the source term. But something is going wrong I the way I am trying to set up the dirac delta function for point source.

I would like to know what's the right approach to do the above.

Hi Magnus and Jeff, Thank you for the explanation. >The Transport of Diluted Species interface solves fine when you solve it on its own. I could simulate the convection diffusion dynamics without any issue. But I am not sure how to define `Ri` , the reaction term in the RHS of the equation diaplyed in tds node, as point source term. The issue that I am facing while trying to use the reaction node is the following: In the reaction node > Domain selection tab : I am only able to select the line segment/ interval as the domain. But I actually want to select the points (added in the geometry, please check the geometry in my mph file) and define Ri as a point source. Due to this reason, I tried using the Weak contribution node to select the points in the geometry and use the dirac delat function to define point source term. Since concentration, c, is the dependent varialble in the convection-diffusion physics I defined test(c)*S for the point source term . Here, S is the magnitude of the source term. But something is going wrong I the way I am trying to set up the dirac delta function for point source. I would like to know what's the right approach to do the above.

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 month ago 14/06/2021, 14:10 GMT-4
Updated: 1 month ago 14/06/2021, 17:28 GMT-4

Hello Deepa,

Food for thought:

If you want point sinks and not point sources, shouldn't your weak contribution be negative?

The mesh is too coarse: you want several elements between the sinks

Constant sinks will result in negative concentrations if the initial concentration is zero as you have it . This is to be expected from the math. Either your initial value shouldn't be zero, or your sinks shouldn't be of constant magnitude, or both.

Your BC on the left is inconsistent with your initial values. Perhaps you want the location for the step to be at .05, resulting in the concentration starting every at zero and rising on the left over the first tenth of a second to 5. Perhaps, in view of the previous point, both your initial values and your BC need to be revised.

I hope these pointers are helpful. I am attaching a modified file where I made suitable adjustments to illustrate the points above. With the caveat that it does not represent the reality of the system you are trying to model, I hope it will prove to be of use to you. If further assistance from COMSOL is needed, please contact our support team at support@comsol.com if your license is eligible for support service.

Best,

Jeff

-------------------
Jeff Hiller
Hello Deepa, Food for thought: If you want point sinks and not point sources, shouldn't your weak contribution be negative? The mesh is too coarse: you want several elements between the sinks Constant sinks will result in negative concentrations if the initial concentration is zero as you have it . This is to be expected from the math. Either your initial value shouldn't be zero, or your sinks shouldn't be of constant magnitude, or both. Your BC on the left is inconsistent with your initial values. Perhaps you want the location for the step to be at .05, resulting in the concentration starting every at zero and rising on the left over the first tenth of a second to 5. Perhaps, in view of the previous point, both your initial values and your BC need to be revised. I hope these pointers are helpful. I am attaching a modified file where I made suitable adjustments to illustrate the points above. With the caveat that it does not represent the reality of the system you are trying to model, I hope it will prove to be of use to you. If further assistance from COMSOL is needed, please contact our support team at support@comsol.com if your license is eligible for support service. Best, Jeff


Please login with a confirmed email address before reporting spam

Posted: 1 month ago 15/06/2021, 09:30 GMT-4

Hi Jeff,

Thanks so much, the pointers mentioned by you are really helpful.

Perhaps you want the location for the step to be at .05, resulting in the concentration starting every at zero and rising on the left over the first tenth of a second to 5.

When we set the intial values at 1 throught the domain and define the step function which starts from 0 at the inlet boundary point, would the intial and boundary condition still be inconsistent because the intial value at the inlet is 0 and not 1 at time,t, = 0?

Side note: I had also submitted this query here https://www.comsol.com/support/case/4715941 and received a few suggestions. Unfortunately, it is still not clear to me what's the right way to do this.

Hi Jeff, Thanks so much, the pointers mentioned by you are really helpful. >Perhaps you want the location for the step to be at .05, resulting in the concentration starting every at zero and rising on the left over the first tenth of a second to 5. When we set the intial values at 1 throught the domain and define the step function which starts from 0 at the inlet boundary point, would the intial and boundary condition still be inconsistent because the intial value at the inlet is 0 and not 1 at time,t, = 0? `Side note: I had also submitted this query here https://www.comsol.com/support/case/4715941 and received a few suggestions. Unfortunately, it is still not clear to me what's the right way to do this.`

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 month ago 15/06/2021, 10:43 GMT-4

For consistency, the value you impose at the boundary at t=0 needs to be the same as the initial value. This is indeed why when I modified the initial value I also modified the BC correspondingly.

Jeff

-------------------
Jeff Hiller
For consistency, the value you impose at the boundary at t=0 needs to be the same as the initial value. This is indeed why when I modified the initial value I also modified the BC correspondingly. Jeff

Please login with a confirmed email address before reporting spam

Posted: 1 month ago 16/06/2021, 10:54 GMT-4
Updated: 1 month ago 16/06/2021, 11:30 GMT-4

Hi Jeff,

Thanks a lot for the clarification. I missed to observe that the intial value of step function starts from 0.2 and not 0 in the modifed version that you shared. This clears my confusion.

I am not sure how to observe the point of singularities in the results generated. From what I understand the positions at which the point sinks are defined will act as point of singularity since the solution will tend toward infinity, please correct me if I am wrong. However, I am not able to observe this in the results - concentration vs. plot that is generated.

I would like to know how this can be visually observed. result

updated Comsol file

Hi Jeff, Thanks a lot for the clarification. I missed to observe that the intial value of step function starts from 0.2 and not 0 in the modifed version that you shared. This clears my confusion. I am not sure how to observe the point of singularities in the results generated. From what I understand the positions at which the point sinks are defined will act as point of singularity since the solution will tend toward infinity, please correct me if I am wrong. However, I am not able to observe this in the results - concentration vs. plot that is generated. I would like to know how this can be visually observed. [result](https://github.com/DeepaMahm/misc/blob/master/Untitled.png) updated [Comsol file](https://drive.google.com/file/d/16Cv0adszO7dMou51JTj_ahOa2dkFWrpn/view?usp=sharing)

Please login with a confirmed email address before reporting spam

Posted: 1 month ago 17/06/2021, 12:39 GMT-4

Hi Jeff,

With the caveat that it does not represent the reality of the system you are trying to model

Would it be better if I use the reaction node (Reaction) in tds to specify the constant sink term instead of using weak form PDE ?

Reaction node only allows the slection of Line segemnt/ interval . So can I create a tiny domain instead of line segment?

Hi Jeff, > With the caveat that it does not represent the reality of the system you are trying to model Would it be better if I use the reaction node (`Reaction`) in tds to specify the constant sink term instead of using weak form PDE ? Reaction node only allows the slection of Line segemnt/ interval . So can I create a tiny domain instead of line segment?

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.