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.

Failed to evaluate variable: freq

Please login with a confirmed email address before reporting spam

Hi COMSOL Users,

I'm new to using the v4.x series of COMSOL, so perhaps I've missed something simple, but I get an error when trying to plot body volume force variables. The error message states:
"Cannot evaluate expression.
Failed to evaluate variable.
- Variable: freq
- Geometry: 1
- Domain: 1
Failed to evaluate variable.
- Variable: mod1.acpr.freq
- Defined as: freq
..."
and continues down to mod1.spf.Fx which I am trying to plot (see attached image).

I have used the Pressure Acoustics module along with the Laminar Flow module. I set the solver to first solve Pressure Acoustics in the frequency domain (Step 1), then a combination of parameters from Pressure Acoustics is used to calculate body forces in the Laminar Flow module. Stationary analysis is used to solve for the Laminar Flow physics (Step 2).

Has anyone had this problem before? Is there an easy way to fix this problem?

Thanks in advance,
Ian


8 Replies Last Post 27 feb 2016, 16:41 GMT-5
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 21 dic 2012, 00:48 GMT-5
Hi

Have you defined the frequency in the first tab in the frequency solver node ? I suspect your field is blank

--
Good luck
Ivar
Hi Have you defined the frequency in the first tab in the frequency solver node ? I suspect your field is blank -- Good luck Ivar

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 dic 2012, 08:22 GMT-5
Ian,

Try the following:

Under Global Definitions>Parameters, define variable “freq” and assign the same numerical value of the frequency you are using in the Study Step.
Update the model and plot your results again.

Regards,
Sergei
Ian, Try the following: Under Global Definitions>Parameters, define variable “freq” and assign the same numerical value of the frequency you are using in the Study Step. Update the model and plot your results again. Regards, Sergei

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2 gen 2013, 21:02 GMT-5
Hi Ivar, Sergei,

Thanks for your help and apologies for the delayed reply. The trick of defining a new parameter "freq" under Global Parameters worked.

Regards,
Ian
Hi Ivar, Sergei, Thanks for your help and apologies for the delayed reply. The trick of defining a new parameter "freq" under Global Parameters worked. Regards, Ian

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 3 gen 2013, 02:31 GMT-5
Hi

probably the same effect as when you run a stationary sover before a time series, with BC equations depending on "t" the time, but "t" is defined only when the time dependent solver is active not during the stationary solver, therefore one must add the variable name as a Parameter (typically t=0[s]).
For the frequency domain, "freq" is defined when that solver is active, but not for any other solver, so you need to add it in the Parameter list too.

A Parameter might be overwritten later by COMSOL as a parameter is loaded once at first solver run and only updated via a "Parameter sweep" or "Continuation sweep" sovler node

--
Good luck
Ivar
Hi probably the same effect as when you run a stationary sover before a time series, with BC equations depending on "t" the time, but "t" is defined only when the time dependent solver is active not during the stationary solver, therefore one must add the variable name as a Parameter (typically t=0[s]). For the frequency domain, "freq" is defined when that solver is active, but not for any other solver, so you need to add it in the Parameter list too. A Parameter might be overwritten later by COMSOL as a parameter is loaded once at first solver run and only updated via a "Parameter sweep" or "Continuation sweep" sovler node -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2 giu 2014, 13:07 GMT-4
Hi, Sergei,

I think I have the pretty similar trouble as the one you solved. Could you take a quick look at the attached file and help me fix the problems.

Thanks in advance on your comment.

Best,
Ji
Hi, Sergei, I think I have the pretty similar trouble as the one you solved. Could you take a quick look at the attached file and help me fix the problems. Thanks in advance on your comment. Best, Ji


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 giu 2014, 15:55 GMT-4
Thank you Sergei,
This bug still exists in 4.4!


Ian,

Try the following:

Under Global Definitions>Parameters, define variable “freq” and assign the same numerical value of the frequency you are using in the Study Step.
Update the model and plot your results again.

Regards,
Sergei


Thank you Sergei, This bug still exists in 4.4! [QUOTE] Ian, Try the following: Under Global Definitions>Parameters, define variable “freq” and assign the same numerical value of the frequency you are using in the Study Step. Update the model and plot your results again. Regards, Sergei [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 11 set 2015, 23:49 GMT-4
And 5.1 too.

Thank you Sergei,
This bug still exists in 4.4!


Ian,

Try the following:

Under Global Definitions>Parameters, define variable “freq” and assign the same numerical value of the frequency you are using in the Study Step.
Update the model and plot your results again.

Regards,
Sergei



And 5.1 too. [QUOTE] Thank you Sergei, This bug still exists in 4.4! [QUOTE] Ian, Try the following: Under Global Definitions>Parameters, define variable “freq” and assign the same numerical value of the frequency you are using in the Study Step. Update the model and plot your results again. Regards, Sergei [/QUOTE] [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 27 feb 2016, 16:41 GMT-5
Has anyone figured out how to deal with this problem when you are running a study with two steps, each of which uses frequency domain RF, but at different frequencies?

When doing the last step, it seems to want to update the solution of the previous step using the new frequency that it sees when I don't want it to do that.

Update: never mind, I figured out how to do it in COMSOL 5.2. If you go to the topmost list (i.e Electromagnetic waves (emw) ), then go to the equation tab, there are now options to choose from. The default seems to be "study controlled", but if you change it to frequency domain, it gives you the option to enter any frequency you want with a different variable name.
Has anyone figured out how to deal with this problem when you are running a study with two steps, each of which uses frequency domain RF, but at different frequencies? When doing the last step, it seems to want to update the solution of the previous step using the new frequency that it sees when I don't want it to do that. Update: never mind, I figured out how to do it in COMSOL 5.2. If you go to the topmost list (i.e Electromagnetic waves (emw) ), then go to the equation tab, there are now options to choose from. The default seems to be "study controlled", but if you change it to frequency domain, it gives you the option to enter any frequency you want with a different variable name.

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.