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.

Discreet Boundary Conditions

Please login with a confirmed email address before reporting spam

Hi all,

I am looking for a way to take a slice from one model, and use the data on that slice as the boundary conditions on another model. If such an interface exists already that would be great however if you have any ideas on how else this could be acomplished that would be great.

Some ideas I had were to try to do a surface fit in MATLAB and then maybe be able to call the fitmodel(x,y) function in matlab with comsol for use on the boundary condition. Is this possible?

Any thoughts on this? Or any suggestions that could be helpful.

I really appreciate the time.

Kind Regards,
Jon Welch

5 Replies Last Post 2009年8月11日 GMT-4 18:37
Michael Rembe Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年8月11日 GMT-4 07:32
Hi,

have you ever tried to use coupling varables on boundaries? There are a lot of possibilities ...

Michael Rembe
Hi, have you ever tried to use coupling varables on boundaries? There are a lot of possibilities ... Michael Rembe

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年8月11日 GMT-4 10:23
Hi,

Thank you for the reply. I haven't tried coupling variables yet, but as I look at them, they seem to be only for working within the same model? Is it possible to take the results from one model and then apply them as boundary conditions to a model in a completely different file?

The goal of this is really to attempt to compensate for the numerical errors I recieve when attempting to solve problems with > 4 orders of magnitude difference in scale between parts. I would like to take slices from the larger scale model where the numbers are ok, and apply those as boundary conditions to a new model (different file) which is much smaller in scale than the first. The idea being that I don't want to lose the larger scale effects that could affect the fields surrounding the smaller object, but want enough resolution on the smaller object for the results to be useful.

I hope that makes sense =).

Thanks again for any additional input.

Kind Regards,
Jon
Hi, Thank you for the reply. I haven't tried coupling variables yet, but as I look at them, they seem to be only for working within the same model? Is it possible to take the results from one model and then apply them as boundary conditions to a model in a completely different file? The goal of this is really to attempt to compensate for the numerical errors I recieve when attempting to solve problems with > 4 orders of magnitude difference in scale between parts. I would like to take slices from the larger scale model where the numbers are ok, and apply those as boundary conditions to a new model (different file) which is much smaller in scale than the first. The idea being that I don't want to lose the larger scale effects that could affect the fields surrounding the smaller object, but want enough resolution on the smaller object for the results to be useful. I hope that makes sense =). Thanks again for any additional input. Kind Regards, Jon

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年8月11日 GMT-4 14:06
Hi Again,

I found a way to do what I wanted, I don't know that its the most efficient way so I am still open to suggestions.

Essentially what I did was took successive slices of the 3D plot at different spots which correspond to where the boundaries on my smaller model would be.

From there I post-processed the exported data (which the slice exports the entire model not just the region I am interested in) and selectively pulled out the points which fell within the region I was interested in. I also removed the 3rd column in the data set (which is constant since the plane used was made to be such).

Now I have a 2d (surface) Data set (coord1, coord2, value). Then using the COMSOL 'functions' dialog, I created six interpolated functions (one for each boundary of interest) from the refined 2d data sets. Finally in the boundary settings dialog, I used the functions as expressions for the boundary conditions.

In the end, it works exactly like I want it to, however there is alot of additional work that is needed to refine the datasets first....

Perhaps the whole thing could be automated using an M script?
Hi Again, I found a way to do what I wanted, I don't know that its the most efficient way so I am still open to suggestions. Essentially what I did was took successive slices of the 3D plot at different spots which correspond to where the boundaries on my smaller model would be. From there I post-processed the exported data (which the slice exports the entire model not just the region I am interested in) and selectively pulled out the points which fell within the region I was interested in. I also removed the 3rd column in the data set (which is constant since the plane used was made to be such). Now I have a 2d (surface) Data set (coord1, coord2, value). Then using the COMSOL 'functions' dialog, I created six interpolated functions (one for each boundary of interest) from the refined 2d data sets. Finally in the boundary settings dialog, I used the functions as expressions for the boundary conditions. In the end, it works exactly like I want it to, however there is alot of additional work that is needed to refine the datasets first.... Perhaps the whole thing could be automated using an M script?

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 2009年8月11日 GMT-4 16:18
Hi

You do not only have the coupling (and extrusion + projection) variables, but I beleive that in your case you could have 2 geometries, you calculate the first geom 1 (global macro one) save the results and restart geom2 (the details from there), for that you must play with the solver manager GUI.

There are several examples around in the doc to give you good starting points

Good luck
Ivar
Hi You do not only have the coupling (and extrusion + projection) variables, but I beleive that in your case you could have 2 geometries, you calculate the first geom 1 (global macro one) save the results and restart geom2 (the details from there), for that you must play with the solver manager GUI. There are several examples around in the doc to give you good starting points Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2009年8月11日 GMT-4 18:37
Thanks for the insight. I am indeed using two geometries, so if I can now find a way to take part of the solution from one geometry and use it as a boundary condition on the other I will be golden.

I will see if I can find something like this in the documentation, if you can think of any of the examples that demonstrate this off the top of your head please let me know.

Kind Regards,
Jon
Thanks for the insight. I am indeed using two geometries, so if I can now find a way to take part of the solution from one geometry and use it as a boundary condition on the other I will be golden. I will see if I can find something like this in the documentation, if you can think of any of the examples that demonstrate this off the top of your head please let me know. Kind Regards, Jon

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.