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.
Access values of one model in the other
Posted 24.01.2011, 09:57 GMT-5 Low-Frequency Electromagnetics, Heat Transfer & Phase Change, Results & Visualization Version 5.0 9 Replies
Please login with a confirmed email address before reporting spam
is it possible in post-processing, to access all the models that are stored in a .mph comsol file?
I have a file that contains two models (with exactly the same geometry) and would like to plot e.g.
mod1.u - mod2.u2
For some reasons this does not work.
Plotting or accessing constant values, e.g. material constants of one model from the other sometimes is possible.
But trying to substract variables of one model from the other fails.
I can not even access variable values of one model from the solution of the other, even when referring to it using the "model2.something" referrer.
Does anyone know a work around, or do I have to export all the solutions to matlab and do the post-processing there?
I often ran out of java heap space, when I tried this...
So I would like to avoid that.
Is there a clever way of using the "at" or "with" operators for this purpose?
Thanks for any hints,
Juergen
Please login with a confirmed email address before reporting spam
you must define global variables that have specific definitions on the specific domains based on the specific physics, and then it mostly works out.
in v4 you should not forget that when adressing a variable from another embeded model you need the ful naming convention (and the variable must be defined solved previously via a specific solve or a order correspondingly in the segregated solver sequence
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
All solutions are available for plotting and evaluation, but you can only plot fields defined on the geometry (model) in the solution data set that a plot group uses. You can use a model coupling operator to make a field variable available in another geometry (model).
In the simple case that the two models use exactly the same geometry, an Identity Mapping operator makes it possible to access, for example, u2 in the geometry for u. If you define it in Model 2, select Geometry 1 from the "Destination geometry" list. You can then plot the difference in a plot group for a Solution data set for Model 1 as, for example,
u-mod2.idmap1(mod2.u2)
The "at" and "with" operators are useful for combining solutions at different times or for different parameter values or eigenmodes in time-dependent, parametric, or eigenvalue simulations.
Best regards,
Magnus Ringh, COMSOL
Please login with a confirmed email address before reporting spam
thanks for your reply. I tried that and it works so far.
Greetings,
Juergen
Please login with a confirmed email address before reporting spam
I used the Identity Mapping function to move values from Model 1 to Model 2 in my simulation. Model 1 is a heat transfer problem where the geometry is first deformed, then the HT is solved for. Model 2 is just the heat transfer portion of the problem without the solid mechanics. They share the same geometry.
I created an idmap in Model 1, with destination Model 2. THen I went to plot using the Model 2 solution:
surface plot: mod2.T2 - mod1.idmap1(mod1.T)
This was meant to plot the difference in temperature with and without compression. The answer didnt make sense, and plotted alone, mod1.idmap1(mod1.T) is just a constant temperature, which is not the case when I just solve Model 1 alone (get a parabolic t-distribution).
Any ideas? Thank you!
Austin
Please login with a confirmed email address before reporting spam
From there, I am unclear how to connect the two models. What exactly is the identity object and how is it used to connect the models once it's created? I can't just simply tell model 2 to solve at this point.
Thanks.
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
mod1.idmap1 (Geometry2)
mod2.physics.source(mod1.idmap3(mod1.u1))
For a large number of DOFs in mod2 or mod1 the mapping requires quite some time - so avoiding seems much better!
Plotting works fine, thanks for that!
Best regards,
Matthias
Attachments:
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
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.