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.

Integral Constraint

Please login with a confirmed email address before reporting spam

Hey there,

I want to impliment an integral constraint: the subdomain integral of one variable (say A) shall be constant. In the COMSOL guide on page 274 it is told to define the integration coupling variable (I call it int_A), with a random point outside my geometry as destination, and then to set its value at "equation system->point settings". There I choose "constr" and type in the field for example "int_A-1" if I want the integral to be 1. (Actually, I define a constant A0, make an integration coupling varialbe "int_A0" and then type in that constr. field "int_A-int_A0", but this should not make the difference I think.) This does not give me an error, but the solution does not fulfill the constraint! What is my mistake? I also tried the recommendations in this thread (www.comsol.com/community/forums/general/thread/11/), but also without succes.

This constraint is surely not a rare thing to want, so if you know how to do it please let me know. :)

3 Replies Last Post 15.06.2014, 16:18 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 10.09.2012, 17:45 GMT-4
Hi

I suppose you are in 3.5a from your notations, then there is something I'm mising in your explanations:

If you define an integration operator on one of your subdomains, your resulting value is a global variable. You can then define a Global Expression (new dependent variable i.e. int_A) and set it to "int_A - some_constant" (implicit: = 0)

You say definedd A0 but then what is int_A0 ? is it A0*int_A(1) to catch the area?

If you int_A(1) will be evaluated at each iteration, if the area is not changing, it's quicker to define it as a true constant


--
Good luck
Ivar
Hi I suppose you are in 3.5a from your notations, then there is something I'm mising in your explanations: If you define an integration operator on one of your subdomains, your resulting value is a global variable. You can then define a Global Expression (new dependent variable i.e. int_A) and set it to "int_A - some_constant" (implicit: = 0) You say definedd A0 but then what is int_A0 ? is it A0*int_A(1) to catch the area? If you int_A(1) will be evaluated at each iteration, if the area is not changing, it's quicker to define it as a true constant -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11.09.2012, 08:16 GMT-4
Dear Ivar,
thanks a lot for the answer! I am indeed working with Version 3.5a.

Int_A0 is the integral of the initial value of A over my subdomain (and A_0 the same everywhere, thus int_A0=A0*area). My area so far is not changing, so this is constant, so I could indeed give int_A0 as a true constant. But then, eventually, I do want to investigate the influence of a changing area, and then I could not change the area solely, but then would have to calculate int_A0 again and type it in as well, which I would like to avoid. (Or is there a predefined variable for the area/volume of a subdomain that I could use for the definition of a constant?)

I tried as you said, but to me it seems as if the condition int_A-int_A0=0 is not yet implemented. I attached three images - my inputs for the integration coupling variable, the global variable and the result I get (in my model, A=c_p and A0=c_pi (analogue for c_n)). What is missing?

All best,
Sabine
Dear Ivar, thanks a lot for the answer! I am indeed working with Version 3.5a. Int_A0 is the integral of the initial value of A over my subdomain (and A_0 the same everywhere, thus int_A0=A0*area). My area so far is not changing, so this is constant, so I could indeed give int_A0 as a true constant. But then, eventually, I do want to investigate the influence of a changing area, and then I could not change the area solely, but then would have to calculate int_A0 again and type it in as well, which I would like to avoid. (Or is there a predefined variable for the area/volume of a subdomain that I could use for the definition of a constant?) I tried as you said, but to me it seems as if the condition int_A-int_A0=0 is not yet implemented. I attached three images - my inputs for the integration coupling variable, the global variable and the result I get (in my model, A=c_p and A0=c_pi (analogue for c_n)). What is missing? All best, Sabine


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 15.06.2014, 16:18 GMT-4
Hi All

I defined the integral operator and used it inside weak constraint option like

int(Stress_ij)-F ---> this is inserted inside he weak constraint

I want to define the integral of Stress_ij - to be equal to some given value of force "F" but the matrix is every time becoming singular.


Ideas or suggestion will be of great help



Regards,
H.
Hi All I defined the integral operator and used it inside weak constraint option like int(Stress_ij)-F ---> this is inserted inside he weak constraint I want to define the integral of Stress_ij - to be equal to some given value of force "F" but the matrix is every time becoming singular. Ideas or suggestion will be of great help Regards, H.

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.