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

Dynamic Mesh: solidBody mesh movement + controlled cell deformation

Register Blogs Community New Posts Updated Threads Search

Like Tree14Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2020, 11:14
Default
  #21
New Member
 
Felix Weiler
Join Date: Nov 2016
Location: Bremen
Posts: 22
Rep Power: 9
benchwell is on a distinguished road
Hi Michael,


it feels to me that your problem would deserve its own thread where you lay out the exact nature of your case and the various movements that you want to implement (a little drawing would help). If you can provide an exemplary case, I will happily have a look at it, too.


Generally, solidBody techniques are best suited if you want to move an entire region of the mesh, as in an overset mesh or a region separated by an AMI. If you want to move a surface - as it appears to be the case with these valves -, rigidBody motion solvers are better suited, as they will move the surface and then solve for the mesh motion.
benchwell is offline   Reply With Quote

Old   July 13, 2020, 11:51
Default
  #22
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Hi Felex,
Thank you for being willing to have a look at my case. I use some dirty code to generate the pointMotionU file for the moving boundary. And the case file is too big to upload. So It needs to be simplified. I'll upload it when it is done later.

Best regards,
Michael


Edit: case file is attached.
Problem description: The outer boundary is expanding, and a plate (baffle) is rotating inside. Please see dynamicMeshDict and pointMotionU for the movements.


The file extension needs to change from 'gz' to 'tar', as the latter is not invalid to upload and I can not compress the folder under the size limitation. Sorry for the inconvenience.
Attached Files
File Type: gz case_test_motionList.gz (164.3 KB, 60 views)

Last edited by Michael@UW; July 13, 2020 at 12:42. Reason: attachment added
Michael@UW is offline   Reply With Quote

Old   July 13, 2020, 12:52
Default
  #23
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Quote:
Originally Posted by benchwell View Post
Hi Michael,


it feels to me that your problem would deserve its own thread where you lay out the exact nature of your case and the various movements that you want to implement (a little drawing would help). If you can provide an exemplary case, I will happily have a look at it, too.


Generally, solidBody techniques are best suited if you want to move an entire region of the mesh, as in an overset mesh or a region separated by an AMI. If you want to move a surface - as it appears to be the case with these valves -, rigidBody motion solvers are better suited, as they will move the surface and then solve for the mesh motion.
I also thought about overset and AMI. The rotation center is located on the wall boundary, so I do not know how to create the AMI zone. It seems it needs a full circle even if I just want to rotate the valve a limited angle.
Overset is only available in ESI OpenFOAM, and I prefer model the value as a baffle for simplicity.
I do not worry about the computational cost of remeshing the whole domain to solve the large displacement issue but do not know how to use topoChangerFvMesh.
Michael@UW is offline   Reply With Quote

Old   July 14, 2020, 14:13
Default
  #24
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Quote:
Originally Posted by benchwell View Post
Hi Tom,

I found two different solutions, both achieving what I wished for (I never got to write a proper blog entry for it... maybe your interest will get me motivated again).

1. Method:
As initially planned, I introduce a superposition of two mesh movements:
- The AMI-sphere with the body inside is moved via the tabulated6DoFMotion solver
- To achieve rigid translation of the translation zone and deformation in the cell deformation zone the solver displacementInterpolation is used, which acts upon a faceZone defined with topoSet.

Code:
dynamicFvMesh       dynamicMultiMotionSolverFvMesh;
motionSolverLibs    ( "libfvMotionSolvers.so" );

// Solve multiple motions
dynamicMultiMotionSolverFvMeshCoeffs
{
    AMI_movement
    {
        solver solidBody;
        cellZone rotatableSphere;
        solidBodyCoeffs
        {
            solidBodyMotionFunction  multiMotion;

            solidBodyMotionFunction tabulated6DoFMotion;
            tabulated6DoFMotionCoeffs
            {
                    CofG            (0 0 0);
                    timeDataFileName "$FOAM_CASE/constant/tables/6DoFMotion.txt";
            }
        }
    }


    BOX_movement
    {
        solver displacementInterpolation;
        cellZone translationboxZone;

        displacementInterpolationCoeffs
        {
            interpolationTables
            (
                // The faceZoneSet
                (translationsurfaceZone     "pyTable")
            );
        }
    }

}
Both solvers use tables, that I created using python and are located in constant/tables/ (displacementInterpolation will look there). I found a bug in the displacementInterpolation solver that occurs with mesh of certain dimensions (will report bug report).

