CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

moving mesh bc to define the movement of the points through their coordinates

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By ALU

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 8, 2015, 07:11
Default moving mesh bc to define the movement of the points through their coordinates
  #1
ALU
New Member
 
Join Date: Jun 2012
Posts: 11
Rep Power: 14
ALU is on a distinguished road
Hi!

For a dynamic mesh I need a boundary condition where I can define the movement of every point of the patch through its point coordinates (for example the z-value).

I would like to use the codedFixedValue boundary condition, but in the code example is only shown how to make time-varying functions.

Any help is appreciated!
ALU is offline   Reply With Quote

Old   June 15, 2015, 07:13
Default swak4Foam
  #2
ALU
New Member
 
Join Date: Jun 2012
Posts: 11
Rep Power: 14
ALU is on a distinguished road
I'm now trying to use groovyBC to define the movement of the patch points.

Code:
    top
    {    
        type groovyBC;
        valueExpression "vector(toPoint(0),toPoint(0),pts().x)";
        value uniform (0 0 0);
    }
The points on the boundary are moving correctly as defined, but the internal field is not moving.

It works perfectly if I define the list of the points motion myself

Code:
    top
    {    
        type fixedValue;
        value nonuniform List<vector>
(
(    0    0    0    )
(    0    0    5    )
(    0    0    5    )
(    0    0    0    )
(    0    0    5    )
...
)
    }
but I would prefer either to use "codedFixedValue" or "groovyBC" for more flexibility.

Last edited by ALU; June 15, 2015 at 11:54.
ALU is offline   Reply With Quote

Old   June 15, 2015, 11:52
Default
  #3
ALU
New Member
 
Join Date: Jun 2012
Posts: 11
Rep Power: 14
ALU is on a distinguished road
I finally got it working using codedFixedValue:

Code:
    top
    {
        type            codedFixedValue;
        value           uniform (0 0 0);
        redirectType    myFixedValue;   // name of generated bc

        code
        #{
            const pointPatch& p = this->patch();
            pointField p0 = p.localPoints();
            vectorField myMotion = p0;
            forAll(p0, i)
            {
                myMotion[i] = vector(0,0,1)*p0[i].x();
            }

            operator==
            (
                myMotion
            );
        #};        
    }
ALU is offline   Reply With Quote

Reply

Tags
codedfixedvalue, dynamic mesh


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Force magnitude with moving mesh fernexda OpenFOAM Post-Processing 3 April 12, 2016 10:09
Is that possible to mapping the mesh with predefined FFD control points in mesh file? Xianguu SU2 Shape Design 1 May 19, 2015 17:47
Trying to set up Moving Mesh Problem dreamchaser CFX 5 December 15, 2014 01:07
[Other] How to set up a dynamic mesh for a piston moving through a tube of variable diameter? karkar OpenFOAM Meshing & Mesh Conversion 0 July 4, 2012 07:54


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