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

Problem with Setfields

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 1, 2012, 09:35
Default Problem with Setfields
  #1
New Member
 
ernest
Join Date: Jun 2010
Posts: 21
Rep Power: 6
erncyc is an unknown quantity at this point
Hello friends,

Currently the setfields utility in OpenFOAM allows for the input of constant data in the setfieldDict dictionary. For instance when using cylinderToCell, it is required that one provides the values p1 and p2 which are the coordinates of the cylinder centre. In this case the coordinates are real values. I would like a situation where i can define a varying coordinate system ie p1 (x1, y1, z1) and p2 (x2, y2, z2). Anybody with an idea of how I might be able to do this. I checked the cylinderToCell.H class file and noticed that p1 and p2 are declared as "const vector". I appreciate any suggestion. Thanks.
erncyc is offline   Reply With Quote

Old   September 2, 2012, 17:00
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by erncyc View Post
Hello friends,

Currently the setfields utility in OpenFOAM allows for the input of constant data in the setfieldDict dictionary. For instance when using cylinderToCell, it is required that one provides the values p1 and p2 which are the coordinates of the cylinder centre. In this case the coordinates are real values. I would like a situation where i can define a varying coordinate system ie p1 (x1, y1, z1) and p2 (x2, y2, z2). Anybody with an idea of how I might be able to do this. I checked the cylinderToCell.H class file and noticed that p1 and p2 are declared as "const vector". I appreciate any suggestion. Thanks.
I'm not quite sure what you mean with "a varying coordinate system". I'd like to understand the problem before I make my usual suggestion: use funkySetFields
gschaider is offline   Reply With Quote

Old   September 5, 2012, 05:40
Default
  #3
New Member
 
ernest
Join Date: Jun 2010
Posts: 21
Rep Power: 6
erncyc is an unknown quantity at this point
Quote:
Originally Posted by gschaider View Post
I'm not quite sure what you mean with "a varying coordinate system". I'd like to understand the problem before I make my usual suggestion: use funkySetFields
Hello Bernhard, firstly I really want you to know I appreciate your responding to my query, thanks a bunch. My problem involves the use of setFields (or a similar utility) that can set a 2D cylindrical region with centres that change with time. I wish to be able to provide new cylinder centres at every time step. Currently the cylinderToCell option allows for provision of a static coordinate (defined in setFields as p1 and p2). If I don't use funkysetfields, is there a way I might be able to do this by modifying the "cylinderToCell.H" class. Thank you again for your help.
erncyc is offline   Reply With Quote

Old   September 5, 2012, 06:58
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Do I understand correctly, that you want to set this during runtime? setFields and funkySetFields are designed for setting initial conditions. If you want to have a moving cylinder, you should put it in the solver itself, and not with a utility. You have much more freedom if you set the value each timestep in a loop over all cells.
Bernhard is offline   Reply With Quote

Old   September 5, 2012, 07:19
Default
  #5
New Member
 
ernest
Join Date: Jun 2010
Posts: 21
Rep Power: 6
erncyc is an unknown quantity at this point
Quote:
Originally Posted by Bernhard View Post
Do I understand correctly, that you want to set this during runtime? setFields and funkySetFields are designed for setting initial conditions. If you want to have a moving cylinder, you should put it in the solver itself, and not with a utility. You have much more freedom if you set the value each timestep in a loop over all cells.
Thanks again Bernhard. Yes you are right, I wish to set the region during runtime. My problem is (since I am using an immersed boundary method), I need to use a static mesh and find a way of connecting the displacement of the cylinder axis with the mesh coordinate system. I believe yes you are right i should use the solver (currently i am on interFoam), but this is where my problems begin...can't figure out how. Thanks
erncyc is offline   Reply With Quote

Old   September 5, 2012, 08:39
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by erncyc View Post
Thanks again Bernhard. Yes you are right, I wish to set the region during runtime. My problem is (since I am using an immersed boundary method), I need to use a static mesh and find a way of connecting the displacement of the cylinder axis with the mesh coordinate system. I believe yes you are right i should use the solver (currently i am on interFoam), but this is where my problems begin...can't figure out how. Thanks
And you need a source term in that cylinder or what? swak4Foam gives you a number of options (built on the machinery that drives funkySetFields):

