Experience in RF module Comsol?

Click For Summary

Discussion Overview

The discussion revolves around the use of the RF module in COMSOL, focusing on user-defined variables, geometry creation, and scripting within the software. Participants share their experiences and seek clarification on specific functionalities and commands.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant inquires about creating user-defined variables after solving a model and seeks guidance on the relevant menu options.
  • Another participant describes the process of generating a solid helicoid using the helix3 command but expresses that the output does not meet their requirements, asking for advice on correcting the formula.
  • A participant suggests using the plot parameters dialog to create custom expressions for visualization and mentions the option to create scalar variables for plotting.
  • Discussion includes details about the helix3 command parameters and their effects on the generated geometry, with suggestions for adjusting these parameters to achieve the desired output.
  • One participant asks about the workflow for modifying an m-file in COMSOL and whether it is necessary to use MATLAB for this process.
  • Questions are raised regarding the nature of COMSOL scripting, the weak PDE mode, and the definition of "fem" within the scripting context.

Areas of Agreement / Disagreement

Participants express varying levels of familiarity with the RF module and COMSOL scripting, leading to a mix of shared insights and individual questions. No consensus is reached on the best approach to creating the desired geometry or on the specifics of scripting.

Contextual Notes

Participants mention the complexity of COMSOL's documentation and the challenges of learning the scripting language, indicating that additional resources or courses may be beneficial.

Who May Find This Useful

This discussion may be useful for users of COMSOL, particularly those working with the RF module, who are looking for practical advice on geometry creation, variable definition, and scripting techniques.

fisico30
Messages
362
Reaction score
0
Hello,

anyone with some experience in Comsol?
I have a few basic questions on the RF module

thanks!
 
Physics news on Phys.org


... RF module isn't really my everyday thing with Comsol but as long as its "basic" :wink: .
 


Thanks PerennialII

2 questions:
1) After "Solve", I get access to predefined variables which i can plot.
How can I create user-defined variables? where is the menu to do that?

2) I need to draw a 1 turn of of solid helicoid (spiral ramp),i.e., the volume included under spiraling surface.

I found the following while hunting online:
Example:
"First issue the command

h = helix3(6,30,20,3*20,12)

which will generate the output log

h =

3D solid object
subdomains: 1
faces: 146
edges: 292
vertices: 148

Then start COMSOL Multiphysics by issuing the command
comsol.

1. In the Model Navigator, choose Space Dimension: 3D.
2. Select COMSOL Multiphysics>Heat Transfer>Conduction and click OK.
3. In the COMSOL user interface, select File>Import >Geometry Objects, select h[3D Solid Object], and click OK.

The solid helix that it generates is not the one i need. How can I fix the formula?

thanks a lot!
fisico30
 


1) When you open the "plot parameters" dialog, and for example take a surface plot, you've the "expression" slot over there. You can just type in whatever mathematical expression you want and Comsol will visualize it for you. Pretty neat compared to traditional FEA. Additionally, you could for example make a "scalar variable" (options->expressions->scalar expressions) out of what you want to visualize and then type in the name of your variable.

2) From comsol documentation :
h3 = helix3(dr,r,dh,h,n) creates a helix-shaped solid3 object with
cross-section radius dr, radius r, distance between turns dh, total height h, and
resolution n. The resolution n is an integer that specifies the number of curved
sections for every turn; a higher resolution yields a smoother-looking helix. The
helix is centered at the origin with main axis in the z direction. All arguments are
optional; when arguments are omitted, the following default values are used:
dr = 0.1, r = 1.0, dh = 1.0, h = 1.0, and n = 12.

Editing those should help, and unless you use other geometry import means (like doing the helix in some other geometry modeler) pretty much the way to do it since comsol's gui doesn't contain this one (not at least in the 3.4 application mode am in now).
 


Hello PerennialII

fisico30 here. you surely are the Comsol expert in this forum. Let me ask you a few simple questions, if you have time.

1) I would like to create the geometry we talked about last time using the command helix3(dr,r,dh,h,n)

Should I first draw something in the GUI, like a cube (but it could be anything), and then save that as a model m-file?
How do I open that m-file, to modify it ( should I insert the command helix3(dr,r,dh,h,n) somewhere in the file and then erase the stuff I do not need) and then launch it in Comsol?
Do I need to close the comsol GUI and then reopen comsol with the option "Comsol with Matlab"? (3 options at the start: Comsol, COmsol with script, Comsol with matlab).

To modify the m-file (which is a text file), do I always have to be in Matlab environment?

Is that the best way to get started (draw anything simple) and take advantage of the automatic scripting that comsol does?

2) The comsol scripting is "almost" like the matlab. The help is a little overwhelming. Would you recommend any other resource (book, paper) on the topic of scripting?

3) Why is the weak PDE mode called weak?

4) what is a fem in the script? is it a class like in java?

thanks again,
fisico30
 


Hi fisico30,

here goes, sure have time whenever my boss isn't breathing in my neck:

1) Yes I think the best option to get going is to use the Export / Import features a lot. Do something in GUI, export it, modify it, import it, and iterate to appropriate conclusion. You can do the editing with any text editor, and unless you're using something you specifically need Matlab for, you can just start Comsol and Comsol script (and then work all over the place, doing the imports / exports without having to close or open anything).

2) Yeah, it's not the easiest thing to learn from the material that is available. However, the Multiphysics part scripting guide is quite readable in my mind and that's the part have used myself (don't have a hard copy of it (didn't come with my documentation), but found it in the software help menu). Probably the best idea would be to get oneself to a course organized by Comsol about the topic or try to get hands on material of such a course (trying to collect such material myself).

3) The weak echoes the fact that in FEM you solve the PDEs in their weak form (~"integral form" of the PDE). Synonym would be the variational form. This is a typical step in derivation of FE methods for PDEs. It's certainly not weak, but it's a step in derivation of the underlying numerical "scheme". Comsol weak form terms aren't completely 1-1 what are understood as the weak forms of boundary value problems in FE literature for example, but it's a representation of the same thing.

4) Yes, I think somewhere they refer it to as a "data structure", but as far as I understand it is pretty much a class in the java sense of things.
 

Similar threads

Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
2K
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
2
Views
3K
Replies
5
Views
4K