CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM

C++ explanation of dynamicMeshDict file

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

LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2017, 06:03
Question C++ explanation of dynamicMeshDict file
Join Date: Nov 2015
Location: Izmir, Turkey
Posts: 97
Rep Power: 9
ordinary is on a distinguished road

I wonder how to reach and use the velocity number in another file, e.g., own custom solver? I mean I'm a bit confused about using scope :: symbol due to lack of understanding the complex class and object definitions and their relations to each other in OpenFOAM.

Here is the dynamicMeshDict file that contains velocity and translation function:

    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh   immersedBoundarySolidBodyMotionFvMesh;

            solidBodyMotionFunction     translation;
                velocity (2 0 0);
                rampTime 0.5;

  1. So what does dynamicFvMesh in the first line mean?
  2. Is immersedBoundarySolidBodyMotionFvMesh object or something?
  3. immersedBoundarySolidBodyMotionFvMeshCoeffs looks like class. But how is this possible? Class inside of a class?
  4. How do I refer to velocity (2 0 0) ? I want to use is in a custom solver. I think I need :: scope definitions but how?
  5. Do I need a header file which is need to be written in the code as #include dynamicMeshDict.h ?

    Best regards
ordinary is offline   Reply With Quote

Old   March 11, 2017, 02:03
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 64
Rep Power: 14
fertinaz is on a distinguished road

It seems that you're in a confusion between the source code behind the dictionary file and the content of the dictionary file you shared.

dynamicFvMesh is the type of the mesh motion supported by OpenFoam library. If you wanna see its core implementation you can check:

When you do an ls -l here, you will see
  • dynamicFvMesh
  • dynamicInkJetFvMesh
  • dynamicMotionSolverFvMesh
  • dynamicRefineFvMesh
  • solidBodyMotionFvMesh
  • staticFvMesh

which are exactly the types you will find in the tutorial cases. You can see them running the command grep -rn "dynamicFvMesh" */*

I guess the type that you're working on belongs to a different version of OF (I switched to 4.x recently) so I do not know the details of your specific example however you can probably find its details by looking at the source code. Just beware that dynamicFvMesh was in $FOAM_SRC/dynamicMesh/ directory in previous versions. You can find its location using grep.

Mesh motion is invoked by the dynamicFvMesh type, therefore you can find how the coefficients are read and how they are evaluated in the source code. But again the file you shared is not a c++ class file, it is a dictionary file designed for I/O file operations in OpenFoam.

Hope this helps

// Fatih
fertinaz is offline   Reply With Quote

Old   March 12, 2017, 09:31
Join Date: Nov 2015
Location: Izmir, Turkey
Posts: 97
Rep Power: 9
ordinary is on a distinguished road
Thank you for your reply. This belongs to foam-extend 3.2.
ordinary is offline   Reply With Quote


c++, dynamicmeshdict, dynamicmeshfvmesh, foam extend 3.2, immersed boundary method

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
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 04:30
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23

All times are GMT -4. The time now is 12:05.