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

Moving obstacle (translation) in a channel

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 29, 2012, 13:18
Default Moving obstacle (translation) in a channel
  #1
New Member
 
Guillaume
Join Date: Nov 2012
Posts: 10
Rep Power: 4
Gloq is on a distinguished road
Hi guys,

I would like to model the "simple" case of an obstacle (a parallelepiped) translating along a channel.

As the channel is quite long, I would like to change the topology of the mesh during the computation.

How would you do that ? Which dynamic class to call in dynamicMeshDict ?

I searched a little bit and it seems that the only way is to use movingConeTopoFvMesh class and to modify it deeply, according to my needs.
Nevertheless, I found documents on Internet mentioning other classes such as LinearValveLayersFvMesh and LinearValveFvMesh which seem to rely on sliding interface between a master and a slave mesh. Using this kind of class appears easier, but they look like desactivated in version 2.1.1. of openFOAM.

Did some of you manage to use these classes recently ?
If yes, what do you think about them ?

Thanks in advance for your support.
Gloq is offline   Reply With Quote

Old   December 24, 2012, 10:20
Default
  #2
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
I'm facing the same problem. Did you find something ?
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   December 24, 2012, 12:48
Default
  #3
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
Some more information regarding my case.

Gloq, tell me if your meshing problem is different, I'll move this post in a new thread.

Simple configuration:
A sphere inside a pipe. Mesh obtained by SHM.

In few words: I want to see the sphere pushed away by the flow.


Here are the setup.

ControlDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application pimpleDyMFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 50;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 0.02;
purgeWrite 0;
writeFormat ascii;
writePrecision 10;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 5;
maxDeltaT 0.01;
libs
(
"libOpenFOAM.so"
"libincompressibleRASModels.so"
"libfvMotionSolvers.so"
"libforces.so"
);
functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so");
outputControl timeStep;
outputInterval 10;
patches (oggetto);
pName p;
UName U;
rhoName rhoInf;
log true;
rhoInf 1000;
CofR (0 0 0);
}
}
// ************************************************************************* //
dynamicMeshDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object motionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libfvMotionSolvers.so");
solver displacementLaplacian;
diffusivity inverseDistance (oggetto);
 
// ************************************************************************* //
pointDisplacement
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class pointVectorField;
location "0.01";
object pointDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
wall
{
type fixedValue;
value uniform (0 0 0);
}
inlet
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type fixedValue;
value uniform (0 0 0);
}
oggetto
{
type sixDoFRigidBodyDisplacement;
centreOfMass (0 0 0.2);
momentOfInertia (0.000001 0.000001 0.000001);
mass 0.01;
rhoName rhoInf;
rhoInf 1000; 
report on;
value uniform (0 0 0);
}
}
 
// ************************************************************************* //

Everything is fine within the limit of dynamicMotionSolverFvMesh approximation (small mesh movements).

Enclosed you can find some pictures.

I hoped to solve the problem just replacing "dynamicMotionSolverFvMesh" with another solver name... it's christmas, tell me I'm right .

Thanks !
Attached Images
File Type: jpg pict0.jpg (41.4 KB, 149 views)
File Type: jpg pict4.jpg (64.6 KB, 147 views)
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   December 24, 2012, 13:46
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Daniele: I'm unable to help much on this, but the following details might help you:
  • From http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2007/:
    Quote:
    A tutorial on how to use Dynamic Mesh solver IcoDyMFoam, by Pirooz Moradnia:
    Report, Presentation, Case
    The report gives a very good review of the types of dynamic meshes that are possible to use, although some might be related to 1.4.1-dev.
  • The tutorial "multiphase/interDyMFoam/ras/damBreakWithObstacle" might be of greater help on this! It additionally refines the mesh where the interface between air and water, which is rather awesome to see!
Best regards and Merry Xmas!
Bruno
wyldckat is offline   Reply With Quote

Old   December 25, 2012, 22:31
Default
  #5
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
deepsterblue will become famous soon enough
If you can stick to tetrahedral meshes, the dynamicTopoFvMesh class should be able to do it. Here's a remeshing example:

