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.

volume calculation

Please login with a confirmed email address before reporting spam

Hi.

Currently, I'm doing simulation to investigate electric field distribution on biological tissue electroporation. I already have the electric field distribution as depicted in attached file "isosurface plot.png". After that, I want to calculate the volume bounded by the red surfaces near the needle electrodes. Anybody can share with me how to do it? I'm completely newbie for this software. I already tried using Volume Integration in Derived Values, but I have found nothing what I want. If this calculation might need another it is ok then.

I really appreciate any comment for this question. Thanks in advance

Iqbal


9 Replies Last Post Jun 19, 2015, 8:49 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 10, 2011, 9:43 a.m. EDT
to visualize the electric field distribution and make the volume I want to calculate clearer, I attach a file "slice plot.png".

thanks
to visualize the electric field distribution and make the volume I want to calculate clearer, I attach a file "slice plot.png". thanks


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 19, 2011, 3:58 a.m. EDT
Use the volume integral but type in "es.normE>30e3" as the argument. This is a Booelan expression that will return 1 when the E field >= 30e3 V/m and zero when it is < 30e3. The integral will evaluate to the tissue volume inside the 30e3 V/m isopotential surface.
Niklas

Hi.

Currently, I'm doing simulation to investigate electric field distribution on biological tissue electroporation. I already have the electric field distribution as depicted in attached file "isosurface plot.png". After that, I want to calculate the volume bounded by the red surfaces near the needle electrodes. Anybody can share with me how to do it? I'm completely newbie for this software. I already tried using Volume Integration in Derived Values, but I have found nothing what I want. If this calculation might need another it is ok then.

I really appreciate any comment for this question. Thanks in advance

Iqbal





--
Niklas
Use the volume integral but type in "es.normE>30e3" as the argument. This is a Booelan expression that will return 1 when the E field >= 30e3 V/m and zero when it is < 30e3. The integral will evaluate to the tissue volume inside the 30e3 V/m isopotential surface. Niklas [QUOTE] Hi. Currently, I'm doing simulation to investigate electric field distribution on biological tissue electroporation. I already have the electric field distribution as depicted in attached file "isosurface plot.png". After that, I want to calculate the volume bounded by the red surfaces near the needle electrodes. Anybody can share with me how to do it? I'm completely newbie for this software. I already tried using Volume Integration in Derived Values, but I have found nothing what I want. If this calculation might need another it is ok then. I really appreciate any comment for this question. Thanks in advance Iqbal [/QUOTE] -- Niklas

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 21, 2012, 12:54 p.m. EDT
Hi Niklas,
In this case, can the boolean expression *(es.normE>=30e3) be used as the argument (note the use of PARENTESIS and equal symbol)?
Thanks
--
Cleber da Silva Pinheiro
Hi Niklas, In this case, can the boolean expression *(es.normE>=30e3) be used as the argument (note the use of PARENTESIS and equal symbol)? Thanks -- Cleber da Silva Pinheiro

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 Apr 22, 2012, 4:30 a.m. EDT
Hi

you can use bollean expression in most cases, the only warning I would give is that it makes the result jump from one value to the other without any "smooth" derivable transition, which can give trouble to the solver process, as it needs to estimate a derivative for the solving process.

I use it extensively for postprocessing with success. The best is always to build up a simple example you can check by a handcalculation, the be sure you are calculating the right thing. For that COMSOL is very nice, and unique in my view

--
Good luck
Ivar
Hi you can use bollean expression in most cases, the only warning I would give is that it makes the result jump from one value to the other without any "smooth" derivable transition, which can give trouble to the solver process, as it needs to estimate a derivative for the solving process. I use it extensively for postprocessing with success. The best is always to build up a simple example you can check by a handcalculation, the be sure you are calculating the right thing. For that COMSOL is very nice, and unique in my view -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Jun 13, 2015, 10:12 a.m. EDT
dear all,

is there any way for one to automatically compute these volumes by replacing (es.normE>="var"), where var is a vector range(0,0.01,10), for instance and have COMSOL evaluate the argument through all the variable and list them in a table?

I don't have MATLAB link and I don't wish to get it either.

Thanks in advance
dear all, is there any way for one to automatically compute these volumes by replacing (es.normE>="var"), where var is a vector range(0,0.01,10), for instance and have COMSOL evaluate the argument through all the variable and list them in a table? I don't have MATLAB link and I don't wish to get it either. Thanks in advance

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: 10 years ago Jun 13, 2015, 11:02 a.m. EDT
Hi Edwin

that's tricky, after some tries I found (I believe) a solution in 5.1

as you cannot define ranges into variables, nor parameters to call them I did the following:

I added a new "dummy" Study with a Parametric Sweep ONLY, defined my parameter Param as a range(0,0.1,1) but you can replace it by any specific values (monotonic though) and you solve this simple case (no other study node after the Parametric node)

Then you go to the derived values you define a surface or volume integration Point it to the Parametric Study Data Set, then you type as expression

withsol('stud1',V)>Param

to be correct with the units, rather

withsol('stud1',V[1/V])>Param

and off you go. You may replace the variable "V[1/V]" by any valid variable in study 'stud1', you might have another "tag" for the study you want if you have many

--
Good luck
Ivar
Hi Edwin that's tricky, after some tries I found (I believe) a solution in 5.1 as you cannot define ranges into variables, nor parameters to call them I did the following: I added a new "dummy" Study with a Parametric Sweep ONLY, defined my parameter Param as a range(0,0.1,1) but you can replace it by any specific values (monotonic though) and you solve this simple case (no other study node after the Parametric node) Then you go to the derived values you define a surface or volume integration Point it to the Parametric Study Data Set, then you type as expression withsol('stud1',V)>Param to be correct with the units, rather withsol('stud1',V[1/V])>Param and off you go. You may replace the variable "V[1/V]" by any valid variable in study 'stud1', you might have another "tag" for the study you want if you have many -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 10 years ago Jun 13, 2015, 8:49 p.m. EDT
Hello Ivar,

