|
[Sponsors] |
June 25, 2019, 02:42 |
What are dictionaries in Openfoam ?
|
#1 |
Senior Member
Mandeep Shetty
Join Date: Apr 2016
Posts: 188
Rep Power: 10 |
I am an absolute beginner to Openfoam and I am trying to understand what the dictionaries are in open foam. It is stated that blockMeshDict is a dictionary. I am not able to understand how this file is a dictionary.
a) It contains a dictionary (is this a sudictionary?) named Foamfile, which in accordance with the definition of dictionary has certain keywords within {}. b) blockMeshDict file also contains list such "vertices" which are not with in any braces {}. c)Also in the boundary-list there are boundaries named 'movingwall' and its definition is given with in braces{} so is this movingwall a dictionary? d) Shouldn't the blockMeshDict be a datafile instead of being called a dictionary? e) Also its given "Most OpenFOAM data files are themselves dictionaries containing a set of keyword entries." How is this possible..ie is everything with in such a file given with in {...} and the name of that datafile being the dictionary name? f) What are dictionaries?? |
|
June 25, 2019, 05:23 |
|
#2 | |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
Quote:
a; A dictionary may contain sub-dictionaries. That is all perfectly fine. b; a dictionary may contain any data, i.e. blockMeshDict containing lists of vertices, blocks, etc. is nothing unusual. c; the boundary-list is a list of dictionaries, with each dictionary entry (e.g. the movingWall entry) being the definition of a boundary patch. d; blockMeshDict is called a dictionary most-probably by convention. If you take a look at the relevent code of blockMesh, where the file blockMeshDict is ultimately being read, you find that reading the file creates an object of the type IOdictionary, which contains the contents of the file blockMeshDict. So calling blockMeshDict a dictionary, and not a data file, is justified. f; a dictionary is either a certain entry in a file, see the PISO dictionary of fvSolution Code:
PISO { nCorrectors 2; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; } Code:
IOdictionary transportProperties ( IOobject ( "transportProperties", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); That's a bit murky, yet correct. I guess the answer to question e follows from the other answers. The User Guide on the dictionary as part of OpenFOAM's IO syntax The Doxygen entry of the dictionary data type |
||
November 20, 2020, 09:55 |
|
#3 |
New Member
Join Date: Nov 2020
Posts: 6
Rep Power: 6 |
||
November 25, 2020, 01:47 |
|
#4 |
Senior Member
Mandeep Shetty
Join Date: Apr 2016
Posts: 188
Rep Power: 10 |
I have gotten better @ it. . My recommendation would depend on what are you looking to do with OF. If you want to just run a simple simulation then search for a suitable solver and run the tutorial for it. That should teach you how to use the solver. If your simulation complex then depending on the complexity you may need to change the solver...which would involve little coding. If you can find the solver edits that is reqired made by someone else you can directly use that...else you will need to do the code edits yourslef..which is where things get a little complicated. You will need basic understanding of C++ and object-oriented programing to nevigate the codes. Then you will need to understand all different classes and objects used in OF themselves..which I am sorry to say requires a lots and lots of reading...and there isn't just one shot place to get all the info. (Google is your friend. So try googling the same question you have in different way). But as you read different materials you will build up the knowledge and that helps as you move forward..as you start to build on what you have already learnt and things start making sense. Parallelly you will need to understand the CFD algorithms ( and the math) themselves so you will need to hit the CFD texts books and lectures too. This is so you know what the code itself is meant to do. So at the at the top you have the difference CFD algorithms which are used to model different kinds of flows. Below that is the C++ ( the language syntax) code which is used to implement the CFD algorithms . Also, you will need to leant to you linux/scripting. Optionally learning Python helps too. I am not trying to deter you...it's but deciding to use OF is not a decision that should be taken lightly and it's a very rewarding journey and you will learn a lot CFD the math and the algorithms how they are implemented in therms of code...and also a powerful and extensively used coding language such as C++ and scripting in Python.
|
|
Tags |
blockmeshdict, dictionaries |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology | wyldckat | OpenFOAM | 17 | November 10, 2017 16:54 |
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | September 21, 2016 12:50 |
Adventure of fisrst openfoam installation on Ubuntu 710 | jussi | OpenFOAM Installation | 0 | April 24, 2008 15:25 |
The OpenFOAM extensions project | mbeaudoin | OpenFOAM | 16 | October 9, 2007 10:33 |