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

C++ explanation of dynamicMeshDict file

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 7, 2017, 06:03
Question C++ explanation of dynamicMeshDict file
  #1
Member
 
Emre
Join Date: Nov 2015
Location: Izmir, Turkey
Posts: 44
Rep Power: 3
ordinary is on a distinguished road
Hello,

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:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh   immersedBoundarySolidBodyMotionFvMesh;

immersedBoundarySolidBodyMotionFvMeshCoeffs
{
    motionFunctions
    (
        IB_block
        {
            solidBodyMotionFunction     translation;
            translationCoeffs
            {
                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
Default
  #2
New Member
 
Fatih Ertinaz
Join Date: Feb 2011
Location: Istanbul
Posts: 24
Rep Power: 8
fertinaz is on a distinguished road
Hi

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:
$FOAM_SRC/dynamicFvMesh/

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
Default
  #3
Member
 
Emre
Join Date: Nov 2015
Location: Izmir, Turkey
Posts: 44
Rep Power: 3
ordinary is on a distinguished road
Thank you for your reply. This belongs to foam-extend 3.2.
ordinary is offline   Reply With Quote

Reply

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

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Swak4Foam funkyDoCalc with OF2.3 massflow NiFl OpenFOAM 11 November 1, 2016 07:43
Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit OpenFOAM Paraview & paraFoam 60 September 18, 2013 03: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 120 December 2, 2009 11:23


All times are GMT -4. The time now is 23:30.