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 domains with Join datasets
Posted 06.07.2014, 22:39 GMT-4 Parameters, Variables, & Functions, Results & Visualization 8 Replies
Please login with a confirmed email address before reporting spam
I am calculating electrostatics in 3D using Comsol 4.4. Using the same geometry and the same mesh, I create two different solutions, "es" and "es2", with different boundary conditions. I want to plot the dot product of the electric field from these two solutions. There was a recent tutorial on Join datasets (www.comsol.com/blogs/join-solutions-comsol-multiphysics/) which seems to be the tool to use.
It does not seem that I can use a "General" Join dataset. That appears to specify an operation on the scalar field that was solved for (the voltage V), assuming that the Join operation maintains the dimension of the dataset. Only then can I pick out the derived quantity (the electric field components) to plot or operate on.
Instead, I now use the "Explicit" option of the Join dataset. Then I get access to "data1()" and "data2()" which represent the two solutions. In plots, I can get the dot product that I want by explicitly giving the expression "(data1(es.Ex)*data2(es2.Ex) + data1(es.Ey)*data2(es2.Ey) + data1(es.Ez)*data2(es2.Ez)". For plotting, this works fine.
Integrating over the results gives me problems though. I want to enter the same expression as for the plot, and integrate this either over the volume of a subdomain or a surface that's defined in the geometry. However, as soon as I select "Join 1" as the dataset for the integration, all options for picking integration domain disappear. I cannot pick any other data set and still have access to "data1()" and "data2()". For the volume integral, I guess the integration domain is the whole extent of the geometry, but for the surface I don't even have a clue. How do I solve this? Is there an alternative method to run computations on the two data sets?
Best wishes
Martin Gustafsson
It does not seem that I can use a "General" Join dataset. That appears to specify an operation on the scalar field that was solved for (the voltage V), assuming that the Join operation maintains the dimension of the dataset. Only then can I pick out the derived quantity (the electric field components) to plot or operate on.
Instead, I now use the "Explicit" option of the Join dataset. Then I get access to "data1()" and "data2()" which represent the two solutions. In plots, I can get the dot product that I want by explicitly giving the expression "(data1(es.Ex)*data2(es2.Ex) + data1(es.Ey)*data2(es2.Ey) + data1(es.Ez)*data2(es2.Ez)". For plotting, this works fine.
Integrating over the results gives me problems though. I want to enter the same expression as for the plot, and integrate this either over the volume of a subdomain or a surface that's defined in the geometry. However, as soon as I select "Join 1" as the dataset for the integration, all options for picking integration domain disappear. I cannot pick any other data set and still have access to "data1()" and "data2()". For the volume integral, I guess the integration domain is the whole extent of the geometry, but for the surface I don't even have a clue. How do I solve this? Is there an alternative method to run computations on the two data sets?
Best wishes
Martin Gustafsson
8 Replies Last Post 28.07.2015, 08:51 GMT-4