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
2012年1月11日 GMT-5 18:06
Hi
I would say you should consider scripting your model via Matlab or an API programming approach
to start you can build a first model in the GUI and then save it as a "m" file, then build ur model based on this m file
but clicking around is rather common, we have models with > 800 magnets generated within COMSOL and disposed on a spherical surface, + coils and sources, this requires quite some clicking (and a tennis elbow from the right-clicks ;) but it works 100% inside the GUI
--
Good luck
Ivar
Hi
I would say you should consider scripting your model via Matlab or an API programming approach
to start you can build a first model in the GUI and then save it as a "m" file, then build ur model based on this m file
but clicking around is rather common, we have models with > 800 magnets generated within COMSOL and disposed on a spherical surface, + coils and sources, this requires quite some clicking (and a tennis elbow from the right-clicks ;) but it works 100% inside the GUI
--
Good luck
Ivar
Nagi Elabbasi
Facebook Reality Labs
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年1月11日 GMT-5 22:35
If there is a gap between the spheres you can select all the spheres in one integral and multiply the integrated quantity by something like (x>A)*(x<B)*(y>C)*(y<D) where A and B are the bounds of one sphere in the x-direction and C and D are the bounds in the y-direction. That way, you can, either manually or through a Matlab/Java API, just change A-D and reevaluate the integral.
Nagi Elabbasi
Veryst Engineering
If there is a gap between the spheres you can select all the spheres in one integral and multiply the integrated quantity by something like (x>A)*(xC)*(y
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年1月11日 GMT-5 23:08
Hi
I would say you should consider scripting your model via Matlab or an API programming approach
to start you can build a first model in the GUI and then save it as a "m" file, then build ur model based on this m file
but clicking around is rather common, we have models with > 800 magnets generated within COMSOL and disposed on a spherical surface, + coils and sources, this requires quite some clicking (and a tennis elbow from the right-clicks ;) but it works 100% inside the GUI
--
Good luck
Ivar
That looks very useful. I have made an example and done some text editing, but now how do you get the modified M file back into COMSOL (4.2 with multiphysics)?
thanks
Mark
[QUOTE]
Hi
I would say you should consider scripting your model via Matlab or an API programming approach
to start you can build a first model in the GUI and then save it as a "m" file, then build ur model based on this m file
but clicking around is rather common, we have models with > 800 magnets generated within COMSOL and disposed on a spherical surface, + coils and sources, this requires quite some clicking (and a tennis elbow from the right-clicks ;) but it works 100% inside the GUI
--
Good luck
Ivar
[/QUOTE]
That looks very useful. I have made an example and done some text editing, but now how do you get the modified M file back into COMSOL (4.2 with multiphysics)?
thanks
Mark
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年1月12日 GMT-5 21:31
OK, so I have found what looks like a solution (still one thing I'm having trouble with though).
I define a surface under "Results", and select all of the surfaces of all the spheres (technically the faces all belong to the material surrounding the spheres) using the "Select box" tool. Then I export this surface giving me diffusive flux magnitude. As the spheres are in a grid pattern it's easy to assign faces to the correct sphere based on their X and Y coordinates.
The trouble is, the output is diffusive flux magnitude per square meter (results match what I get manually wth Fick's Law for the toy model), and I can't figure out how to get the area of the corresponding mesh element to multiply it by to find out the absolute flux for each element. Also, there are many more exported data points than i expected. For example, I made a toy model moving O2 through a cube and set the mesh to "extremely coarse", so the end face only consists of two triangles. However, when I export this surface instead of the expected 2, I get 25 nodes if i export gauss points (order 1) or 79 (!) if I export Lagrangian points. The only mesh parameter I can export in the same file is "h" - my impression is that this number represents the longest edge of the 3D mesh element to which the specific triangle is attached and forms the surface - so it may not even be an edge shared with the triangle I care about. Any idea where i can get the relevant area numbers?
thanks
Mark
OK, so I have found what looks like a solution (still one thing I'm having trouble with though).
I define a surface under "Results", and select all of the surfaces of all the spheres (technically the faces all belong to the material surrounding the spheres) using the "Select box" tool. Then I export this surface giving me diffusive flux magnitude. As the spheres are in a grid pattern it's easy to assign faces to the correct sphere based on their X and Y coordinates.
The trouble is, the output is diffusive flux magnitude per square meter (results match what I get manually wth Fick's Law for the toy model), and I can't figure out how to get the area of the corresponding mesh element to multiply it by to find out the absolute flux for each element. Also, there are many more exported data points than i expected. For example, I made a toy model moving O2 through a cube and set the mesh to "extremely coarse", so the end face only consists of two triangles. However, when I export this surface instead of the expected 2, I get 25 nodes if i export gauss points (order 1) or 79 (!) if I export Lagrangian points. The only mesh parameter I can export in the same file is "h" - my impression is that this number represents the longest edge of the 3D mesh element to which the specific triangle is attached and forms the surface - so it may not even be an edge shared with the triangle I care about. Any idea where i can get the relevant area numbers?
thanks
Mark