2. Method:
Using OpenFOAM-v1706's Overset Grid with the tabulated6DoFMotion makes a lot of stuff much easier
-----------------------------------------------------------
Can you explain more about method 2?
I tried dynamicOversetFvMesh in OpenFOAM-1906. It is easy to make multiple solid body motion, but I do not know how to couple it with deformation. dynamicOversetFvMesh and dynamicMotionSolverFvMesh are at the same top level (dynamicFvMesh); it seems they cannot be nested or superimposed. I need to deform the domain and solid body motion at the same time.
Michael@UW is offline   Reply With Quote

Old   July 15, 2020, 02:13
Default
  #25
New Member
 
Felix Weiler
Join Date: Nov 2016
Location: Bremen
Posts: 22
Rep Power: 9
benchwell is on a distinguished road
Hi Michael,


a bunch of questions seem to have piled up and I will start from the back: In my case back then, overset was a fitting solution as I wanted to combine translation with rotation a basically just reframed the problem so that I eliminated the mesh deformation entirely. However, I think that it's not entire impossible to combine the two.



I had a look at your case and while I couldn't run it (lacking OpenFOAM-7 on my machine at the moment) there were a few things that I would propose to change:

  1. As indicated earlier, solidBody deformations work on entire sections of the mesh, since you want to move your valve, which is a baffle boundary, I suggest you pick a rigidBody solver (like SBRSstress) and define the valve motion in the respective boundary condition file.
  2. Separating the two problems (boundary expansion and valve motion) into two cases would be an easier start
Best regards
benchwell is offline   Reply With Quote

Old   July 15, 2020, 11:23
Default
  #26
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Quote:
Originally Posted by benchwell View Post
Hi Michael,


a bunch of questions seem to have piled up and I will start from the back: In my case back then, overset was a fitting solution as I wanted to combine translation with rotation a basically just reframed the problem so that I eliminated the mesh deformation entirely. However, I think that it's not entire impossible to combine the two.

Overset can handle large movement perfectly, but I need both deformation and rigid body. Can you offer some ideas about how to introduce deformation with overset?



I had a look at your case and while I couldn't run it (lacking OpenFOAM-7 on my machine at the moment) there were a few things that I would propose to change:

I uploaded a new case. It should run in OpenFOAM v1906. I would appreciate it if you could take a look at it.
  1. As indicated earlier, solidBody deformations work on entire sections of the mesh, since you want to move your valve, which is a baffle boundary, I suggest you pick a rigidBody solver (like SBRSstress) and define the valve motion in the respective boundary condition file.

    Thanks for your suggestion. I am not familiar with SBRStress but would like to study it. Hope it can work with mesh deformation.

  2. Separating the two problems (boundary expansion and valve motion) into two cases would be an easier start

    The key issue is large displacement caused by valve rotation. I could not use AMI like many tutorials to solver the problem. It does not rotates a full circle as the rotation center on the boundary. If you have and idea that you think may work, I would like to try. I have been being stuck on this problem for two weeks.

Best regards
Thanks for your time!

Best regards,
Michael
Attached Files
File Type: gz case_test_motionList_1906.gz (163.4 KB, 21 views)
Michael@UW is offline   Reply With Quote

Old   July 15, 2020, 19:07
Default
  #27
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Just one idea about using AMI or acutally ACMI without a full circle. Your problem seems to be related to this setup described here: https://openfoam.org/release/2-3-0/non-conforming-ami/

In your case the valve would rotate, but you do not need the full circular connection to the rest of the mesh like in the case above. You can specify other boundary conditions for the parts of the value which are not connected to the rest of the mesh, e. g. a wall.


