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

How to Discover Available Options for fvModels (and Other Dictionaries) in OpenFOAM?

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

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2025, 15:46
Default How to Discover Available Options for fvModels (and Other Dictionaries) in OpenFOAM?
  #1
New Member
 
Jim Carter
Join Date: Apr 2025
Posts: 4
Rep Power: 2
foamy_blast is on a distinguished road
Hi everyone,

I’m still fairly new to OpenFOAM and have been learning a lot from the tutorial cases — they’re really helpful, but they don’t always cover every possible feature or configuration.

For example, when setting up an fvModels file, I understand how to define something like a massSource by specifying keys like type, phase, points, and massFlowRate. However, I’m unsure what other model types are available besides massSource, and what additional parameters each of them might accept.

Sometimes, if I enter something incorrectly, the log file throws an error listing the valid options — which is helpful, but I assume there must be a more systematic way to explore available model types and their corresponding dictionary entries.

Is there a recommended way to find out:
• What values are accepted for keys like type in fvModels or other dictionaries?
• What other parameters can or must be included for a given model?
• How to understand the required inputs when switching to a different solver (beyond just looking at example tutorials)?

Any advice or pointers to documentation or tools would be greatly appreciated!

Thanks in advance!
foamy_blast is offline   Reply With Quote

Old   April 22, 2025, 04:30
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,294
Rep Power: 30
Yann will become famous soon enoughYann will become famous soon enough
Hello,

The answer to your question depends on the OpenFOAM version / development branch you are using.

The answer which will always work: get familiar with the source code structure, and look at the source to know what is available in your version.

You mention fvModels so I'm assuming you are using the OpenFOAM foundation branch (openfoam.org). If you are using a recent version, you should have the foamInfo and foamToC tools to help you.
https://cfd.direct/openfoam/v11-useful-tools/

In addition, the documentation/user guide corresponding to the version you are using can be pretty handy for general information. (but it won't cover exhaustively all the models and features)
Tobermory likes this.
Yann is offline   Reply With Quote

Old   April 23, 2025, 09:09
Default
  #3
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 826
Rep Power: 16
Tobermory will become famous soon enough
Yann's response is spot on - if you plan to use OpenFOAM for the long-term, then ultimately the best way to get to grips with it is to be able to read the code and work out things for yourself. It WILL be daunting to begin with (and will probably require you to brush up on/develop your C++ skills), but with time and effort you will get there.

To flesh out Yann's post, here are a few pointers to some of your questions below:
Quote:
• What values are accepted for keys like type in fvModels or other dictionaries?
Try the "banana trick" - ie, add the following block into fvModels, and it will generate the list of known fvModels:
Code:
bananaBlock
{
    type    banana;
}
With OF12, it lists 32 models in my installation.

Quote:
• What other parameters can or must be included for a given model?
• How to understand the required inputs when switching to a different solver (beyond just looking at example tutorials)?
I find the Doxygen pages to be a really good way of navigating through the source code. Eg for the foundation version, and the massSource fvModel that's: https://cpp.openfoam.org/v12/classFo...assSource.html (there's a similar site for the ESI version). This has a search facility, and if you use the tree on the left hand side, you can dig down into the file structure and get to the same info as the banana trick:
https://cpp.openfoam.org/v12/dir_ec4...cc4e3c6a6.html.

Hope this helps.
Yann likes this.
Tobermory is offline   Reply With Quote

Old   April 30, 2025, 07:34
Default
  #4
New Member
 
Jim Carter
Join Date: Apr 2025
Posts: 4
Rep Power: 2
foamy_blast is on a distinguished road
Hello Yann, thank you for your response.
I was out of office, hence my late response.
I was wondering whether I am missing out on smth critical, but now I know that I have to dig deeper into the code. Yes I am using the foundation branch, and I will try to make more use of foamInfo and foamToC as well!
Best, Kai
foamy_blast is offline   Reply With Quote

Old   April 30, 2025, 07:45
Default
  #5
New Member
 
Jim Carter
Join Date: Apr 2025
Posts: 4
Rep Power: 2
foamy_blast is on a distinguished road
Hello Tobermory,
thanks for your response, yes I have been trying to use the Doxygen docs though I found them a bit difficult to interpret. However they are quite useful!
Thanks for the idea with the banana trick!
Best, Kai
foamy_blast is offline   Reply With Quote

Reply

Tags
documentation, openfoam 12, utilities

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



All times are GMT -4. The time now is 01:22.