CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding new topoSetSourceType (https://www.cfd-online.com/Forums/openfoam-programming-development/204918-adding-new-toposetsourcetype.html)

mpgfritze August 4, 2018 09:27

Adding new topoSetSourceType
 
Hi,

I would like to expand the setFields utility to fit my needs.
The field K of my 2D-Mesh needs to be filled a certain way. For example: Cell 0-199, 400-599 and 800-999 of my mesh consisting of 1000 Cells need to be filled with the fieldValues given in the SetFieldsDict.

It works using labelToCell in the dictionary and writing explicitly a labelList consisting of 600 labels. To simplify this, i would like to only give some parameters and fieldValues in the setFieldsDict.

So far i was able to copy setFields, rename it and using it with the new mySetFieldsDict. After some hours of trying to understand the sourcecode of setFields, topoSetSource and labelToCell i figured i needed to make my own topoSetSourceType like myLabelToCell and don't need to change anything in setFields. Inside the myLabelToCell.C i should be able to access data from the dict and set up the custom labelList.

My question is how is that possible? Does it work the same way as copying, renaming and compiling utilities like setFields? But as there is Make folder how do i compile it?

I'm quite new to OpenFOAM programming, so I'd be really happy to get some advice from you or sources where I can learn some more.

Or maybe there is even a much simpler way to do it...and I'm thinking way to complicated.

-Paul


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