Actually, there are several videos on youtube demonstrating such setups: https://www.google.com/search?q=acmi...e=lnms&tbm=vid
jherb is offline   Reply With Quote

Old   July 15, 2020, 21:04
Default
  #28
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Hi Joachim,

Thanks for your idea! I have watched some of the videos but definitely I will watch more to get inspired. I believe AMI or ACMI is promising for rotation or large displacement. But I just cannot figure out how to configure the A(C)MIs to implement my idea: The two valves rotate at different speed to control the flow in a deforming chamber (problem sketch is attached). Any further ideas will be helpful to me.

Best regards,
Michael
Attached Images
File Type: png problem.png (9.1 KB, 77 views)
Michael@UW is offline   Reply With Quote

Old   July 16, 2020, 04:46
Default
  #29
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
How do the valves rotate? In a plane normal to the drawning? So like a shutter wheel?
Is your case 2D or 3D?
jherb is offline   Reply With Quote

Old   July 16, 2020, 06:27
Default It's not pretty, but a start
  #30
New Member
 
Felix Weiler
Join Date: Nov 2016
Location: Bremen
Posts: 22
Rep Power: 9
benchwell is on a distinguished road
Hi Michael,


please check the below files to indicate how to set up a motion using mesh deformation. This is rather dirty, but I hope it can illustrate the idea.




0/pointDisplacement

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       pointVectorField;
    location    "0";
    object      pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 0 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    // The boundaries are expanding
    outlet
    {
            type         uniformFixedValue;
            uniformValue table ((0 (0 0 0)) (1 (1 0 0)));
    }
    inlet
    {
            type         uniformFixedValue;
            uniformValue table ((0 (0 0 0)) (1 (-1 0 0)));
    }

    // Rotating -- see dynamicMeshDict
    plate
    {
        type            angularOscillatingDisplacement;
        value           (0 0 0.3925);
        axis            (0 0 1);
        origin          (10 4.5 0);
        angle0          0;
        amplitude       10;
        omega           0.3925;
    }

    // Other sides are deformed as well
    frontAndBack
    {
        // might work with empty, too, haven't checked
        type            fixedNormalSlip;
        n               (0 0 1);
    }
    tunnel
    {
        type            fixedNormalSlip;
        n               (0 1 0);
    }

}

// ************************************************************************* //
constant/dynamicMeshDict

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      dynamicMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs (fvMotionSolvers);

motionSolver displacementSBRStress;   //displacementLaplacian;
//motionSolver velocityComponentLaplacian z;

// diffusivity  uniform;
// diffusivity  directional (1 200 0);
// diffusivity  motionDirectional (1 1000 0);
// diffusivity  file motionDiffusivity;
diffusivity  quadratic inverseDistance 1(plate);

// ************************************************************************* //
system/fvSolution
Code:
    cellDisplacement
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-08;
        relTol          0;
    }
    cellDisplacementFinal
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-08;
        relTol          0;
    }
benchwell is offline   Reply With Quote

Old   July 16, 2020, 10:41
Default
  #31
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Hi Felix,

Thanks for setting up the displacementSBRStress. I tried it earlier, but it did not behave as expected. Your configuration gives better results (see attached figure). displacementSBRStress can afford larger rotation than Laplacian solvers even though it fails finally. I will try this with my real case to see how much it improves the results.

Best regards,
Michael
Attached Images
File Type: jpg result.jpg (201.2 KB, 100 views)
Michael@UW is offline   Reply With Quote

Old   July 16, 2020, 10:50
Default
  #32
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Quote:
Originally Posted by jherb View Post
How do the valves rotate? In a plane normal to the drawning? So like a shutter wheel?
Is your case 2D or 3D?
Hi Joachim,
My case is 2D. The valves rotate in the plane. The rotation centers are located on the walls. Acutally, there are no pysical gap between the two valves. But I found the gap is nessary, otherwise the sharing node (intersection of the two valves) will rotate twice. That's another issue.
The main issue is how to keep the mesh quality with large rotation angle (up to 90 degree) and deforming outer boundaries.

