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.

surface integration (doing calculations with derived values)

Please login with a confirmed email address before reporting spam

Hello,

I have a simulation with several subdomains.
In the postprocessing, I'd like to relate two of those subdomains, i.e. I want to compare the power flow of say domain 1 to the power flow of domain 2.
The power flow values for the respective domains are easily obtained by chosing derived values - surface integration.
But how to do some calculations with these values without resorting to a pocket calculator?
Can I tell Comsol to calculate the ratio (quotient) of these two values?

Thanks,
/H.

4 Replies Last Post Oct 16, 2012, 7:11 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 20, 2012, 11:11 a.m. EDT
You need to add these integrations as model couplings, then you can create variables that contain their results. Here's how: Right click on Definitions under Model 1, and select Model Couplings->Integration. Then in the settings for that integration, select the surface to integrate over, and name the integration operator something, say IntegrateOverA. Then left click on Variables under Definitions, and add a variable to contain the result of that integration. Name it whatever and use expression: IntegrateOverA(funct), replacing funct with your desired integrand. Then you can define another variable in terms of this one and others, and evaluate any of these variables with Global Evaluation derived value.
You need to add these integrations as model couplings, then you can create variables that contain their results. Here's how: Right click on Definitions under Model 1, and select Model Couplings->Integration. Then in the settings for that integration, select the surface to integrate over, and name the integration operator something, say IntegrateOverA. Then left click on Variables under Definitions, and add a variable to contain the result of that integration. Name it whatever and use expression: IntegrateOverA(funct), replacing funct with your desired integrand. Then you can define another variable in terms of this one and others, and evaluate any of these variables with Global Evaluation derived value.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 21, 2012, 4:19 a.m. EDT
Great, I tried it out and it works!
However, these model couplings need to be added *before* the actual simulation is started.
For simulations that are already finished, changes in these model coupling definitions do not affect the result unless I run the whole simulation once again. Is there a way to overcome this limitation?
Great, I tried it out and it works! However, these model couplings need to be added *before* the actual simulation is started. For simulations that are already finished, changes in these model coupling definitions do not affect the result unless I run the whole simulation once again. Is there a way to overcome this limitation?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 21, 2012, 4:28 a.m. EDT
For simulations that are already finished, changes in these model coupling definitions do not affect the result unless I run the whole simulation once again. Is there a way to overcome this limitation?

Yes, just right-click the study node and select "Update Solution". This updates the solution object with the model defintions you've recently made, so you don't have to solve again.
[QUOTE]For simulations that are already finished, changes in these model coupling definitions do not affect the result unless I run the whole simulation once again. Is there a way to overcome this limitation? [/QUOTE] Yes, just right-click the study node and select "Update Solution". This updates the solution object with the model defintions you've recently made, so you don't have to solve again.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 16, 2012, 7:11 p.m. EDT
Can anybody on this thread help me?


What I'm wanting to do is use my variables in Global Evaluation Derived Values. In my heat source, I've defined one term called heat_gen, which is also a variable in definitions. After simulation, comsol gives me the range of heat_gen values. I want to calculate the average heat_gen over the domain and also calculate the volume of the domain. Later, I want to max their product using global evaluation under derived values. As suggested in this thread, I created 2 more variables for my avg heat_gen and volume under definitions but now when I'm trying to use global evaluation, it says "no predefined expressions" in its settings. How do I create the expression of their product?

Any help would be appreciated.
Thanks
Can anybody on this thread help me? What I'm wanting to do is use my variables in Global Evaluation Derived Values. In my heat source, I've defined one term called heat_gen, which is also a variable in definitions. After simulation, comsol gives me the range of heat_gen values. I want to calculate the average heat_gen over the domain and also calculate the volume of the domain. Later, I want to max their product using global evaluation under derived values. As suggested in this thread, I created 2 more variables for my avg heat_gen and volume under definitions but now when I'm trying to use global evaluation, it says "no predefined expressions" in its settings. How do I create the expression of their product? Any help would be appreciated. Thanks

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.