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

Problem with Setfields

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 1, 2012, 09:35
Default Problem with Setfields
  #1
New Member
 
ernest
Join Date: Jun 2010
Posts: 21
Rep Power: 14
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: 4,225
Rep Power: 51
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: 14
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: 21
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: 14
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: 4,225
Rep Power: 51
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: 14
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: 4,225
Rep Power: 51
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: 14
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: 21
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: 14
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: 4,225
Rep Power: 51
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

Old   December 9, 2018, 00:34
Default setFieldsDict - in the form of sphere for 1D solver
  #13
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 347
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello everyone,
My topic of research is on coke oven process using 1D solver. Heat transfer is considered to be one-dimensional for the lump coal (placed inside the domain).
To define geometrical regions in the form of sphere (coal) inside my domain, I adopted setFieldsDict file ~ to initialize fields. But unfortunately, the set field directory gives shapes of sphere for 2D or 3D modeling in better way - whereas not in the case of 1D modeling.
I am hereby including my blockMeshDict file (only blocks) and setFieldsDict file.

blockMeshDict file:
convertToMeters 0.01;
vertices
(
(0 0 0) (15 0 0) (15 1 0) (0 1 0) (0 0 7) (15 0 7) (15 1 7) (0 1 7)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (1250 1 1) simpleGrading (1 1 1)
);
edges
(
);

setFieldsDict file:

defaultFieldValues
(
volScalarFieldValue C 0
);

regions
(
sphereToCell
{
centre (0.03 0 0.03);
radius 0.02;

fieldValues
(
volScalarFieldValue C 800
);
}
);

As a result, the initialized field in paraFoam [Attachment] ~ is not in the form of sphere because the set field dimensions is influenced only in X- directional for 1D mesh.

Dear Foamers, I want to know the possibility of creating fields in the form of sphere inside my domain for 1D solver using setFieldsDict.
If not setfieldDict, is there any relevant options to initialize fields for 1D solver ?

Kindly share your ideas plzz..

Thank you
Attached Images
File Type: png 1D.png (11.0 KB, 24 views)
Kummi is offline   Reply With Quote

Old   December 19, 2018, 07:49
Default
  #14
Member
 
Geir Karlsen
Join Date: Nov 2013
Location: Norway
Posts: 59
Rep Power: 13
gkarlsen is on a distinguished road
Deleted Deleted

Last edited by gkarlsen; December 19, 2018 at 07:51. Reason: Didn't read the question :)
gkarlsen is offline   Reply With Quote

Old   January 2, 2019, 06:16
Default
  #15
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 85
Rep Power: 11
cyss38 is on a distinguished road
I am not sure to well understand...



But :

in 1D mesh (your case), sphere doesn't exist... because there is only one cell in the y and z directions.


So no solution to make a sphere.
cyss38 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 20:44.