Thanks for the response. I looked at your solution and it makes a lot of sense. However, I don't understand how to apply this for a study in the frequency domain. I solved for the electric field/ electric potential for 8 time points, each giving me the correct and expected potential maps (3D); my geometry is certainly not symmetry nor homogeneous. I did the following and the result is all zeros:

Created a new study (Study 2) under comp1, added a parametric sweep and deleted step 1 of study 2. I went to global parameters and added a parameter Param with expression "1" . Back in the parametric sweep, I added the parameter "Param" with range(0,0.1,1) in the value list.

Under derived values, I added a volume integration, data set: study 2/ parametric solutions 1. Selection: domain1 (one of the domains I'm interested. Expression: withsol('sol1',ec.normE)<=Param, unit: cm^3, integration method on auto and data series operation to none since I want to see the value for each of the 8 time points I solved for in study 1.

My goal is to probe for each time point, the volume in cm^3 of each selected domain that has an electric field <= to a list of values defined in the list Param.

Any suggestions would be helpful.

Thank you in advance!
Hello Ivar, Thanks for the response. I looked at your solution and it makes a lot of sense. However, I don't understand how to apply this for a study in the frequency domain. I solved for the electric field/ electric potential for 8 time points, each giving me the correct and expected potential maps (3D); my geometry is certainly not symmetry nor homogeneous. I did the following and the result is all zeros: Created a new study (Study 2) under comp1, added a parametric sweep and deleted step 1 of study 2. I went to global parameters and added a parameter Param with expression "1" . Back in the parametric sweep, I added the parameter "Param" with range(0,0.1,1) in the value list. Under derived values, I added a volume integration, data set: study 2/ parametric solutions 1. Selection: domain1 (one of the domains I'm interested. Expression: withsol('sol1',ec.normE)

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: 9 years ago Jun 15, 2015, 4:43 a.m. EDT
Hi

I do not fully understand your comment "frequency domain" and solutions for 8 time steps ?

For me either you work in the frequency domain and assume a constant frequency (and your physics is developed in "i*omega" (for a physicist) or "s" or "z" parameter for an electrician.
Or you solve in the time domain and you define your frequency(ies) as sin(2*pi*f_n*t) for n=1 ...

Then you end up with a " double parameter" sweep and must combine "withsol()" with the "at()" or "with()" operators (check the doc)

--
Good luck
Ivar
Hi I do not fully understand your comment "frequency domain" and solutions for 8 time steps ? For me either you work in the frequency domain and assume a constant frequency (and your physics is developed in "i*omega" (for a physicist) or "s" or "z" parameter for an electrician. Or you solve in the time domain and you define your frequency(ies) as sin(2*pi*f_n*t) for n=1 ... Then you end up with a " double parameter" sweep and must combine "withsol()" with the "at()" or "with()" operators (check the doc) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jun 19, 2015, 8:49 a.m. EDT
Hi Ivar and anybody else who'd like to chime in,

I created and attached a very simple block model of something much more complicated I'm modeling. For the purpose of demonstrating the issue I'm having with the volume integration, this model should do just fine.

You will see that in this model, there are 2 domains of 2 different materials. An I've applied a sine wave across two boundaries. The volume integration I'm doing computes the volume of each domain that "receives" an electric field of a range from 10 - 100 V/m (I didn't complete the Water domain list because I didn't feel it was necessary to make the point clearer). As you can see, integrating from 0 - 100 in steps of 10 requires me to create a node for each value, and I'm sure you can image the number of these volume integration nodes required if I'm trying to do this on a model with 20 domains and with steps of 1V/m as opposed to 10V/m steps. Also, you can see that the table I've generated for each domain needs to be separated, which is fine for now, but I had to manually click on each node to evaluate each integral in sequential order so that the numbers line up and make sense (volumes decreasing as I increased the >E-field value).

To reiterate, I'd like to be able to export a table of values showing all the computed volume integrals for each "value- step", for each domain; it would be even better if there is a way to put these values for each domain all in one giant table for export.

If there is a way for me to replace all of those stepped integration nodes by a simpler and automated method, that would be ideal.

Please let me know if you can help me with this.

Thank you in advance!
Ed
Hi Ivar and anybody else who'd like to chime in, I created and attached a very simple block model of something much more complicated I'm modeling. For the purpose of demonstrating the issue I'm having with the volume integration, this model should do just fine. You will see that in this model, there are 2 domains of 2 different materials. An I've applied a sine wave across two boundaries. The volume integration I'm doing computes the volume of each domain that "receives" an electric field of a range from 10 - 100 V/m (I didn't complete the Water domain list because I didn't feel it was necessary to make the point clearer). As you can see, integrating from 0 - 100 in steps of 10 requires me to create a node for each value, and I'm sure you can image the number of these volume integration nodes required if I'm trying to do this on a model with 20 domains and with steps of 1V/m as opposed to 10V/m steps. Also, you can see that the table I've generated for each domain needs to be separated, which is fine for now, but I had to manually click on each node to evaluate each integral in sequential order so that the numbers line up and make sense (volumes decreasing as I increased the >E-field value). To reiterate, I'd like to be able to export a table of values showing all the computed volume integrals for each "value- step", for each domain; it would be even better if there is a way to put these values for each domain all in one giant table for export. If there is a way for me to replace all of those stepped integration nodes by a simpler and automated method, that would be ideal. Please let me know if you can help me with this. Thank you in advance! Ed

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.