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 on a volume using a parameter

Please login with a confirmed email address before reporting spam

Dear COMSOL colleagues,

I am simulating the flow in a biological chamber, using laminar flow and transport of diluted species to simulate the convection and diffusion of oxygen in the chamber, as well as the consumption of oxygen by the cells inside it.

After running my simulation, I would like to have a distribution of oxygen.
What I can do is use a step function to calculate the volume inside the chamber above a certain threshold concentration (i.e. 70% of the chamber is below 0.3mol/m3, 60% is below 0.2mol/m3, 50% is below 0.1mol/m3).
But using the Volume Integration in Derived Values, I always need to specify this threshold (0.3 - 0.1 mol/m3).
That s why I would like to make a Volume Integration but for a range of thresholds (way more than what I could manually implement) to be able to plot Volume = function(threshold concentration).

Is there a way to make a 1D plot using some kind of integration function with a parameter that would vary ?

Thank you
Pierre

1 Reply Last Post Feb 3, 2015, 3:11 p.m. EST
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Feb 3, 2015, 3:11 p.m. EST
Hello Pierre,
It's not the most elegant of solution, but check out the attached file; I think it does what you want.
I added a second study that runs a parametric sweep but does not actually solve any equations. This sweep forces the evaluation of the variable "volumebelowthreshold" for a bunch of values of the threshold. Since no equation is solved in that study, this is numerically very inexpensive.
I hope this helps.

You could certainly achieve the same through some programming with LiveLink for MATLAB, or in a method in an application.
Best,
Jeff
Hello Pierre, It's not the most elegant of solution, but check out the attached file; I think it does what you want. I added a second study that runs a parametric sweep but does not actually solve any equations. This sweep forces the evaluation of the variable "volumebelowthreshold" for a bunch of values of the threshold. Since no equation is solved in that study, this is numerically very inexpensive. I hope this helps. You could certainly achieve the same through some programming with LiveLink for MATLAB, or in a method in an application. Best, Jeff

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.