CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Add icoLagrangianFoam to FoamX (http://www.cfd-online.com/Forums/openfoam-solving/58824-add-icolagrangianfoam-foamx.html)

dyxu August 1, 2007 04:49

hi all, i just have compiled
 
hi all,
i just have compiled icoLagangianFoam using wmaked,but how can i add it to FoamX as a solver ,so that it will appear in the solvers list when i create a new case just like icoFoam ?

gschaider August 1, 2007 09:31

As a start have a look at: ht
 
As a start have a look at:
http://openfoamwiki.net/index.php/Ho...olver_to_foamX
As icoLagrangianFoam is derived from icoFoam (the name is a hint ;) ) the icoFoam-stuff is a good start. The fun part is "Adapt the configuration file and the dictionaries to your needs", you'll have to add the lagrangian-specific stuff. An option would be to just "change /Make/files to match your application name" and edit the lagrange-stuff by hand.

dyxu August 4, 2007 21:29

thank u Bernhard
 
thank u Bernhard

zhoubinwx May 27, 2008 05:07

Hi, all, I would like to sh
 
Hi, all,

I would like to show what I have done:

1.install svn software using package manager
2.zhou@wsfoam:~$ svn checkout https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/solvers/other/IcoLagrangianFoam/
3.I find the directory "icoLagrangianFoam" is in "zhou" directory automatically.
4.I copy it into "$WM_PROJECT_USER_DIR/applications/solvers"
5../Allwmake

After I compile the icoLagrangianFoam solver, I get the error:

