This website uses cookies to function and to improve your experience. By continuing to use our site, you agree to our use of cookies.

**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.

## Solution not converging - point sink implementation

Posted Jun 11, 2021, 10:26 a.m. EDT Microfluidics, Chemical Reaction Engineering, Equation-Based Modeling Version 5.6 8 Replies

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?

Attachments:

Please login with a confirmed email address before reporting spam

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

Please login with a confirmed email address before reporting spam

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

Please login with a confirmed email address before reporting spam

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.

Please login with a confirmed email address before reporting spam

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

Attachments:

Please login with a confirmed email address before reporting spam

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.`

Please login with a confirmed email address before reporting spam

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

Please login with a confirmed email address before reporting spam

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

Please login with a confirmed email address before reporting spam

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?

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.