- the manipulateField functionObject allows you to set an existing field according to an expression (which may depend on the time)
- there is a class expressionSource which you can incorporate into your solver to add a source term according to your needs (there is also a class for fixing the values in selected cells)
- in the development version for 2.x (mercurial repository) there is also a class based on basicSource which allows you to have expression-dependent sources in solvers that use the sourcesProperties-dictionary (no need to modify the solver)
__________________
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   September 5, 2012, 08:43
Default
  #7
New Member
 
ernest
Join Date: Jun 2010
Posts: 21
Rep Power: 6
erncyc is an unknown quantity at this point
Quote:
Originally Posted by gschaider View Post
And you need a source term in that cylinder or what? swak4Foam gives you a number of options (built on the machinery that drives funkySetFields):

- the manipulateField functionObject allows you to set an existing field according to an expression (which may depend on the time)
- there is a class expressionSource which you can incorporate into your solver to add a source term according to your needs (there is also a class for fixing the values in selected cells)
- in the development version for 2.x (mercurial repository) there is also a class based on basicSource which allows you to have expression-dependent sources in solvers that use the sourcesProperties-dictionary (no need to modify the solver)
Yes I need a source term. I have never used swakFoam...how could I get and install it? I currently have OF 2.01...thanks
erncyc is offline   Reply With Quote

Old   September 5, 2012, 11:01
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by erncyc View Post
Yes I need a source term. I have never used swakFoam...how could I get and install it? I currently have OF 2.01...thanks
You find it under http://openfoamwiki.net/index.php/Contrib/swak4Foam.

The basicSource-source-term currently is only in the development version. expressionSource in the release. Search the forum there is an explanation for it.

There may be an issue with compilation on 2.0.1 (the 2.x-branch is currently only tested on 2.1.x)
__________________
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   September 5, 2012, 12:47
Default
  #9
New Member
 
ernest
Join Date: Jun 2010
Posts: 21
Rep Power: 6
erncyc is an unknown quantity at this point
Quote:
Originally Posted by gschaider View Post
You find it under http://openfoamwiki.net/index.php/Contrib/swak4Foam.

The basicSource-source-term currently is only in the development version. expressionSource in the release. Search the forum there is an explanation for it.

There may be an issue with compilation on 2.0.1 (the 2.x-branch is currently only tested on 2.1.x)
Thank you again. I tried to install but I got the error message below:

ernest@cfdlab-desktop:~/OpenFOAM/swak4Foam$ nice ./Allwmake
No 'swakConfiguration'. Python etc won't work
Checking swak4Foam-version and generating file
No 'bison' found. This is absolutely essential for swak4Foam. Can't go on
Requirements for Library not satisfied. I see no sense in going on
erncyc is offline   Reply With Quote

Old   September 5, 2012, 13:27
Default
  #10
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Quote:
Originally Posted by erncyc View Post
Thank you again. I tried to install but I got the error message below:

ernest@cfdlab-desktop:~/OpenFOAM/swak4Foam$ nice ./Allwmake
No 'swakConfiguration'. Python etc won't work
Checking swak4Foam-version and generating file
No 'bison' found. This is absolutely essential for swak4Foam. Can't go on
Requirements for Library not satisfied. I see no sense in going on
Did you read the prequisites in the README? You need bison to install it, and according to the error message, you should install that one first.
Bernhard is offline   Reply With Quote

Old   September 5, 2012, 13:48
Default
  #11
New Member
 
ernest
Join Date: Jun 2010
Posts: 21
Rep Power: 6
erncyc is an unknown quantity at this point
Quote:
Originally Posted by Bernhard View Post
Did you read the prequisites in the README? You need bison to install it, and according to the error message, you should install that one first.
oh ok...I will read README and try again thanks.
erncyc is offline   Reply With Quote

Old   September 5, 2012, 16:17
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Bernhard View Post
Did you read the prequisites in the README? You need bison to install it, and according to the error message, you should install that one first.
Got nothing to add.

And while you're at it install flex ....
__________________
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

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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Problem in implementing cht tilek CFX 3 May 8, 2011 08:39
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


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