IC Engine re-meshing

You can find the repository here:
https://github.com/smenon/dynamicTopoFvMesh
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   December 26, 2012, 04:50
Default
  #6
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
Thanks to all.

@deepsterblue: I started to dream of that movie several days ago... Even if I'm used to SHM hex mesh I'll try it, many thanks !

@Bruno: I had already read the document you suggested but togheter with many other. Thanks for focus me on this. I'll go deep into topoChangerFvMesh class.

The damBreakWithObstacle case is really interesting but I don't think it's what I need. Do I ?

I also found a very good step by step guide regarding moving (rotating in this case) an object: Dynamic Mesh for a Gear Pump.

I still don't know if a similar approach can be used to generalize moving mesh cases, even in problems where the motion of an object is caused by the fluid.

For example, applied to my above simple case:
- Use dynamicMotionSolverFvMesh to solve the case until the quality of the mesh is degrading too much (Q: how much & how ?)
- Fix the above mesh (Q: how to remesh it ?) remapping the previous solution.
- Repeat the cycle.

For sure it won't be an efficient way to solve a particular problem because of the calculation cost of remeshing everything every few iterations but at least it would be general. Can this be done ?

Thanks,
Daniele
__________________
Daniele Vicario

blueCFD2.1 - Windows 7

Last edited by danvica; December 26, 2012 at 04:53. Reason: Grammatic editing
danvica is offline   Reply With Quote

Old   December 26, 2012, 05:46
Default
  #7
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
BTW what is rawTopoChangerFvMesh ?

I'm looking at the code but... well any help would be really appreciated.

Thanks.
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   December 27, 2012, 04:19
Default
  #8
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
@deepsterblue:
Can I install it even if I use OF 2.1 ? Or should I use an extended release ?

Thanks.
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   December 27, 2012, 09:40
Default
  #9
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
deepsterblue will become famous soon enough
It should work with OpenFOAM-2.1.x - take a look at the Port-2.1.x branch of the repository.

Once you have the repository checked out, do this:

git checkout Port-2.1.x

There are install instructions posted for the compile process with 2.1.x in the Install.txt for that branch
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   December 27, 2012, 12:31
Default
  #10
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
Many thanks. It will ll be a little more complicated because I'm working with a Windows porting of OF but it'll be done.

I just want to point out this good paper:
DYNAMIC MESH HANDLING IN OPENFOAM APPLIED TO
FLUID-STRUCTURE INTERACTION SIMULATIONS

