CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Femlab: why isn't this code working?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 27, 2008, 10:53
Default Femlab: why isn't this code working?
  #1
Max
Guest
 
Posts: n/a
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
  Reply With Quote

Old   April 9, 2008, 02:17
Default Re: Femlab: why isn't this code working?
  #2
Magnus Ringh
Guest
 
Posts: n/a
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
  Reply With Quote

Old   April 9, 2008, 09:35
Default Re: Femlab: why isn't this code working?
  #3
Max
Guest
 
Posts: n/a
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
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD code for homework Hugo Main CFD Forum 6 April 14, 2008 16:13
Editing code Joseph Main CFD Forum 0 May 28, 2007 16:18
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10
own Code vs. commercial code Bernhard Mueck Main CFD Forum 10 February 16, 2000 11:07


All times are GMT -4. The time now is 05:24.