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.

How to include a condition that changes a model property based on the results of the model (?)

Please login with a confirmed email address before reporting spam

Hi All,

I'm asking for help to know how you can change a property of a model expressed by a parameter (e.g. Young's modulus in Deformable Solid) depending on the COMSOL results.

The example that I mention would consist of simulating a loss of mechanical properties when the Von Mises stress is very high in a model. In this case, the Young's modulus would go from being the initial to a X% of the initial. Similar to a loss of support capacity of the material.

I was using this conditional in the material properties:

if(solid.mises<30e6,E,E*0.2),

COMSOL 6.1 initially accepts it, but when I ask it to solve the model, it tells me that there is a "cyclical" condition that it cannot solve.

Could someone help me with this :)

Thank you very much in advance.

Kind Regards Andres


4 Replies Last Post 2023年5月25日 GMT-4 15:51
Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 months ago 2023年5月22日 GMT-4 04:47

The circular dependency error is an effect of that the stress is computed as (roughly speaking) Young's modulus times strain. So you cannot directly write an expression where Young's modulus depends on stress, since it will define itself. Some kind of iterative procedure would be needed. An example of how you can deal with this type of problem is given in https://www.comsol.com/model/modeling-stress-dependent-elasticity-14441

This said, I don't think your material model will converge anyway. In essence, you want the strains to jump and increase by a factor of 5 when a certain stress level is reached. If you look at the built-in damage models, they have a gradual softening behavior, and can also be equipped with regularization.

-------------------
Henrik Sönnerlind
COMSOL
The circular dependency error is an effect of that the stress is computed as (roughly speaking) Young's modulus times strain. So you cannot directly write an expression where Young's modulus depends on stress, since it will define itself. Some kind of iterative procedure would be needed. An example of how you can deal with this type of problem is given in This said, I don't think your material model will converge anyway. In essence, you want the strains to jump and increase by a factor of 5 when a certain stress level is reached. If you look at the built-in damage models, they have a gradual softening behavior, and can also be equipped with regularization.

Please login with a confirmed email address before reporting spam

Posted: 10 months ago 2023年5月23日 GMT-4 08:41

Dear Henrik,

Thank you very much for the information. Really very useful :-)

I leave you a couple of questions that I would greatly appreciate if you could help me:

(1) In the example you sent me I see that a auxiliar function is defined in order to avoid the circular dependency. For this, a "Weak Contribution" is formulated in which the new variable "p" is multiplied by a test function to "weaken" or lower the derivability requirement of the variable. What it doesn't understand is the expression "test(p)*(p-solid.pm)", specifically "(p-solid.pm)". Understanding that negative values of "p-solid.pm" would give an E0(p) with a smaller negative value according to the definition of E0. It's right (?). If so, wouldn't the function be E0(p-solid.pm) the correct expression ?

(2) I didn't test yey the COMSOL damage module. I has been looking at some information in the manual and I do not know the theory of this part of deformable solid mechanics. I would have to study the damage models. But to give me an idea. Understanding that these damage models would replicate what I'm trying to do which is that the strength of the material is reduced when the stresses are very high? It's right (?).

Thank you very much for your help.

Best, Andres

Dear Henrik, Thank you very much for the information. Really very useful :-) I leave you a couple of questions that I would greatly appreciate if you could help me: (1) In the example you sent me I see that a auxiliar function is defined in order to avoid the circular dependency. For this, a "Weak Contribution" is formulated in which the new variable "p" is multiplied by a test function to "weaken" or lower the derivability requirement of the variable. What it doesn't understand is the expression "test(p)*(p-solid.pm)", specifically "(p-solid.pm)". Understanding that negative values of "p-solid.pm" would give an E0(p) with a smaller negative value according to the definition of E0. It's right (?). If so, wouldn't the function be E0(p-solid.pm) the correct expression ? (2) I didn't test yey the COMSOL damage module. I has been looking at some information in the manual and I do not know the theory of this part of deformable solid mechanics. I would have to study the damage models. But to give me an idea. Understanding that these damage models would replicate what I'm trying to do which is that the strength of the material is reduced when the stresses are very high? It's right (?). Thank you very much for your help. Best, Andres

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 months ago 2023年5月24日 GMT-4 08:53

