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.

Accessing Fem Structure within COMSOL & Coupling Variables

Please login with a confirmed email address before reporting spam

Hi everyone,

I am looking for a way to access the fem structure within comsol for a given geometry.

I would ideally like a way to evaluate the postinterp(fem,[x;y;z]) function as an expression while remaining in COMSOL (that is without exporting the fem strcture to MATLAB and then trying to evaluate it there).

The idea is that I have one geometry which I have solved and wish to evaluate specific points within the subdomains to be used in a second geometry in the same mph file. The coupling variables approach doesn't seem to be what I need, unless it has some hidden implementation that I am just not seeing. I would like point evaluation and not an integral over the entire domain. Really I am looking for a command that replicates the functionality of the 'Data Display>Subdomain' dialog that can be used as an expression.

Thanks again,
Jon

1 Reply Last Post Aug 12, 2009, 4:09 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 12, 2009, 4:09 p.m. EDT
Hi,

As an update, I tried using the Extrusion coupling variables, and it actually looks like it does what I am looking for. The only remaining issue is that it seems to try to solve both geometries simultaneously, and as a result the solver doesn't converge.

I have attached the sample file that I was playing with, but the idea is the following:

I have one cube that is 1x1x1 in Geom1, and a second cube that is .5x.5x.5 in Geom2. I then set the boundary conditions on Geom1 and also create an extrusion variable named v1 with the expression V, and have geom2 (subdomain) as the destination.

Then in Geom2 i set the boundary conditions of the second cube to have a potential of v1 (which should be the potential that was solved for in Geom1 and was set as the extrusion variable).

Now when I go to solve the system, the solver almost never converges, or depending on the solver if it does converge the solution isn't correct. If you look at the attached file you will see in Geom1 the second slice should have a constant potential given the boundary conditions (and does if you solve the model without the second geometry and coupling variables....?) but it clearly doesn't have a constant potential for some reason when the coupling variable is used.

Are coupling variables bi-directional?

Is there a way to force COMSOL to solve Geom1 first, and then solve Geom2? (Solver manager 'Solve for' doesn't seem to work even if I only select Geom1).


Thanks again,
Jon

EDIT: I can't seem to attach a file, so here is a link to the file.
dl.getdropbox.com/u/1605265/Test2.mph

Thanks!
Hi, As an update, I tried using the Extrusion coupling variables, and it actually looks like it does what I am looking for. The only remaining issue is that it seems to try to solve both geometries simultaneously, and as a result the solver doesn't converge. I have attached the sample file that I was playing with, but the idea is the following: I have one cube that is 1x1x1 in Geom1, and a second cube that is .5x.5x.5 in Geom2. I then set the boundary conditions on Geom1 and also create an extrusion variable named v1 with the expression V, and have geom2 (subdomain) as the destination. Then in Geom2 i set the boundary conditions of the second cube to have a potential of v1 (which should be the potential that was solved for in Geom1 and was set as the extrusion variable). Now when I go to solve the system, the solver almost never converges, or depending on the solver if it does converge the solution isn't correct. If you look at the attached file you will see in Geom1 the second slice should have a constant potential given the boundary conditions (and does if you solve the model without the second geometry and coupling variables....?) but it clearly doesn't have a constant potential for some reason when the coupling variable is used. Are coupling variables bi-directional? Is there a way to force COMSOL to solve Geom1 first, and then solve Geom2? (Solver manager 'Solve for' doesn't seem to work even if I only select Geom1). Thanks again, Jon EDIT: I can't seem to attach a file, so here is a link to the file. http://dl.getdropbox.com/u/1605265/Test2.mph Thanks!

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.