CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

How to use setField to create sphere

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2008, 09:27
Default Hallo World. I'm trying to
  #1
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Hallo World.

I'm trying to place a spherical bubble into my mesh.
I thought about doing this with setting the parameter gamma with setFields.

But I just know the command boxToCell and a bubble isn't really like a box ..

Any ideas?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   April 25, 2008, 09:46
Default Beware: Advertising of own stu
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Beware: Advertising of own stuff

Look on the message-board or the Wiki for a thing called funkySetFields. I think there is even an example how to set a sphere with it somewhere

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 25, 2008, 10:05
Default Hi, Sebastian, you can do t
  #3
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
Hi, Sebastian,

you can do that with such steps:

1) Create spherical surface (for example, with Netgen)
2) Export this surface to stl-formal
3) use option surface surfaceToCell (like in cellSetDict)
4) run foamToVTK . . -cellSet <your_cell_set_name>
5) preview <your_cell_set_name> in paraview
6) Enjoy!
mkraposhin is offline   Reply With Quote

Old   March 11, 2016, 11:16
Default
  #4
New Member
 
Alpha Beta
Join Date: Mar 2016
Posts: 28
Rep Power: 10
xoitx is on a distinguished road
Quote:
Originally Posted by mkraposhin View Post
Hi, Sebastian,

you can do that with such steps:

1) Create spherical surface (for example, with Netgen)
2) Export this surface to stl-formal
3) use option surface surfaceToCell (like in cellSetDict)
4) run foamToVTK . . -cellSet <your_cell_set_name>
5) preview <your_cell_set_name> in paraview
6) Enjoy!
Any tutorial on this?
This is too crude .. just started openFoam 3 days ago
what to after a cad model shape and how does it get its reference point...
Thanks
xoitx is offline   Reply With Quote

Old   April 30, 2008, 04:38
Default Which one may be the easier wa
  #5
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Which one may be the easier way?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   April 30, 2008, 05:04
Default Hi Sebastian As far as I u
  #6
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Sebastian

As far as I understand you are using interFoam and you want to initialize the gamma field with a spherical bubble.

If that is the case then funkySetFields is the best choice as it allows you to do that in a very simple way.

Let me know if you still trying to do that as I can send you the code (courtesy Bernhard) which compiles with the 1.4.1 version.



With Regards
Jaswinder
XU0207 likes this.
jaswi is offline   Reply With Quote

Old   February 20, 2012, 03:39
Default
  #7
New Member
 
anonymous
Join Date: Apr 2010
Posts: 14
Rep Power: 16
shchao is on a distinguished road
Quote:
Originally Posted by jaswi View Post
Hi Sebastian

As far as I understand you are using interFoam and you want to initialize the gamma field with a spherical bubble.

If that is the case then funkySetFields is the best choice as it allows you to do that in a very simple way.

Let me know if you still trying to do that as I can send you the code (courtesy Bernhard) which compiles with the 1.4.1 version.



With Regards
Jaswinder
Can you send me the input files and the grid files shown in that picture? My email address:shenchao.sx@gmail.com
Thank you!
shchao is offline   Reply With Quote

Old   February 9, 2013, 12:19
Default
  #8
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15
liguifan is on a distinguished road
Quote:
Originally Posted by shchao View Post
Can you send me the input files and the grid files shown in that picture? My email address:shenchao.sx@gmail.com
Thank you!
Dear shchao,

How is going with your bubble rising from the water. I am currently working on the same thing, however, I am not able to figure out how to design a 3D bubble from the above picture given. Just wondering does someone has sent you the code for that? I have figured out the 2D model but not the 3D one.

If you have the code, do you think you can send me a copy for that? my email address is liguifan@gmail.com
Appreciated!
liguifan is offline   Reply With Quote

Old   April 30, 2008, 05:43
Default Sending me the code would be g
  #9
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Sending me the code would be great.
Send it to NOSPAM.sebastian.gatzka@stud.tu-darmstadt.de

(without the NOSPAM.) :-)

Thanks a lot ...

What is your setup in the picture used for?
I would like to simulate a rising bubble to investigate it's terminal velocity.
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   January 13, 2022, 00:39
Default
  #10
Member
 
ESI
Join Date: Sep 2017
Posts: 46
Rep Power: 8
ht2017 is on a distinguished road
could you send me the code to create a sphere by funkysetfiled?

my email: hoaithanhbk281113@gmail.com

Thank you so much!
ht2017 is offline   Reply With Quote

Old   April 30, 2008, 05:51
Default Hi Sebastian This is just
  #11
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Sebastian

This is just a trial setup to see how one can initialize the bubble and use interFoam to simulate bubble rising. it lacks the proper physics setup

It would be nice if you could share your experience one you have simulated the rising bubble up to its terminal velocity.

I send you the code right now.

Let me know if it won't compile or some other help required to initialize the bubble.

With Regards
Jaswi
jaswi is offline   Reply With Quote

Old   April 30, 2008, 06:49
Default Hi! The most recent version
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi!