(1): The choice of 'p' is not for modifying the field order. Actually, the shape function for ‘p’ is chosen as Gauss point data, so it is not a field at all. It is only pointwise values living at Gauss points. This choice seems natural, since for the solution we only need Young’s modulus at the Gauss points.

For more info about Gauss point data, you can look towards the end of https://www.comsol.com/blogs/introduction-to-numerical-integration-and-gauss-points

The choice of shape functions for ''p' is not unique though. You could also use Lagrange type shape functions (continuous or discontinuous) for ‘p’ and then have ‘p’ as a field. In this case, it would make sense to select a linear shape function since 'p' is a stress type quantity (and the displacements have quadratic interpolation).

“test(p)*(p-solid.pm)" can in general be interpreted as, ‘solve for p so that p = pm in a weak sense’. Since there is no distributed field involved for Gauss point data, it must here be interpreted as ‘set p to pm in all Gauss points’. In a fully converged solution this will be exactly fulfilled.

Young’s modulus is a function of the pressure (mean stress), so it should be E0(p). The expression E0(p-pm) would make Young’s modulus a function of the error in the variable ‘p’ when compared to ‘pm’.

(2) The damage models are originally intended to reduce the stress (or stiffness) to zero. You could however use a trick if you want to avoid that. In the Advanced section of the Damage node, you can set Maximum damage to, for example, 0.8. That will retain 20% of the stiffness.

-------------------
Henrik Sönnerlind
COMSOL
(1): The choice of 'p' is not for modifying the field order. Actually, the shape function for ‘p’ is chosen as *Gauss point data*, so it is not a field at all. It is only pointwise values living at Gauss points. This choice seems natural, since for the solution we only need Young’s modulus at the Gauss points. For more info about Gauss point data, you can look towards the end of The choice of shape functions for ''p' is not unique though. You could also use Lagrange type shape functions (continuous or discontinuous) for ‘p’ and then have ‘p’ as a field. In this case, it would make sense to select a linear shape function since 'p' is a stress type quantity (and the displacements have quadratic interpolation). “test(p)\*(p-solid.pm)" can in general be interpreted as, ‘solve for p so that p = pm in a weak sense’. Since there is no distributed field involved for Gauss point data, it must here be interpreted as ‘set p to pm in all Gauss points’. In a fully converged solution this will be exactly fulfilled. Young’s modulus is a function of the pressure (mean stress), so it should be E0(p). The expression E0(p-pm) would make Young’s modulus a function of the error in the variable ‘p’ when compared to ‘pm’. (2) The damage models are originally intended to reduce the stress (or stiffness) to zero. You could however use a trick if you want to avoid that. In the *Advanced* section of the *Damage* node, you can set *Maximum damage* to, for example, 0.8. That will retain 20% of the stiffness.

Please login with a confirmed email address before reporting spam

Posted: 10 months ago 2023年5月25日 GMT-4 15:51

Dear Henrik,

Thank you very much for all this information, it is really very useful : )

In relation to the damage model I am studying this example: https://www.comsol.com/model/brittle-fracture-of-a-holed-plate-89321

And I find that if I draw a "Cut Line 2D" in the middle of the plate, going through a damaged area and ask COMSOL to draw the Young's modulus value, a constant value equal to 6 GPa appears. Fractures have occurred, the phase-field model indicates it, but I don't see that the value of the modulus of elasticity has dropped at any point. Could you help me with this (?).

Thank you very much in advance.

Best Andres

Dear Henrik, Thank you very much for all this information, it is really very useful : ) In relation to the damage model I am studying this example: https://www.comsol.com/model/brittle-fracture-of-a-holed-plate-89321 And I find that if I draw a "Cut Line 2D" in the middle of the plate, going through a damaged area and ask COMSOL to draw the Young's modulus value, a constant value equal to 6 GPa appears. Fractures have occurred, the phase-field model indicates it, but I don't see that the value of the modulus of elasticity has dropped at any point. Could you help me with this (?). Thank you very much in advance. Best Andres

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.