Best regards,
Michael
Michael@UW is offline   Reply With Quote

Old   July 17, 2020, 10:41
Default
  #33
Member
 
benoit paillard
Join Date: Mar 2010
Posts: 96
Rep Power: 16
bennn is on a distinguished road
Hi,

For very large deformation I'd suggest switching to SLERP, available in .org version.
bennn is offline   Reply With Quote

Old   July 17, 2020, 12:18
Default interpolatingSolidBody
  #34
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Quote:
Originally Posted by bennn View Post
Hi,

For very large deformation I'd suggest switching to SLERP, available in .org version.
Hi Benn,
Thanks for your reply. I just checked out this motion sovler. The mesh can have a large deformation without ill-distorted with SLERP. But I do not understand the parameters and the baffle does not move as I expected.

I cannot find any tutorial in OpenFOAM-7. But I looked through a few threads and found you provided a very useful sample dynamicMeshDict to use this interpolatingSolidBody solver.

Mesh deformation with SLERP interpolation

Mesh deformation with SLERP interpolation

Here is my dynamicMeshDict which is almost the same as the sample from you.


Code:
ampli (0 0 10);

omeg 12.0;

dynamicFvMesh   dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");
motionSolver interpolatingSolidBody; 
solidBodyMotionFunction oscillatingRotatingMotion;

oscillatingRotatingMotionCoeffs
{
  origin (10 4.5 0.05);
  axis (0 0 1);
  omega $omeg;
  amplitude $ampli;
}

patches (plate);
CofG (10 5 0.05);
innerDistance 0.1;
outerDistance 5;
What I want is rotate the patch 'plate' around (10 4.5 0.05). But it seems the plate is not rotating around it. Can you tell me how to set CofG and other parameters? I set CofG as the center of the plate, not the rotation center. I changed a few positions, it still did not work as expected (see figure attached).

Thank you!
Michael


// There is mistake in the sketch. The length of the plate is 1 not 10!
Attached Images
File Type: jpg result.jpg (72.1 KB, 97 views)
Michael@UW is offline   Reply With Quote

Old   July 20, 2020, 08:41
Default
  #35
Member
 
benoit paillard
Join Date: Mar 2010
Posts: 96
Rep Power: 16
bennn is on a distinguished road
Well something is wrong with the center of rotation so in that case I'd try changing the settings to understand how your dynamicMeshDict does not work as expected.
bennn is offline   Reply With Quote

Old   July 20, 2020, 18:58
Default
  #36
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Quote:
Originally Posted by bennn View Post
Well something is wrong with the center of rotation so in that case I'd try changing the settings to understand how your dynamicMeshDict does not work as expected.
Hi Benn,
Thank you for your hints. You are right! I changed the CofG, it rotates as expected. I set the origin of oscillatingRotatingMotionCeffs to be (0 0 0) and CofG the rotation center. The orgin does affect the motion, but I do not understand how it does.


Code:
ampli (0 0 10);

omeg 1;

dynamicFvMesh   dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");
motionSolver interpolatingSolidBody; 
solidBodyMotionFunction oscillatingRotatingMotion;

oscillatingRotatingMotionCoeffs
{
  origin (0 0 0);      // not the rotaion center (surprizing), but affects the motion
  axis (0 0 1);
  omega $omeg;
  amplitude $ampli;
}

patches (plate);
CofG (10 4.5 0);  //rotation center
innerDistance 0.1;
outerDistance 4;
Michael@UW is offline   Reply With Quote

Old   July 21, 2020, 11:11
Default
  #37
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Is there a way to let "motionSolver interpolatingSolidBody" not move the points on some patches? It interplates all the points in the area between
innerDistance and outerDistance, even those on fixed walls.

As can be seen in the figure attached. I only rotate the lower plate, but the bottom wall and part of the upper plate are displaced as well because they are located in the range of innerDistance and outerDistance. The bottom wall and upper plate should not be moved.



This is the dynamicMeshDict using interpolatingSolidBody.
Code:
ampli (0 0 90);

