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

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.

Integration of fields from PDF solutions

Please login with a confirmed email address before reporting spam

Hi,

I am working with COMSOL 4.4, Multiphysics, solving three different physics models on the same geometry. Two of them are Electrostatics, (a potential field "V" and another "weighting" potential field "Vw"). The third is an convection/diffusion equation, solving the concentration "n" of charge carriers in the geometry, using the potential field coming from one of the electrostatics nodes.

So, now I have three fields, as a function of space: V, Vw and n. Now, I want to solve the following integral:

Q = INT_t dt INT_geometry dOmega ( n(r) * (d/dr V) (d/dr Vw) )

Where n(r) is the value of n given by a particular point in the domain. Is there a way I can do this?

In the manual I found some information about "Component Couplings".
For instance, under Component->Definitions->Component Couplings I find an Integration node. Here, I can set the name and the domain. But I cannot set the actual function to integrate, so it seems useless to me.
Likewise, under Results->Data Sets, I can select "Integral", but again I cannot see how I can specify what expression I want to integrate.

Is there any way to do the integration as I want to?
Best regards,

Machiel Kolstein



2 Replies Last Post 8 mai 2014, 12:40 UTC−4
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 mai 2014, 08:49 UTC−4
Hello Machiel,

I am going to presume that you need to use Q somewhere in your equations, i.e. that you don't need it simply for post-processing purposes.

You are on the right track with Component Couplings to perform the spatial integration.
Component Couplings are operators, so when you call one of those you pass to it the arguments on which it needs to operate by putting the argument between parentheses after the name of the component coupling.

There are a couple of ways to set up the time integration. The easiest for me to explain is to add a Global ODE physics. See the attached file where I solve the ODE d(MyVar)/dt-intop1(T)=0 . intop1(T) computes the integral of the temperature on face 1 , so that MyVar ends up computing the time integral of the space integral over face 1 of temperature.

I hope this helps.
Best,
Jeff
Hello Machiel, I am going to presume that you need to use Q somewhere in your equations, i.e. that you don't need it simply for post-processing purposes. You are on the right track with Component Couplings to perform the spatial integration. Component Couplings are operators, so when you call one of those you pass to it the arguments on which it needs to operate by putting the argument between parentheses after the name of the component coupling. There are a couple of ways to set up the time integration. The easiest for me to explain is to add a Global ODE physics. See the attached file where I solve the ODE d(MyVar)/dt-intop1(T)=0 . intop1(T) computes the integral of the temperature on face 1 , so that MyVar ends up computing the time integral of the space integral over face 1 of temperature. I hope this helps. Best, Jeff


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 8 mai 2014, 12:40 UTC−4
Hello Jeff,

Wow, I am impressed, that's a very clever trick. It would never have occured to me to do it like that but it makes absolute sense. Many thanks for your help. I will try it right now, and I will let you know how it goes.

Best regards,

Machiel
Hello Jeff, Wow, I am impressed, that's a very clever trick. It would never have occured to me to do it like that but it makes absolute sense. Many thanks for your help. I will try it right now, and I will let you know how it goes. Best regards, Machiel

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.