The most recent version of funkySetFields can be downloaded via the subversion command in the Downloads section of
http://openfoamwiki.net/index.php/Co...funkySetFields

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 13, 2011, 09:54
Default
  #13
agr
New Member
 
agr
Join Date: Apr 2011
Posts: 2
Rep Power: 0
agr is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Hi!

The most recent version of funkySetFields can be downloaded via the subversion command in the Downloads section of
http://openfoamwiki.net/index.php/Co...funkySetFields

Bernhard
Thanks, Bernard, for the nice and promising utility.

Dear Bernard and All,

I downloaded the swak4Foam package, tried to follow your instructions - additionally installed flex. Seems it was built without errors.

But I still cannot get - should one use funkySetFields instead of setFields or after?

I just placed your demo funkySetFields Dictionary in my case/system directory and run the funkySetFields utility. It returned me the error:
FOAM FATAL ERROR:
funkySetFields: time/latestTime option is required
What does that mean?

Thanks in advance for your advice,
Regards,
Gallyam
agr is offline   Reply With Quote

Old   April 14, 2011, 03:41
Default
  #14
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi Gallyam,

Quote:
I just placed your demo funkySetFields Dictionary in my case/system directory and run the funkySetFields utility. It returned me the error:
FOAM FATAL ERROR:
funkySetFields: time/latestTime option is required
What does that mean?
This means that funkySetFields wants to know where to write the new fields, i.e. in which time directory. If you just want to plug it into your 0 directory, use
Code:
funkySetFields -time 0
Quote:
But I still cannot get - should one use funkySetFields instead of setFields or after?
Depends on what you want to do. If you just need funkySetFields to set a field according to an algorithm, e.g. as fuction of some coordinate, then funkySetFields is enough.
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   April 14, 2011, 05:04
Default
  #15
agr
New Member
 
agr
Join Date: Apr 2011
Posts: 2
Rep Power: 0
agr is on a distinguished road
Hello, Gijsbert!

Thanks a lot for your reply!

Now it works.

Regards,
Gallyam
agr is offline   Reply With Quote

Old   April 30, 2008, 07:03
Default I have seen the file, but what
  #16
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
I have seen the file, but what is subversion?
I'm not yet familiar with the Linux environment..
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   April 30, 2008, 12:00
Default Ok, after installing subversio
  #17
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Ok, after installing subversion and flex (not knowing what these are exactly doing) I get this strange listing, wenn running wmake funkySetFields:

Making dependency list for source file ValueExpressionParser.yy
could not open file ValueExpressionParser.tab.hh for source file ValueExpressionParser.yy
Segmentation fault (core dumped)
Making dependency list for source file ValueExpressionLexer.ll
could not open file ValueExpressionParser.tab.hh for source file ValueExpressionLexer.ll
Segmentation fault (core dumped)
Making dependency list for source file ValueExpressionDriver.C
could not open file ValueExpressionParser.tab.hh for source file ValueExpressionDriver.C
Segmentation fault (core dumped)
Making dependency list for source file funkySetFields.C
could not open file ValueExpressionParser.tab.hh for source file funkySetFields.C
Segmentation fault (core dumped)
SOURCE=ValueExpressionParser.yy ; rm -f Make/linuxGccDPOpt/ValueExpressionParser.C Make/linuxGccDPOpt/ValueExpressionParser.tab.hh; bison -ra -v -d $SOURCE ; mv *.tab.cc Make/linuxGccDPOpt/ValueExpressionParser.C ; mv *.tab.hh Make/linuxGccDPOpt/ValueExpressionParser.tab.hh ; mv *.hh Make/linuxGccDPOpt ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -IlnInclude -I. -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread -c Make/linuxGccDPOpt/ValueExpressionParser.C -o Make/linuxGccDPOpt/ValueExpressionParser.o
ValueExpressionParser.tab.cc: In member function 'unsigned char ve::ValueExpressionParser::yytranslate_(int)':
ValueExpressionParser.tab.cc:1865: warning: use of old-style cast
SOURCE=ValueExpressionLexer.ll ; rm Make/linuxGccDPOpt/ValueExpressionLexer.C ; flex -f $SOURCE ; mv *.c Make/linuxGccDPOpt/ValueExpressionLexer.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -IlnInclude -I. -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread -c Make/linuxGccDPOpt/ValueExpressionLexer.C -o Make/linuxGccDPOpt/ValueExpressionLexer.o
rm: Entfernen von &bdquo;Make/linuxGccDPOpt/ValueExpressionLexer.C" nicht möglich: No such file or directory
lex.ve.c:340: warning: use of old-style cast
lex.ve.c:410: warning: use of old-style cast
lex.ve.c:410: warning: use of old-style cast
lex.ve.c: In function 'int velex(ve::ValueExpressionParser::semantic_type*, ve::location*, ValueExpressionDriver&)':
lex.ve.c:6854: warning: use of old-style cast
lex.ve.c:6854: warning: use of old-style cast
lex.ve.c:6871: warning: use of old-style cast
lex.ve.c:6884: warning: use of old-style cast
lex.ve.c:7224: warning: use of old-style cast
lex.ve.c: In function 'int yy_get_next_buffer()':
lex.ve.c:7403: warning: use of old-style cast
lex.ve.c:7426: warning: use of old-style cast
lex.ve.c:7439: warning: use of old-style cast
lex.ve.c:7439: warning: use of old-style cast
lex.ve.c:7460: warning: use of old-style cast
lex.ve.c:7460: warning: use of old-style cast
lex.ve.c: In function 'yy_state_type yy_get_previous_state()':
lex.ve.c:7515: warning: use of old-style cast
lex.ve.c:7515: warning: use of old-style cast
lex.ve.c: In function 'int yyinput()':
lex.ve.c:7633: warning: use of old-style cast
lex.ve.c: In function 'yy_buffer_state* ve_create_buffer(FILE*, int)':
lex.ve.c:7732: warning: use of old-style cast
lex.ve.c:7741: warning: use of old-style cast
lex.ve.c: In function 'void ve_delete_buffer(yy_buffer_state*)':
lex.ve.c:7767: warning: use of old-style cast
lex.ve.c:7770: warning: use of old-style cast
lex.ve.c:7772: warning: use of old-style cast
lex.ve.c: In function 'void veensure_buffer_stack()':
lex.ve.c:7939: warning: use of old-style cast
lex.ve.c:7957: warning: use of old-style cast
lex.ve.c: In function 'yy_buffer_state* ve_scan_buffer(char*, yy_size_t)':
lex.ve.c:7983: warning: use of old-style cast
lex.ve.c: In function 'yy_buffer_state* ve_scan_bytes(const char*, int)':
lex.ve.c:8036: warning: use of old-style cast
lex.ve.c: In function 'void yy_push_state(int)':
lex.ve.c:8072: warning: use of old-style cast
lex.ve.c:8075: warning: use of old-style cast
lex.ve.c:8075: warning: use of old-style cast
lex.ve.c: In function 'int yy_init_globals()':
lex.ve.c:8243: warning: use of old-style cast
lex.ve.c:8256: warning: use of old-style cast
lex.ve.c:8257: warning: use of old-style cast
lex.ve.c: In function 'void* vealloc(yy_size_t)':
lex.ve.c:8333: warning: use of old-style cast
lex.ve.c: In function 'void* verealloc(void*, yy_size_t)':
lex.ve.c:8345: warning: use of old-style cast
lex.ve.c:8345: warning: use of old-style cast
lex.ve.c: In function 'void vefree(void*)':
lex.ve.c:8350: warning: use of old-style cast
lex.ve.c: At global scope:
lex.ve.c:8059: warning: 'void yy_push_state(int)' defined but not used
lex.ve.c:8088: warning: 'void yy_pop_state()' defined but not used
lex.ve.c:8100: warning: 'int yy_top_state()' defined but not used
SOURCE=ValueExpressionDriver.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -IlnInclude -I. -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/ValueExpressionDriver.o
SOURCE=funkySetFields.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -IlnInclude -I. -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/funkySetFields.o
g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -IlnInclude -I. -I/home/sega/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread Make/linuxGccDPOpt/ValueExpressionParser.o Make/linuxGccDPOpt/ValueExpressionLexer.o Make/linuxGccDPOpt/ValueExpressionDriver.o Make/linuxGccDPOpt/funkySetFields.o -L/home/sega/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt \
-lfiniteVolume -lmeshTools -lOpenFOAM -ldl -lm -o /home/sega/OpenFOAM/sega-1.4.1/applications/bin/linuxGccDPOpt/funkySetFields


Whats wrong with that?
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   April 30, 2008, 13:57
Default Nothing is wrong. It compiled
  #18
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
Nothing is wrong. It compiled fine. Those are just warnings NOT errors.
msrinath80 is offline   Reply With Quote

Old   April 30, 2008, 13:59
Default oops, what are those segfault
  #19
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
oops, what are those segfault messages doing up there? Did you follow the instructions correctly?
msrinath80 is offline   Reply With Quote

Old   April 30, 2008, 14:04
Default Try this: Go into the folde
  #20
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
Try this:

Go into the folder that contains the file insertGenerated.sh. Then type:

./insertGenerated.sh

Then type:

cd ..

Followed by:

./Allwmake

That worked for me even though I am using Bison v 2.3.
msrinath80 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] Create a mesh for flow around a sphere harly OpenFOAM Meshing & Mesh Conversion 7 November 6, 2013 16:28
SetField problem in OpenFoam 14 joakim OpenFOAM Bugs 17 October 30, 2009 07:18
How to use SetField tian OpenFOAM Pre-Processing 2 May 18, 2009 04:06
cd of sphere senthil FLUENT 3 June 1, 2006 05:22
Sphere tie FLUENT 0 July 5, 2005 14:29


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