We finished the first comsol model which where we can modify the geometry automatically. The problem with comsol is that you can't export geometry data in a useful format, only binary which you can't modify. So the only way to have an adjustable geometry model is to use matlab code, and only call the comsol fem solver. A problem with matlab is that the documentation for the comsol interfacing is bad close to not existent. So e.g. if you create an object you don't know how to access the individual subdomains because you don't know anything about the numbering scheme. Here the solution was to create the geometry, import that from the matlab workspace into comsol, then use the comsol gui to create the subdomains and boundary conditions, export the stuff into a matlab file (whic you can't re-open in comsol), and copy all the information about the indexing and material property declaration back into the matlab file. Here is an example how the boundary condition syntax looks like:
bnd.Hy = {0,1};
bnd.Hz = {0,1};
bnd.ind = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1, 1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1];
So without the gui you can't identify the right index for the surfaces you wanna fix. But once you have done this and all the material declaration in the matlab file you can use the object created with matlab and use all the boundary conditions created with comsol and combine that. At the end the simple model for the basic cavity is 750 (!) lines of code.
Now you can do changes to the geometry within matlab as long as the indexing does not change, which is not the case for us if we move the grooves a little bit.
As we can't run a model with a good mesh on our computers (not enough memory) we tried to start comsol on menkar. Unfortunately the comsol installation does not support the integration into matlab, so you can't start matlab with the comsol functions (or better you can't run comsol which then also starts matlab and configures it in the way that you can call the comsol functions within matlab. So we can't do a good simulation and parameter sweep right now until we fix this. Jan has the same problem on his computer.
First plots will be provided tomorrow.... |