CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   COMSOL (https://www.cfd-online.com/Forums/comsol/)
-   -   Femlab: why isn't this code working? (https://www.cfd-online.com/Forums/comsol/14991-femlab-why-isnt-code-working.html)

Max March 27, 2008 09:53

Femlab: why isn't this code working?
 
Hey people,

I'm new to Femlab but I used to do a few things in Matlab. I found sth. interesting in a publication on the net and would like to get it to work. It's just some sphere in a Navier Stokes fluid. http://www2.mic.dtu.dk/research/MIFT...FlowSphere.pdf

Now when I save those 2 m files from the appendix and try to open the main file Femlab doesn't understand a bunch of functions as tic;,toc; or even num2str();. It also seems to be unable to include the second m-file even though it's in the same directory and it has the right filename.

Anyways I just included (copy paste) the code from the second file (http://www.xammm.com/setappmode.m) twice into the main file and I also made comments out of any tic;,toc;,num2str(); functions since afaik they aren't really necessary for the code to run.

So I end up using this m-file: http://www.xammm.com/calcdrag.m Now when I try to run it in Femlab there are no errors but nothing happens (cpu usage goes to 100% and computer almost freezes). Can anyone try the last m-file? Maybe it's just not working because of the Femlab version I'm using here. Thanks, Max

Max

Magnus Ringh April 9, 2008 02:17

Re: Femlab: why isn't this code working?
 
Hi,

Some general advice:

- Upgrade to the latest version of the software: COMSOL Multiphysics 3.4 (formerly FEMLAB)

- Scripts can use any scriping functions when you run them as scripts. Model M-files, which you can save and load into the COMSOL Multiphysics user interface, have stricter rules about the syntax if you want to be able to load them into the GUI, and commands such as tic and toc are not allowed.

- Contact the COMSOL support desk at support@comsol.com or www.comsol.com/support.

Hope this helps,

Magnus Ringh COMSOL AB

Max April 9, 2008 09:35

Re: Femlab: why isn't this code working?
 
Hey Magnus,

thanks for your reply! I already fixed the problem by designing my own model from scratch in Femlab. It was easier than I thought it would be.

Max


All times are GMT -4. The time now is 10:41.