/home/zhou/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libtriSurface.so: undefined reference to `yyFlexLexer::yywrap()'
collect2: ld returned 1 exit status
make: *** [/home/zhou/OpenFOAM/zhou-1.4.1/applications/bin/linuxGccDPOpt/icoLagrangianFoam ] Error 1

I copy the file "FoamX" (from "The solver" in http://openfoamwiki.net/index.php/Co...LagrangianFoam) into /home/zhou/OpenFOAM/zhou-1.4.1/applications/solvers/icoLagrangianFoam/icoLagrang ianFoam.

Change the name icoFoam.cfg into icoLagrangianFoam.cfg.

Is there any one who could tell me what's wrong with my steps.

Thank you

niklas May 28, 2008 02:10

There are 2 ways to solve this
 
There are 2 ways to solve this.
I think there are 4 flex files that you will have to fix. In your case it is this one.
OpenFOAM/OpenFOAM-1.4.1/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L

solution 1.
find the line
extern "C" int yywrap()
and replace it with
extern "C" int yyFlexLexer::yywrap()

solution 2.
find the line
%option stack
under this add the following
%option noyywrap

since yywrap always return 1 I think the 2 solutions produce the same result

niklas May 28, 2008 02:11

I forgot to add that you of co
 
I forgot to add that you of course need to recompile the trisurface lib also

zhoubinwx May 28, 2008 13:00

Hi, Dear NLklas, Thank you
 
Hi, Dear NLklas,

Thank you for your reply.

I follow both of your method, but it is not ok.

When I follow method 2,

%option stack
%option noyywrap
/* zhoubin add: %option noyywrap*/
%x readSolidName

When I recompile using:
zhou@wsfoam:~/OpenFOAM/OpenFOAM-1.4.1/src$ wmake libso triSurface

I get the error:
triSurface/interfaces/STL/readSTLASCII.L:54: error: expected unqualified-id before numeric constant
lex.yy.cc: In member function 'int STLLexer::lex()':
lex.yy.cc:5498: warning: use of old-style cast
lex.yy.cc:5498: warning: use of old-style cast
lex.yy.cc:5514: warning: use of old-style cast
lex.yy.cc:5728: warning: use of old-style cast
triSurface/interfaces/STL/readSTLASCII.L:208: warning: unused variable 'endPtr'
lex.yy.cc: In member function 'int yyFlexLexer::yy_get_next_buffer()':
lex.yy.cc:5977: warning: use of old-style cast
lex.yy.cc:6004: warning: use of old-style cast
lex.yy.cc:6017: warning: use of old-style cast
lex.yy.cc:6018: warning: use of old-style cast
lex.yy.cc:6039: warning: use of old-style cast
lex.yy.cc: In member function 'yy_state_type yyFlexLexer::yy_get_previous_state()':
lex.yy.cc:6087: warning: use of old-style cast
lex.yy.cc:6087: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yyunput(int, char*)':
lex.yy.cc:6148: warning: use of old-style cast
lex.yy.cc:6149: warning: use of old-style cast
lex.yy.cc:6157: warning: use of old-style cast
lex.yy.cc: In member function 'int yyFlexLexer::yyinput()':
lex.yy.cc:6226: warning: use of old-style cast
lex.yy.cc: In member function 'virtual yy_buffer_state* yyFlexLexer::yy_create_buffer(std::istream*, int)':
lex.yy.cc:6283: warning: use of old-style cast
lex.yy.cc:6292: warning: use of old-style cast
lex.yy.cc: In member function 'virtual void yyFlexLexer::yy_delete_buffer(yy_buffer_state*)':
lex.yy.cc:6310: warning: use of old-style cast
lex.yy.cc:6313: warning: use of old-style cast
lex.yy.cc:6315: warning: use of old-style cast
lex.yy.cc: In member function 'void yyFlexLexer::yy_push_state(int)':
lex.yy.cc:6378: warning: use of old-style cast
lex.yy.cc:6382: warning: use of old-style cast
lex.yy.cc:6382: warning: use of old-style cast
lex.yy.cc: In function 'void* yy_flex_alloc(yy_size_t)':
lex.yy.cc:6484: warning: use of old-style cast
lex.yy.cc: In function 'void* yy_flex_realloc(void*, yy_size_t)':
lex.yy.cc:6502: warning: use of old-style cast
lex.yy.cc:6502: warning: use of old-style cast
lex.yy.cc: At global scope:
lex.yy.cc:5317: warning: 'yy_start_stack_ptr' defined but not used
lex.yy.cc:5318: warning: 'yy_start_stack_depth' defined but not used
lex.yy.cc:5319: warning: 'yy_start_stack' defined but not used
lex.yy.cc:5321: warning: 'void yy_push_state(int)' declared 'static' but never defined
lex.yy.cc:5324: warning: 'void yy_pop_state()' declared 'static' but never defined
lex.yy.cc:5327: warning: 'int yy_top_state()' declared 'static' but never defined
make: *** [Make/linuxGccDPOpt/readSTLASCII.o] Error 1

Sorry for my deeper problem.

Thank you for helping me.

Best regards,

Bin

niklas May 29, 2008 02:11

thats because your flex is too
 
thats because your flex is too old.

go to http://flex.sourceforge.net/

and compile and install 2.5.35
to the linux (or linux64 or whatever architecture you're using).
Be sure to edit the FLEX_HOME enviroment variable in OpenFOAM-1.4.1/.bashrc to point to your new flex

make sure you link flex++ to the new flex and copy the new FlexLexer.h file to OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude

that will solve it

zhoubinwx June 5, 2008 10:15

Thank you, the problem is solv
 
Thank you, the problem is solved and I am studying icoLagrangianFoam case.
Best regards,
Bin

zhoubinwx June 11, 2008 08:42

Hello Bernhard Gschaider and o
 
Hello Bernhard Gschaider and other friends,

Could I ask any of you several questions:

1) in the case of cavityLagrange, we could see that in the file "controDict" it uses icoFoam solver, not icoLagrangianFoam solver, could you tell me why?

2) If we change "icoFoam" into "icoLagrangianFoam", we have an error, saying that "transportModel" not found???

3) since we could see that in the case "cavityLagrange", there is a file named "cloudProperties",however, after we open that case with OpenFOAM, we could not set for the particles?

Thank you very much for your patience.

Best regards,

Zhou Bin

gschaider June 11, 2008 09:53

Hi yhoubin! I never tried t
 
Hi yhoubin!

I never tried to run icoLagrangianFoam on FoamX and I havn't used FoamX for a long time (I somehow broke it and I'm to lazy to fix it - I prefer working with a text editor)

@1: this entry is ONLY for the benefit of FoamX - if you're not using that it can be missing or have any value - the solvers don't care

@2: FoamX has that error? Can't help you there, sorry

@3: You mean you can't edit any particle-stuff in FoamX? You have to edit some "case definition files" (basically something like DTD-files for XML-files, if you know that kind of stuff) for FoamX to be able to work with new dictionaries. Have a look at the stuff that resides in ~/OpenFOAM/OpenFOAM-1.4.1/.OpenFOAM-1.4.1/apps/FoamX/ for examples.

There may be some tars floating around of icoLaFo that have a FoamX-directory and for that reason FoamX seems to recognize it, but that was only a copy of the original icoFoam-FoamX-stuff. It has been removed from the latest version (the one on the svn). Should anyone have the time and produce FoamX-support for icoLaFo he/she is welcome to add it to the version on the SVN

Bernhard


All times are GMT -4. The time now is 04:35.