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.

How to transfer "eigenfrequency" from eigenfrequency to frequency domain step

Please login with a confirmed email address before reporting spam

Hi,
I am trying to simulate acoustic levitation, including both mechanics and acoustics. Simulation consists of two parts - structural mechanics and piezoelectrics, where eigenfrequency step is used to get resonance frequency of whole ultrasonic transducer. Next, frequency domain step is used with acoustics module, to get pressure and velocity field of gas with respect to computed mechanic displacement field as input.

When I run this by myself, eg run Step1 (mechanics and piezoelectrics active), ctrl+c resulting eigenfrequency, switch to Step2 (acoustics active), ctrl+v frequency, run, everything is fine. However, I am unable to setup Comsol to transfer computed eigenfrequency from Step1 to Step2 by itself. It would be useful, because with that, I would be able to use optimization and next features...

I can't use Frequency domain modal (which - if i got it right - is supposed to handle this case), because I need to separate these two steps as described. And I can probably use LiveLink with Matlab and handle it by myself, but I think it shouldn't be necessary.

Thank you,
Petr Barton

2 Replies Last Post Apr 7, 2017, 2:16 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Apr 6, 2017, 5:39 a.m. EDT
Dear Petr,

unfortunately I can't help you, because I'm interested in the solution for the same problem, too.

Kind regards,
Levin Dieterle
Dear Petr, unfortunately I can't help you, because I'm interested in the solution for the same problem, too. Kind regards, Levin Dieterle

Henrik Sönnerlind COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Apr 7, 2017, 2:16 p.m. EDT
Hi,

You can do this by adding a very lightweight app on top of the model, in which you implement a method which reads the eigenfrequency, and writes the value into the frequency field of the second study.

In version 5.3, soon to be released, it will also be possible to embed something called a 'Model Method'. There, the following method does the trick, but something along the same lines should work also in an app:

model.sol("sol1").runAll(); // Run eigenfrequnecy study
model.result().table("tbl1").clearTableData();
model.result().numerical("gev1").setResult(); // A Global Evaluation node is used for displaying the eigenfrequency
double[] frq = model.result().numerical("gev1").getReal()[0]; // Get eigenfrequency from table
model.study("std2").feature("freq").set("plist", frq[0]); // Set frequency to use in frequency domain
model.sol("sol2").runAll(); // run frequency domain study

Regards,
Henrik
Hi, You can do this by adding a very lightweight app on top of the model, in which you implement a method which reads the eigenfrequency, and writes the value into the frequency field of the second study. In version 5.3, soon to be released, it will also be possible to embed something called a 'Model Method'. There, the following method does the trick, but something along the same lines should work also in an app: model.sol("sol1").runAll(); // Run eigenfrequnecy study model.result().table("tbl1").clearTableData(); model.result().numerical("gev1").setResult(); // A Global Evaluation node is used for displaying the eigenfrequency double[] frq = model.result().numerical("gev1").getReal()[0]; // Get eigenfrequency from table model.study("std2").feature("freq").set("plist", frq[0]); // Set frequency to use in frequency domain model.sol("sol2").runAll(); // run frequency domain study Regards, Henrik

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.