(http://www.google.it/url?sa=t&rct=j&...55534169,d.bGE)

It clarifies different dynamic mesh approaches in a clear way.

BTW: Compliment to Mr. Menon !

Now I just have to re-evaluate tet-meshes vs. hex-meshes performances.

Regards,
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   December 31, 2012, 06:38
Default
  #11
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
Ops, this is the right link:

http://www.google.it/url?sa=t&rct=j&...55534169,d.ZG4
__________________
Daniele Vicario

blueCFD2.1 - Windows 7
danvica is offline   Reply With Quote

Old   December 31, 2012, 11:59
Default
  #12
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
In response to the original poster, moving a parallelopiped can be done by using the layerAdditionRemoval polyTopoChanger. I've tried using rawTopoChangerFvMesh, but I think that is a generic class you can copy and use to implement topology changes. When making a new topoChanger class, I like to proceed like this:

1. Identify what operations need to be done to change the mesh (cell/face/point addition or removal etc)

2. See what polyTopoChanger (in dynamicMeshDict) will perform the operation most efficiently (granted the documentation for these isn't stellar, you may have to do some digging. A quick summary of two
- layerAdditionRemoval: creates or destroys a layer of cells adjacent to a specifies faceZone based on the minimum/maximum thickness of that layer. Only works with simply connected surfaces with minimal warping (fairly consistent face normal). Can be used when a surface is translating and we don't want the cell aspect ratio to change
- attachDetach: switches a set of internal faces to a pair of boundary patches to created internal walls. Can be used to make valves which can be actuated according to times or to other criteria
- hexRef8: refinement of hexahedral meshes; see dynamicRefineFvMesh

3. If possible, find an existing fvMesh class that implements the polyTopoChanger and modify

Otherwise, take rawTopochangerFvMesh and get to work.

Good luck!
mturcios777 is offline   Reply With Quote

Old   January 28, 2013, 18:24
Default
  #13
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 129
Rep Power: 8
ziemowitzima is on a distinguished road
Hi,
I am currently trying to solve problem with solution dependent mesh.
In short, I have to change shape of one boundary of the mesh every time step by using information from previous time step.
So I dont know how the mesh (boundary of the mesh) is going to behave a priori.

Do you know how should I attack this problem ?

Thanks
ZMM
ziemowitzima is offline   Reply With Quote

Old   January 28, 2013, 18:59
Default
  #14
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
This sounds like (or is at least related to) fluid structure interaction. Do a search for FSI and you should be able to find useful links.
mturcios777 is offline   Reply With Quote

Old   July 2, 2013, 10:47
Default
  #15
New Member
 
Join Date: May 2013
Posts: 4
Rep Power: 4
jcab is on a distinguished road
Hello everyone,

I tried to follow the advice of Marco: I modified solidBodyMotionFvMesh file in order to call rawTopoChangerFvMesh. The modification are:

In solidBodyMotionFvMesh.H, in private data: rawTopoChangerFvMesh topoChanger_

In solidBodyMotionFvMesh.C:
In constructor: topoChanger_(io),
In members functions: topoChanger_.update();

When I Run moveDynamicMesh, I see the mesh moving, and cells at the entry and the exit of the channel are stretching and squeezing, but no layer is created. After some iterations, moving cell are even overlapping the others. It gives me the feeling that layer addition/removal is not taken into account. Nevertheless, when I modify the file constant/meshModifiers by giving negative value for thickness, for example, I have an error message. So that is in contradiction with my first feeling !

Did someone know what I am doing wrong ?

Thanks !
jcab is offline   Reply With Quote

Old   July 2, 2013, 11:23
Default
  #16
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
How do you initialize the polyTopoChange? I'm just wondering if the layerAdditionRemoval was created, and if the request to update is sent every time.
mturcios777 is offline   Reply With Quote

Old   July 3, 2013, 03:27
Default
  #17
New Member
 
Join Date: May 2013
Posts: 4
Rep Power: 4
jcab is on a distinguished road
Hi Marco, thanks for your reply !

I didn't change anything about the poyTopoChange: rawTopoChangerFvMesh calls topoChangerFvMesh, which calls polyTopoChanger, which calls polyTopoChange (correct me if I'm wrong). I only specify in the meshModifiers file that I want layerAdditionRemoval, and the parameters needed (thickness...)
jcab is offline   Reply With Quote

Old   July 3, 2013, 11:30
Default
  #18
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
Have you specified the faceZones where you want layers added/removed? I'm curious if rawTopoChangerFvMesh can create the appropriate given a properly defined meshModifiers file.
mturcios777 is offline   Reply With Quote

Old   July 3, 2013, 11:42
Default
  #19
New Member
 
Join Date: May 2013
Posts: 4
Rep Power: 4
jcab is on a distinguished road
Yes, I have created 2 faceZones that I specify in the meshModifiers.
jcab is offline   Reply With Quote

Old   July 3, 2013, 11:45
Default
  #20
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
What happens if you define one of the layerAdditionRemoval modifiers incorrectly? Please post the error message from your solver.
mturcios777 is offline   Reply With Quote

Reply

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
obstacle in a linear channel Stephy OpenFOAM Running, Solving & CFD 5 November 2, 2011 11:42
open channel flow with obstacle !!! opard OpenFOAM 4 May 13, 2011 06:30
Moving cell in a channel yongshenglian OpenFOAM Running, Solving & CFD 0 October 6, 2008 16:45
Translation and rotation for a moving wall St├ęphane Champmartin FLUENT 1 November 28, 2006 11:57
Channel with 2D surface mounted obstacle Francesco Marra Main CFD Forum 1 January 5, 2000 04:49


All times are GMT -4. The time now is 09:45.