omeg 0.314;

dynamicFvMesh   dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");

solvers
(

	rigidBodyMovement1
	{
		motionSolver interpolatingSolidBody; 
		solidBodyMotionFunction oscillatingRotatingMotion;
		oscillatingRotatingMotionCoeffs
		{
		  origin (0 0 0);
		  axis (0 0 1);
		  omega $omeg;
		  amplitude (0 0 90);
		}

		patches (plate1_lower);
		CofG (10 0 0);
		innerDistance 0;
		outerDistance 5;
	}
/*
	rigidBodyMovement2
	{
	 	//solver multiSolidBodyMotionSolver;
		motionSolver interpolatingSolidBody; 
		solidBodyMotionFunction oscillatingRotatingMotion;
		oscillatingRotatingMotionCoeffs
		{
		  origin (0 0 0);
		  axis (0 0 1);
		  omega $omeg;
		  amplitude (0 0 0);
		}

		patches (plate2_upper);
		CofG (10 10 0.05);
		innerDistance 0;
		outerDistance 4;
	}
*/

    internalMovement
	{
		solver displacementLaplacian;
		motionSolverLibs ("libfvMotionSolvers.so");
                displacementLaplacianCoeffs
               {
                    diffusivity  inverseDistance 2 ( inlet outlet );
               }
	}

);
Attached Images
File Type: jpg Untitled.jpg (60.2 KB, 98 views)
Michael@UW is offline   Reply With Quote

Old   October 27, 2020, 15:24
Default dynamicMesh time-dependent rotation
  #38
New Member
 
A P
Join Date: Feb 2020
Location: Indiana, USA
Posts: 10
Rep Power: 6
prakashPra is on a distinguished road
Quote:
Originally Posted by Michael@UW View Post
I have the same problem. The rotation distorts the mess two much. The two solvers just modify the displacement in sequence (superposition), so there is no way to hope Laplacian silver adjust the distorted mesh by rotation. I am seeking a remeshing tutorial (topoChangerFvMesh) in OpenFoam but cannot find anyone.
Hello Michael,
I am running a multiphase case where I need to produce rotating motion for initial 5 seconds of my simulation. After omega I am adding datafile to stop rotation of container after 5 seconds while the simulation continues. But, the container keeps on rotating. I am attaching my dynamicMeshDict lines, it would be great if you could look at it.

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolver solidBody;

solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{

axis (0 0 1);
origin (0 0 0);
omega 2;

timeDataFileName "$FOAM_CASE/constant/time.dat";


}
prakashPra is offline   Reply With Quote

Old   October 27, 2020, 15:58
Default
  #39
Senior Member
 
Join Date: Jan 2019
Posts: 125
Blog Entries: 1
Rep Power: 0
Michael@UW is on a distinguished road
Hi prakashPra,

My understanding is that timeDataFileName does not work in your sub-dictionary rotatingMotionCoeffs. OpenFOAM does not read this entry timeDataFileName if you use "solidBodyMotionFunction rotatingMotion". You may want to use " solidBodyMotionFunction tabulated6DoFMotion" to impose a varying angular velocity.

Michael
prakashPra likes this.
Michael@UW is offline   Reply With Quote

Old   November 1, 2020, 18:57
Default
  #40
New Member
 
A P
Join Date: Feb 2020
Location: Indiana, USA
Posts: 10
Rep Power: 6
prakashPra is on a distinguished road
Thanks Michael, that was helpful.
prakashPra is offline   Reply With Quote

Reply


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
y+ = 1 boundary layer mesh with snappyHexMesh Arzed23 OpenFOAM Running, Solving & CFD 6 November 23, 2022 15:15
simulation flapper movement with mesh deformation in CFX sakalido CFX 11 January 27, 2014 14:28
Update of the variables after dynamic mesh motion. gtg258f OpenFOAM Programming & Development 9 January 18, 2014 10:08
Dynamic Mesh for Movement of Piston vigii Fluent UDF and Scheme Programming 0 November 18, 2013 06:43
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


All times are GMT -4. The time now is 20:41.