|
[Sponsors] |
September 1, 2012, 10:35 |
Problem with Setfields
|
#1 |
New Member
ernest
Join Date: Jun 2010
Posts: 23
Rep Power: 15 |
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. |
|
September 2, 2012, 18:00 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
|
||
September 5, 2012, 06:40 |
|
#3 |
New Member
ernest
Join Date: Jun 2010
Posts: 23
Rep Power: 15 |
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.
|
|
September 5, 2012, 07:58 |
|
#4 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
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.
|
|
September 5, 2012, 08:19 |
|
#5 | |
New Member
ernest
Join Date: Jun 2010
Posts: 23
Rep Power: 15 |
Quote:
|
||
September 5, 2012, 09:39 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
- 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 |
||
September 5, 2012, 09:43 |
|
#7 | |
New Member
ernest
Join Date: Jun 2010
Posts: 23
Rep Power: 15 |
Quote:
|
||
September 5, 2012, 12:01 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
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 |
||
September 5, 2012, 13:47 |
|
#9 | |
New Member
ernest
Join Date: Jun 2010
Posts: 23
Rep Power: 15 |
Quote:
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 |
||
September 5, 2012, 14:27 |
|
#10 | |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
Quote:
|
||
September 5, 2012, 14:48 |
|
#11 |
New Member
ernest
Join Date: Jun 2010
Posts: 23
Rep Power: 15 |
||
September 5, 2012, 17:17 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
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 |
||
December 9, 2018, 01:34 |
setFieldsDict - in the form of sphere for 1D solver
|
#13 |
Senior Member
|
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. convertToMeters 0.01;blockMeshDict file: 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 |
|
December 19, 2018, 08:49 |
|
#14 |
Member
Geir Karlsen
Join Date: Nov 2013
Location: Norway
Posts: 59
Rep Power: 14 |
Deleted Deleted
Last edited by gkarlsen; December 19, 2018 at 08:51. Reason: Didn't read the question :) |
|
January 2, 2019, 07:16 |
|
#15 |
Member
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11 |
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Problem in implementing cht | tilek | CFX | 3 | May 8, 2011 09:39 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |