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

[mesh manipulation] How to combine dynamic mesh and static mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By victor13165

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 6, 2014, 23:28
Default How to combine dynamic mesh and static mesh
  #1
New Member
 
Chen Yu
Join Date: Sep 2013
Posts: 19
Rep Power: 13
chery1986 is on a distinguished road
Is it possible to combine the dynamic mesh and static mesh in one simulation case?

I want to use dynamic mesh based on dynamicMotionSolverFvMesh according to the prescribed motion of boundary in one part of the computational domain. At the same time, static mesh are wanted in the other side part of the computational domain because I need to use porous material etc. over there.

Is there any solution for my requirement? How shall I define dynamicMeshDict and blockMeshDict? If not possible, is there any alternatives for this problem?
chery1986 is offline   Reply With Quote

Old   May 7, 2014, 15:10
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
One possibility is to set the point motion diffusivity to zero in the region you don't want to move.
mturcios777 is offline   Reply With Quote

Old   July 4, 2014, 00:45
Default
  #3
New Member
 
Chen Yu
Join Date: Sep 2013
Posts: 19
Rep Power: 13
chery1986 is on a distinguished road
Thank you, can you provide the method to define different diffusivity coefficients in different regions?

Quote:
Originally Posted by mturcios777 View Post
One possibility is to set the point motion diffusivity to zero in the region you don't want to move.
chery1986 is offline   Reply With Quote

Old   July 4, 2014, 03:00
Default
  #4
New Member
 
Chen Yu
Join Date: Sep 2013
Posts: 19
Rep Power: 13
chery1986 is on a distinguished road
This is the setting I'm using right now, can you give suggestions how to change it?



dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");

solver velocityLaplacian;

velocityLaplacianCoeffs
{
diffusivity motionDirectional (10 10 0);
}


Quote:
Originally Posted by mturcios777 View Post
One possibility is to set the point motion diffusivity to zero in the region you don't want to move.
chery1986 is offline   Reply With Quote

Old   July 4, 2014, 13:24
Default
  #5
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
For all motionSolvers, you can change the diffusivity to "file", which is a surfaceScalarField in the constant directory that provides the face diffusivity. You will need to create this yourself. This is your only option if you are using velocityLaplacian.

If you are using displacement motion solvers, you can specify an additional "frozenPointsZone" that is the name of a pointZone for non-moving points. This is probably the easiest, but is restricted to displacement motion solvers.
mturcios777 is offline   Reply With Quote

Old   July 29, 2014, 04:58
Default
  #6
New Member
 
Chen Yu
Join Date: Sep 2013
Posts: 19
Rep Power: 13
chery1986 is on a distinguished road
thanks for your reply

I have switched to displacement motion solvers, but still don't get how to define a frozenPointsZone as you suggested.

Do you mean create a pointZone file in polymesh folder, and define the frozenPointsZone inside of it like

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class regIOobject;
location "constant/polyMesh";
object pointZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
frozenPointsZone
{
type pointZone;
pointLabels List<label>
83646
(
48
49
50
51
.......

Or, do you mean create another file named frozenPointsZone under polymesh folder and define the points inside?


Quote:
Originally Posted by mturcios777 View Post
For all motionSolvers, you can change the diffusivity to "file", which is a surfaceScalarField in the constant directory that provides the face diffusivity. You will need to create this yourself. This is your only option if you are using velocityLaplacian.

If you are using displacement motion solvers, you can specify an additional "frozenPointsZone" that is the name of a pointZone for non-moving points. This is probably the easiest, but is restricted to displacement motion solvers.
chery1986 is offline   Reply With Quote

Old   August 5, 2014, 15:14
Default
  #7
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
You should define the points as a pointZone with whatever name you want them to have, then add the keyword frozenPointsZone to your dynamicMeshDict with the name of pointZone you want frozen.
mturcios777 is offline   Reply With Quote

Old   August 6, 2014, 03:46
Default
  #8
New Member
 
Chen Yu
Join Date: Sep 2013
Posts: 19
Rep Power: 13
chery1986 is on a distinguished road
Thanks you. However, I follow your instructions, but still cannot succeed.

The dynamicMeshDict file is

FoamFile
{
version 2.0;
format binary;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

//dynamicFvMesh staticFvMesh;

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");


solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity inverseDistance (inlet);

}
frozenPointsZone farfield;



The pointZone file is

FoamFile
{
version 2.0;
format ascii;
class regIOobject;
location "constant/polyMesh";
object pointZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
farfield
{
type pointZone;
pointLabels List<label>
83646
(
48
49
50
51
52
53
......

Any further suggestions?

Quote:
Originally Posted by mturcios777 View Post
You should define the points as a pointZone with whatever name you want them to have, then add the keyword frozenPointsZone to your dynamicMeshDict with the name of pointZone you want frozen.
chery1986 is offline   Reply With Quote

Old   August 6, 2014, 13:13
Default
  #9
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
You need to put the frozenPointsZone inside the displacementLaplacianCoeffs, as that is where the solver is looking for it. Try that and let me know if there are any error messages.
mturcios777 is offline   Reply With Quote

Old   August 7, 2014, 05:47
Default
  #10
New Member
 
Chen Yu
Join Date: Sep 2013
Posts: 19
Rep Power: 13
chery1986 is on a distinguished road
the interDyMFoam is still running as the frozenPointsZone has not been defined

Quote:
Originally Posted by mturcios777 View Post
You need to put the frozenPointsZone inside the displacementLaplacianCoeffs, as that is where the solver is looking for it. Try that and let me know if there are any error messages.
chery1986 is offline   Reply With Quote

Old   August 7, 2014, 13:09
Default
  #11
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Sorry, I think I was unclear. Your dictionary should look like:

Code:
FoamFile
{
version 2.0;
format binary;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

//dynamicFvMesh staticFvMesh;

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");


solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity inverseDistance (inlet);
frozenPointsZone farfield;
}
mturcios777 is offline   Reply With Quote

Old   August 8, 2014, 02:37
Default
  #12
New Member
 
Chen Yu
Join Date: Sep 2013
Posts: 19
Rep Power: 13
chery1986 is on a distinguished road
I believe that is exactly what I have done

FoamFile
{
version 2.0;
format binary;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

//dynamicFvMesh staticFvMesh;
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libfvMotionSolvers.so");

solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity inverseDistance (inlet);
frozenPointsZone farfield;
}

The simulation runs smoothly, but the points hasn't been frozen.


Quote:
Originally Posted by mturcios777 View Post
Sorry, I think I was unclear. Your dictionary should look like:

Code:
FoamFile
{
version 2.0;
format binary;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

//dynamicFvMesh staticFvMesh;

dynamicFvMesh dynamicMotionSolverFvMesh;

motionSolverLibs ("libfvMotionSolvers.so");


solver displacementLaplacian;
displacementLaplacianCoeffs
{
diffusivity inverseDistance (inlet);
frozenPointsZone farfield;
}
chery1986 is offline   Reply With Quote

Old   August 8, 2014, 13:32
Default
  #13
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
That's odd. If you turn on the debug option for fvMotionSolvers in the global controlDict, you should get a message that re-states the motionsolver diffusivity and frozenPointsZone. Can you tell me what message you get with the debug option activated?
mturcios777 is offline   Reply With Quote

Old   October 19, 2014, 00:14
Default
  #14
New Member
 
Wang Xiuting
Join Date: May 2014
Location: Tianjin,CHN
Posts: 4
Rep Power: 12
wxtwalkee is on a distinguished road
I did exactly as you have done, and the mesh points still moved. So I want know whether you have solved this problem.
Thank U.
wxtwalkee is offline   Reply With Quote

Old   July 23, 2020, 15:32
Default
  #15
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 mturcios777 View Post
That's odd. If you turn on the debug option for fvMotionSolvers in the global controlDict, you should get a message that re-states the motionsolver diffusivity and frozenPointsZone. Can you tell me what message you get with the debug option activated?

Hi mturcios777,
I wonder if you have a case working with "frozenPointZone". I cannot find any cases in the tutorials folder.

I have searched a few posts. It seems no one gets this option work. The source code shows it will not change the displacement if "frozenPointZone" exists in dynamicMeshDict, but the points still move. I confrim the fixed points desired in paraview and the existence of the file "constant/polyMesh/pointZones".

The output has nothing to do with 'frozenPointZone" when the debug option is switched on as shown below:
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Overriding DebugSwitches according to controlDict
    dynamicMotionSolverFvMesh 2;

    fvMotionSolver (unregistered)
Create mesh for time = 0 

Selecting dynamicFvMesh dynamicOversetFvMesh
Selecting motion solver: displacementLaplacian
Applying solid body motion to entire mesh
--> FOAM Warning : 
    From const Foam::HashTable<Foam::List<int> >& Foam::polyBoundaryMesh::groupPatchIDs() const
    in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 510 
    Removed patchGroup 'wall' which clashes with patch 1 of the same name.
Selecting motion diffusion: uniform
Selecting motion solver: multiSolidBodyMotionSolver
Applying solid body motion to entire mesh
Selecting solid-body motion function tabulated6DoFMotion
Applying solid body motion tabulated6DoFMotion to 564 points of cellZone movingZone1

PIMPLE: no residual control data found. Calculations will employ 10 corrector loops
The dynamicMeshDict is set up as below:

HTML Code:
                motionSolverLibs ("libfvMotionSolvers.so");
		solver displacementLaplacian;
		displacementLaplacianCoeffs
		//solver 	velocityLaplacian;
		//velocityLaplacianCoeffs
		{
			diffusivity  uniform;
			//frozenDiffusion no;
                        frozenPointsZone fixedPoints;
		}
By the way, I am using OpenFOAM v2006.

Anyone share your experience?

Regards,
Michael
Michael@UW is offline   Reply With Quote

Old   May 19, 2021, 09:33
Default how to setup frozenPointsZone with displacementLaplacian
  #16
New Member
 
Victor Baconnet
Join Date: Apr 2021
Location: Cannes, France
Posts: 9
Rep Power: 5
victor13165 is on a distinguished road
Hello,

Might be a bit late, but maybe it can help somebody.

In the case I am using, I have managed to use frozenPointsZone by doing the following:

1. Create a pointZone in your topoSetDict dictionary. As an example, mine looks like this:
Code:
xsep 1.0;

actions
(
      //First, define a pointSet
    {
        name    fixedZonePointSet;
        type    pointSet;
        action  new;
        source  boxToPoint;
        box ($xsep -1.0 -1.0) (30.0 1.0 3.0);
    }



      //Convert existing pointSet to pointZone.
      //This is the one you want to be using for your frozenPointsZone

    {
        name    fixedZone;
        type    pointZoneSet;
        action  new;
        source  setToPointZone;
        set     fixedZonePointSet;
    }

);
2. Add the pointZone to your dynamicMeshDict using the frozenPointsZone parameter:

Code:
dynamicFvMesh       dynamicMotionSolverFvMesh;
motionSolverLibs    (fvMotionSolvers);

solver              displacementLaplacian;

displacementLaplacianCoeffs
{
    diffusivity quadratic inverseDistance (leftwall);
    frozenPointsZone fixedZone;  //Here! Make sure it's inside the brackets
}
This worked for me. However, if you want to check that the solver recognizes your pointZone, you can have a look in this file:


$FOAM_SRC/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C


At line 96, you can see the following code :

Code:
frozenPointsZone_
(
        coeffDict().found("frozenPointsZone")
      ? fvMesh_.pointZones().findZoneID
        (
            coeffDict().get<word>("frozenPointsZone")
        )
      : -1
)
Which means that the solver will look for your pointZone next to the "frozenPointsZone" parameter in your dynamicMeshDict. If the pointZone does not exist, frozenPointsZone_ will simply be set to -1. A few lines below (line 115), you can see this :

Code:
if (debug)
{
            Info<< "displacementLaplacianFvMotionSolver:" << nl
            << "    diffusivity       : " << diffusivityPtr_().type() << nl
            << "    frozenPoints zone : " << frozenPointsZone_ << endl;
 }
If you comment the "if" statement, when you start your solver (simpleFoam, etc...) you will be able to see the value of your frozenPointsZone. If it is set to -1, it means that somehow your pointZone is not correctly set up. The value that is printed is supposed to be the zone ID.

As an example, this is what it looks like for me, when my pointZone is correctly set up:


Code:
Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: displacementLaplacian
Applying solid body motion to entire mesh
Selecting motion diffusion: exponential
Selecting motion diffusion: inverseDistance
Selecting patchDistMethod meshWave
displacementLaplacianFvMotionSolver:
    diffusivity       : quadratic
    frozenPoints zone : 1
I hope this helps. Please let me know if you want an example case that works.

Cheers,


Victor
AliVali and Michael@UW like this.
victor13165 is offline   Reply With Quote

Old   April 21, 2022, 02:47
Default
  #17
New Member
 
Ali
Join Date: May 2016
Location: Sydney, Australia
Posts: 19
Rep Power: 10
AliVali is on a distinguished road
Quote:
Originally Posted by victor13165 View Post
Hello,

Might be a bit late, but maybe it can help somebody.

In the case I am using, I have managed to use frozenPointsZone by doing the following:

1. Create a pointZone in your topoSetDict dictionary. As an example, mine looks like this:
Code:
xsep 1.0;

actions
(
      //First, define a pointSet
    {
        name    fixedZonePointSet;
        type    pointSet;
        action  new;
        source  boxToPoint;
        box ($xsep -1.0 -1.0) (30.0 1.0 3.0);
    }



      //Convert existing pointSet to pointZone.
      //This is the one you want to be using for your frozenPointsZone

    {
        name    fixedZone;
        type    pointZoneSet;
        action  new;
        source  setToPointZone;
        set     fixedZonePointSet;
    }

);
2. Add the pointZone to your dynamicMeshDict using the frozenPointsZone parameter:

Code:
dynamicFvMesh       dynamicMotionSolverFvMesh;
motionSolverLibs    (fvMotionSolvers);

solver              displacementLaplacian;

displacementLaplacianCoeffs
{
    diffusivity quadratic inverseDistance (leftwall);
    frozenPointsZone fixedZone;  //Here! Make sure it's inside the brackets
}
This worked for me. However, if you want to check that the solver recognizes your pointZone, you can have a look in this file:


$FOAM_SRC/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C


At line 96, you can see the following code :

Code:
frozenPointsZone_
(
        coeffDict().found("frozenPointsZone")
      ? fvMesh_.pointZones().findZoneID
        (
            coeffDict().get<word>("frozenPointsZone")
        )
      : -1
)
Which means that the solver will look for your pointZone next to the "frozenPointsZone" parameter in your dynamicMeshDict. If the pointZone does not exist, frozenPointsZone_ will simply be set to -1. A few lines below (line 115), you can see this :

Code:
if (debug)
{
            Info<< "displacementLaplacianFvMotionSolver:" << nl
            << "    diffusivity       : " << diffusivityPtr_().type() << nl
            << "    frozenPoints zone : " << frozenPointsZone_ << endl;
 }
If you comment the "if" statement, when you start your solver (simpleFoam, etc...) you will be able to see the value of your frozenPointsZone. If it is set to -1, it means that somehow your pointZone is not correctly set up. The value that is printed is supposed to be the zone ID.

As an example, this is what it looks like for me, when my pointZone is correctly set up:


Code:
Create time

Create mesh for time = 0

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: displacementLaplacian
Applying solid body motion to entire mesh
Selecting motion diffusion: exponential
Selecting motion diffusion: inverseDistance
Selecting patchDistMethod meshWave
displacementLaplacianFvMotionSolver:
    diffusivity       : quadratic
    frozenPoints zone : 1
I hope this helps. Please let me know if you want an example case that works.

Cheers,


Victor
Thanks Victor, you post was really helpful. I was expecting to get a better performance by freezing a some part of my mesh. However, I see no speed up, and the combination of dynamic mesh with forzen points is about 2% slower. Do you have the same experience?
AliVali is offline   Reply With Quote

Old   October 25, 2023, 01:55
Default
  #18
Senior Member
 
M. Montero
Join Date: Mar 2009
Location: Madrid
Posts: 155
Rep Power: 17
be_inspired is on a distinguished road
Do you know the debug switch name to be activated without the need to modify the code? I have generated the point zone but the points are still moved
Thanks a lot
be_inspired 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 18:16
udf for valve closing a pipe using dynamic mesh chem engineer Fluent UDF and Scheme Programming 2 May 13, 2017 10:39
Dynamic mesh is not getting updated. cardio FLUENT 1 May 20, 2014 09:41
How to know mesh size after dynamic refinement tayo OpenFOAM 16 May 22, 2013 14:39


All times are GMT -4. The time now is 18:32.